This paper proposes a deep learning traffic demand prediction method to meet the requirements of high accuracy and time sensitivity in dynamic traffic assignment. The time interval of traffic demand data is determined based on the requirements of dynamic traffic assignment. A prediction method using long short-term memory neural network is established for better performance in complex traffic demand. Combining the periodicity, randomness and nonlinearity of traffic demand in dynamic traffic assignment, this study uses a time series decomposition method to decompose the traffic demand data and to reduce the interference of data noise. The trend component and residual component are used as the input of the deep learning prediction method. Meanwhile, the periodic component is predicted using the cycles. The key parameters of the prediction method, such as the number of hidden layer units, learning rate and training iterations, are optimized by using the cuckoo search algorithm, which is characterized by strong random optimization ability and high optimization efficiency. The proposed method is verified using the checkpoint data in Chang'an District of Xi'an, China. In each of the four consecutive periods of peak and off peak, the results of proposed method are compared with the auto regressive moving average model, the long short-term memory model, and the support vector regression model. The results indicate a reduction of the average absolute error of 10.55% to 19.80%, a reduction of the root mean square error of 11.20% to 17.99%, and the coefficient of determination increased by 8.62% to12.48% . Compared with the models optimized by genetic algorithm and particle swarm optimization, the proposed model reduced the average absolute error by 7.36% to 13.81% and reduced the root mean square error by 4.23% to 10.67%. The coefficient of determination increased by 3.50% to 7.01%. The proposed model has the shortest running time. Compared with the traditional methods, the proposed prediction method has higher prediction accuracy in the traffic demand prediction for dynamic traffic assignment. © 2024 Science Press. All rights reserved.