First of all, because it is a practical model, the patent right is not firm. It's best to make a search report of two patents in China National Intellectual Property Administration first to see if there are any existing technologies that affect novelty and creativity. If there is, then A is not necessarily invalid, because B will also be invalid. It is best to win-win and cross-license two utility models. If A feels that his patent is strong, he can consider invalidating B's patent.
B can either invalidate A's patent or pay some money to keep B's patent.