During the Chongzhen period of the late Ming Dynasty, engineer Shen Yanzhi transformed into a villain vassal king who was regarded as a "collaborator and treason". In the face of internal and external troubles, he used modern engineering knowledge to build fortifications and improve firearms, used agricultural knowledge to promote high-yielding crops to alleviate famine, and used public health concepts to prevent and control plague. Despite the reputation of being a "rebellious minister and traitor", he integrated local forces and skillfully dealt with Li Zicheng and the Qing army. He not only retained the cultural foundation of the Ming Dynasty, but also introduced advanced Western technology, allowing China to avoid the path of isolation during the dynasty change.