With the rapid development of social economy, the traffic volume of urban roads has raised significantly, which has led to increasingly serious urban traffic congestion problems, and has caused much inconvenience to people's travel. By focusing on the complexity and long-term dependence of traffic flow sequences on urban road, this paper considered the traffic flow data and weather conditions of the road section comprehensively, and proposed a short-term traffic flow prediction model based on the attention mechanism and the 1DCNN-LSTM network. The model combined the time expansion of the CNN and the advantages of the long-term memory of the LSTM. First, the model employs 1DCNN network to extract the spatial features in the road traffic flow data. Second, the output spatial features are considered as the input of LSTM neural network to extract the time features in road traffic flow data, and the long-term dependence characteristics of LSTM neural network are adopted to improve the prediction accuracy of traffic flow. Next, the spatio-temporal characteristics of road traffic flow were regarded as the input of the regression prediction layer, and the prediction results corresponding to the current input were calculated. Finally, the attention mechanism was introduced on the LSTM side to give enough attention to the key information, so that the model can focus on learning more important data features, and further improve the prediction performance. The experimental results showed that the prediction effect of the 1DCNN-LSTM-Attention model under the weather factor was better than that without considering the weather factor. At the same time, compared with traditional neural network models, the prediction effect of the proposed model revealed faster convergence speed and higher prediction accuracy. It can be found that for short-term traffic flow prediction on urban roads, the 1DCNN-LSTM network structure considering the attention mechanism provides superior features. (c) 2021 Elsevier B.V. All rights reserved.