Recognizing the evolution pattern of traffic condition and making accurate prediction play a vital role in intelligent transportation systems (ITS). With the massive increase of available traffic data, deep learning-based models have attracted considerable attention for their impressive performance in traffic forecasting. However, the majority of existing approaches neglect to model of asynchronously dynamic spatio-temporal correlation and fail to consider the impact of historical traffic data on future condition. Additionally, the attribute of deep learning method presents challenges in interpreting the explicit spatiotemporal relationships. In order to enhance the accuracy of traffic prediction as well as extract comprehensive and explainable spatial–temporal relevance in traffic networks, we propose a novel attention-based local spatial and temporal relation discovery (ALSTRD) model. Our model firstly implements feature representation learning to effectively express latent input traffic information. Then, a local attention mechanism structure is established to model asynchronous dependencies of historical input data. Finally, another attention network and the Pearson Correlation Coefficient method are introduced to extract the elaborate influence of the historical traffic condition of neighboring roads on the future condition of the target road. The experiment results on several datasets demonstrate that our model achieves significant improvements in prediction accuracy compared to other baseline methods, which can be attributed to its ability to extract the fine-grained correlation among historical traffic data and capture the dynamic association between past and future data. In addition, the incorporation of attention mechanism and Pearson Correlation Coefficient promotes the model’s ability to elucidate spatiotemporal correlations among traffic data, thereby providing a more robust explanation.