As an Irishman, you are describing my arch-enemies! Slash benefactors!
Come on you, boys in blue!
The European powers were huge fans of the concerted double whammy for colonisation.
Fo example, France took bits of Thailand. Thailand asked the UK to ask the French to stop it which they did. Then, as payment for their good service, the UK took a bit of Thai territory. I just love that bit.
Anyway. China would probably not ask anybody to guarantee independance, but maybe with a PoD around the 100 days? Or something like that?
Say, Third Opium war or the like, the European power "force" modernisation by acquiring unlimited monopolies over rail links or something equivalent. Maybe some officials at the local level see that as an actual good opportunity to not get stomped every twenty years by foreign devils.
Debts accumulate in several areas but after a few years, something causes the debt to stop being reimbursed. Bad harvests, or even better an uprising. The European powers come in to re-establish order and never quite leave.
After a while, the Chinese Emperor or local prefect is forced to aknowledge this, while still being nominally in charge.
Wash, rinse, repeat.