Population migration is an essential medium for the spread of epidemic, which can accelerate localized outbreaks of disease into widespread epidemic. Large-scale population movements between different areas increase the risk of cross-infection and bring great challenges to epidemic prevention and control. As COVID-19 can spread rapidly through human-to-human transmission, understanding its migration patterns is essential to modeling its spreading and evaluating the efficiency of mitigation policies applied to COVID-19. Using nationwide mobile phone data to track population flows throughout China at prefecture-level, we use the temporal network analysis to compare topological metrics of population mobility network during two consecutive months between before and after the outbreak, i.e. January 1st to February 29th. To detect the regions which are closely connected with population movements, we propose a Spatial-Louvain algorithm through adapting a gravity attenuation factor. Moreover, our proposed algorithm achieves an improvement of 14% in modularity compared with the Louvain algorithm. Additionally, we divide the period into four stages, i.e. normal time, Chunyun migration, epidemic interventions, and recovery time, to describe the patterns of mobility network’s evolution. Through the above methods, we explore the evolution pattern and spatial mechanism of the population mobility from the perspective of spatiotemporal big data and acquire some meaningful findings. Firstly, we find that after the lockdown of Wuhan and effective epidemic interventions, a substantial reduction in mobility lasted until mid-February. Secondly, based on the economic interaction and geographic location, China has formed an urban agglomeration structure with core cities centering and radiating toward the surroundings. Thirdly, in the extreme cases, the dominant factor of population mobility in remote areas is geographic location rather than economy. Fourthly, the urban agglomeration structure of cities is robust so that when the epidemic weakens or disappears, the city clusters can quickly recover into their original patterns.