I don't believe China wants us to go to war with N. Korea.  We're China's biggest consumer, providing almost 20% of their market.  Chinese are very business-oriented.  Having dealt with them for almost 15 years and having been there many times meeting directly with their engineering and manufacturing companies, they put business before ideology.  Their government representatives sit in the back of major business meetings and largely keep out of the transactions.  The companies' leaders work hard to improve business relations simply to get our business.  China recognizes an opportunity for them to continue to grow their wealth, and they welcome it.  A full blown war with N. Korea, particularly a nuclear war, would likely kill a world economy, and that means big money lost.

I believe their engagement now is their recognition not only of this, but also that N. Korea is an uncontrollable entity threatening their future.