The use of machine learning in artificial intelligence to solve industrial problems has been a current trend. Predictions can be made by machine learning algorithms. This greatly improves the efficiency and also the accuracy. With the development of industrialization, the pollution of water resources is becoming more and more serious. How to treat wastewater more cost-effectively to meet the discharge standards has become one of the most urgent problems in the world. In the Anaerobic-Anoxic-Aerobic (AAO) process, the key to reach the standard of sewage treatment with low cost and high efficiency lies in the aeration link. In this study, multiple machine learning methods are used for modeling, and proposed a method employing the long short-term memory (LSTM) neural network model for regression prediction addresses the need for a more accurate prediction approach. By utilizing data from the preceding 100 days, this model replaces manual, experience-based prediction methods, thereby mitigating energy consumption. This model is optimized by training and testing with real wastewater treatment plant data and continuously adjusting the parameters through multiple sets of experiments. This can make the real recorded aeration amount and the actual aeration amount infinitely close. Through the experimental comparison, it is found that the performance of the LSTM neural network model is better, with about 14% higher accuracy than the benchmark model.