Traditional collaborative filtering recommendation algorithm has some problems, such as the sparsity of rating data, the lack of user rating preference, and the limitation of traditional similarity measurement. In this paper, a twostage recommendation model combining item prediction score and user preference score is proposed. In the first stage, the itembased prediction score is used to complete the score matrix, and the time weight factor is used to improve the item similarity; In the second stage, the complete scoring matrix is transformed into a user scoring preference matrix for scoring categories by using the scoring preference model, then the preference score is calculated by using the userbased collaborative filtering algorithm through the matrix, and the user common rating score weight is used to improve the user similarity. Finally, the itembased prediction score and the userbased preference score are used as the comprehensive prediction score of the target user. Experimental results show that the proposed algorithm outperforms the traditional collaborative filtering algorithm in terms of accuracy and recall rate under different number of neighbor users and different lengths of recommendation list. Moreover, for different sparsity data sets, the MAE increment value of the proposed algorithm is reduced by 8%-24.6%, with higher recommendation precision and accuracy.