His maternal grandfather had committed a crime and was exiled to Shymkent, to serve in the Tang Dynasty army, as part of the army for Anxi Circuit (安西, headquartered in modern Aksu Prefecture, Xinjiang) with the responsibility to guard the south gate of the non-Han portion of the city.
His maternal grandfather was banished to Shymkent, where he served in the Tang Dynasty army as part of the Anxi Circuit's forces, tasked with safeguarding the southern entrance to the non-Han sector of the city.