Reading a book on China right now, and the author talks about alien rule during Imperial China, and then the Chinese would every so often come along and kick the foreigners out. Even if the foreigners were ruling in the "Chinese Way" they would still be considered alien. Yet, from what I understand there were multiple ethnicities in China throughout its history and the boundaries were widely different throughout it as well. So what distinguished in the mind of the Chinese who was and was not Chinese?
Imperial China has a long, long history, and I can only speak to the very tail end of it because that's all I've studied. The last Imperial dynasty, the Qing, were some of these alien rulers, as they were ethnically Manchus, in contrast to the majority Han Chinese ethnic group (which the previous (Ming) dynasty also was). Over the course of the Qing dynasty China's territory expanded greatly, incorporating or sometimes conquering Manchuria and Machus, Mongolia and Mongols, Tibet and Tibetans, Xinjiang and... not really doing a great job of incorporating Uighurs, etc, and from the get-go the emperors would stye themselves as the rightful leaders of these different groups. And the Qing left in place the existing Chinese examination system, by which members of the gentry were tested to became government officials or tax collectors and all that, leaving the normal social order intact. But, they didn't completely adopt Han Chinese cultural practices, for example upper class Han Chinese women practiced foot-binding while Manchu women wore a sort of lifted / high 'heeled' shoes, and generally different dress. And the Manchus maintained their language, which is very different from Chinese and has its own script (now it's down to only a few thousand speakers though). They were still visibly culturally different, and so as China faced incredible incredible strife throughout the 19th century (largely because of the Western world) it became easier to blame these ruling aliens for invading and taking over the country from the Han Chinese. As revolutionary sentiment spread, and China faced humiliation at the hands of other countries, and as theories of Social Darwinism and corresponding racism, and nationalist imperialism, were in favor on the international stage, the Manchu Qing dynasty was a logical target for educated revolutionaries. One such writer was a young student named Zou Rong, who wrote a widely-circulated treatise called the Revolutionary Army in 1903, in which he called for ending the Qing dynasty and making China a Han ethnostate. I don't have access to a copy right now, but I'll try to find one online for some of the excerpts on race. It's quite interesting in that he wanted to model a new government almost completely on the US constitution, but also wants all Manchus expelled or killed, and for a new Chinese identity to be based more strongly on race. For now all I've got is:
"China is the China of the Chinese. Countrymen, you must all recognise the China of the Chinese of the Han race. Not to allow any alien race to lay their hands on the least rights of our China. Any obligations subordinating people to the Manchus are one and all annulled."
Later Chinese communists weren't interested in pursuing this, but also by that point the Qing were out of power and Manchus were no longer 'oppressors.'