According to Article 39 of the Exit and Entry Administration Law of the People' s Republic of China: For foreigners who reside or stay in domiciles other than hotels, they or the persons who accommodate them shall, within 24 hours after the foreigners’arrival, go through the registration formalities with the public security organs in the places of residence.
You could register via the following ways.
Declaration Methods for Temporary Accommodation Registration for Foreigners:
1.Report temporary residence registration at the comprehensive window of the local police station within 24 hours after arrival.
Source:english.nanjing.gov.cn