Dozens of people have been killed in China in the past three months in a series of mass attacks using vehicles or knives.