The primary cause of hazy weather is PM2.5, and forecasting PM2.5concentrations can aid in managing and preventing hazy weather. This paper proposes a novel spatiotemporal prediction model called SpatioTemporal-Informer (ST-Informer) in response to the shortcomings of spatiotemporal prediction models commonly used in studies for long-input series prediction. The ST-Informer model implements parallel computation of long correlations and adds an independent spatiotemporal embedding layer to the original Informer model. The spatiotemporal embedding layer captures the complex dynamic spatiotemporal correlations among the input information. In addition, the ProbSpare Self-Attention mechanism in this model can focus on extracting important contextual information of spatiotemporal data. The ST-Informer model uses weather and air pollutant concentration data from numerous stations as its input data. The outcomes of the trials indicate that (1) The ST-Informer model can sharply capture the peaks and sudden changes in PM2.5concentrations. (2) Compared to the current models, the ST-Informer model shows better prediction performance while maintaining high-efficiency prediction(MAE≈7.50μg/m3,RMSE≈4.31μg/m3,R2≈0.88). (3) The ST-Informer model has universal applicability, and the model was applied to the concentration of other pollutants prediction with good results.