During the Xining period of the Northern Song Dynasty, in the Hehuang Valley (today's border between Gansu and Qinghai), the Song Dynasty had just recovered the six states of Hehuang. The war in the border areas had begun to subside, and the people's livelihood was in decline. The fields were barren, the water conservancy was inactive, and the Han, Qiang, and Tubo ethnic groups lived together, and there was a sense of neighborly help. The anger also hides the undercurrents of ethnic estrangement, military oppression, and powerful mergers. At the policy level, the Song Dynasty implemented the Green Crops Law and the Baojia Law, and implemented deformation in the border areas. The people were miserable, but there were also opportunities to reclaim wasteland and stabilize their livelihoods.