Had contractions last night

Alexis
I'm 30 weeks + 5 days and I had some back pain, cramps and spotting so I hurried to the hospital it took almost 6 hours for my uterus to stop contracting and for me to get the OK for me to go home.I'm scared does this mean that I will be going into labor soon? My due date is 7/31