During exercise, I might have caused a mild muscle strain or rupture in the upper back area. Probably trapezius or rhomboideus muscle. What to do?

REST AND HEAT. if you just did it ice will work better to minimize the damage in the muscle. after that, rest and heat is the key to overcome the spasm in the muscle that causing the pain. you can do some stretching exercise to the muscle as well. have some body apply icy hot on the area as well. take aleve, (naproxen) or naprosen, it works better than ibuprofen on muscle. good luck.