The Huaisheng Mosque is supposedly built in 627, during the Prophet Muhammad's lifetime. Did the Muslims really have contact with the Chinese and have Chinese converts that early in their history?
Trade between Arabia and China had been going on for centuries prior to Muhammad's revelations, not just by land, but by sea. It is this sea-going trade that would have delivered early Muslims to Guangzhou. Keep in mind that initially these routes were for trade, not proselytizing, although that would become a motivation in later centuries.
It's all along this sea route that traders would take to port, where some would stay and marry into the local communities. That's where conversions would take place and children were born, growing a Muslim community; spouses would not be compelled to convert, but children were required to be raised Muslim.
Broomhall states that “it is possible that the Arabs had established a factory at [Guangzhou]” prior to 622 CE, although he does not substantiate that claim. He then goes further to describe date discrepancies of Chinese Muhammad monuments, some claimed to have been installed prior to Muhammad receiving his first revelations from God.
Regarding the date discrepancies, /u/cthulhushrugged touches on the date issues in this post from a few months back covering What's the earliest mention of Islam in China
Sources:
Broomhall, Marshall. 1910. Islam in China A Neglected Problem.
Chew, Sing C. 2016. “From the Nanhai to the Indian Ocean and Beyond: Southeast Asia in the Maritime 'Silk' Roads of the Eurasian World Economy, 200 BC – AD500.”