If North Korea were to collapse, the refugees would head SOUTH, not north.  South Korea is a wealthy place and they happen to speak the same language.  A united Korea wouldn't pose  any threat to China.   Aid would pour in from around the world. In fact, with no threat from the north, the U.S. would likely pull its military out within a few years.
I'm so tired of these cliches.  China has long loved having its vicious North Korean friends.  Pull a string, and China's military gets to study how the U.S., South Korea and Japan respond--where their fighters take off from--the movement of troops and ships--the communications that are employed.  China needs that kind of intel as it continues to expand into the South China Sea, knowing its aggressiveness could provoke an American response.  
It's time for China to end this madness and become the great power it fancies itself to be.  The Kim Dynasty needs to fall.  Trump will act if the Chinese don't.