After some time, it doesn’t make much sense to think about what it is to be under occupation by a foreign invader or not.
That said, it's possible that the opium wars get too much credit for China's weakened position, relative to the Taiping Rebellion (Chinese civil war) which claimed around 20 million lives, comparable to the first world war.
Most people think of the first Opium war as the start of Qing China's decline, but I'd say the real crippling blow was the Taiping rebellion that came a few years afterwards. The Taiping rebellion revealed the biggest flaw that was crippling Qing China's political system, that it was had a monarchy made of an ethnic minority Manchus ruling a majority Han nation. The Manchu nobility only survived the Taiping rebellion by negotiating with conservative Han warlords and using them to recruit enough Han soldiers to put down the other Han rebels, but after the Taiping rebellion the Qing dynasty had no good options. If you modernize too quickly, you take away the privileges of those conservative warlords and risk having them support another rebellion with the majority of the population. If you modernize slowly or not at all, you get to keep playing the game for a few more decades until Japan overtakes you.
Compare that to Japan's experience with the Meiji restoration. They quickly overthrew the conservative Tokugawa shogunate, then eliminated the remaining conservative factions by crushing the Satsuma Rebellion. Then Japan could continue with industrialization without worrying about the resulting political instability that could result from conservative power structures being uprooted by modernization.