Accurate prediction of water quality is conducive to intelligent management and control of watershed ecology. Water quality data has time series characteristics, and although methods such as LSTM can capture sequence correlations in time series data, these methods do not consider the impact of bidirectional neighborhoods on the model, and they are not able to pay attention to the feature sequences to varying degrees. Aiming at this problem, this paper proposes a watershed water quality prediction model based on attention mechanism and bidirectional LSTM neural network (AT-BILSTM). The model mainly contains the Bi-LSTM layer and the temporal attention layer, and the attention mechanism is introduced after the bidirectional feature extraction of the water quality time series data to highlight the data series that have a key impact on the prediction results, and effectively use the sequence correlation of the watershed water quality data to improve the accuracy of the model. Finally, the actual datasets of four monitoring sites in the Lanzhou section of the Yellow River Basin in China were used to verify the effectiveness of the method. After comparing the reference model, the results show that the proposed model combines the bidirectional nonlinear mapping ability of Bi-LSTM and the feature-weighted characteristics of the attention mechanism. Taking FuHe Bridge as an example, compared with the original LSTM model, the RMSE and MAE of the model are reduced to 0.101 and 0.059, respectively, and the R2 is increased to 0.970, which has the best prediction performance in four sections, which can provide decision-making basis for comprehensive water quality management and pollutant control in the river basin.