Cold-start problem is a key challenge in recommender system. In order to solve this problem, we proposed a dynamic latent factor model that combined with attributes of user and item. With the increase of interaction between user and recommender system, our model can automatically adjust its coefficient to achieve a more reasonable and more satisfactory recommendation. The experimental results show that the proposed method can not only alleviate the cold-start problem of new users and new items, but also improve the recommendation accuracy to some extent.