Gaochang and Karahan Dynasties were both local regimes established by Uighurs who moved to the western regions and other turkic peoples after the collapse of the Uighur khanate in Mobei in 840 AD. The former is centered on Turpan, while the latter controls a vast area including the southern Tianshan Mountains and rivers in Central Asia.
Uighurs settled in the western regions, and these local regimes were closely related to the Central Plains dynasty. The ruler of the Karahan Dynasty called himself "Peach Blossom Stone Khan", which means "China Khan", indicating that he belonged to China. 1009, the Karahan dynasty, which occupied the area of Khotan, sent envoys to pay tribute to the Northern Song Dynasty (960- 1 127). 1063, in the Northern Song Dynasty, Khan of Karahan Dynasty was conferred the title of "the obedient Black Hanwang". In the third year after the establishment of the Northern Song Dynasty, Gaochang Uighur sent 42 envoys to pay tribute to the Northern Song Dynasty.
Khotan is a settlement of Cypriots. After the Tang Dynasty, Yu Kan, Wei Chi and other royal families came to power and had close contacts with the Central Plains. Because they were canonized by the Tang Dynasty, they called themselves Li. In 938 AD, Emperor Gaozu of the late Jin Dynasty appointed Zhang Kuangye and Emperor Gaozu as ambassadors in Khotan, and named Li Shengtian "King of Khotan". At the beginning of the Northern Song Dynasty, Yu Kan's envoy monks paid tribute to the Song Dynasty.