China carried out exercises near the Korean Peninsula, practicing to defend against a "surprise attack," media said.