In the seventh year of Tianbao in the Northern Qi Dynasty (556), Beihengzhou was changed to Heng 'an Town, also known as Dongzhou City, which belonged to Taiping County of Hengzhou (30 miles west of Datong, also known as Xicheng). The following year, the town was abandoned, and it was still Beihuan State.
At the beginning of the Northern Zhou Dynasty (577), Yu Wenxuan destroyed the Northern Qi Dynasty and changed Taiping County to Yunzhong County, which belonged to Beishuozhou. Heng 'an Town belongs to Yunzhong County, Shuozhou.
In the first year of Emperor Kai of Sui Dynasty (58 1), Yunzhong County was Yunnei County. In the second year of Daye (606), Shuozhou was changed to Mayi County, and Heng 'an Town was subordinate to Yunnei County of Mayi County.
Beihengzhou was established in the sixth year of Tang Wude (623) and abolished in the seventh year (624). In the 14th year of Zhenguan (640), Xiang County was established (moved from Dingxiang City in the north of Shuozhou), and Yunzhou was also ruled (moved from Inner Mongolia and Linger). In the first year of Yongchun (682), it was destroyed by the desert water of East Turkistan, and the counties were abolished, and the people moved to Shuozhou. In the 18th year of Kaiyuan (730), Dingxiang was changed to Yunzhong County and Yunzhou was restored. In the first year of Tianbao (742), Yunzhou was changed to Yunzhong County. In the first year of Gan Yuan (758), it was changed to Yunzhou. In the 10th year of Xian Tong (869), the Datong Army was appointed as our time.