 Though a Han Chinese, he had connections with the leading Muslim families of Yunnan.He was knowledgeable about Islam and Islamic culture.He passed the imperial examination and became a "jinshi" degree holder in 1899.