Aeration air quantity control method based on attention mechanism
Patent Information
- Application Number
- CN202611088443.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2046-07-22
AI Technical Summary
[0005]本申请提供了一种基于注意力机制的曝气气量控制方法,解决了现有曝气气量控制方法中快慢变量混同建模、注意力机制作用于历史观测值而非未来预测轨迹、两路信息融合权重无法依据实时预测误差自动调整的技术问题,解决了现有方法在进水负荷冲击与生物状态衰减叠加工况下气量决策逻辑混淆、控制结果缺乏可解释性的问题
[0007]本申请提供的技术方案中,通过对多维曝气过程变量依据时变速率特征值进行分组划分,将进水流量、进水化学需氧量、进水氨氮等外部负荷指标归入快变量集合并设定较短的短预测时域,将混合液悬浮固体浓度、比耗氧速率等生物状态指标归入慢变量集合并设定较长的长预测时域,使两类物理语义根本不同的变量在结构层面即得到区分对待,避免了现有技术中快慢变量混同建模导致的短程负荷突变信息与长程生物状态趋势信息相互干扰的问题。在此基础上,本申请引入前向轨迹注意力机制,将注意力权重的作用对象从现有技术中的历史观测值转移至解码器逐步生成未来预测轨迹的过程,通过对短预测时域与长预测时域内全部预测步的注意力权重矩阵沿时域轴求均值,分别得到快变量贡献度向量与慢变量贡献度向量,使贡献度度量从对当前状态的即时重要性排序转变为对未来趋势演化过程的综合贡献量化,从根本上改变了现有注意力机制在曝气气量控制场景中仅能反映历史状态特征而无法感知未来负荷演化方向的局限。
Smart Images

Figure CN122614121B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of aeration volume prediction technology, and in particular to an aeration volume control method based on an attention mechanism. Background Technology
[0002] The aeration system is the most energy-intensive unit in the activated sludge process of wastewater treatment plants, and its air volume control directly affects the dissolved oxygen concentration in the biological treatment tank and the compliance of effluent quality. Existing aeration air volume control methods mainly include closed-loop control based on PID, model predictive control, and data-driven control methods based on deep learning. Among them, PID control relies on dissolved oxygen feedback deviation to adjust the air volume, model predictive control optimizes the air volume setpoint by establishing a mechanistic model, and deep learning-based methods use time series models such as LSTM and Transformer to extract features from historical data, and use the multi-dimensional state observations at the current moment as input to predict the required air volume at the next moment. Representative methods include dual-stage attention LSTM (DA-LSTM), and combined models of multi-scale convolutional neural networks and Transformers.
[0003] However, the aforementioned methods share a common fundamental flaw in practical applications. Both PID control and model predictive control are reactive controls, only able to passively respond after dissolved oxygen deviations occur, lacking the ability to predict influent water quality shocks. While existing deep learning methods based on attention mechanisms introduce feature importance metrics, their attention mechanisms operate on historical observations, essentially remaining an instantaneous mapping from the current state to gas volume. They cannot distinguish the contribution mechanisms of two fundamentally different variables—influent water quality (external load indicators such as COD and ammonia nitrogen) and microbial activity (biological state indicators such as MLSS, OUR, and SVI)—to gas volume demand. This results in two different driving forces—external load shocks and internal biological state decay—being treated equally in the gas volume decision-making logic, leading to insufficient gas volume allocation accuracy and a lack of interpretability in the control results.
[0004] The root cause of the aforementioned shortcomings lies in the fact that existing methods fail to consider the fundamental differences in time scales between different categories of variables. Influent water quality variables fluctuate dramatically on a minute-to-hour scale, while microbial activity variables drift slowly on an hour-to-day scale. The impact of these two types of variables on gas demand is inherently asymmetrical over time. This asymmetry dictates that trend prediction for fast variables only needs to be performed over a shorter future time domain, while trend prediction for slow variables needs to be performed over a longer future time domain. They should not be treated with a unified time series model and the same time horizon. However, existing technologies model all variables uniformly within the same time window, failing to allocate differentiated prediction time domains for the time-varying characteristics of different variables. This leads to interference between short-range load mutation information of fast variables and long-range biological state trend information of slow variables, making it impossible for gas demand decisions to simultaneously consider both the rapid response to external loads and the long-range perception requirements of internal biological states. Furthermore, when the prediction reliability of the two types of variables changes dynamically during operation, existing methods lack a mechanism to automatically adjust the fusion weights of the two information streams based on the real-time prediction error distribution, and there are no effective feedforward compensation and degradation protection measures when model predictions deviate. Summary of the Invention
[0005] This application provides an aeration volume control method based on an attention mechanism, which solves the technical problems in existing aeration volume control methods, such as mixed modeling of fast and slow variables, the attention mechanism acting on historical observations rather than future predicted trajectories, and the inability of the weights of the two-way information fusion to be automatically adjusted based on real-time prediction errors. It also solves the problems of confused air volume decision logic and lack of interpretability of control results under the superposition of influent load shock and biological state decline conditions.
[0006] This application provides an aeration volume control method based on an attention mechanism, the aeration volume control method based on an attention mechanism includes: Step S1: Based on the time-varying rate characteristic values of the multidimensional aeration process variables, divide the multidimensional aeration process variables into a fast variable set and a slow variable set, and set corresponding short prediction time domains and long prediction time domains respectively. Step S2: Generate future prediction trajectories for the fast variable set and the slow variable set in the short prediction time domain and the long prediction time domain, respectively. Perform integration on the future prediction trajectory through the forward trajectory attention mechanism to obtain the fast variable contribution vector and the slow variable contribution vector, respectively. Based on the future prediction trajectory, obtain the fast path gas demand component and the slow path gas demand component. Step S3: Based on the historical distribution parameters of the prediction errors of the fast-path gas demand component and the slow-path gas demand component, the real-time prediction error within the current sliding window is standardized to obtain the fusion coefficient. Step S4: The fast-path gas demand component and the slow-path gas demand component are weighted and fused using the fusion coefficient to obtain a fused gas demand estimate. The difference between the fused gas demand estimate and the basic gas demand setting is used as a feedforward compensation quantity and output. The fast variable contribution vector, the slow variable contribution vector and the fusion coefficient are weighted and merged to obtain a joint output of the dominant variable label and the feedforward compensation quantity.
[0007] In the technical solution provided in this application, the variables of the multidimensional aeration process are grouped and classified according to the time-varying rate characteristic value. External load indicators such as influent flow rate, influent chemical oxygen demand, and influent ammonia nitrogen are classified into the fast variable set and a shorter short prediction time domain is set. Biological state indicators such as mixed liquor suspended solids concentration and specific oxygen consumption rate are classified into the slow variable set and a longer long prediction time domain is set. This allows the two types of variables with fundamentally different physical meanings to be treated differently at the structural level, avoiding the problem of mutual interference between short-range load change information and long-range biological state trend information caused by the mixed modeling of fast and slow variables in the prior art. Based on this, this application introduces a forward trajectory attention mechanism, which shifts the focus of attention weights from historical observations in existing technologies to the process of the decoder gradually generating future predicted trajectories. By averaging the attention weight matrices of all prediction steps in the short and long prediction time domains along the time domain axis, the contribution vectors of fast variables and slow variables are obtained respectively. This transforms the contribution measurement from ranking the immediate importance of the current state to a comprehensive quantification of the contribution to the future trend evolution process, fundamentally changing the limitation of existing attention mechanisms in aeration volume control scenarios that can only reflect historical state characteristics and cannot perceive the future load evolution direction.
[0008] This application calculates the standardized deviation of the real-time prediction errors of the two paths online within the current sliding window based on the historical distribution parameters of the fast-path prediction error and the slow-path prediction error. The fusion coefficient is obtained through Sigmoid mapping, allowing the fusion weights of the fast-path and slow-path gas demand components to be dynamically adjusted according to the real-time reliability of the two models, rather than relying on manually set fixed weights. This solves the problem of existing technologies being unable to adaptively adjust the information fusion strategy under conditions of high uncertainty in influent load. Simultaneously, this application uses the difference between the fused gas demand estimate and the basic gas demand setpoint as a feedforward compensation quantity superimposed on the PID controller output instead of replacing the PID controller. This allows the system to obtain effective feedforward correction when the model prediction is reliable, and the feedforward compensation quantity naturally converges and the system degenerates into basic PID control when both predictions deviate simultaneously, preserving the stability fallback capability of closed-loop control. Finally, a unified contribution sequence is generated by weighting and merging the contribution vectors of fast and slow variables through a fusion coefficient. The name of the variable ranked first is used as the dominant variable label and is jointly output with the feedforward compensation amount. This allows the driving source of the gas volume control decision-making process to be presented in the form of readable labels in each control cycle. The attention distribution inside the model is transformed into process diagnostic information that operators can directly understand. This makes the contribution of algorithm features to aeration gas volume allocation explicitly output in a structured and traceable manner, rather than remaining at the level of opaque predicted values. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a schematic diagram of an embodiment of the aeration volume control method based on the attention mechanism in this application. Figure 2 This is a schematic diagram of the short-time domain prediction trajectory of fast variables and the long-time domain prediction trajectory of slow variables in the embodiments of this application; Figure 3 This is a schematic diagram of the attention weight matrix generated by the forward trajectory attention mechanism in the short prediction time domain in the embodiments of this application. Detailed Implementation
[0011] This application provides an aeration volume control method based on an attention mechanism. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0012] For ease of understanding, the specific process of the embodiments of this application is described below. Please refer to [link / reference]. Figure 1 One embodiment of the aeration volume control method based on the attention mechanism in this application includes: Step S1: Based on the time-varying rate characteristic values of the multidimensional aeration process variables, divide the multidimensional aeration process variables into a fast variable set and a slow variable set, and set corresponding short prediction time domains and long prediction time domains respectively. Specifically, multidimensional aeration process variables refer to multidimensional time-series data collected from the online monitoring platform of the wastewater treatment system, reflecting the operational status of the aeration process. These include influent flow rate, influent chemical oxygen demand (COD), influent ammonia nitrogen, mixed liquor suspended solids concentration, sludge volume index, and specific oxygen consumption rate. The time-varying rate characteristic value is calculated by progressively subtracting adjacent sampled values of each variable within a preset time window (72 sampling steps, corresponding to 6 hours) to form a difference sequence. The mean and standard deviation of the absolute values of the difference sequence are then calculated, and the sum of these two values yields a scalar value reflecting the degree of fluctuation of the variable over time. Using the median of all time-varying rate characteristic values as the dividing threshold avoids human intervention in the grouping boundaries, allowing the statistical characteristics of the data distribution to determine the grouping results. The short prediction time domain is set to 60 minutes (12 sampling steps), and the long prediction time domain is set to 240 minutes (48 sampling steps). The ratio of the two is 1:4, which is determined by the mean ratio of the time-varying rate characteristic values of the fast variable set and the slow variable set. This directly maps the difference in the physical change rate of the fast and slow variables in the process mechanism to the structural difference in the prediction time domain, rather than manually specifying a fixed duration.
[0013] Step S2: Generate future prediction trajectories for the fast variable set and the slow variable set in the short prediction time domain and the long prediction time domain, respectively. Perform integral operation on the future prediction trajectory through the forward trajectory attention mechanism to obtain the contribution vector of fast variables and the contribution vector of slow variables, respectively. Based on the future prediction trajectory, obtain the fast path gas demand component and the slow path gas demand component. Specifically, the forward trajectory attention mechanism is the core of this invention, distinguishing it from existing technologies. Existing attention-based methods (such as DA-LSTM) apply attention weights to historical observation time steps, measuring which historical observation state contributes more to the current prediction. This invention's forward trajectory attention mechanism applies attention weights to the decoder as it progressively generates the future prediction trajectory. When the decoder generates the τ-th step prediction value, the attention score is calculated between the current decoded hidden state and the sequence of all encoder hidden states. This score is then normalized using Softmax to obtain the attention weight vector for that step. The attention weight vector is then weighted and summed with the hidden state sequence to obtain the context vector. The context vector is concatenated with the current decoded hidden state to output the prediction value. The mean of the attention weight matrix for all τ steps within the short prediction time domain is calculated along the time axis to obtain the fast variable contribution vector. Each dimension of this vector reflects the contribution of the corresponding variable in the fast variable set to the future short-term load evolution prediction. The slow variable contribution vector is generated in the same way but applies to the long prediction time domain. The gas demand component of the fast-path system is obtained by summing the predicted average values of influent chemical oxygen demand (COD), influent ammonia nitrogen (NH4N), and flow rate within the short prediction time domain, multiplied by their corresponding unit oxygen demand coefficients. The unit oxygen demand coefficients are taken from the standard parameters of the activated sludge ASM1 model. The coefficient corresponding to influent COD is taken as 0.9 g O2 / g COD, and the coefficient corresponding to influent ammonia nitrogen is taken as 4.57 g O2 / g NH4. + -N. The slow-path gas demand component is obtained by multiplying the predicted mean of the specific oxygen consumption rate and the predicted mean of the mixed liquid suspended solids concentration in the long prediction time domain, and dividing by the product of the oxygen transfer correction coefficient (taken as 0.85) and the dissolved oxygen concentration difference (saturated dissolved oxygen concentration of 9.1 mg / L minus the control setpoint of 2.0 mg / L).
[0014] Step S3: Based on the historical distribution parameters of the prediction errors of the fast-path gas demand component and the slow-path gas demand component, the real-time prediction error within the current sliding window is standardized to obtain the fusion coefficient. Specifically, the historical distribution parameters of prediction errors refer to the mean and standard deviation obtained by fitting the mean sequence of the absolute prediction errors of the fast variable prediction sub-model and the slow variable prediction sub-model at each time step on the validation dataset during the offline validation phase. These two parameters jointly describe the error statistical characteristics of the prediction sub-model on historical data. During the online phase, the current sliding window length is 12 sampling steps (corresponding to 1 hour). Within the window, the mean of the real-time prediction errors of the two paths is calculated, and the difference between each is taken and its respective historical distribution mean, then divided by the corresponding standard deviation to obtain the fast path standardized deviation and the slow path standardized deviation. The fast path standardized deviation is negatively taken and summed with the slow path standardized deviation. The sum is then subjected to a Sigmoid mapping to obtain the fusion coefficient, which is a continuous value between 0 and 1. When the recent prediction error of the fast path is consistently higher than the historical mean, the fast path standardized deviation is larger. Taking it negatively makes the sum smaller, resulting in a smaller fusion coefficient output by the Sigmoid mapping, and the proportion of the fast path gas demand component in the weighted fusion decreases; conversely, the proportion of the fast path increases.
[0015] Step S4: The gas demand components of the fast path and the slow path are weighted and fused using the fusion coefficient to obtain the estimated value of the fused gas demand. The difference between the estimated value of the fused gas demand and the basic gas demand setting is used as the feedforward compensation quantity and output. The contribution vectors of the fast variable and the slow variable are weighted and merged with the fusion coefficient to obtain the joint output of the dominant variable label and the feedforward compensation quantity.
[0016] Specifically, the estimated blended air demand is obtained by adding the product of the blending coefficient and the fast-path air demand component, and the product of the blending coefficient supplement (i.e., 1 minus the blending coefficient) and the slow-path air demand component. The blending coefficient supplement is numerically equal to 1 minus the blending coefficient, and the sum of the two is 1, ensuring that the total weight of the fast and slow paths in the weighted blending is always 1. The feedforward compensation is the difference between the estimated blended air demand and the basic air demand setting multiplied by the compensation gain coefficient. The initial value of the compensation gain coefficient is 0.6, based on the fact that the root mean square error of dissolved oxygen control corresponding to this initial value is within a reasonable range in experimental verification. The upper and lower bounds of the coefficient are limited to 0.3 to 0.9 to prevent excessive compensation from causing frequent blower speed adjustments or insufficient compensation from causing feedforward failure. The dominant variable label is generated by merging the contribution vectors of fast and slow variables into a unified contribution sequence through a fusion coefficient and then arranging them in descending order. The name of the first-ranked variable is used to generate the label, which is output to the monitoring platform synchronously with the feedforward compensation amount. This allows operators to directly determine the driving source of the current gas demand without having to consult the internal parameters of the model.
[0017] In one specific embodiment, step S1 includes: Historical operating data of the aeration system were collected, including influent flow rate, influent chemical oxygen demand, influent ammonia nitrogen, mixed liquor suspended solids concentration, sludge volume index and specific oxygen consumption rate. The historical operating data were preprocessed by normalization to obtain multidimensional aeration process variables. Within a preset time window, the mean and standard deviation of the absolute values of the difference sequences of each variable in the multidimensional aeration process are calculated, and the sum of the mean and standard deviation of the absolute values is used as the time-varying rate characteristic value of the variable. The division threshold is set based on the median of all time-varying rate characteristic values. Variables with time-varying rate characteristic values not lower than the division threshold are classified into the fast variable set, and variables with time-varying rate characteristic values lower than the division threshold are classified into the slow variable set. Based on the ratio of the mean of the time-varying rate characteristic values of each variable in the fast variable set and the slow variable set, a short prediction time domain is set for the fast variable set and a long prediction time domain is set for the slow variable set. The ratio of the short prediction time domain to the long prediction time domain is determined by the ratio of the mean of the time-varying rate characteristic values of the fast variable set and the slow variable set.
[0018] Specifically, the historical operational data collection spans at least 180 days, with a sampling interval of 5 minutes. Normalization preprocessing employs a minimum-maximum normalization method, mapping the historical data of each variable to a 0-1 interval to eliminate interference from dimensional differences in subsequent feature calculations. A preset time window of 72 sampling steps, corresponding to 6 hours, is used. This window length is chosen because the typical fluctuation cycle of influent water quality in a wastewater treatment system is approximately 4 to 8 hours; a 6-hour window fully covers the variable variation characteristics within a typical fluctuation cycle. For each variable, adjacent sampled values within the window are progressively subtracted, resulting in a difference sequence of length 71. The absolute value of the difference sequence is calculated, and then the standard deviation of the absolute values of the difference sequence is calculated. Adding the absolute mean and standard deviation yields the time-varying rate characteristic value. The absolute mean reflects the average amplitude of the variable's change, while the standard deviation reflects the dispersion of the amplitude. The sum of these two values comprehensively measures the intensity of the variable's fluctuation over time; using only the mean or standard deviation will miss some fluctuation information.
[0019] The median of the time-varying rate eigenvalues of all variables is used as the dividing threshold because the median is insensitive to extreme values and can stably divide the variable set into high-fluctuation and low-fluctuation groups, avoiding threshold shifts and grouping distortions caused by abnormally large time-varying rate eigenvalues of individual variables. Variables such as influent flow rate, influent chemical oxygen demand, and influent ammonia nitrogen are driven by external influent conditions and fluctuate drastically on a minute to hourly scale. Their time-varying rate eigenvalues are usually not lower than the dividing threshold and are classified into the fast variable set. Mixed liquor suspended solids concentration, sludge volume index, and specific oxygen consumption rate are driven by biochemical reaction processes and drift slowly on an hourly to daily scale. Their time-varying rate eigenvalues are usually lower than the dividing threshold and are classified into the slow variable set. The ratio of the short prediction time domain to the long prediction time domain is obtained by dividing the mean of the time-varying rate characteristic values of all variables in the fast variable set by the mean of the time-varying rate characteristic values of all variables in the slow variable set. This ratio directly reflects the ratio of the physical change rates of the two types of variables. This ratio is used to determine the length ratio of the short prediction time domain to the long prediction time domain, so that the setting of the prediction time domain forms a quantitative correspondence with the dynamic characteristics of the variables themselves. Specifically, the short prediction time domain is 60 minutes and the long prediction time domain is 240 minutes. The ratio of the two is 1:4, which is consistent with the above mean ratio.
[0020] In one specific embodiment, step S2 involves generating future prediction trajectories for the fast variable set and the slow variable set in the short prediction time domain and the long prediction time domain, respectively, including: The multidimensional time series containing fast variables within the history review window is input into the encoder-decoder network. The encoder of the encoder-decoder network encodes the multidimensional time series step by step to obtain the hidden state sequence of fast variables. The multidimensional time series containing the slow variable set within the corresponding historical review window is input into the bidirectional encoder-decoder network. The bidirectional encoder of the bidirectional encoder-decoder network encodes the multidimensional time series in both forward and reverse directions to obtain the slow variable hidden state sequence. Based on the hidden state sequence of fast variables, the decoder of the encoder-decoder network generates the future prediction trajectory of fast variables step by step through autoregression in the short prediction time domain; based on the hidden state sequence of slow variables, the decoder of the bidirectional encoder-decoder network generates the future prediction trajectory of slow variables step by step through autoregression in the long prediction time domain.
[0021] Specifically, the historical review window corresponding to the fast variable set takes 24 sampling steps, corresponding to 2 hours. This length covers the typical fluctuation history of the fast variables before the short prediction time domain, which is sufficient for the encoder to extract effective short-range load change features. The encoder-decoder network consists of a two-layer LSTM network with a hidden layer dimension of 128. The input is a multidimensional time series of the fast variable set within the historical review window, with a dimension of 24 rows multiplied by the number of fast variables. At each time step, the encoder updates the hidden state and cell state, gradually compressing the input sequence into a fixed-length hidden state representation. After all 24 steps of encoding are completed, a fast variable hidden state sequence is obtained. This sequence contains the hidden states output by the encoder at each time step, with a dimension of 24 rows multiplied by 128 columns, completely preserving the intermediate state information of each time step during the encoding process. The decoder is a single-layer LSTM. It uses the hidden state of the encoder's final time step as the initial hidden state and generates predicted values through autoregression within 12 steps in the short prediction time domain. That is, each step uses the predicted output of the previous step as the input of the current step, and gradually extends to 12 steps to obtain the future predicted trajectory of fast variables. Its dimension is 12 rows multiplied by the number of fast variables, and each row corresponds to the predicted value of each fast variable in the next sampling step.
[0022] The historical review window corresponding to the slow variable set takes 96 sampling steps, corresponding to 8 hours, covering the gradual historical trend of the slow variable before the long prediction time domain. The bidirectional encoder-decoder network's bidirectional encoder is composed of a bidirectional LSTM with a hidden layer dimension of 128. Forward encoding processes the input sequence sequentially from step 1 to step 96, while backward encoding processes it sequentially from step 96 to step 1. The hidden states of both at each time step are concatenated to obtain a dimension of 256, resulting in a slow variable hidden state sequence with a dimension of 96 rows by 256 columns. The significance of bidirectional encoding is that the long-term trend of slow variables is influenced by both past history and trend direction. Unidirectional encoding can only accumulate information from the past to the present, while bidirectional encoding allows the hidden state at each time step to contain contextual information from both the past and future directions, resulting in a more complete expression of the gradual trend of slow variables. The decoder is a single-layer LSTM with a hidden layer dimension of 256. The initial hidden state is the vector concatenated from the forward and reverse hidden states of the bidirectional encoder. Over 48 steps in the long prediction time domain, it autoregressively generates the future predicted trajectories of slow variables, with each trajectories consisting of 48 rows multiplied by the number of slow variables. Each row corresponds to the predicted value of each slow variable in the next sampling step. The step size of both predicted trajectories on the time axis is aligned with the 5-minute sampling interval.
[0023] Figure 2 This is a schematic diagram of the short-time domain prediction trajectory of fast variables and the long-time domain prediction trajectory of slow variables in the embodiments of this application. Figure 2 The middle left figure illustrates the encoder-decoder network in the short prediction time domain. The predicted trajectory of influent COD within a single step shows that the actual and predicted value curves generally follow the same trend. The confidence interval widens slightly with the increase of the prediction steps, reflecting the accumulation of prediction uncertainty with increasing prediction distance in the short time domain. The right figure shows the bidirectional encoder-decoder network in the long prediction time domain. Comparing the predicted trajectories of the oxygen consumption rate (OUR) within a step, the two curves showed good agreement in overall trend, with relatively uniform confidence interval widths, demonstrating the stability of long-term prediction under the slowly varying characteristics of slow variables. Both sets of trajectories used a 5-minute sampling interval as the step size, with the fast variable trajectory covering the next 60 minutes and the slow variable trajectory covering the next 240 minutes. The ratio of their time-domain lengths was consistent with the ratio of the mean of the time-varying rate eigenvalues.
[0024] In one specific embodiment, in step S2, the future predicted trajectory is integrated using a forward trajectory attention mechanism to obtain the contribution vectors of fast variables and slow variables, including: At each step of the encoder-decoder network when the decoder generates the future prediction trajectory of the fast variable, the attention score is calculated by the current decoded hidden state and the sequence of fast variable hidden states. After normalization, the corresponding attention weight is obtained. The attention weight is weighted and summed with the sequence of fast variable hidden states to obtain the context vector. The context vector is concatenated with the current decoded hidden state to output the prediction value. The average of the attention weights of all steps in the short prediction time domain along the time domain axis is calculated to obtain the contribution vector of the fast variable. At each step of the decoder in the bidirectional encoder-decoder network when generating the future prediction trajectory of the slow variable, the attention score is calculated for the current decoded hidden state and the slow variable hidden state sequence. After normalization, the corresponding attention weight is obtained. The attention weight is weighted and summed with the slow variable hidden state sequence to obtain the context vector. The context vector is concatenated with the current decoded hidden state to output the prediction value. The average of the attention weights of all steps in the long prediction time domain is calculated along the time domain axis to obtain the slow variable contribution vector.
[0025] Specifically, when the decoder generates the predicted value at step τ of the fast variable future prediction trajectory, the current decoded hidden state is a vector of dimension 128, and the fast variable hidden state sequence is a matrix of 24 rows by 128 columns. The attention score is calculated by concatenating the current decoded hidden state with the cell state, multiplying it by the learnable weight matrix, and then adding it to the result of each row of the fast variable hidden state sequence after transformation by the learnable weight matrix. After processing with the hyperbolic tangent activation function, the result is multiplied by the learnable vector to obtain an attention score vector of length 24. Each element in this vector corresponds to the degree of relevance of a certain step in the encoder's 24 time steps to the current decoded step. The attention score vector is normalized by the Softmax function to obtain an attention weight vector of length 24 with a sum of 1 for each element. This attention weight vector is then used to weight and sum the 24 rows of the fast variable hidden state sequence to obtain a context vector of dimension 128. This context vector is concatenated with the current decoded hidden state to form a vector of dimension 256, which is then passed through a fully connected layer to output the predicted value for the current step. The above operations are performed step by step in all 12 steps of the short prediction time domain. Each step generates an attention weight vector of length 24. After the 12 steps are completed, an attention weight matrix with dimensions of 12 rows and 24 columns is obtained. The mean of this matrix along the row direction (i.e., the time domain axis) is calculated to obtain a fast variable contribution vector of length 24. Each element of this vector reflects the average contribution of the encoder's historical input at the corresponding time step to the generation of the fast variable's future prediction trajectory throughout the entire short prediction time domain.
[0026] The attention score calculation method for the slow variable path is the same as that for the fast variable path. The difference is that the current decoded hidden state dimension is 256, the slow variable hidden state sequence is 96 rows by 256 columns, and the attention score vector length is 96. After normalization, an attention weight vector of length 96 with a sum of 1 for each element is obtained. This weight is used to weight and sum the 96 rows of the slow variable hidden state sequence to obtain a context vector of dimension 256. After concatenation, the context vector is passed through a fully connected layer to output the predicted value. After 48 steps in the long prediction time domain are completed, an attention weight matrix of 48 rows by 96 columns is obtained. The mean value along the row direction is used to obtain a slow variable contribution vector of length 96. It should be noted that the attention weights in this step are calculated based on the decoder's dynamic query of the encoder's historical hidden states during the generation of the future predicted trajectory. The contribution vector obtained by averaging the weight matrix along the time axis reflects the comprehensive contribution of each historical time step to the generation of the future trajectory within the entire prediction time domain. This is fundamentally different from the mechanism in existing methods such as DA-LSTM, where attention weights directly act on the original input feature dimension and measure which input variable is more important at the current moment. The contribution vector of this invention measures the contribution of the state information accumulated by the encoder in which historical time steps to the future predicted trajectory, rather than the immediate importance ranking of the current observation state.
[0027] Figure 3This is a schematic diagram of the attention weight matrix generated by the forward trajectory attention mechanism in the short prediction time domain in the embodiments of this application. Figure 3 The vertical axis represents decoder prediction steps 1 to 12, and the horizontal axis represents encoder historical time steps t-24 to t-1. The grayscale of each cell in the matrix reflects the magnitude of the decoder's attention weight to each historical time step of the encoder when generating the corresponding prediction step; the darker the color, the greater the weight. As can be seen from the figure, the attention distribution of different prediction steps to historical time steps is significantly different and not uniform. This indicates that the forward trajectory attention mechanism dynamically focuses on the encoded information of different historical time steps when generating prediction values for different future steps. This demonstrates the mechanism's ability to selectively utilize historical states during the generation of future prediction trajectories, which is fundamentally different from the existing technology that fixes attention on the input feature dimension.
[0028] In one specific embodiment, step S2, obtaining the gas demand components for the fast route and the slow route based on the future predicted trajectory, includes: Based on the future prediction trajectory of fast variables, the predicted mean values of influent chemical oxygen demand and influent ammonia nitrogen, as well as the predicted mean flow rate, are extracted in the short prediction time domain. The predicted mean values are multiplied by the corresponding unit oxygen demand coefficient and then summed to obtain the fast gas demand component. Based on the future prediction trajectory of slow variables, the mean predicted specific oxygen consumption rate and the mean predicted concentration of suspended solids in the mixed liquor are extracted in the long prediction time domain. The product of the mean predicted specific oxygen consumption rate and the mean predicted concentration of suspended solids in the mixed liquor is divided by the product of the oxygen transfer correction coefficient and the dissolved oxygen concentration difference to obtain the slow-path gas demand component.
[0029] Specifically, the dimension of the future prediction trajectory of the fast variables is 12 rows multiplied by the number of fast variables. The arithmetic mean of the 12 predicted values in the influent chemical oxygen demand (COD) column is obtained; the arithmetic mean of the 12 predicted values in the influent ammonia nitrogen (AM) column is obtained; and the arithmetic mean of the 12 predicted values in the influent flow rate column is obtained. The unit oxygen demand coefficient corresponding to the influent COD is taken as 0.9, and the unit is... This value is derived from the standard oxygen demand (OD) equivalent parameter of aerobic degradation of carbon-source organic matter in the activated sludge ASM1 model, reflecting the mass of oxygen consumed per unit mass of COD degradation. The unit OD coefficient corresponding to influent ammonia nitrogen is taken as 4.57, with units of... This value is derived from the stoichiometric relationship of the nitrification reaction, which states that theoretically, 4.57g of oxygen is required to completely nitrate 1g of ammonia nitrogen into nitrate nitrogen. The correction factor for the influent flow rate is taken as 0.15, and the unit is... Air / Wastewater, reflecting the correction term for the basic aeration volume required per unit volume of influent. The calculation of the rapid aeration volume requirement component is: the predicted average influent chemical oxygen demand multiplied by 0.9, the predicted average influent ammonia nitrogen multiplied by 4.57, and the predicted average flow rate multiplied by 0.15. The result is in units of... This reflects the gas demand driven by external organic loads and ammonia nitrogen loads in the short forecast time domain.
[0030] The predicted trajectory of the slow variable has a dimension of 48 rows multiplied by the number of slow variables. The arithmetic mean of the 48 predicted values in the specific oxygen consumption rate column is obtained, with units of _____. The arithmetic mean of the 48 predicted values for the mixed liquor suspended solids concentration was calculated to obtain the predicted mean concentration of the mixed liquor suspended solids, in g / L. The product of the specific oxygen consumption rate and the mixed liquor suspended solids concentration reflects the total oxygen consumption rate of activated sludge per unit volume of the aeration tank, and the unit is... Multiplying this product by the effective volume of the aeration tank yields the total oxygen consumption of the aeration tank, in units of... The oxygen transfer correction factor is set at 0.85, reflecting the reduction ratio of oxygen transfer efficiency in actual wastewater relative to clean water. This value is a commonly used empirical parameter in activated sludge process engineering design. The dissolved oxygen concentration difference is the difference between the saturated dissolved oxygen concentration and the dissolved oxygen control setpoint. The saturated dissolved oxygen concentration is set at 9.1 mg / L, corresponding to the standard dissolved oxygen saturation value at a water temperature of 20℃. The dissolved oxygen control setpoint is set at 2.0 mg / L, which is the conventional operating control value for the aerobic section of wastewater treatment. The difference between the two is 7.1 mg / L. The slow-path air demand component is calculated by multiplying the predicted average specific oxygen consumption rate and the predicted average mixed liquor suspended solids concentration by the effective volume of the aeration tank, and then dividing by the product of the oxygen transfer correction factor 0.85 and the dissolved oxygen concentration difference of 7.1 mg / L. The result is then converted to [unit not specified]. The next component is the slow-path gas demand component, which reflects the gas demand driven by the activity state of the biological system in the long-term forecast period.
[0031] In one specific embodiment, step S3 includes: Run the prediction sub-models corresponding to the fast variable set and the slow variable set on the validation dataset respectively. Calculate the absolute difference between the predicted output and the true value at each validation time step by step and take the mean to obtain the fast path prediction error sequence and the slow path prediction error sequence respectively. Normal distributions are fitted to the fast road prediction error sequence and the slow road prediction error sequence respectively to obtain the historical distribution parameters of the fast road prediction error and the slow road prediction error. The historical distribution parameters of the fast road prediction error and the slow road prediction error respectively contain the corresponding mean and standard deviation. The mean real-time prediction error of the fast road gas demand component and the slow road gas demand component within the current sliding window is calculated online. The mean real-time prediction error is then subtracted from the mean in the historical distribution parameters of the fast road prediction error and the slow road prediction error, and divided by the corresponding standard deviation to obtain the fast road standardization deviation and the slow road standardization deviation, respectively. The fast path standardization bias is negatively calculated and summed with the slow path standardization bias. The sum is then subjected to a Sigmoid mapping to obtain the fusion coefficient.
[0032] Specifically, the validation dataset is derived from the historical dataset, divided into the last 30 days in chronological order, without overlapping with the training data. The fast variable prediction sub-model is run time-by-time on the validation dataset. At each validation time, the model outputs a predicted value within 12 steps in the short prediction time domain. The absolute values of the differences between each predicted value and the corresponding true value are calculated, yielding 12 absolute differences. The arithmetic mean of these 12 absolute differences is calculated to obtain the fast path single-step prediction error for that validation time. This process is repeated for all time points in the validation dataset to obtain the fast path prediction error sequence, the length of which is equal to the total number of time points in the validation dataset. The slow variable prediction sub-model operates in the same way, except that the prediction time domain is 48 steps, and the arithmetic mean of the 48 absolute differences is calculated to obtain the slow path prediction error sequence. The maximum likelihood estimation method is used to fit the normal distribution of the fast path prediction error sequence and the slow path prediction error sequence, respectively, to obtain the historical distribution parameters of the fast path prediction error (mean μf and standard deviation σf) and the slow path prediction error (mean μs and standard deviation σs). After the four parameters are calculated offline, they are stored in the control parameter storage unit and can be directly called in the online inference stage.
[0033] During the online inference phase, the sliding window length is 12 sampling steps, corresponding to 1 hour. At the current time, the mean of the single-step prediction error for the most recent 12 time steps within the window is taken. The arithmetic mean of these 12 values is then calculated to obtain the mean real-time prediction error for the fast path and the mean real-time prediction error for the slow path. The standardized deviation of the fast path is calculated by subtracting μf from the mean real-time prediction error of the fast path and dividing by σf. The standardized deviation of the slow path is calculated by subtracting μs from the mean real-time prediction error of the slow path and dividing by σs. Both standardized deviations are dimensionless scalars, reflecting the degree to which the current prediction error deviates from the historical normal level, measured in standard deviation. The standardized deviation of the fast path is multiplied by negative one and added to the standardized deviation of the slow path to obtain the sum. This sum is then input into the Sigmoid function. The Sigmoid function is calculated by dividing by 1 and adding a power of 1 to the sum, with the sum being negative. The output value is a continuous value between 0 and 1, representing the fusion coefficient. When the recent prediction error of the fast path is higher than the historical average, the standardization deviation of the fast path is positive. Taking the negative value reduces the summation result, the fusion coefficient output by the Sigmoid is smaller, and the proportion of the gas demand component of the fast path decreases in the subsequent weighted fusion. When the recent prediction error of the slow path increases, the standardization deviation of the slow path is positive, the summation result increases, the fusion coefficient is larger, and the proportion of the gas demand component of the slow path decreases. The dynamic adjustment of the weights of the two paths is driven entirely by the real-time error distribution and does not require manual intervention.
[0034] In one specific embodiment, step S4 includes: The estimated value of the combined gas demand is obtained by multiplying the fusion coefficient by the fast-path gas demand component, multiplying the complement of the fusion coefficient by the slow-path gas demand component, and summing the two products. The difference between the estimated gas volume demand and the basic gas volume setting is calculated. The difference is multiplied by the compensation gain coefficient to obtain the feedforward compensation amount. The feedforward compensation amount is then added to the basic gas volume setting to output the final gas volume command. The contribution vector of the fast variable is multiplied by the fusion coefficient and then normalized. The contribution vector of the slow variable is multiplied by the complement of the fusion coefficient and then normalized. The two normalization results are merged into a unified contribution sequence. The unified contribution sequence is sorted in descending order of value, and the name of the variable ranked first is taken as the dominant variable label. The dominant variable label and the feedforward compensation amount are output together. In each preset update cycle, the compensation gain coefficient is updated according to the root mean square of the difference between the dissolved oxygen measurement value and the dissolved oxygen set value in the current cycle. The updated compensation gain coefficient is written into the control parameter storage unit and takes effect in the next control cycle.
[0035] Specifically, the complement of the fusion coefficient is 1 minus the fusion coefficient, and the sum of the two is always 1. This ensures that the sum of the weights of the fast and slow gas demand components in the weighted fusion is 1, without introducing additional dimensional bias. The estimated fused gas demand is calculated by multiplying the fusion coefficient by the fast gas demand component and then by multiplying the complement of the fusion coefficient by the slow gas demand component. The result is in meters (m). 3 / h. The basic gas volume setpoint is output by the PID controller in the existing dissolved oxygen closed-loop control loop, reflecting the gas volume setpoint calculated by the PID based on the dissolved oxygen deviation at the current moment, with the same unit. The feedforward compensation is calculated by multiplying the difference between the estimated gas volume demand and the basic gas volume setpoint by the compensation gain coefficient. The initial value of the compensation gain coefficient is 0.6, determined based on empirical results from experimental verification showing that the root mean square error of dissolved oxygen control is within a reasonable range. The value is limited to between 0.3 and 0.9, with a lower limit of 0.3 to ensure that the feedforward compensation does not fail due to an excessively small coefficient, and an upper limit of 0.9 to prevent excessive compensation from causing frequent and significant speed adjustments of the blower. The final gas volume command is the sum of the feedforward compensation and the basic gas volume setpoint, output as a 4 to 20mA analog signal to the blower's frequency converter driver, corresponding to a linear mapping from 0 to the maximum gas volume range.
[0036] Each element of the fast variable contribution vector is multiplied by the fusion coefficient, and the product is normalized by dividing by the sum of the products, so that the sum of the elements is 1. Similarly, each element of the slow variable contribution vector is multiplied by the fusion coefficient complement, and then normalized by dividing by the sum of the products. The two normalized results are concatenated in variable order to form a unified contribution sequence with a length equal to the sum of the number of fast and slow variables, totaling 9 elements. The unified contribution sequence is arranged in descending order of value. The variable name corresponding to the first-ranked element is taken as the dominant variable label, and the names of the top three variables are taken as the dominant factor combination. The dominant variable label and the feedforward compensation are simultaneously uploaded to the monitoring platform for display. The preset update cycle is 24 hours. At the end of each update cycle, the difference between the dissolved oxygen measurement value and the dissolved oxygen setpoint of 2.0 mg / L at all sampling times within that cycle is taken. The square root of the squared mean of all differences is then calculated to obtain the root mean square error of dissolved oxygen control for that cycle. When the root mean square error (RMSE) is greater than 0.3 mg / L, the compensation gain coefficient increases in steps of 0.05; when the RMSE is less than 0.1 mg / L, the compensation gain coefficient decreases in steps of 0.02; when the RMSE is between 0.1 and 0.3 mg / L, the compensation gain coefficient remains unchanged. The updated compensation gain coefficient is written to the control parameter storage unit and takes effect in the feedforward compensation calculation for the next 24-hour control cycle.
[0037] In one specific embodiment, the value range of the compensation gain coefficient is limited to 0.3 to 0.9. When the root mean square difference between the measured dissolved oxygen value and the set dissolved oxygen value is greater than 0.3 mg / L, the compensation gain coefficient increases by a preset step size; when the root mean square difference is less than 0.1 mg / L, the compensation gain coefficient decreases by a preset step size.
[0038] The basic air volume setpoint is output by the PID controller in the dissolved oxygen closed-loop control loop, and the final air volume command is output to the blower frequency converter in the form of an analog signal.
[0039] The names of the top three variables in the unified contribution sequence are used as the dominant factor combination, and the dominant variable labels and dominant factor combinations are uploaded to the monitoring platform synchronously along with the feedforward compensation amount.
[0040] In the preset step size, the step size is 0.05 when the compensation gain coefficient increases and 0.02 when it decreases. The reason for setting the step size for increasing the step size to be greater than the step size for decreasing the step size is that when the dissolved oxygen control error is large, a faster response is needed to enhance the feedforward compensation, while when the control effect is good, the convergence should be slow to avoid frequent and large fluctuations in the compensation coefficient, which would lead to unstable air volume commands. If the new value of the compensation gain coefficient after each update exceeds the range of 0.3 to 0.9, it is truncated to the corresponding boundary value before being written to the control parameter storage unit. The final air volume command is output to the blower frequency converter in the form of a 4 to 20mA analog signal. 4mA corresponds to the blower's zero air volume output, and 20mA corresponds to the blower's maximum rated air volume. The final air volume command is proportionally converted into the corresponding current value within this linear range and then drives the frequency converter to adjust the blower speed. The refresh cycle of the dominant variable labels and the combination of dominant factors is consistent with the control cycle, and is updated once every 5 minutes at each sampling interval. It is uploaded to the monitoring platform in sync with the feedforward compensation. The monitoring platform displays the names of the dominant driving variables of the current air volume demand and the ranking of the top three contributions in real time in the form of text labels, so that operators can directly determine the driving source of the current aeration regulation without having to look up the internal parameters of the model.
[0041] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for controlling aeration volume based on an attention mechanism, characterized in that, The method includes: Step S1: Based on the time-varying rate characteristic values of the multidimensional aeration process variables, divide the multidimensional aeration process variables into a fast variable set and a slow variable set, and set corresponding short prediction time domains and long prediction time domains respectively. This includes: collecting historical operating data of the aeration system, including influent flow rate, influent chemical oxygen demand, influent ammonia nitrogen, mixed liquor suspended solids concentration, sludge volume index, and specific oxygen consumption rate; performing normalization preprocessing on the historical operating data to obtain multidimensional aeration process variables; within a preset time window, calculating the absolute value mean and standard deviation of the difference sequence of each variable in the multidimensional aeration process variables, and setting the absolute value mean and standard deviation. The sum of the mean and standard deviation is used as the time-varying rate characteristic value corresponding to the variable. A division threshold is set based on the median of all the time-varying rate characteristic values. Variables with time-varying rate characteristic values not lower than the division threshold are classified into the fast variable set, and variables with time-varying rate characteristic values lower than the division threshold are classified into the slow variable set. Based on the ratio of the mean of the time-varying rate characteristic values of each variable in the fast variable set and the slow variable set, a short prediction time domain is set for the fast variable set, and a long prediction time domain is set for the slow variable set. The ratio of the short prediction time domain to the long prediction time domain is determined by the ratio of the mean of the time-varying rate characteristic values of the fast variable set and the slow variable set. Step S2: Generate future prediction trajectories for the fast variable set and the slow variable set in the short prediction time domain and the long prediction time domain, respectively. Perform integration on the future prediction trajectory through the forward trajectory attention mechanism to obtain the fast variable contribution vector and the slow variable contribution vector, respectively. Based on the future prediction trajectory, obtain the fast path gas demand component and the slow path gas demand component. Step S3: Based on the historical distribution parameters of the prediction errors of the fast-path gas demand component and the slow-path gas demand component, the real-time prediction error within the current sliding window is standardized to obtain the fusion coefficient. Step S4: The fast-path gas demand component and the slow-path gas demand component are weighted and fused using the fusion coefficient to obtain a fused gas demand estimate. The difference between the fused gas demand estimate and the base gas demand setting is used as a feedforward compensation amount and output. The fast variable contribution vector, the slow variable contribution vector, and the fusion coefficient are weighted and combined to obtain a joint output of the dominant variable label and the feedforward compensation amount. This includes: multiplying the fusion coefficient by the fast-path gas demand component; multiplying the complement of the fusion coefficient by the slow-path gas demand component; summing the products to obtain the fused gas demand estimate; and subtracting the fused gas demand estimate from the base gas demand setting, multiplying the difference by the compensation gain coefficient to obtain the feedforward compensation amount. The feedforward compensation amount is superimposed on the basic gas volume setpoint to output the final gas volume command; the contribution vector of the fast variable is multiplied by the fusion coefficient and then normalized; the contribution vector of the slow variable is multiplied by the complement of the fusion coefficient and then normalized; the two normalization results are merged into a unified contribution sequence; the unified contribution sequence is sorted in descending order of value, and the name of the variable ranked first is used as the dominant variable label; the dominant variable label and the feedforward compensation amount are jointly output; and in each preset update cycle, the compensation gain coefficient is updated according to the root mean square of the difference between the dissolved oxygen measurement value and the dissolved oxygen setpoint in the current cycle; the updated compensation gain coefficient is written into the control parameter storage unit and takes effect in the next control cycle.
2. The aeration volume control method based on attention mechanism according to claim 1, characterized in that, In step S2, generating future prediction trajectories for the fast variable set and the slow variable set in the short prediction time domain and the long prediction time domain, respectively, includes: The multidimensional time series of the fast variable set within the history review window is input into the encoder-decoder network, and the encoder of the encoder-decoder network encodes the multidimensional time series step by step to obtain the fast variable hidden state sequence. The multidimensional time series of the slow variable set in the corresponding historical review window is input into the bidirectional encoder-decoder network. The bidirectional encoder of the bidirectional encoder-decoder network encodes the multidimensional time series in both forward and reverse directions to obtain the slow variable hidden state sequence. Based on the hidden state sequence of the fast variable, the decoder of the encoder-decoder network generates the future prediction trajectory of the fast variable stepwise by autoregression in the short prediction time domain; based on the hidden state sequence of the slow variable, the decoder of the bidirectional encoder-decoder network generates the future prediction trajectory of the slow variable stepwise by autoregression in the long prediction time domain.
3. The aeration volume control method based on attention mechanism according to claim 2, characterized in that, In step S2, the future predicted trajectory is integrated using a forward trajectory attention mechanism to obtain the contribution vectors of fast variables and slow variables, including: At each step when the decoder of the encoder-decoder network generates the future prediction trajectory of the fast variable, the attention score is calculated by combining the current decoded hidden state with the sequence of the fast variable hidden states. After normalization, the corresponding attention weight is obtained. The attention weight is weighted and summed with the sequence of the fast variable hidden states to obtain the context vector. The context vector is concatenated with the current decoded hidden state to output the prediction value. The average of the attention weights of all steps in the short prediction time domain is calculated along the time domain axis to obtain the contribution vector of the fast variable. At each step when the decoder of the bidirectional encoder-decoder network generates the future prediction trajectory of the slow variable, the attention score is calculated by combining the current decoded hidden state with the sequence of slow variable hidden states. After normalization, the corresponding attention weight is obtained. The attention weight is weighted and summed with the sequence of slow variable hidden states to obtain a context vector. The context vector is concatenated with the current decoded hidden state to output the prediction value. The average of the attention weights of all steps in the long prediction time domain is calculated along the time domain axis to obtain the slow variable contribution vector.
4. The aeration volume control method based on attention mechanism according to claim 3, characterized in that, In step S2, the fast-path gas demand component and the slow-path gas demand component are obtained based on the future predicted trajectory, including: Based on the future prediction trajectory of the fast variables, the predicted mean values of influent chemical oxygen demand and influent ammonia nitrogen and the predicted mean value of flow rate are extracted within the short prediction time domain. The predicted mean values are multiplied by the corresponding unit oxygen demand coefficient and then summed to obtain the fast gas demand component. Based on the future prediction trajectory of the slow variable, the predicted mean of specific oxygen consumption rate and the predicted mean of mixed liquid suspended solids concentration are extracted in the long prediction time domain. The product of the predicted mean of specific oxygen consumption rate and the predicted mean of mixed liquid suspended solids concentration is divided by the product of the oxygen transfer correction coefficient and the dissolved oxygen concentration difference to obtain the slow path gas demand component.
5. The aeration volume control method based on attention mechanism according to claim 1, characterized in that, Step S3 includes: Run the prediction sub-models corresponding to the fast variable set and the slow variable set on the validation dataset respectively. Calculate the absolute difference between the predicted output and the true value at each validation time step by step and take the mean to obtain the fast path prediction error sequence and the slow path prediction error sequence respectively. The fast road prediction error sequence and the slow road prediction error sequence are respectively fitted with normal distribution to obtain the historical distribution parameters of fast road prediction error and slow road prediction error. The historical distribution parameters of fast road prediction error and slow road prediction error respectively contain the corresponding mean and standard deviation. The mean real-time prediction error of the fast road gas demand component and the slow road gas demand component within the current sliding window is calculated online. The mean real-time prediction error is then subtracted from the mean of the historical distribution parameters of the fast road prediction error and the historical distribution parameters of the slow road prediction error, and divided by the corresponding standard deviation to obtain the fast road standardization deviation and the slow road standardization deviation, respectively. The fast path standardization bias is negatively evaluated and then summed with the slow path standardization bias. The summation result is then subjected to a Sigmoid mapping to obtain the fusion coefficient.
6. The aeration volume control method based on attention mechanism according to claim 5, characterized in that, The value range of the compensation gain coefficient is limited to 0.3 to 0.
9. When the root mean square difference between the measured dissolved oxygen value and the set dissolved oxygen value is greater than 0.3 mg / L, the compensation gain coefficient increases by a preset step size; when the root mean square difference is less than 0.1 mg / L, the compensation gain coefficient decreases by a preset step size.
7. The aeration volume control method based on attention mechanism according to claim 6, characterized in that, The basic gas volume setpoint is output by the PID controller in the dissolved oxygen closed-loop control loop, and the final gas volume command is output to the blower frequency converter in the form of an analog signal.
8. The aeration volume control method based on attention mechanism according to claim 7, characterized in that, The names of the top three variables in the unified contribution sequence are used as the dominant factor combination, and the dominant variable labels and the dominant factor combination are uploaded to the monitoring platform synchronously along with the feedforward compensation amount.
Citation Information
Patent Citations
Sewage treatment method and system, intelligent terminal and storage medium
CN121063698A
Self-adaptive prediction control method and system for cut tobacco drying moisture and storage medium
CN121882824A