Method and system for accurately controlling dissolved oxygen concentration of sewage treatment aeration unit

By constructing an LSTM-Attention model and fusing it with measured data, the aeration air volume was dynamically adjusted, which solved the lag problem in dissolved oxygen concentration control in the sewage treatment system and achieved high-precision, low-energy sewage treatment results.

CN121850177APending Publication Date: 2026-04-14恩宜瑞(江苏)环境发展有限公司 +1
View PDF 0 Cites 2 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

The dissolved oxygen concentration control of the aeration unit in the existing sewage treatment system has a lag effect, which leads to control instability, serious energy waste, and difficulty in achieving high-precision and stable control.

Method used

A prediction model based on LSTM-Attention is constructed, and weighted fusion is performed with measured data to dynamically adjust the aeration air volume and achieve precise control of dissolved oxygen concentration.

Benefits of technology

It significantly improves the control precision and system stability of the aeration process in wastewater treatment, reduces energy consumption, and ensures that the wastewater treatment effect consistently meets the standards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121850177A_ABST
    Figure CN121850177A_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for accurately controlling the concentration of dissolved oxygen (DO) of a sewage treatment aeration unit, and the method comprises the steps: constructing a prediction model, and obtaining a model prediction value of the DO concentration at a current moment or a future moment according to the prediction model; calculating a current confidence coefficient; taking the current confidence coefficient as a weight coefficient, and carrying out weighted fusion calculation on a DO concentration measured value at the current moment and a DO concentration model prediction value to obtain a DO concentration fusion variable; the aeration air volume is adjusted or controlled with the purpose of minimizing the error between the DO concentration fusion variable and the DO concentration target value; the problem of overshoot oscillation caused by DO response lag in traditional control is solved, and a dynamic and accurate control solution is provided for the DO concentration of the aeration unit of the sewage plant.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wastewater treatment technology, specifically to a method and approach for precise control of dissolved oxygen concentration in wastewater treatment aeration units. Background Technology

[0002] In wastewater treatment systems, aeration is a core technological step in degrading pollutants in water and ensuring that effluent meets standards. This process involves continuously introducing air into the water to maintain a suitable dissolved oxygen (DO) level, providing the necessary oxygen for aerobic microbial communities, thereby degrading pollutants in the water.

[0003] In engineering, precise control of dissolved oxygen (DO) concentration in biological aeration tanks is crucial for the efficient and stable operation of wastewater treatment systems. On the one hand, excessively low DO concentrations inhibit the activity of microorganisms in the aerobic biological process, leading to incomplete pollutant degradation, substandard effluent, and in severe cases, the death of aerobic microorganisms, causing system failure. On the other hand, excessively high DO concentrations intensify endogenous respiration of microorganisms, leading to excessive consumption of their own cell matrix and reduced activated sludge volume in the absence of sufficient organic matter. Furthermore, to meet the requirements of nitrogen and phosphorus removal processes, wastewater from aeration tanks often needs to be returned to an anoxic tank. If the DO concentration is too high, the oxygen-rich return water will disrupt the denitrification conditions in the anoxic tank, significantly reducing nitrogen and phosphorus removal efficiency. Simultaneously, aeration is an energy-intensive process, typically accounting for 50%–70% of the plant's total electricity consumption. Insufficient DO concentration control precision results in significant energy waste. Statistics show that for every 0.5 mg / L deviation of the DO concentration from the target value, aeration energy consumption increases by 8%–15%. Therefore, achieving high-precision control of DO concentration is key to balancing stable system operation and energy optimization.

[0004] Most existing control strategies are based on PID control with real-time sensor feedback, maintaining the target dissolved oxygen (DO) level by adjusting the frequency of aeration fans or the opening of valves. However, in actual operating conditions, there is a significant lag between aeration rate adjustment and DO concentration response. That is, after a change in aeration rate, oxygen needs to undergo physical processes such as release, diffusion, dissolution, and uniform distribution before the DO probe can detect the concentration change. This lag period often lasts from several minutes to tens of minutes, causing control commands to be executed in an "outdated" state. The consequence is that the system continuously experiences overshoot or undershoot oscillations. This control instability caused by lag severely limits the efficient and stable operation and maintenance of wastewater treatment systems, as well as the implementation of subsequent high-precision intelligent management and control.

[0005] To overcome the lag problem, most technologies attempt to introduce feedforward compensation, model predictive control (MPC), or advanced algorithms (such as fuzzy logic and neural networks). Feedforward control predicts DO demand by monitoring influent load in real time, but it is difficult to accurately quantify lag time. Although MPC can predict future states based on dynamic models, the nonlinear and multivariate coupling characteristics of wastewater treatment systems make the construction of mechanistic models complex and parameter identification difficult. While conventional data-driven models can capture time-series characteristics, they accumulate significant errors in multi-step predictions because they do not explicitly integrate lag period information. In addition, relying solely on DO sensor feedback is susceptible to interference from factors such as bubble adhesion, sludge coverage, or electrode drift, and the measured values ​​may deviate from the true concentration. Pure model prediction is affected by the completeness of training data and sudden changes in operating conditions, and its reliability is insufficient when used independently. Therefore, existing methods still cannot achieve high-precision and stable control of DO concentration under conditions of strong disturbances and large lags, and there is an urgent need for a fusion control mechanism that can coordinate lag quantification, dynamic prediction, and reliable feedback. Summary of the Invention

[0006] To address the aforementioned problems, this invention provides a method and system for precise control of dissolved oxygen concentration in aeration units of wastewater treatment.

[0007] A method for precise control of dissolved oxygen concentration in wastewater treatment aeration units includes the following steps: A prediction model is constructed, and the model prediction value of DO concentration at the current or future time is obtained based on the prediction model; the input of the prediction model is historical water volume data, aeration air volume and water quality data; the output of the prediction model is the model prediction value of DO concentration at the current or future time. The measured DO concentration value for the current time period is weighted and fused with the model prediction value of DO concentration for the current time period obtained by the prediction model to obtain a fused DO concentration value. Given a target DO concentration, the aeration air volume is adjusted or controlled with the goal of minimizing the error between the DO concentration fusion value and the target DO concentration value.

[0008] Explanation: The above method constructs a model to predict the current or future DO concentration using historical water volume, aeration air volume, and water quality data as inputs. It calculates the current confidence level by using the measured DO concentration value and the model prediction value for the current period, and then weights and fuses them to obtain the DO concentration fusion value. Finally, it adjusts the aeration air volume with the goal of minimizing the error between the fusion value and the target value, thereby achieving accurate prediction, effective fusion, and intelligent control of dissolved oxygen concentration in wastewater treatment aeration units.

[0009] Furthermore, the prediction model employs one of the following: a long short-term memory network model, a recurrent neural network model, or a support vector regression model.

[0010] Note: Among the above models, Long Short-Term Memory Networks and Recurrent Neural Networks are good at processing time-series data and can capture the complex patterns of changes in various factors in wastewater treatment over time. Support Vector Regression Models, on the other hand, perform well in processing small samples and high-dimensional data. They provide a variety of applicable and effective technical options for accurately predicting dissolved oxygen concentrations, which helps to improve the accuracy and stability of predictions.

[0011] Furthermore, the prediction model includes: An encoder is used to extract the temporal features of the input data; the encoder adopts a two-layer long short-term memory network, wherein the first layer outputs the sequence of all hidden states and the second layer outputs the final state; The attention mechanism unit is used to calculate the dynamic correlation weight with the current prediction time using the entire hidden state sequence output by the first layer, and generate a context vector; The decoder is used to initialize with the final state output by the second layer of the encoder, use the process time delay period as the prediction step size, and decode based on the context vector to generate and output the model prediction value of the DO concentration at the current or future time.

[0012] Explanation: The above method uses a two-layer long short-term memory network as the encoder. The first layer outputs the sequence of all hidden states, and the second layer outputs the final state, which can fully explore the temporal features of the input data. The attention mechanism unit uses the first-layer hidden state sequence to calculate dynamic correlation weights and generate context vectors, which enhances the capture of key information. The decoder is initialized with the final state of the second layer of the encoder and performs decoding prediction by combining the process time delay period and context vectors. This enables the model to accurately focus on key features and effectively adapt to the complex dynamic changes in the wastewater treatment process, thereby generating more accurate DO concentration prediction values ​​for the current or future time.

[0013] Furthermore, the time difference between the historical moment and the current moment, and the time difference between the current moment and the future moment, are equal to the time lag period between DO concentration and aeration volume; the time lag period is obtained by performing correlation analysis on DO concentration and aeration volume at multiple moments.

[0014] Note: The above method obtains the time delay relationship between DO concentration change and aeration volume adjustment through time lag period, which makes the model and control system more closely match the actual working conditions of wastewater treatment, avoids inaccurate prediction and control lag caused by ignoring time lag factor, and thus improves the reliability of accurate control of dissolved oxygen concentration, ensuring stable and compliant wastewater treatment effect.

[0015] Furthermore, the correlation analysis can be any one of the following: cross-correlation analysis, normalized cross-correlation, cross-correlation based on fast Fourier transform, phase cross-correlation, or time-varying window cross-correlation.

[0016] Note: The above provides a variety of mature and distinctive analytical methods that can more accurately determine the time lag period between the two, thus providing solid and reliable data support for the accurate prediction and effective control of dissolved oxygen concentration.

[0017] Further, the weighted fusion calculation of the measured DO concentration value for the current time period and the model prediction value of the DO concentration for the current time period obtained by the prediction model to obtain a fused DO concentration value includes: The current confidence level is calculated based on the measured DO concentration value for the current time period and the model prediction value of DO concentration for the current time period obtained by the prediction model. Using the current confidence level as a weighting coefficient, the measured DO concentration value and the model predicted DO concentration value at the current time are weighted and calculated to obtain the DO concentration fusion value.

[0018] Further, the step of calculating the current confidence level based on the measured DO concentration at the current moment and the model prediction value of the DO concentration obtained by the prediction model at the current moment includes: Calculate the error between the measured DO concentration in the current time period and the model prediction of the DO concentration in the current time period obtained by the prediction model. ; Error Input the following formula (1) to calculate the current confidence level: (1) In equation (1), For error, At the current confidence level, This is the maximum error tolerance coefficient; This is the rate-of-change control factor for the function.

[0019] Explanation: The above method first calculates the error between the measured DO concentration and the model prediction for the current time period, and then uses a specific formula combined with the maximum error tolerance coefficient and the function change rate control factor to calculate the current confidence level. This method can comprehensively consider the magnitude of the prediction error and the model's sensitivity to error changes, so that the current confidence level can more scientifically and reasonably reflect the reliability of the model prediction, thereby providing an accurate basis for the subsequent weighted fusion of the measured DO concentration and the model prediction.

[0020] Furthermore, the error The calculation method is shown in formula (2): (2) In equation (2), For error, express M The first in the current time periodi Measured DO concentration at each time point; The prediction model predicts the first time period in the current time period. i Model-predicted DO concentration at a given time point.

[0021] Note: The above formula calculates the value by comparing the measured value with the corresponding model prediction value at each moment in the current time period. It can comprehensively and meticulously measure the prediction accuracy of the prediction model at different times, providing a precise data foundation for the subsequent accurate calculation of the current confidence level. This ensures that the entire method for precise control of dissolved oxygen concentration can achieve scientific and effective control decisions based on reliable error analysis.

[0022] Furthermore, the DO concentration fusion value is calculated using the following formula (3): (3) In equation (3), This represents the DO concentration fusion value. For the prediction model at time... The current confidence level; for Predicting future moments at every moment + Model predictions of DO concentration; for The measured value of DO concentration monitored at all times.

[0023] Explanation: The above formula can dynamically balance the weights of model predictions and measured values ​​based on the current confidence level. When the current confidence level is high, the model predictions are trusted more, and vice versa, the measured values ​​are given more weight. This results in a more accurate and reliable DO concentration fusion value, which provides solid data support for subsequent precise adjustment of aeration volume based on minimizing the error between the fusion value and the target value. This helps to improve the dissolved oxygen concentration control effect of the entire wastewater treatment aeration unit.

[0024] The present invention also provides a system for precise control of dissolved oxygen concentration in aeration units of wastewater treatment, comprising: a data acquisition module, a prediction module, a fusion module, and a control module; The data acquisition module is used to acquire water volume data, DO concentration, aeration air volume, and water quality data in the aeration unit. The prediction module is used to: carry a prediction model and obtain the model prediction value of DO concentration at the current time or future time based on the prediction model; the input of the prediction model is historical water volume data, aeration air volume and water quality data; the output of the prediction model is the model prediction value of DO concentration at the current time or future time. The fusion module is used to: calculate the current confidence level based on the measured DO concentration value for the current time period and the model prediction value of DO concentration for the current time period obtained by the prediction model; and use the current confidence level as a weighting coefficient to perform weighted fusion calculation on the measured DO concentration value and the model prediction value of DO concentration at the current moment to obtain the DO concentration fusion value. The control module is used to adjust or control the aeration air volume based on a given DO concentration target value, with the goal of minimizing the error between the DO concentration fusion value and the DO concentration target value.

[0025] Explanation: The above system's acquisition module comprehensively obtains key data, providing basic information for system operation; the prediction module uses historical data to accurately predict current or future DO concentrations, assisting in advance decision-making; the fusion module calculates the current confidence level and weights and fuses measured and predicted values ​​to improve data reliability; the control module precisely adjusts the aeration air volume based on minimizing the error between the fused value and the target value. All modules work together to achieve precise and efficient control of dissolved oxygen concentration, ensuring stable and compliant wastewater treatment results.

[0026] The beneficial effects of this invention are: This invention effectively overcomes the lag problem between aeration regulation and DO concentration response by constructing a DO prediction model that integrates temporal features and an attention mechanism, and combining measured data with a dynamic weighted fusion strategy of model output. This method significantly improves the control accuracy and system stability of the wastewater treatment aeration process, achieving an intelligent upgrade from feedforward prediction to adaptive regulation. While ensuring wastewater treatment effectiveness, it effectively reduces aeration energy consumption, providing reliable technical support for the efficient and low-carbon operation of wastewater treatment plants. Attached Figure Description

[0027] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the process of controlling the aeration air volume using PID regulation in an embodiment of the present invention; Figure 3 The confidence level in the embodiments of this invention The graph of the function; Figure 4 This is a schematic diagram of the system architecture of an embodiment of the present invention. Detailed Implementation

[0028] To further illustrate the methods and effects of this invention, the technical solution of this invention will be clearly and completely described below in conjunction with experiments.

[0029] Example 1: To further illustrate the methods and effects of the present invention, the technical solution of the present invention will be clearly and completely described below in conjunction with experiments.

[0030] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0031] In the context of the background technology, when an aeration unit is in an ideal, hysteresis-free system, increasing aeration immediately causes a rise in dissolved oxygen (DO). Upon detecting this rise, the controller immediately reduces the aeration command, allowing the system to stabilize smoothly at the target value. However, due to the hysteresis effect present in real-world systems, achieving the stability of an ideal closed loop is impossible. For example, when the controller issues an "increase aeration" command, oxygen needs to undergo a series of processes, including release, diffusion, dissolution, and uniform distribution within the large aeration tank. It may take several minutes or even tens of minutes before the DO probe reading begins to rise slowly. During this hysteresis period, the controller cannot confirm that the issued command has taken effect, so it continues to output an "increase aeration" command, leading to over-aeration. When the delayed DO reading finally begins to rise and reaches the target value, because the previous over-aeration command has already been executed, a large amount of oxygen is flooding into the system, causing the DO concentration to continue to rise sharply due to inertia, far exceeding the target value. At this point, the controller issues a "decrease aeration" command. Similarly, instructions take a lag period to take effect. This repeated cycle causes the system to fall into a continuous, periodic overshoot-undershoot oscillation. The derivative term in a PID controller is intended to anticipate future trends and smooth the system by suppressing rapid changes. However, in a lag system, the change signal returned by the sensor is itself delayed and distorted. The "trend" calculated based on this "outdated" signal is completely misleading, not only failing to help stabilize the system but sometimes even exacerbating oscillations; resulting in extremely high energy waste, unstable biochemical treatment effects, and the inability to achieve precise dosing.

[0032] Feedforward compensation / feedforward control involves real-time monitoring of the influent load (such as flow rate and pollutant concentration) entering the wastewater treatment system. Based on this influent data, the system predicts the subsequent DO demand in advance and adjusts the aeration equipment (such as blower speed) accordingly to attempt to offset or reduce the impact of lag. The drawback of this technology is that it is difficult to accurately quantify the lag time. Wastewater transport, mixing, and biochemical reactions all require time, so the "lag time" is not a fixed value. It varies with factors such as flow rate, water temperature, and sludge concentration. If the lag time parameter used in feedforward control is inaccurate, its compensation effect is difficult to implement precisely.

[0033] MPC (Multi-Process Control) is an advanced process control algorithm. It makes decisions based on the current state and uses dynamic mathematical models to predict the system's future behavior. The controller calculates a series of optimal control actions based on this prediction, executes only the first step, and then re-predicts and optimizes based on new measurements in the next sampling period—a "rolling optimization" strategy. The core challenge of MPC lies in improving its accuracy. Because wastewater treatment systems are nonlinear and involve multivariate coupling (e.g., adjusting an aeration valve affects not only the dissolved oxygen (DO) in the local area but also pressure, DO in other areas, microbial activity, and other variables), constructing mechanistic models based on physical and chemical principles becomes extremely complex, making accurate prediction difficult.

[0034] Based on the specific problems in the existing technology, this invention proposes a method for precise control of dissolved oxygen concentration in aeration units of wastewater treatment plants. This method is based on intelligent prediction and dual-source fusion feedback. Specifically, it dynamically analyzes the real-time lag period of aeration volume and DO response through cross-correlation analysis, and uses this as a step size. An LSTM-Attention model is then employed to achieve high-precision advance prediction of future DO concentration. A confidence-driven dual-source fusion mechanism is designed to dynamically weight model predictions and sensor measurements, generating a robust composite process variable. A PID controller is designed based on this composite variable to adjust the aeration intensity in real time. This method fundamentally solves the problem of control instability caused by lag. Through a three-level synergy of "quantifying lag - advance prediction - fusing feedback information," it provides a precise control paradigm with strong dynamic adaptability and excellent anti-interference capabilities for the aeration process, providing a technical foundation and support for improving the quality and reducing the cost of wastewater treatment plants and for intelligent operation. The specific scheme is as follows: A method for precise control of dissolved oxygen concentration in wastewater treatment aeration units includes the following steps: S101. Construct a prediction model and obtain the model prediction value of DO concentration at the current or future time based on the prediction model; the input of the prediction model is the historical water volume data, aeration air volume and water quality data; the output of the prediction model is the model prediction value of DO concentration at the current or future time. In some embodiments of the present invention, the prediction model employs one of the following: a long short-term memory network model, a recurrent neural network model, or a support vector regression model. In this embodiment, the prediction model used above is the LSTM-Attention model, which includes: an encoder for extracting temporal features of the input data; the encoder uses a two-layer long short-term memory network, wherein the first layer outputs the sequence of all hidden states and the second layer outputs the final state; The attention mechanism unit is used to calculate the dynamic correlation weight with the current prediction time using the entire hidden state sequence output by the first layer, and generate a context vector; The decoder is used to initialize with the final state output by the second layer of the encoder, use the process time delay period as the prediction step size, and decode based on the context vector to generate and output the model prediction value of the DO concentration at the current or future time. The time difference between the historical moment and the current moment, and the time difference between the current moment and the future moment, are equal to the time lag period between DO concentration and aeration volume (the time lag period is also called the lag time, which is calculated by step S101-3 below); the time lag period is obtained by performing correlation analysis on DO concentration and aeration volume at multiple moments; the correlation analysis can be any one of cross-correlation analysis, normalized cross-correlation, cross-correlation based on fast Fourier transform, phase cross-correlation, and time-varying window cross-correlation.

[0035] The construction of the prediction model and the acquisition of the model prediction value of DO concentration at the current time or future time based on the prediction model include the following S101-1 to S101-4. S101-1, Data Acquisition; Real-time data on water volume, water quality, and operation of the biological aeration unit are collected using online instruments. Water volume data includes the influent flow rate to the biological aeration unit; water quality data includes COD concentration, ammonia nitrogen concentration, DO concentration, pH value, ORP value, MLSS concentration, and water temperature; operation data includes the aeration air volume. The collected indicators are shown in Table 1 below. Table 1 Input and Output Data Acquisition Indicators

[0036] S101-2, Data Preprocessing; 1): Using 3 The criteria, combined with a sliding window, involve outlier detection and repair of the data collected in step S101-1. The specific process includes: a. Set the sliding window size to 60 data points, and the sliding step size to be equal to the sliding window size; b. Calculate the mean of the data points within the window. and standard deviation ; c. Detect each data point within the detection window; if it exceeds... If the value falls outside the specified range, it is marked as an outlier. d. For each outlier, replace it with a linear interpolation using the non-outlier values ​​immediately before and after it.

[0037] In real-time processing, each time new data is acquired, the window is updated to contain the latest 60 points of that new data, and step b above is executed, followed by step 3. The criteria determine whether new data is an outlier. If it is determined to be an outlier, it is replaced with the most recent non-outlier value.

[0038] 2) The data collected in step S101-1 above is normalized using the Z-sore standardization method, transforming the data into a distribution with a mean of 0 and a standard deviation of 1. The Z-sore standardization formula is as follows: In the formula This is the original data sample. Original data sample mean, The standard deviation of the original data sample. This is a normalized dimensionless data sample.

[0039] S101-3: Dynamic Calculation of Time Lag Period for Aeration Process and DO Concentration Response The time delay period calculation adopts the cross-correlation analysis method, including but not limited to normalized cross-correlation, cross-correlation based on fast Fourier transform, phase cross-correlation, and time-varying window cross-correlation; This embodiment uses the normalized cross-correlation method as an example to describe the dynamic calculation process of the aeration process and the response time lag period of DO concentration, including the following ①~④.

[0040] ① Set the time delay period search window This value is determined by the actual process. In particular, this value must be greater than twice the maximum response time lag period of DO concentration under different operating conditions.

[0041] For example, if the response time lag period for changes in DO concentration after aeration in the biological aeration unit of a wastewater treatment plant ranges from 15 to 30 minutes, then the maximum response time lag period for DO concentration is 30 minutes. Therefore, the time lag period search window... The minimum response time is set to 60 minutes.

[0042] ② Obtain the time-lag period analysis sequence. This sequence includes two indicators: DO concentration and aeration air volume in the aeration unit. It is collected from the latest data after processing in step S101-2. 1 data point. And ,in This represents the collection frequency of this indicator.

[0043] For example, setting a time delay period search window If the sampling frequency for DO and aeration air volume is 5 min, and the sampling frequency for DO and aeration air volume is 5 min, then the analysis sequence is the latest one processed by step S101-2. It consists of 12 data points, with a dimension of 12×2.

[0044] ③ Using a normalized cross-correlation function, process the time-delay period analysis sequence from step ② to calculate the cross-correlation between the two time series of DO concentration and aeration volume in the aeration unit under different lag times. The formula for calculating the normalized cross-correlation is as follows: in It is a time step with a lag, and ; To step in the lag time The cross-correlation coefficient between the DO concentration and aeration air volume of the lower aeration unit over two time series. A larger value indicates a more stable DO concentration over a longer time series. The greater the correlation between the DO concentration and aeration volume sequences, the stronger the cross-correlation between them. and These represent the first two time series, aeration air volume and DO concentration, respectively. The value of each data item; yes arrive The mean of the sequence is represented as the local mean of the aeration volume analysis sequence. yes arrive The mean of the sequence is represented as the variable local mean of the DO concentration analysis sequence.

[0045] ④ Traverse all The value is calculated according to step ③ under different lag time steps (i.e. (when taking different values) The maximum value is [value]. value corresponding This refers to the time lag period step of the DO concentration response during the aeration process.

[0046] S101-4. Establish an LSTM-Attention time series hybrid model. Input the influent flow rate parameters, water quality parameters, and operating parameters preprocessed in step S101-2 into the model to predict the future DO concentration of the aeration unit. Specifically, the LSTM-Attention model designed in this embodiment of the invention adopts a sequence-to-sequence structure, and its output is the future time-domain DO concentration sequence of the aeration unit. The specific method includes: (1): Based on the data preprocessed in step S101-2, the following model input tensor is constructed. : Time window: =12, step size is 5 min; Feature dimensions: =9; Specifically, the COD data was collected at a frequency of 60 min, which is greater than the step size of 5 min. Since the COD value in the aeration tank is relatively stable, the left-most nearest neighbor value of the sequence was used for padding to ensure the data granularity of the input tensor was aligned.

[0047] Define the model output sequence The structure is as follows (the label sequence structure is the same during model training): in Indicates the predicted future number The DO concentration value of the aeration unit in step 5 min. .

[0048] (2): Input the input tensor constructed in step (1) into the LSTM-Attention time series mixture model and predict the DO concentration sequence of the aeration tank in the future time period. The structure and calculation process of the LSTM-Attention time series mixture model are as follows: 1) The input tensor first extracts temporal features through a two-layer LSTM unit.

[0049] The first layer outputs the complete hidden state sequence. The second layer outputs the final state as a context vector.

[0050] a. The computation process for the first-layer LSTM unit is as follows: in , , These are the input gate, forget gate, and output gate, respectively. It is the sigmoid activation function; This is the weight matrix.

[0051] b. The computation process for the second-layer LSTM unit is as follows: Finally, the encoder state is obtained: This vector encapsulates the spatiotemporal features of the entire input sequence, providing a global context for the decoding stage.

[0052] 2) By using a double weight matrix ( and Process the decoder state separately. and encoder output This method quantifies the correlation between historical operating data and the current prediction target, enhancing feature representation capabilities. The calculation formula is as follows: in, This is the decoder state weight matrix; Output the weight matrix for the encoder; This is the energy mapping vector.

[0053] 3) Softmax normalize the energy values ​​calculated in the previous step to generate attention weights. The calculation formula is as follows: 4) The attention weights and encoder output are weighted and combined to generate a context vector: Where T is the size of the time window in step S101-4.

[0054] 5) Initialize the encoder (inheriting the encoder's final state), using the current DO value as the initial input: And update the LSTM state: 6) Predict DO concentration: in This is the output layer weight vector; This is the output layer bias term.

[0055] 7) Time-step iterative calculation to predict DO concentration at different time steps, and output the predicted DO concentration sequence. .

[0056] 8) Based on the time delay period calculated above... Select the corresponding predicted DO value from the above DO concentration prediction sequence. As the final output, that is: .

[0057] S102. Calculate the current confidence level based on the measured DO concentration value for the current time period and the model predicted value of DO concentration for the current time period obtained by the prediction model. Specifically, this step can evaluate the prediction accuracy of the LSTM-Attention model in real time, dynamically fuse the model's DO predictions and the sensor's measured DO values, and generate a stable composite process variable with anti-hysteresis capabilities. This provides robust optimization feedback input for the PID controller. The specific method for constructing the composite process variable is as follows: Dynamic evaluation of model confidence; Select the latest (Time window size) historical DO instrument measured values At the same time, obtain the DO model prediction value at the corresponding time. Calculated based on the following formula and error : (2) in, For error, express M The first in the current time period i Measured DO concentration at each time point; The prediction model predicts the first time period in the current time period. i The model-predicted DO concentration at time point; the error function is a variation of the root mean square error (RMSE), obtained through... The amplified prediction fluctuation not only effectively evaluates the absolute accuracy of the model's prediction results but also reflects the stability of the prediction effect. To more clearly illustrate the effectiveness of this error function, this patent provides an example of the error calculation method: If the time window size is set And in a certain period of time The latest measured values ​​and model predictions for the five DOs are shown in Table 2 below: Table 2 Comparison of DO measured values ​​and model predicted values

[0058] For both prediction sequences #1 and #2, the mean absolute error is 0.3 mg / L. Therefore, from the perspective of mean absolute error, the prediction accuracy of the two prediction sequences is equal. However, based on the error evaluation method of this patent, the errors of prediction sequences #1 and #2 are... The errors are 0.32 and 0.37 respectively, with the former clearly having a lower error than the latter, meaning that prediction sequence #1 has higher prediction accuracy. This is because the error assessment comprehensively considers the stability of the model prediction. For prediction sequence #1, its prediction error fluctuates between 0.2 and 0.4, while the prediction error of prediction sequence #2 fluctuates between 0.1 and 0.5. Therefore, with the same absolute error, prediction sequence #1 is evaluated as having better prediction accuracy than prediction sequence #2.

[0059] Construct a model confidence evaluation function to dynamically obtain the model's error. Then, the model confidence score is calculated by inputting it into the following confidence evaluation function. : (1) Among them, This represents the maximum error tolerance. This is a control factor for the rate of change of the function. When Take 0.5, When the confidence level is 2.0, The graph of the function is as follows Figure 3 As shown, Figure 3 When the model prediction error The closer the confidence level is to 0, the higher the model confidence level becomes. The closer the value is to 1, and the smaller the rate of change, the higher the confidence score of the model will be, thus ensuring a high confidence score even with low errors. The higher; When the model prediction error The closer to the maximum error tolerance At that time, model confidence The closer the value is to 0, and the faster the rate of change increases, the more pressure the model's confidence score will be forced to rise. To ensure the reliability of system operation, a lower value is preferred; when the model prediction error... ≥ Maximum error tolerance At that time, the model confidence score A value of 0 indicates that the model has failed and will not participate in subsequent regulation.

[0060] For prediction sequences 1#, 2#, and 3# in the table above, when Take 0.5, When the value is 2.0, its model confidence level is... exist The calculation results for each time point are shown below: Predicted sequence #1: ; Predicted sequence #2: ; Predicted sequence #3: ; S103. Using the current confidence level as a weighting coefficient, perform a weighted fusion calculation on the measured value of DO concentration at the current time and the model predicted value of DO concentration to obtain the DO concentration fusion value. Based on the evaluation results of the model prediction effect in step S102, the predicted DO value and the measured DO value from the sensor are dynamically fused to generate interference-resistant fusion process variables. The specific fusion function is as follows: (3) In equation (3), This represents the DO concentration fusion value. For the prediction model at time... The current confidence level; for Predicting future moments at every moment + Model predictions of DO concentration; for The measured value of DO concentration monitored at all times.

[0061] For example, in step S102 arrive The measured DO sequence at time 1, if at At time point S101-4, the predicted future DO concentration of the aeration unit is 2.9 mg / L according to the LSTM-Attention time series hybrid model. Therefore, the calculation results of the fusion process variables for the above prediction sequences 1#, 2#, and 3# are as follows: 1# Result of variable generation for the prediction sequence fusion process: ; Results of variable generation for the #2 prediction sequence fusion process: ; Results of variable generation for the #3 prediction sequence fusion process: ; When the model prediction error Greater than the maximum error tolerance At that time, model confidence Then the result of the fusion process variable calculation is: ; Based on the above examples, it can be seen that the smaller the model's prediction error, the higher the model's confidence level, and thus the closer the fused variables are to the model's predicted values ​​(e.g., ...). At this point, subsequent aeration rate adjustments rely more heavily on model predictions, thus reducing the time lag between aeration actions and DO concentration changes and improving the accuracy of DO concentration control in the aeration tank. However, the larger the prediction error, the lower the model confidence level, and the closer the fused variables are to the current measured values ​​on the instrument (e.g., ...). This ensures the reliability of system operation.

[0062] S104. Given a target DO concentration value, adjust or control the aeration air volume with the goal of minimizing the error between the DO concentration fusion value and the target DO concentration value.

[0063] This invention designs a PID controller to dynamically adjust the aeration rate of the aeration tank. This embodiment of the invention abandons the traditional control strategy of directly comparing the measured value of the DO sensor with the set value, and innovatively uses a composite process variable generated by fusing the predicted value of the LSTM-Attention model with the measured value of the sensor as the feedback input of the PID controller. This method fundamentally solves the control instability problem caused by the lag in DO response, achieving an advanced and precise control effect. The specific control logic is as follows: Figure 2 As shown, it includes the following steps 1) to 4). 1) Set the target value for DO concentration. That is, if the target for DO concentration in the aeration unit is 2.0 mg / L, then ; 2) The information obtained in step S103 The DO concentration fusion value at any given time (i.e., the fusion process variable) and the set DO concentration target value. Do bad things, get Time control error : in The result calculated in step S103 The values ​​of process variables are integrated at all times.

[0064] 3) Control error Input to the PID controller to generate control signals (For a 4-20 mA analog signal); the PID controller structure is shown below: in, , , These are the control proportional coefficients for the proportional, integral, and derivative terms, respectively.

[0065] 4) The generated control signal The PLC transmits the signal to the blower frequency converter to adjust the operating frequency of the aeration blower, thereby controlling the aeration volume.

[0066] A system for precise control of dissolved oxygen concentration in aeration units of wastewater treatment, used to implement the method described in the above embodiments, includes: a data acquisition module, a prediction module, a fusion module, and a control module; The data acquisition module is used to acquire water volume data, DO concentration, aeration air volume, and water quality data in the aeration unit. The prediction module is used to: carry a prediction model and obtain the model prediction value of DO concentration at the current time or future time based on the prediction model; the input of the prediction model is historical water volume data, aeration air volume and water quality data; the output of the prediction model is the model prediction value of DO concentration at the current time or future time. The fusion module is used to: calculate the current confidence level based on the measured DO concentration value for the current time period and the model prediction value of DO concentration for the current time period obtained by the prediction model; and use the current confidence level as a weighting coefficient to perform weighted fusion calculation on the measured DO concentration value and the model prediction value of DO concentration at the current moment to obtain the DO concentration fusion value. The control module is used to adjust or control the aeration air volume based on a given DO concentration target value, with the goal of minimizing the error between the DO concentration fusion value and the DO concentration target value.

Claims

1. A method for precise control of dissolved oxygen concentration in aeration units of wastewater treatment plants, characterized in that, Includes the following steps: A prediction model is constructed, and the model prediction value of DO concentration at the current or future time is obtained based on the prediction model; the input of the prediction model is historical water volume data, aeration air volume and water quality data; the output of the prediction model is the model prediction value of DO concentration at the current or future time. The measured DO concentration value for the current time period is weighted and fused with the model prediction value of DO concentration for the current time period obtained by the prediction model to obtain a fused DO concentration value. Given a target DO concentration, the aeration air volume is adjusted or controlled with the goal of minimizing the error between the DO concentration fusion value and the target DO concentration value.

2. The method for precise control of dissolved oxygen concentration in a wastewater treatment aeration unit as described in claim 1, characterized in that, The prediction model employs one of the following: a long short-term memory network model, a recurrent neural network model, or a support vector regression model.

3. The method for precise control of dissolved oxygen concentration in a wastewater treatment aeration unit as described in claim 1, characterized in that, The prediction model includes: An encoder is used to extract the temporal features of the input data; the encoder adopts a two-layer long short-term memory network, wherein the first layer outputs the sequence of all hidden states and the second layer outputs the final state; The attention mechanism unit is used to calculate the dynamic correlation weight with the current prediction time using the entire hidden state sequence output by the first layer, and generate a context vector; The decoder is used to initialize with the final state output by the second layer of the encoder, use the process time delay period as the prediction step size, and decode based on the context vector to generate and output the model prediction value of the DO concentration at the current or future time.

4. The method for precise control of dissolved oxygen concentration in a wastewater treatment aeration unit as described in claim 1, characterized in that, The time difference between the historical moment and the current moment, and the time difference between the current moment and the future moment, are equal to the time lag period between DO concentration and aeration volume; the time lag period is obtained by performing correlation analysis on DO concentration and aeration volume at multiple moments.

5. The method for precise control of dissolved oxygen concentration in a wastewater treatment aeration unit as described in claim 4, characterized in that, The correlation analysis can be any one of the following: cross-correlation analysis, normalized cross-correlation, cross-correlation based on fast Fourier transform, phase cross-correlation, or time-varying window cross-correlation.

6. The method for precise control of dissolved oxygen concentration in a wastewater treatment aeration unit as described in claim 1, characterized in that, The step of weightedly fusing the measured DO concentration value for the current time period with the model prediction value of the DO concentration for the current time period obtained by the prediction model to obtain a fused DO concentration value includes: The current confidence level is calculated based on the measured DO concentration value for the current time period and the model prediction value of DO concentration for the current time period obtained by the prediction model. Using the current confidence level as a weighting coefficient, the measured DO concentration value and the model predicted DO concentration value at the current time are weighted and calculated to obtain the DO concentration fusion value.

7. The method for precise control of dissolved oxygen concentration in a wastewater treatment aeration unit as described in claim 6, characterized in that, The step of calculating the current confidence level based on the measured DO concentration at the current moment and the model prediction value of the DO concentration at the current moment obtained by the prediction model includes: Calculate the error between the measured DO concentration in the current time period and the model prediction of the DO concentration in the current time period obtained by the prediction model. ; Error Input the following formula (1) to calculate the current confidence level: (1) In equation (1), For error, At the current confidence level, This is the maximum error tolerance coefficient; This is the rate-of-change control factor for the function.

8. The method for precise control of dissolved oxygen concentration in a wastewater treatment aeration unit as described in claim 7, characterized in that, The error The calculation method is shown in formula (2): (2) In equation (2), For error, express M The first in the current time period i Measured DO concentration at each time point; The prediction model predicts the first time period in the current time period. i Model-predicted DO concentration at a given time point.

9. The method for precise control of dissolved oxygen concentration in a wastewater treatment aeration unit as described in claim 6, characterized in that, The DO concentration fusion value is calculated using the following formula (3): (3) In equation (3), This represents the DO concentration fusion value. For the prediction model at time... The current confidence level; for Predicting future moments at every moment + Model predictions of DO concentration; for The measured value of DO concentration monitored at all times.

10. A system for precise control of dissolved oxygen concentration in a wastewater treatment aeration unit, used to implement the method described in any one of claims 1 to 9, characterized in that, include: The module consists of a data acquisition module, a prediction module, a fusion module, and a control module. The data acquisition module is used to acquire water volume data, aeration air volume, and water quality data in the aeration unit. The prediction module is used to: carry a prediction model and obtain the model prediction value of DO concentration at the current time or future time based on the prediction model; the input of the prediction model is historical water volume data, aeration air volume and water quality data; the output of the prediction model is the model prediction value of DO concentration at the current time or future time. The fusion module is used to: calculate the current confidence level based on the measured DO concentration value for the current time period and the model prediction value of DO concentration for the current time period obtained by the prediction model; and use the current confidence level as a weighting coefficient to perform weighted fusion calculation on the measured DO concentration value and the model prediction value of DO concentration at the current moment to obtain the DO concentration fusion value. The control module is used to adjust or control the aeration air volume based on a given DO concentration target value, with the goal of minimizing the error between the DO concentration fusion value and the DO concentration target value.

Citation Information

Cited By

  • An intelligent control method, system and device for sewage treatment aeration quantity

    CN122166922A

  • An intelligent control method, system and device for sewage treatment aeration quantity

    CN122166922B