In the process of implementing recommendation, the time sequence of users' browsing and following page information is important data information in the recommendation algorithm, and the same user's different preferences for items at different times also have a certain impact on the recommendation results. Under the framework of the filtering model, it is proposed to integrate the long-short-term memory network and generalized matrix factorization to capture the user's short-term and long-term preferences at the same time. Using the long-short-term memory network's strong fitting ability to time series data, learn the user's short-term preference information, The long-term dependencies of sequences are captured, and the long-term preference information of users is learned through generalized matrix factorization, so as to optimize the recommendation algorithm and improve the recommendation performance. It is verified by experiments that the new model proposed in this paper has improved both in terms of convergence speed and recommendation performance.