The traditional collaborative filtering (CF) method based on static user preference modeling and linear matching function learning severely limits the recommendation performance. To solve the above problem, in this article, we adopt dynamic user preference modeling and nonlinear matching function learning in the CF recommendation. For dynamic user preference modeling, a two-layer neural attention network is used, which fully considers the predicted item, the recent historical interacted items and their interaction time to estimate the contribution weight of each interacted item in user preferences modeling. For nonlinear matching function learning, we add a single hidden layer neural network on top of the traditional matrix factorization (MF) model, which can significantly improve the feature interaction learning capabilities of the model with only a few additional parameters. Extensive experiments show that our method significantly outperforms the state-of-the-art CF methods and the key technologies we proposed in this research have a positive effect on improving the recommendation performance.