How to tell the difference between stomach pains and contractions?

I’m 33 weeks. I woke up with some pretty bad back & stomach pains. My bf had food poisoning about 4 days ago. I’m not sure if it was stomach virus or not? But I keep getting these pains that start kind of in my mid stomach area and then push through my back. It kind of hurts all over my stomach but the back pains come & go. I just started timing it (just in case) but I’m not really sure what I’m doing? All I know is I want to puke.