Commuting is an important type of travel activity for urban residents. Gravity model is a classical method to describe and explain commuters between cities and regions. The traditional global gravity model based on sampling survey data is inadequate in accuracy and applicability, and fail to grasp the difference of commuting rules caused by urban spatial heterogeneity. Cellular signaling data has the advantages of large sample size, high precision and full coverage. Based on cellular signaling data, this study first identifies the user's residence and workplace, and builds the basic unit-specific commuting model of Shanghai. Secondly, the residual independent variables are generated to optimize the basic model through the local spatial autocorrelation analysis of the residuals of the basic model. The results show that the goodness of fit of the residual model is much higher than that of the basic model, and the prediction effect is greatly improved. Finally, two cases are presented to show the application of the model in planning practice. Through this study, in the theoretical level, a path of large data modeling is explored, and in the application level, it can provide technical support for the layout of urban employments and residential areas.