Accurately predicting dissolved oxygen is of great significance to the intelligent management and control of river water quality. However, due to the interference of external factors and the irregularity of its changes, this is still a ticklish problem, especially in multi-step forecasting. This article mainly studies two issues: we first analyze the lack of water quality data and propose to use the random forest algorithm to interpolate the missing data. Then, we systematically discuss and compare water quality prediction methods based on attention-based RNN, and develop attention-based RNN into a multi-step prediction for dissolved oxygen. Finally, we applied the model to the canal in Jiangnan (China) and compared 8 baseline methods. In the dissolved oxygen single-step prediction, the attention-based GRU model has better performance. Its measure indicators MAE, RMSE, and R-2 are 0.051, 0.225, and 0.958, which are better than baseline methods. Next, attention-based GRU was developed into multi-step prediction, which can predict the dissolved oxygen in the next 20 hours with high prediction accuracy. The MAE, RMSE, and R-2 are 0.253, 0.306, and 0.918. Experimental results show that attention-based GRU can achieve more accurate dissolved oxygen prediction in single-step and multi-step predictions.