Accurate traffic flow prediction is highly important for relieving road congestion. Due to the intricate spatial–temporal dependence of traffic flows, especially the hidden dynamic correlations among road nodes, and the dynamic spatial–temporal characteristics of traffic flows, a traffic flow prediction model based on an interactive dynamic spatial–temporal graph convolutional probabilistic sparse attention mechanism (IDG-PSAtt) is proposed. Specifically, the IDG-PSAtt model consists of an interactive dynamic graph convolutional network (IL-DGCN) with a spatial–temporal convolution (ST-Conv) block and a probabilistic sparse self-attention (ProbSSAtt) mechanism. The IL-DGCN divides the time series of a traffic flow into intervals and synchronously and interactively shares the captured dynamic spatiotemporal features. The ST-Conv block is utilized to capture the complex dynamic spatial–temporal characteristics of the traffic flow, and the ProbSSAtt block is utilized for medium-to-long-term forecasting. In addition, a dynamic GCN is generated by fusing adaptive and learnable adjacency matrices to learn the hidden dynamic associations among road network nodes. Experimental results demonstrate that the IDG-PSAtt model outperforms the baseline methods in terms of prediction accuracy. Specifically, on METR-LA, the mean absolute error (MAE) and root mean square error (RMSE) induced by IDG-PSAtt for a 60 min forecasting scenario are reduced by 0.75 and 1.31, respectively, compared to those of the state-of-the-art models. This traffic flow prediction improvement will lead to more precise estimates of the emissions produced by mobile sources, resulting in more accurate air quality forecasts. Consequently, this research will greatly support local environmental management efforts.