Carbon source feeding and dissolved oxygen optimization method and system under disturbance environment

CN122977651APending Publication Date: 2026-10-27QINGDAO UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611476659.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-22
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

当系统处于扰动状态时,容易出现当前实际处理能力表征不准确、候选控制响应与实际运行规律不一致,以及预测最优控制点位于安全边界附近、受到进一步扰动后容易失效等问题,进而影响碳源投加量和溶解氧设定值优化结果的可靠性和稳定性

Benefits of technology

[0013]在本发明中,将反映系统基础生化处理能力的慢变背景与反映近期运行变化的快速动态进行分离表征,并依据当前扰动来源及扰动程度对相关状态信息进行自适应增强,使状态表达能够随扰动变化进行调整,能够更充分地反映扰动作用下水温、MLSS、进水碳氮结构及运行状态变化所引起的实际处理能力偏移,提高扰动及复杂扰动条件下当前处理能力表征的适应性;在统一扰动状态基准下分别推演候选碳源投加量和溶解氧设定值的各候选控制组合对应的出水响应,使不同候选控制组合能够在同一实际处理能力状态下进行比较;同时利用相似扰动状态下的历史实际响应对候选预测结果进行局部一致性校核,从而避免将不同扰动条件下的控制响应规律直接混用,并能够在保留扰动条件下真实局部非线性和响应转折的同时,排除由模型局部拟合误差或历史数据覆盖不足形成的异常候选结果,提高候选控制响应的可信性;在满足安全性和稳定性的候选区域内,筛选综合运行代价最低的组合候选方案作为目标控制方案,使经济性优化建立在安全性和稳定性得到保证的基础上,避免单纯追求预测最优或运行成本最低而牺牲控制可靠性。本发明提高碳源投加量与溶解氧设定值协同优化在扰动环境下的可靠性、稳定性、适应性和运行经济性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122977651A_ABST
    Figure CN122977651A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of sewage treatment, in order to solve the problem of inaccurate sewage treatment under disturbance, a carbon source dosing and dissolved oxygen collaborative optimization method and system under disturbance environment is proposed, the slow change background and fast dynamic are separated and characterized, and the related state information is enhanced according to the current disturbance source and disturbance degree, the adaptability of the current treatment capacity characterization under disturbance and complex disturbance conditions is improved; under the unified disturbance state benchmark, the effluent response corresponding to each candidate control combination of the candidate carbon source dosing amount and the dissolved oxygen set value is deduced respectively; the local consistency of the candidate prediction results is checked by using the historical actual response under the similar disturbance state; in the candidate area meeting the safety and stability, the combination candidate scheme with the lowest comprehensive operation cost is selected. The present application improves the reliability, stability, adaptability and operation economy of the carbon source dosing amount and dissolved oxygen set value collaborative optimization under the disturbance environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of wastewater treatment, and in particular relates to a method and system for synergistic optimization of carbon source addition and dissolved oxygen under disturbed environments. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Urban wastewater treatment plants typically employ biological denitrification processes to remove organic matter and nitrogenous pollutants from wastewater. Among these processes, the amount of carbon source added and the dissolved oxygen setpoint are important control parameters that affect the denitrification effect, effluent stability, and operating costs.

[0004] In actual operation, wastewater treatment systems are affected by various factors such as changes in influent water quality, seasonal temperature variations, sludge condition changes, and fluctuations in operating load, resulting in different types and time scales of operational disturbances. Low C / N ratios, low temperatures in winter, and high temperatures in summer are representative special disturbance conditions. Under more complex operating conditions, multiple disturbances may occur simultaneously. Furthermore, wastewater treatment processes have a certain process lag; the current operating state and control behaviors typically take some time to be reflected in effluent COD, TN, and other indicators. Therefore, it is necessary to ensure a correct time correspondence between disturbance states, control behaviors, and corresponding effluent responses. These disturbances and their temporal effects collectively cause the wastewater treatment system to deviate from its normal stable operating state, leading to changes in actual treatment capacity, carbon source demand, aeration demand, and the response relationships between carbon source dosage, dissolved oxygen setpoints, and effluent COD and TN.

[0005] Existing methods for optimizing carbon source dosing and dissolved oxygen typically establish a unified state characterization or control relationship based on historical overall operating patterns, but they do not adequately consider the differences between different sources and degrees of disturbance, as well as state changes at different time scales. When the system is in a disturbed state, problems such as inaccurate characterization of the current actual processing capacity, inconsistencies between candidate control responses and actual operating patterns, and the predicted optimal control point being located near the safety boundary and prone to failure after further disturbances can easily arise. These issues, in turn, affect the reliability and stability of the optimization results for carbon source dosing and dissolved oxygen setpoints.

[0006] Therefore, the key issues that need to be addressed in the synergistic optimization of carbon source addition and dissolved oxygen in wastewater treatment are: how to identify the current operational disturbances and reconstruct the actual treatment capacity of the wastewater treatment system based on the disturbance state; how to determine the reliability of the control response corresponding to different carbon source dosages and dissolved oxygen setpoints under the current disturbance state; and how to avoid selecting a single-point optimal solution that is prone to failure under the influence of disturbances. Summary of the Invention

[0007] To overcome the shortcomings of the prior art, this invention provides a method and system for the synergistic optimization of carbon source addition and dissolved oxygen under disturbed conditions, which improves the accuracy of wastewater treatment status identification and control optimization under disturbed conditions, and achieves stable effluent quality and reduced operating energy consumption.

[0008] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for synergistic optimization of carbon source addition and dissolved oxygen under disturbed conditions, comprising: Based on the current actual operating data of the wastewater treatment plant, and according to the judgment boundary of each disturbance, it is determined whether the plant is currently in a disturbance and the disturbance state corresponding to the disturbance. The process delay is determined based on the actual hydraulic residence time of the wastewater from the control position to the effluent monitoring position, and a wastewater treatment state sequence is constructed based on the process delay. Slowly varying background features reflecting the long-term biochemical capacity of the wastewater treatment state sequence are extracted. The slowly varying background features are enhanced based on the slowly varying variables to obtain enhanced slowly varying background features. Based on the slowly varying background features, rapid disturbance features of rapidly changing influent load and process state are extracted. The enhanced slowly varying background features and rapid disturbance features are then fused to obtain the basic state vector of the current operating condition. The gating coefficients of the enhanced state vector are generated based on the identified disturbance state, and the enhanced state vector is dynamically adjusted so that as the disturbance level increases, the effect of the corresponding state vector is simultaneously enhanced. Under a unified disturbance state baseline, the effluent response corresponding to each candidate control combination with candidate carbon source dosage and dissolved oxygen setpoint is simulated. Based on the current disturbance state, effective samples with similar disturbance background and similar treatment capacity are selected from historical operating data. The local change direction and response amplitude of the candidate response surface are checked for consistency. For the candidate control combinations that pass the consistency check, within the candidate region that meets the requirements of safety and stability, the combination candidate scheme with the lowest comprehensive operating cost is selected as the target control scheme.

[0009] Secondly, the present invention provides a system for the coordinated optimization of carbon source addition and dissolved oxygen under disturbed conditions, comprising: The disturbance determination module is configured to: determine whether the current situation is under disturbance based on the current actual operating data of the wastewater treatment plant and the determination boundary of each disturbance, as well as the disturbance state corresponding to the disturbance, and determine the process delay based on the actual hydraulic residence time of the wastewater from the control position to the effluent monitoring position, and construct a wastewater treatment state sequence based on the process delay. The feature extraction module is configured to: extract slowly varying background features reflecting the long-term biochemical capacity of the system from the wastewater treatment state sequence; enhance the slowly varying background features based on the slowly varying variables to obtain enhanced slowly varying background features; extract rapid disturbance features of rapidly changing influent load and process state based on the slowly varying background features; and fuse the enhanced slowly varying background features with the rapid disturbance features to obtain the basic state vector of the current operating condition. The disturbance adjustment module is configured to: generate a gating coefficient for the enhanced state vector based on the disturbance state of the identified disturbance, and dynamically adjust the enhanced state vector so that as the disturbance level increases, the effect of the corresponding state vector is simultaneously enhanced; The optimization module is configured to: deduce the effluent response corresponding to each candidate control combination with candidate carbon source dosage and dissolved oxygen setpoint under a unified disturbance state benchmark; select effective samples with similar disturbance background and similar processing capabilities from historical operating data based on the current disturbance state; perform consistency verification on the local change direction and response amplitude of the candidate response surface; and select the candidate combination with the lowest comprehensive operating cost as the target control scheme within the candidate region that meets safety and stability requirements for the candidate control combination that passes the consistency verification.

[0010] Thirdly, the present invention provides an electronic device including a memory and a processor, and computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the method described in the first aspect.

[0011] Fourthly, the present invention provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the method described in the first aspect.

[0012] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.

[0013] In this invention, the slowly varying background reflecting the system's basic biochemical treatment capacity is separated from the rapidly changing dynamics reflecting recent operational changes. The relevant state information is adaptively enhanced based on the current source and degree of disturbance, allowing the state representation to adjust with disturbance changes. This more fully reflects the actual treatment capacity shift caused by changes in water temperature, MLSS, influent carbon and nitrogen structure, and operating conditions under disturbance, improving the adaptability of the current treatment capacity representation under disturbance and complex disturbance conditions. Under a unified disturbance state benchmark, the effluent response corresponding to each candidate control combination with candidate carbon source dosage and dissolved oxygen setpoint is derived, enabling different candidate control combinations to operate under the same actual treatment capacity state. The method involves comparing the results with historical actual responses under similar disturbance conditions to verify the local consistency of candidate predictions. This avoids directly mixing control response patterns under different disturbance conditions and, while preserving the true local nonlinearity and response transitions under disturbance conditions, eliminates abnormal candidate results caused by local model fitting errors or insufficient historical data coverage, thus improving the reliability of candidate control responses. Within the candidate region that satisfies safety and stability requirements, the combined candidate scheme with the lowest overall operating cost is selected as the target control scheme. This ensures that economic optimization is based on guaranteed safety and stability, avoiding the sacrifice of control reliability by simply pursuing the best prediction or the lowest operating cost. This invention improves the reliability, stability, adaptability, and operational economy of the synergistic optimization of carbon source dosage and dissolved oxygen setpoint under disturbance environments. Attached Figure Description

[0014] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0015] Figure 1 This is a schematic diagram of the overall optimization method for coordinating carbon source addition and dissolved oxygen setting in wastewater treatment according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the predicted COD concentration in the effluent in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the predicted TN concentration in the effluent in Embodiment 1 of the present invention; Figure 4 This is the carbon source-DO-effluent water quality response surface under low C / N conditions in Embodiment 1 of the present invention; wherein, (a) is effluent COD, and (b) is effluent TN; Figure 5 This is the carbon source-DO-effluent water quality response surface under low-temperature conditions in winter in Embodiment 1 of the present invention; wherein, (a) is effluent COD, and (b) is effluent TN; Figure 6This is the carbon source-DO-effluent water quality response surface under high-temperature conditions in summer in Embodiment 1 of the present invention; wherein, (a) is effluent COD, and (b) is effluent TN; Figure 7 This is a schematic diagram of coarse grid derivation, local refinement, and connected stable domain in Embodiment 1 of the present invention. Detailed Implementation

[0016] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0017] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.

[0018] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0019] Example 1 This embodiment addresses the problems of changes in actual treatment capacity, deviations in the control response of carbon source dosage and dissolved oxygen setpoints, and decreased stability of optimization results caused by disturbances at different time scales in wastewater treatment systems under conditions such as low C / N ratios, low winter temperatures, and high summer temperatures. It proposes a method for synergistic optimization of carbon source dosage and dissolved oxygen under multi-time-scale disturbances. First, the current disturbance is identified, and a state sequence matching the effluent response is constructed based on the actual process delay. Then, slowly varying biochemical background and rapid operational disturbances are separated and characterized, and the response ratios of relevant features are adaptively adjusted according to the source and degree of the current disturbance to form a state vector reflecting the current actual treatment capacity. Subsequently, the slowly varying biochemical background and rapid operational disturbances are separated and characterized, and the model learns the basic contribution relationship between various state features and the effluent response. Furthermore, based on the current disturbance type and degree, the corresponding state features are adaptively enhanced to form a state vector representing the current actual treatment capacity while retaining complete dual-time-scale information. Based on this, to address the issue that disturbances may cause changes in the relationship between carbon source dosage, dissolved oxygen setpoint, and local responses of effluent COD and TN, different carbon source-DO candidate combinations are deduced under a fixed current disturbance state, and the reliability of candidate responses is reviewed based on historical operating patterns under similar disturbance states. Furthermore, the continuous adjustability of the candidate control area and its tolerance to subsequent disturbances are evaluated, and the target control scheme is determined by comprehensively considering the operating costs within a stable area with sufficient safety margin, thereby achieving reliable synergistic optimization of carbon source dosage and dissolved oxygen setpoint under disturbance conditions.

[0020] The following provides a detailed description of the method for synergistic optimization of carbon source addition and dissolved oxygen under multi-timescale perturbation proposed in this embodiment, specifically including: S1, Data Construction for Disturbance Identification and Baseline Actual Process Delay Acquire historical and current operational data from the wastewater treatment plant. Operational data includes influent water quality data, process status data, historical control data, and effluent water quality data. Specifically, influent water quality data includes influent flow rate, influent COD, influent TN, and influent NH4. + -N and influent TP; process status data include water temperature, MLSS, and NO3 in the anoxic tank. - -N; Historical control data includes actual carbon source dosage and DO setpoint; Effluent water quality data includes effluent COD and effluent TN.

[0021] This embodiment first utilizes historical operating data of the wastewater treatment plant to determine the thresholds for disturbances such as low C / N ratio, low winter temperatures, and high summer temperatures. Specifically, it statistically analyzes the influent C / N ratio, water temperature, and corresponding effluent COD, effluent TN, and process operating status during historical operating periods. Based on the actual distribution range of the operating variables and the intervals in which the system's treatment performance changes significantly during their variations, it determines the disturbance entry boundary.

[0022] In the historical operating data corresponding to this embodiment, after the influent C / N ratio drops to below approximately 4.0, the carbon source limitation of the system becomes more obvious. Therefore, an influent C / N ratio of 4.0 is used as the judgment boundary for low C / N conditions. After the water temperature drops to below approximately 15 ℃, the system's biochemical treatment capacity begins to be significantly affected by the low temperature. Therefore, a water temperature of 15 ℃ is used as the judgment boundary for low-temperature winter conditions. When the water temperature rises to above approximately 25 ℃, a water temperature of 25 ℃ is used as the judgment boundary for high-temperature summer conditions.

[0023] To avoid frequent switching of operating conditions caused by small fluctuations in the C / N ratio or water temperature near the aforementioned boundaries, an exit boundary is set based on the entry boundary. In this embodiment, the exit boundary for low C / N condition is set to an inlet C / N ratio of 4.5, the exit boundary for low temperature condition is set to a water temperature of 16 ℃, and the exit boundary for high temperature condition is set to a water temperature of 24 ℃, thereby forming a hysteresis interval between the entry and exit boundaries.

[0024] Meanwhile, to avoid misjudgment of operating conditions due to abnormal changes in a single sampling point, this embodiment uses a continuous 24-hour time window for operating condition identification. Since the data sampling period is 1 hour, each judgment window includes 24 sampling points; the corresponding disturbance is determined only when the average value of the window meets the corresponding operating condition boundary and at least 80% of the sampling points within the window simultaneously meet the corresponding conditions.

[0025] For low C / N conditions, the influent C / N ratio is calculated based on the influent COD and influent TN at the same sampling time:

[0026] In the formula, R ,t Indicates the influent carbon-nitrogen ratio at control time t; COD in,t TN represents the influent COD detection value at control time t. in,t This represents the influent TN detection value at control time t; the subscript in indicates the influent. COD in,t and TN in,t Data from the same sampling time were used, and outlier removal and unit standardization were performed before calculation.

[0027] Calculate the average C / N ratio within a continuous 24-hour decision window. :

[0028] And calculate the proportion of sampling points with a C / N ratio below 4.0 within the window. :

[0029] In the formula, I is an indicator function, when the expression within the parentheses is used... The value is 1 if the condition is met, otherwise it is 0.

[0030] when and When the current condition is determined to be low C / N, the corresponding main disturbance is identified as a carbon source limiting disturbance; when: After continuously meeting the preset exit cycle, the low C / N condition flag is removed.

[0031] To characterize the impact of the low C / N state on current operation, the degree of carbon source constraint perturbation is... Defined as:

[0032] in, ( The function ,0,1) represents the amplitude limiting function, which is used to limit the calculated disturbance level to the range of 0 to 1; when the calculation result is less than 0, it takes 0, when it is greater than 1, it takes 1, and in other cases, the original value remains unchanged.

[0033] For temperature-controlled conditions, let the water temperature at control time t be T. t Calculate the average water temperature within a continuous 24-hour decision window. :

[0034] Calculate the proportions of sampling points with water temperatures below 15 ℃ and above 25 ℃ within the window, respectively. , :

[0035]

[0036] when and When, it is determined that the current operating condition has entered the low-temperature winter condition; when and At that time, it is determined that the current operating condition has entered the high-temperature summer condition. Under low-temperature operating conditions, when:

[0037] After continuously meeting the preset exit cycle, the low-temperature operating condition indicator is deactivated; under high-temperature operating conditions, when:

[0038] After continuously meeting the preset exit cycle, the high-temperature condition indicator is deactivated.

[0039] Degree of temperature disturbance corresponding to low temperature The degree of temperature disturbance corresponding to high temperature They are represented as follows:

[0040]

[0041] In the formula, T min and T max These are the lower reference limit for low temperature and the upper reference limit for high temperature, determined based on historical operating data, respectively. and These represent the degree of disturbance at low and high temperatures, respectively.

[0042] When low-temperature or high-temperature operating conditions are established, accompanied by a sustained shift in MLSS and long-term operating status relative to normal operating levels, this is further characterized as a slow-varying disturbance primarily characterized by a drift in the system's basic biochemical treatment capacity. This is applied to recent influent flow rate, influent COD, influent TN, and NO3 in the anoxic tank. - Significant changes in variables such as -N are recorded as rapid disturbances caused by load shocks and changes in process state, respectively.

[0043] Therefore, at any given control moment, step S1 outputs not only disturbance indicators such as low C / N, low temperature, or high temperature, but also the corresponding disturbance type and degree. When multiple disturbances simultaneously meet the judgment conditions, each disturbance component is retained instead of replacing the current actual disturbance state with a single operating condition label, thus providing input for subsequent adaptive enhancement of different state information based on the source and degree of disturbance.

[0044] After completing disturbance identification and disturbance status determination, in order to ensure that the current disturbance status, historical control behavior and actual effluent results correspond to the same batch of wastewater, the process delay is further determined based on the actual hydraulic residence time of the wastewater from the control position to the effluent monitoring position.

[0045] In this embodiment, the wastewater sequentially passes through a selection zone, an anaerobic zone, an anoxic zone, an aerobic zone, a secondary sedimentation tank, and a high-density sedimentation tank. The designed hydraulic retention times for each structure are 0.83 h, 1.65 h, 4.4 h, 8.8 h, 3.5 h, and 0.7 h, respectively. Therefore, the total process retention time is:

[0046] In the formula, τ0 represents the total process retention time obtained by summing the design hydraulic retention times of wastewater in each treatment structure; 0.83, 1.65, 4.4, 8.8, 3.5 and 0.7 represent the design hydraulic retention times of the selective zone, anaerobic zone, anoxic zone, aerobic zone, secondary sedimentation tank and high-density sedimentation tank, respectively, and the unit is hours (h).

[0047] When the data sampling period is 1 hour, 19.88 hours is rounded up to obtain a process delay τ of 20 time steps. For any control time t, the state input sequence X is constructed using the influent water quality, process status, and historical actual control data from the consecutive τ time steps preceding t. t =X[t-(τ-1):t]; The candidate carbon source dosage and candidate DO setpoint at control time t are used as the control inputs to be evaluated; the effluent COD and effluent TN at time t+τ are used as monitoring labels.

[0048]

[0049] In the formula, Y t The monitoring label represents the operating condition data and control data corresponding to the control time t; Indicates the number of control times after time t. The measured COD values ​​of the effluent obtained at each time step; Indicates the number of control times after time t. The measured TN value of the effluent obtained at each time step; the subscript out indicates effluent, t indicates the current control time, t+ This indicates the time of water effluent detection after the process delay.

[0050] By aligning the process delays described above, the current disturbance state, historical actual control behavior, and corresponding effluent response are kept consistent across batches. This avoids misalignment of state, control, and effluent data due to time lag in the wastewater treatment process. It provides a unified data foundation for reconstructing the current actual treatment capacity of the wastewater treatment system based on the type and degree of disturbance, and for further evaluating candidate control responses for carbon source dosage and dissolved oxygen setpoints.

[0051] S2, Reconstruction of dual-timescale processing capabilities for perturbation states This step addresses the issue that when disturbances at different time scales occur simultaneously, the actual biochemical treatment capacity and recent operating status of a wastewater treatment system change simultaneously. Conventional time-series coding is prone to being dominated by short-term high-amplitude fluctuations and cannot accurately reflect the current actual treatment capacity of the system. Therefore, this step optimizes the state characterization process.

[0052] Specifically, firstly, the slowly varying background that determines the system's basic biochemical processing capability is separated from the rapidly operating disturbance that reflects the current control requirements, thus avoiding mutual masking of information at different time scales during the unified encoding process. After forming a complete dual-time-scale basic state, the disturbance type and disturbance degree obtained in step S1 are used to perform secondary adaptive enhancement on the state information that is significantly affected by the current disturbance, so that the state representation can dynamically change with the source of the disturbance, the intensity of the disturbance, and their combination relationship. At the same time, a slowly varying background preservation mechanism is set to prevent the long-term biochemical processing capability information from being covered after the rapid disturbance is enhanced.

[0053] Therefore, the focus of this step is not to build separate prediction models for different disturbances, but to use a unified state reconstruction framework so that the same state encoding mechanism can adjust the state expression according to the current actual disturbance state. Low C / N ratio, low temperature in winter, and high temperature in summer are typical disturbances selected in this embodiment; when multiple types of disturbances exist at the same time, each disturbance component can act on the corresponding state information to achieve joint representation under complex disturbance states.

[0054] S21: Dual-timescale characterization of slowly varying background and fast dynamics First, considering that variables such as water temperature and MLSS, which have a long-term impact on the system's biochemical treatment capacity, have different time scales of influence than variables such as influent flow rate, influent COD, TN, and process state, the state sequence constructed in step S1 is characterized by dual time scale separation.

[0055] If the above variables are directly encoded according to a uniform time scale, the influent load and process status, which have large recent changes, are likely to have a strong impact on the feature extraction results, while information such as water temperature and MLSS, which have small short-term changes but continuously determine the system's biochemical treatment capacity, are easily weakened. Therefore, this embodiment first establishes a slowly changing background state and a rapidly changing dynamic state, so that the state representation simultaneously retains the system's basic processing capacity background as well as the recent operational disturbances it is currently experiencing.

[0056] In one specific implementation, the state sequence X constructed in step S1 is... t Inputting the data into an LSTM network encodes long-term dependencies within the process delay range, yielding slowly varying background features:

[0057] in, This represents the slowly varying background features extracted by LSTM. This indicates an LSTM network.

[0058] LSTM networks are mainly used to extract long-term biochemical processing capabilities reflected by water temperature, MLSS, and historical operating status, enabling the model to identify the current basic processing capability level of the system.

[0059] Based on a slowly varying background, a GRU network is further employed to extract recent dynamic changes closer to the current control moment:

[0060] Among them, H G This indicates the rapid perturbation characteristics after incorporating recent dynamic changes.

[0061] The GRU network is primarily used to capture recent changes in influent flow rate, fluctuations in influent COD and TN loads, and NO3 levels in the anoxic tank. - Rapid disturbance information such as -N changes.

[0062] The LSTM-GRU cascaded structure described above allows the state encoding process to no longer uniformly compress all variables using a single time scale. Instead, it retains the slowly varying background information that determines the system's long-term processing capability and the recent disturbance information that affects current control requirements, thereby improving the accuracy of current state identification under disturbances.

[0063] S22, Explicit enhancement of information on slow-changing biochemical processing capabilities.

[0064] After completing the separation of the two time scales, we further addressed the issue that slow-changing variables such as water temperature and MLSS have small variations within a single process delay window and may still be weakened by recent rapid changes when relying solely on implicit extraction by the network. Therefore, we made explicit enhancements to the slow-changing biochemical capacity state.

[0065] Specifically, although water temperature and MLSS affect the process delay... The variation range within the process window is small, but its trend directly determines the microbial activity, biochemical reaction rate, and the system's effective processing capacity. Therefore, it is not possible to rely solely on neural networks to automatically learn its implicit features, but rather to explicitly enhance their expression.

[0066] For any slowly changing variable Calculate the current value, the average value over the time window, the rate of change, and the deviation from the historical average for the same period, respectively:

[0067]

[0068]

[0069] in, This represents the value of the slowly changing variable at the current time t. express The average level of slowly changing variables within a time step D represents the trend of this slowly changing variable within the process time window. z This indicates the deviation between the current state and the normal operating level during the same period in history; This is at a normal level for the same period in history.

[0070] Construct a slowly varying background enhancement vector using the above statistics. :

[0071] And it is fused with the slowly varying background features extracted by LSTM:

[0072] Through this process, the status code not only represents the current water temperature and MLSS value, but also reflects its long-term level, direction of change, and continuous deviation relative to the normal operating state, so that the system can distinguish between operating states with "similar influent conditions but different basic biochemical treatment capabilities".

[0073] S23: Secondary adaptive enhancement based on the current disturbance state.

[0074] After processing in steps S21 and S22, a basic state has been obtained that simultaneously includes a slowly changing biochemical background and rapid operational dynamics. However, this basic state mainly reflects the overall correlation formed in historical operational data and cannot fully reflect the immediate impact of the type and degree of disturbance under the current disturbance on the actual processing capacity of the system.

[0075] Therefore, this step further introduces the disturbance identification result obtained in step S1 into the state coding process. Based on the current disturbance source and its intensity, the state features related to the disturbance are subjected to secondary adaptive adjustment, so that the state expression is further modified from the general operating state to the actual processing capacity state under the current disturbance conditions.

[0076] Based on the 0 / 1 state identifiers of each disturbance obtained in step S1, such as the low temperature identifier, low C / N identifier, and load fluctuation identifier, and combined with the degree of deviation of the corresponding variable of the operating condition from the normal operating state, the corresponding gating coefficient is calculated. For example, when the low temperature identifier is 1, the gating coefficients related to water temperature, MLSS, and long-term background are increased according to the degree of deviation of the current water temperature from the normal range; when the low C / N identifier is 1, the gating coefficients related to C / N and carbon source limitation are increased according to the degree of deviation of C / N ratio; when the load fluctuation identifier is 1, the load-related gating coefficients are increased according to the degree of fluctuation of flow rate, COD, and TN. The gating coefficients corresponding to untriggered operating conditions remain at the base value. The scenario gating vector is essentially a set of gating coefficients of each feature group. The generation logic is: the operating condition identifier determines whether to activate, and the corresponding disturbance degree determines the enhancement magnitude; multiple gating channels are activated simultaneously under composite operating conditions.

[0077] The current disturbance state obtained in step S1 is represented as follows:

[0078] In the formula, , and These represent the disturbance levels corresponding to low-temperature, high-temperature, and low C / N conditions, respectively.

[0079] The aforementioned disturbance amount does not directly replace the basic state vector formed in steps S21 and S22, but serves as the basis for state adjustment, making additional corrections to the feature contributions related to the current disturbance.

[0080] For the j-th type of disturbance, the adjustment coefficient of its corresponding characteristic group Represented as:

[0081] In the formula, This refers to the adjustment coefficient for the corresponding state characteristic group; The current perturbation level of the j-th type of perturbation; To determine the enhancement parameters based on historical operational data, specifically, several candidate parameters are set for the j-th type of disturbance. The values ​​were selected and used for state reconstruction. The prediction errors of effluent COD and TN under each candidate parameter and the consistency between the predicted change trend and the actual operating data under disturbance conditions were compared. The parameter with the smaller prediction error and the consistent response trend was selected as the final α.j Once the parameters are determined, they remain unchanged, and during online operation, they are only affected by the current level of disturbance. Dynamically calculate the corresponding adjustment coefficient .

[0082] When a certain type of perturbation is not identified, its perturbation level is 0, and the corresponding feature maintains its original basic contribution; as the perturbation level increases, the role of the corresponding state feature in the final state expression is simultaneously enhanced.

[0083] Finally, the corresponding gating coefficient is formed. :

[0084] in, This is a perturbation-eigenvalue mapping matrix, used to describe the influence of different perturbations on different sets of state characteristics. Gating coefficients. Each element in the above represents the adjustment coefficient corresponding to different state characteristic groups, as mentioned above. It can be considered as a component. Perturbation-eigenmap matrix The method involves first determining the correspondence and then determining the specific values. Specifically, based on the process mechanism, the state characteristic groups that mainly affect different disturbances are determined, and matrix elements that are not obviously related to a certain type of disturbance are set to 0; the remaining non-zero elements are calibrated using historical operating data under the corresponding disturbance conditions, and parameter values ​​that can make the predicted COD and TN of the effluent more consistent with the actual operating results are selected.

[0085] Specifically, low-temperature or high-temperature disturbances primarily affect the system's long-term biochemical treatment capacity; therefore, the degree of disturbance contributes to adjusting water temperature, MLSS, and related slowly varying background characteristics. Low C / N disturbances mainly reflect the influent carbon source's insufficiency relative to the nitrogen load; therefore, the degree of disturbance is used to adjust the influent C / N ratio, influent COD, influent TN, and NO3 in the anoxic tank. - The contribution of features such as -N is related to carbon source supply and denitrification state. Therefore, although different perturbations use a unified state coding structure, the state expression can be specifically changed according to the specific source and intensity of the current perturbation.

[0086] The slowly varying enhancement features obtained in steps S21 and S22 With fast dynamic features The fusion forms a basic dual-timescale state:

[0087] in, This represents the feature fusion function, which combines slowly varying enhanced features and fast dynamic features into a unified basic state vector.

[0088] Then, generate the corresponding gating vector based on the current disturbance state. And adjust the basic state vector:

[0089] In the formula, This represents the base state vector before disturbance adjustment. This represents the enhanced state after considering the current type and degree of disturbance. This indicates that the gating coefficients are applied to the basic state vector according to the corresponding feature groups.

[0090] To avoid excessive attenuation of long-term biochemical processing capacity information during perturbation enhancement, the slowly varying background features obtained in step S22 are retained when forming the perturbation enhancement state. This ensures that the final state simultaneously includes the current perturbation impact and the system's basic processing capacity information, thus obtaining the actual system processing capacity state under the current perturbation conditions.

[0091] In the formula, X t To control the sequence of operating states that have been actually acquired and aligned according to the process delay before time t, D t For the current disturbance state determined in step S1, H s This indicates the actual processing capacity of the system under the current disturbance conditions; The state reconstruction function represents a unified summary of the processing procedures, including dual timescale separation, slow-varying enhancement, perturbation gating, and preservation of the slow-varying background.

[0092] When two or more types of disturbances exist simultaneously, each disturbance component acts on its corresponding state characteristics, allowing the impact of different disturbances on the current processing capacity to be preserved simultaneously without the need to rebuild independent operating condition models. Through the above processing, the disturbance identification result obtained in step S1 is no longer used merely as an operating condition label, but is further transformed into a dynamic adjustment quantity in the state coding process. This allows the state representation formed in step S2 to adaptively adjust according to changes in the current source and degree of disturbance, thereby more accurately reflecting the actual processing capacity of the wastewater treatment system under disturbance.

[0093] S24: Verification of the effectiveness of status coding.

[0094] To verify the effectiveness of the aforementioned dual-timescale state enhancement coding method in representing the state of a wastewater treatment system, this embodiment utilizes the formed enhanced state vector H s The COD and TN of the effluent after the process delay are predicted, and the prediction results are compared with the actual test results.

[0095] Figure 2 The comparison between predicted and actual COD values ​​in the effluent is shown. Figure 2It is evident that the prediction results can follow the actual COD change trend of the effluent as a whole, and can reflect the dynamic change process of COD in different operating stages. This indicates that after process time delay alignment and long-term-short-term state coding, the model can establish an effective correspondence between the current operating state and the future effluent response. Figure 3 The comparison between predicted and actual effluent TN values ​​is shown. Figure 3 It is evident that the prediction results can reflect the trend of water TN change well, indicating that the model can effectively capture the hysteresis change characteristics in the denitrification process by enhancing the slow background of water temperature and MLSS and adjusting the perturbation gating.

[0096] In this embodiment, the predicted effluent COD results showed an RMSE of 1.988 mg / L, a MAE of 1.383 mg / L, and a MAPE of 13.07%; the predicted effluent TN results showed an RMSE of 0.698 mg / L, a MAE of 0.471 mg / L, and a MAPE of 5.6%. These results demonstrate that the dual-timescale state-enhanced coding method proposed in this embodiment can effectively integrate long-term biochemical background information and recent load disturbance information to form a state vector with practical process significance, providing a reliable state basis for subsequent batch simulation and optimization screening of candidate carbon source-DO control combinations.

[0097] S3. Candidate scheme deduction and response credibility verification under unified perturbation state.

[0098] Step S2 has already generated an enhanced state vector reflecting the actual treatment capacity of the wastewater treatment system based on the current disturbance type and degree. This step further addresses the problem that disturbances can cause shifts in the response relationship between carbon source dosage, DO setpoint, and effluent COD and TN, making conventional control optimization, which relies solely on predictive model outputs, prone to candidate response distortion or even pseudo-optimal control points. Therefore, this step optimizes the derivation and evaluation methods for candidate control schemes.

[0099] This step first keeps the current disturbance state obtained in step S2 unchanged, and separates the candidate carbon source injection amount and DO setpoint that have not yet been executed in this round from the state coding process. Under a unified disturbance state benchmark, the effluent response corresponding to each candidate control combination is derived. Then, based on the current disturbance state, effective samples with similar disturbance backgrounds and similar processing capabilities are screened from historical operating data. The consistency of the local change direction and response amplitude of the candidate response surface is checked, and abnormal response regions that lack support from similar disturbance operating patterns are eliminated, thereby improving the credibility of the candidate control response under disturbance. S31: Separation of the current disturbance state vector from the candidate control variables.

[0100] This step first addresses the issue that when candidate control variables are involved in state coding, different candidate schemes may correspond to different state representations, thus confusing the differences in current processing capacity with the differences in control schemes. It separates the system state under the current disturbance conditions from the carbon source dosage and DO setpoint to be evaluated. Specifically, a unique current processing capacity state is first determined based on historical operating data and the current disturbance state. Then, different candidate control combinations are injected based on this fixed state, allowing each candidate scheme to be compared under the same disturbance state benchmark.

[0101] Step S2 forms the enhanced state vector at the current control moment:

[0102] Wherein, the state sequence X t The system retains historically implemented carbon source additions and DO setpoints, as these historical control actions have already contributed to the formation of the current system state; however, candidate carbon source additions and DO setpoints not yet implemented in this round are not included in the H2O control. s The calculation.

[0103] The i-th candidate control scheme is represented as:

[0104] in, This represents the amount of carbon source added in the i-th candidate scheme. This indicates the corresponding DO setting value.

[0105] Therefore, the candidate control variables in this round and the current state code satisfy the following:

[0106] That is, within the same control period, regardless of how many candidate carbon source-DO combinations are evaluated subsequently, the current perturbation state H remains unique. s constant.

[0107] Through the above separation, the response differences between different candidate schemes only come from changes in carbon source dosage and DO setpoint, and will not cause the current disturbance state to change synchronously with the candidate scheme due to the candidate control quantity entering the state coding in advance. This establishes a unified benchmark for comparing different control schemes under the same disturbance environment.

[0108] S32: Construction of candidate control space under current disturbance state After fixing the current disturbance state, based on the allowable operating ranges of the carbon source dosing equipment and the aeration equipment, this embodiment sets the candidate range for carbon source dosage to 0.20–0.40 t / h and the candidate range for DO setpoint to 2.0–4.0 mg / L. In the initial simulation phase, the carbon source dosage step size is set to 0.02 t / h, resulting in 11 candidate carbon source values; the DO setpoint step size is set to 0.2 mg / L, resulting in 11 candidate DO values. The two sets of candidate values ​​are then combined to form: Initial candidate control schemes for the group.

[0109] The purpose of using the above-mentioned initial discrete step length is to cover the complete executable control space with a smaller number of candidate control points, firstly obtain the overall distribution characteristics of the response changes of carbon source dosage and DO setpoint to effluent COD and TN under different disturbances, and identify the main changing trends, local gradient change regions and potential response inflection points in the response surface.

[0110] Based on this, candidate points are locally densified only in areas where there is a significant change in the direction of the response surface and which are supported by historical operating data. By reducing the control step size, the local search accuracy is improved, avoiding the generation of a large number of redundant candidate schemes with similar prediction results in areas with a smooth response. At the same time, global search capability and local optimization accuracy are taken into account.

[0111] S33: Candidate Control Post-Injection and Response Deduction under Uniform Disturbance State This step addresses the issue that the control response under disturbance is easily affected by changes in the current processing capacity. Based on the unique disturbance state obtained in step S31, the candidate carbon source dosage and DO setpoint are subsequently injected into the response prediction process.

[0112] For the i-th candidate scheme, it is combined with the current enhanced state vector to form:

[0113] Then, the above splicing results were... Input-shared prediction model The predicted effluent water quality for the i-th candidate control scheme is obtained. :

[0114] in:

[0115] Candidate control variables are injected after state coding is completed. Therefore, the 121 initial candidate schemes share the same enhanced state vector and the same shared prediction model. The prediction differences between candidate schemes are only caused by the differences in carbon source addition and DO setpoint.

[0116] Among them, the shared prediction model A multilayer perceptron (MLP) prediction network is employed; wherein, a shared prediction model is used. The MLP prediction network is shared by all candidate schemes, and the network parameters are shared among all candidate schemes. This setting allows all candidate schemes to be evaluated under the same state vector and the same prediction model. The differences in prediction results are mainly caused by the different amounts of candidate carbon source added and DO setpoints.

[0117] Within a control cycle, the state coding network is executed only once, and then candidate schemes are calculated in batches through a shared prediction model to reduce the repeated coding of the same historical state sequence.

[0118] S34: Construction of carbon source-DO response surface and identification of local regions under the current perturbation state.

[0119] This step addresses the issue that disturbances alter the sensitivity of wastewater treatment systems to carbon source dosage and DO setpoints, causing shifts in the local response relationships between carbon source, DO, and effluent COD and TN, which in turn reduces the applicability of fixed control laws under disturbed conditions. The step involves re-identifying candidate control responses under the current disturbance state.

[0120] Based on the prediction results of each candidate control scheme obtained in step S33, using carbon source dosage and DO setpoint as two control dimensions, and predicting effluent COD and TN as response indicators, a three-dimensional response surface of carbon source-DO-effluent COD and a three-dimensional response surface of carbon source-DO-effluent TN under the current disturbance state are constructed. The response surface is used to characterize the combined impact of different combinations of carbon source dosage and DO setpoint on subsequent effluent quality under the condition that the current treatment capacity state determined in step S2 remains unchanged. Due to different types and degrees of disturbance, the same carbon source-DO control combination may exhibit different response gradients, sensitivities, and local turning points under different disturbance states. Therefore, this step does not pre-set a fixed monotonic relationship between carbon source dosage or DO setpoint and effluent COD and TN. Instead, based on the actual response surface formed under the current disturbance state, regions with significant changes in local gradient, increased response sensitivity, and turning points in the direction of change are identified and designated as local response regions to be further verified. For the identified local response regions, historical operating data similar to the current disturbance state are further used for consistency verification. The matching of similar disturbance states is based not only on the type of operating condition but also on the corresponding disturbance degree and the current processing capacity state formed in step S2, in order to improve the comparability between historical samples and the current operating state. When the local change trend of the predicted response surface can be supported by historical operating data of similar disturbance states, the corresponding region is determined as an effective local response region, and the step size of carbon source addition and DO setpoint is reduced on the basis of the original candidate grid to increase local candidate control points; for regions that only show local gradient abrupt changes or response direction reversals in the model predicted response surface but lack support from historical operating data of similar disturbance states, candidate point densification is not performed to reduce the impact of local model fitting errors or insufficient historical sample coverage on subsequent control optimization.

[0121] This embodiment selects three typical disturbance conditions—low C / N ratio, low temperature in winter, and high temperature in summer—to illustrate the above-mentioned response surface construction, local region identification, and candidate point densification process. Among them, Figure 4 (a) and Figure 4 Figure (b) shows the carbon source-DO-effluent COD response surface and the carbon source-DO-effluent TN response surface under low C / N conditions, respectively. Figure 5 (a) and Figure 5 Figure (b) shows the carbon source-DO-effluent COD response surface and the carbon source-DO-effluent TN response surface under low-temperature winter conditions, respectively. Figure 6 (a) and Figure 6 Figure (b) shows the carbon source-DO-effluent COD response surface and the carbon source-DO-effluent TN response surface under high-temperature conditions in summer.

[0122] Depend on Figures 4-6It can be seen that, within the same candidate control range, the COD and TN response surfaces formed under different disturbance conditions differ in their overall trend, local gradient, and response inflection points, indicating that disturbances alter the system's local response characteristics to carbon source dosage and DO setpoint. Therefore, this embodiment does not directly determine the final control scheme based on the overall trend, but further identifies and verifies historical consistency of regions with significant local changes under the current disturbance state. Under low C / N conditions, according to Figure 4 The local gradient change of the effluent TN response surface shown in Figure (b) identifies a local response inflection point near a carbon source dosage of approximately 0.22 t / h and a DO setpoint of approximately 3.2 mg / L. After verification with historical operating data under similar disturbance conditions, the carbon source dosage range of 0.20–0.24 t / h and the DO setpoint range of 3.0–3.4 mg / L were identified as the local densification zone, and 16 additional local candidate points were added to the initial 121 candidate schemes. Under low-temperature winter conditions, according to... Figure 5 (a) and Figure 5 The local variation characteristics of the response surface shown in Figure (b) identified local TN response variation regions near a carbon source dosage of approximately 0.22 t / h and a DO setpoint of approximately 3.2–3.4 mg / L, and local COD response variation regions near a carbon source dosage of approximately 0.34–0.36 t / h and a DO setpoint of approximately 2.2–2.4 mg / L. After verification with historical operating data under similar disturbance conditions, the above regions were locally densified, adding a total of 50 candidate points. Under high-temperature conditions in summer, according to Figure 6 (a) and Figure 6 The local gradient changes of the response surface shown in Figure (b) identify the TN response transition region near a carbon source dosage of approximately 0.24 t / h and a DO setpoint of approximately 3.6 mg / L, and the COD response transition region near a carbon source dosage of approximately 0.34 t / h and a DO setpoint of approximately 2.0 mg / L. After verification with historical operating data under similar disturbance conditions, the corresponding regions are locally densified, adding a total of 25 candidate points. Through the above processing, the local candidate densification is not based on a fixed range preset according to operating conditions such as low C / N, low temperature, or high temperature, but is determined by the actual response surface change characteristics formed under the current disturbance condition and the historical responses of similar disturbances, thereby improving the identification accuracy and reliability of local candidate responses under disturbance conditions.

[0123] It should be noted that the low C / N ratio, low winter temperature, and high summer temperature mentioned above are only three typical perturbation scenarios selected in this embodiment to illustrate the changes in the response surface and the local region identification process under different perturbation backgrounds, and do not constitute a limitation on the scope of application of this method. For other types of perturbation or complex operating states formed by the combined effects of multiple types of perturbation, the carbon source-DO response surface construction, local region identification, historical consistency verification, and candidate point densification can still be completed in the same way based on the perturbation information obtained in step S1 and the comprehensive perturbation state formed in step S2.

[0124] S35: Local response consistency check based on similar perturbation states.

[0125] This step addresses the issue that the local response relationship between carbon source dosage and DO setpoint on effluent COD and TN may shift under disturbances, leading to predicted results in the candidate response surface that are inconsistent with current operational patterns. It introduces a local response consistency check based on historical data from similar disturbances. The core principle is: instead of directly judging the rationality of candidate schemes based on model predictions, it compares the current candidate response with historical actual responses under similar disturbance conditions to confirm whether the direction of change has a basis in actual operation.

[0126] First, based on the current disturbance type and degree identified in step S1, and combined with the current processing capacity status formed in step S2, valid samples similar to the current state are selected from historical operating data. The similar disturbance state is not determined solely by a fixed operating condition name, but rather by comprehensively considering the disturbance source, disturbance degree, and key operating variables such as influent flow rate, influent COD, influent TN, water temperature, and MLSS, ensuring high comparability between the selected historical samples and the current operating state.

[0127] This embodiment uses three typical disturbance conditions—low C / N ratio, low winter temperature, and high summer temperature—to illustrate the above screening process. For example, under the low C / N condition, historical samples with similar influent C / N ratios and similar main operating states are preferentially selected; under the low winter temperature condition, historical samples with water temperature, MLSS, and influent load similar to the current state are preferentially selected; under the high summer temperature condition, historical samples under similar high temperature backgrounds are selected. The above three conditions are only typical disturbance scenarios for this embodiment and do not constitute a limitation on the types of disturbances applicable to this method; for situations where multiple disturbances coexist, historical samples that are similar to the current state in multiple disturbance components and main operating states are preferentially selected.

[0128] In the screened historical samples of similar disturbances, the local response directions of effluent COD and TN corresponding to changes in carbon source dosage and DO setpoint were statistically analyzed. For the effluent index q, where... The local response is determined by the direction of carbon source dosage and the direction of DO setpoint. When determining the direction of carbon source, the DO setpoint and other main operating conditions are kept unchanged or within a preset range, and the difference in effluent indicators before and after the increase in carbon source dosage is compared.

[0129] The historical local variation in the direction of carbon source is expressed as: :

[0130] in, This indicates the effluent parameters when the carbon source dosage is C and the DO setpoint is D in historical operating data. This indicates that the DO setting value remains basically unchanged, while the carbon source dosage increases. The subsequent water discharge indicators.

[0131] when When, it indicates the effluent index after adding a carbon source in that local area. Lower; when When the carbon source is increased, the effluent index q increases.

[0132] When determining the direction of the DO setpoint, the carbon source dosage and other key operating conditions are kept constant or within a preset range. The difference in effluent parameters before and after increasing the DO setpoint is compared. The historical local variation in the direction of the DO setpoint is expressed as follows: :

[0133] in, This indicates that the carbon source dosage remains basically unchanged, while the DO setpoint is increased. The subsequent water discharge indicators.

[0134] when When, it indicates that increasing DO in that local area reduces the effluent index q; when When , it indicates that the effluent index q increases after increasing DO.

[0135] Because single sets of historical data may be affected by measurement errors and short-term influent disturbances, this embodiment does not determine the local response direction based on a single control change. Instead, it statistically analyzes the change directions of multiple sets of valid historical samples within the same local area. When all historical samples within the same area that reach a preset proportion show a decrease in effluent indicators after adding a carbon source, the carbon source reference direction for that area is determined to be decreasing; when all historical samples that reach a preset proportion show an increase in effluent indicators after adding a carbon source, the carbon source reference direction is determined to be increasing. The DO setpoint direction is determined in the same way. When neither the increasing nor decreasing samples within the same area reach a preset proportion, the historical response direction of that area is considered unstable, and no forced response direction is set for that area. Instead, it is marked as a low-confidence area or an area requiring further investigation.

[0136] Subsequently, adjacent grid points are compared on the candidate response surfaces obtained in step S34. With the DO setting unchanged, the predicted change between the i-th and (i+1)-th carbon source candidate values ​​is expressed as... :

[0137] in, This represents the predicted change in the j-th DO candidate value and the i-th carbon source candidate value. This represents the predicted change in the j-th DO candidate value and the (i+1)-th carbon source candidate value.

[0138] With the carbon source input remaining constant, the predicted change between the j-th and (j+1)-th DO candidate values ​​is expressed as: :

[0139] in, This represents the predicted change in the i-th carbon source candidate value and the j-th DO candidate value; This represents the predicted change in the i-th carbon source candidate value and the (j+1)-th DO candidate value.

[0140] The local response region is determined based on the predicted change direction and magnitude of adjacent grid points. When multiple consecutive adjacent grid points along the carbon source dosage direction or DO setpoint direction have the same change direction, they are assigned to the same local response region. When the predicted change direction changes, or the change magnitude increases significantly relative to adjacent locations, that location is determined as the boundary of the local response region. Therefore, the local region is not divided by equal-distance averages according to the carbon source dosage range and DO setpoint range, but rather determined based on the actual location where the candidate response surface changes.

[0141] Considering the inherent errors in the prediction model, consistency tolerances are set for effluent COD and TN respectively. and When the absolute value of the prediction change between adjacent candidate grid points does not exceed the corresponding tolerance, i.e.: ,or, When the predicted change direction is opposite to the historical reference direction, and the magnitude of the reverse change exceeds the corresponding tolerance, the corresponding candidate point is marked as a response inconsistency point and is not allowed to enter the subsequent stability region screening.

[0142] This step does not set a uniform monotonic constraint on the entire carbon source-DO response surface. The perturbation conditions themselves may cause changes in the sensitivity of local responses or even actual turning points. Therefore, when a local turning point identified in step S34 can be supported by historical data of similar perturbations, it is not removed as an abnormal response but retained as a true local nonlinear response under the current perturbation conditions. For regions that have already undergone local densification, the continuity of responses on both sides of the turning point is further checked using newly added candidate points. If the trend of change after densification is continuous, and the direction of change on both sides can be supported by historical data of similar perturbations, then the local turning point is retained. If isolated low-value points, anomalous changes in adjacent candidate points, or a continuous conflict between the direction of change and historical patterns still occur, then the corresponding candidate points are judged as having abnormal local responses and are excluded. For regions with insufficient historical valid samples and where the local reference direction cannot be stably determined, they are not directly considered to have passed the consistency check but are marked as low-confidence regions. In step S4, the corresponding safety margin requirements are increased or they are restricted from being directly used as target control points to reduce the risk of abnormal predictions being selected by subsequent optimization procedures under insufficient historical data coverage.

[0143] After completing the above checks, the candidate schemes are categorized into consistent response candidates, true turning point candidates with historical support, inconsistent response candidates, and low-trust candidates. Consistent response candidates and true turning point candidates proceed to subsequent connectivity stability domain screening; inconsistent response candidates are eliminated; and low-trust candidates face stricter security requirements.

[0144] S4. Disturbance-resistant optimization screening based on connected stability domain and security depth.

[0145] This step addresses the issue that while a single candidate control scheme may currently meet effluent requirements under disturbance conditions, it could still rapidly fail due to minor changes in influent water quality, temperature, model prediction errors, or equipment execution deviations if it is located near the safety boundary. The step further screens the candidate schemes retained in step S35 for stability. Its core is not merely determining whether a particular carbon source-DO combination is currently feasible, but rather further assessing whether there is a continuous safety adjustment space around the scheme and whether it has sufficient margin from unsafe regions. This avoids selecting boundary-type or isolated candidate points that are prone to failure under disturbance.

[0146] First, based on the safety constraints of effluent COD and effluent TN, the allowable operating range of carbon source addition and aeration equipment, and the single-cycle control variation limit, the candidate schemes are safety-assessed, and a binary safety matrix is ​​formed according to the positions of carbon source addition and DO setpoint in the two-dimensional control space.

[0147] Candidate schemes that meet the requirements for safe effluent, the allowable operating range of the equipment, and the single-cycle control change limit are assigned a value of 1; otherwise, they are assigned a value of 0.

[0148] Based on the positions of the carbon source dosage and DO setpoint in the two-dimensional candidate space, a connected component search is performed on the valid candidate points in the safety matrix. Since the prediction results of the deep learning model may be affected by insufficient data coverage or local fitting errors, some candidate solutions may form isolated safe points, meaning that the solution itself satisfies the constraints, but there are no continuously adjustable safe solutions around it. Therefore, this embodiment sets a minimum connected area Amin, deletes isolated safe regions smaller than this minimum connected area, and retains only connected feasible regions with continuously adjustable space.

[0149] For the retained connected feasible regions, the safety depth of the candidate solutions is further calculated. :

[0150] in, This represents the normalized distance of the i-th candidate solution to the nearest infeasible region. and These represent the candidate step size for carbon sources and the candidate step size for DO, respectively. This represents the amount of carbon source added corresponding to the i-th candidate scheme; This represents the amount of carbon source added corresponding to the j-th infeasible candidate solution; This represents the DO setting value corresponding to the i-th candidate scheme; This represents the DO setting value corresponding to the j-th infeasible candidate solution. This represents the set of infeasible candidate solutions that do not meet the effluent safety constraints, equipment operation constraints, or control change constraints, where j is the index of the infeasible candidate solution in this set.

[0151] A greater safety depth indicates that the candidate solution is farther from the effluent exceeding the standard boundary, and is less likely to enter the infeasible zone when there are small fluctuations in influent water quality, temperature, or model predictions. Therefore, only [the following options are retained]. ≥d min Candidate solutions within the stability region are then included in the subsequent economic evaluation. In this embodiment, d can be taken. min =2 indicates that a safe distance of at least 2 normalized candidate grids is maintained between the candidate solution and the nearest infeasible region. Taking a locally refined carbon source step size of 0.01 t / h and a DO step size of 0.1 mg / L as an example, d min =2 indicates that the candidate point maintains a buffer distance of at least 2 grid scales from the nearest unsafe region in the normalized two-dimensional control space. If two-dimensional Euclidean distance is used for calculation, this value represents the combined distance formed by the carbon source and DO directions, and it is not required that each direction be separated by 2 candidate step sizes.

[0152] Within the stability region, the comprehensive operating cost of the candidate solutions is further calculated. :

[0153] Among them, the first item ( The second item represents the cost of carbon source consumption. ) represents the energy consumption cost of aeration, the third item ( () indicates the cost of control adjustment. This represents the unit carbon source addition cost coefficient; This represents the unit aeration energy consumption cost coefficient; This represents the weighting coefficient for the control adjustment cost; This indicates the actual amount of carbon source added in the previous control cycle; This indicates the DO setting value actually executed in the previous control cycle.

[0154] Ultimately, following the principle of "safety first, cost second best," the following was selected within the stability domain that meets the safety depth requirements: As a target control scheme.

[0155] like Figure 7 As shown, after the above screening, the slanted area represents the connected feasible region that satisfies the safety constraints, and the dotted area represents the region inside the stable region that meets the safety depth requirements. The final target control point is located inside the stable region, rather than directly near the lowest point of the predicted response.

[0156] The above methods can avoid the execution of isolated optimal solutions due to local prediction errors in the model, and at the same time avoid selecting high-risk solutions near the safety boundary. While ensuring that the effluent COD and TN stably meet the requirements, the methods can comprehensively reduce carbon source consumption, aeration energy consumption and control fluctuations, thereby improving the stability and engineering applicability of the optimized control strategy.

[0157] S5. Issuance of target control commands and closed-loop verification based on process delay.

[0158] The determined target control scheme is sent to the execution equipment, and the measured results of COD and TN of the corresponding batch of wastewater are obtained according to the actual process delay.

[0159] The effectiveness of the optimization scheme is judged based on the deviation between the predicted and actual results. When the verification results meet the requirements, the operating status and control results are used as valid samples for model updates. When prediction failure, sensor malfunction, or the absence of a stable control region that meets the requirements occurs, the current optimization results are discontinued, and a conservative control strategy under the corresponding disturbance is switched.

[0160] The target carbon source dosage and target DO setting value determined in step S4 are converted into control commands for the carbon source dosing equipment and aeration equipment, and sent to the corresponding execution equipment.

[0161] Since the process delay determined in step S1 is Therefore, the control effect is not evaluated immediately after the next sampling time following the issuance of the control command, but rather after a time interval t. At each time step, the corresponding measured values ​​of effluent COD and effluent TN are obtained.

[0162]

[0163]

[0164] In the formula, and These represent the time intervals after the target control scheme is issued at control time t, and the time intervals after which the control scheme is executed. The predicted residuals of COD and TN in the effluent obtained at each time step; and They represent t+ The measured values ​​of COD and TN in the effluent were obtained at all times. and They respectively represent the i-th selected in step S5 The predicted values ​​of effluent COD and effluent TN corresponding to the group target control scheme; i This indicates the target control scheme number. The residual is the measured value minus the predicted value.

[0165] When the predicted residual is within the preset allowable range, the current "disturbance state - target control scheme - actual effluent result" is recorded as a valid closed-loop sample and added to historical operating data after data quality checks for subsequent model incremental updates or periodic retraining. If the predicted residual of effluent COD or TN exceeds the threshold for (K) consecutive validation cycles, key sensor data is abnormal, the current operating state exceeds the coverage of historical training data, or a connected and stable control region that meets safety requirements cannot be obtained under the current disturbance state, then the current optimization result is stopped, and the preset conservative control strategy is switched to.

[0166] This embodiment addresses the challenge of stabilizing carbon source dosage and DO setpoints under disturbed conditions by constructing a complete control process. First, step S1 identifies the current disturbance source and its severity, and establishes a time correspondence between operating status, historical control behavior, and effluent results based on actual process delays. Then, step S2 separates and characterizes the slowly changing biochemical background and rapid operational changes, and adaptively enhances relevant features based on the current disturbance state to reconstruct the actual processing capacity under the disturbance. Building upon this, step S3 fixes the current disturbance state, performs a unified simulation of different carbon source-DO candidate combinations, and uses historical responses to similar disturbances for local consistency checks, eliminating abnormal candidate results lacking practical operational basis. Step S4 further identifies stable control regions with continuous safety space and sufficient safety depth from credible candidate schemes, and optimizes carbon source consumption, aeration energy consumption, and control adjustment costs within these regions. Finally, the target control scheme is validated and updated using actual effluent results in a closed-loop manner.

[0167] Therefore, the technical focus of this embodiment is not on simply improving the accuracy of effluent prediction, but on addressing three consecutive problems under disturbance conditions: "changes in processing capacity, shifts in control response relationship, and easy failure of single-point optimality". These problems are addressed through disturbance state reconstruction, similar disturbance response verification, and connected stability domain screening. As a result, the final determined carbon source dosage and DO setpoint not only meet the current effluent requirements, but also have good disturbance adaptability, control stability, and operational economy.

[0168] This embodiment further characterizes disturbances as disturbance states that actually affect the wastewater treatment process. It establishes a correspondence between operating states, historical control behaviors, and subsequent effluent responses by combining actual process delays. This reduces the mismatch between state and effluent results caused by inherent lags in the wastewater treatment process, ensuring that subsequent control optimization is based on disturbance states consistent with actual treatment batches. Secondly, addressing the issue of disturbances having different time scales, this embodiment separates and characterizes the slowly changing background reflecting the system's basic biochemical treatment capacity from the rapid dynamics reflecting recent operational changes. It adaptively enhances relevant state information based on the current source and degree of disturbance, allowing state representation to adjust with disturbance changes. Compared to using fixed time scales or fixed state relationships, this approach more fully reflects the actual treatment capacity shift caused by changes in water temperature, MLSS, influent carbon and nitrogen structure, and operating states under disturbance conditions, improving the adaptability of the current treatment capacity representation under disturbance and complex disturbance conditions. Furthermore, this embodiment separates the current disturbance state from the candidate carbon source dosage and dissolved oxygen setpoints that have not yet been executed in this round, enabling comparison of different candidate control combinations under the same actual processing capacity. Simultaneously, it utilizes historical actual responses under similar disturbance states to perform local consistency verification of candidate prediction results, thereby avoiding the direct mixing of control response patterns under different disturbance conditions. It also preserves the true local nonlinearity and response transitions under disturbance conditions while eliminating abnormal candidate results caused by local model fitting errors or insufficient historical data coverage, improving the reliability of candidate control responses. In addition, this embodiment does not directly use a single candidate point predicted to be feasible as the control target, but further evaluates whether there is continuous safe adjustment space around the candidate scheme and the safety margin between it and infeasible regions. Through connected stability domains and safety depth screening, the risk of directly executing candidate schemes near isolated feasible points and safety boundaries can be reduced. This ensures that the finally determined carbon source dosage and dissolved oxygen setpoints retain a certain adjustment space under disturbances such as influent fluctuations, state drift, prediction errors, and equipment execution deviations, improving the disturbance resistance stability and engineering execution reliability of the control scheme. Finally, within the candidate region that meets the requirements for effluent COD, TN control, and disturbance stability, this embodiment comprehensively considers carbon source consumption, aeration energy consumption, and control adjustment costs, ensuring that economic optimization is based on the guarantee of safety and stability, and avoiding the sacrifice of control reliability by simply pursuing the best prediction or the lowest operating cost.

[0169] This embodiment addresses three consecutive problems caused by disturbances: processing capacity shift, candidate response distortion, and single-point control instability. It addresses these issues through disturbance state reconstruction, similar disturbance response verification, and connected stability domain and safety depth screening, thereby improving the reliability, stability, adaptability, and operational economy of the coordinated optimization of carbon source addition and dissolved oxygen setpoint under disturbance conditions.

[0170] Example 2 The purpose of this embodiment is to provide a system for the coordinated optimization of carbon source addition and dissolved oxygen under disturbed conditions, including: The disturbance determination module is configured to: determine whether the current operation of the wastewater treatment plant is under disturbance based on the current actual operating data of the wastewater treatment plant and the determination boundary of each disturbance, as well as the disturbance state corresponding to the disturbance, and determine the process delay based on the actual hydraulic residence time of the wastewater from the control position to the effluent monitoring position, and construct a wastewater treatment state sequence based on the process delay. The feature extraction module is configured to: extract slowly varying background features reflecting the long-term biochemical capacity of the system from the wastewater treatment state sequence; enhance the slowly varying background features based on the slowly varying variables to obtain enhanced slowly varying background features; extract rapid disturbance features of rapidly changing influent load and process state based on the slowly varying background features; and fuse the enhanced slowly varying background features with the rapid disturbance features to obtain the basic state vector of the current operating condition. The disturbance adjustment module is configured to: generate a gating coefficient for the enhanced state vector based on the disturbance state of the identified disturbance, and dynamically adjust the enhanced state vector so that as the disturbance level increases, the effect of the corresponding state vector is simultaneously enhanced; The optimization module is configured to: deduce the effluent response corresponding to each candidate control combination with candidate carbon source dosage and dissolved oxygen setpoint under a unified disturbance state benchmark; select effective samples with similar disturbance background and similar processing capabilities from historical operating data based on the current disturbance state; perform consistency verification on the local change direction and response amplitude of the candidate response surface; and select the candidate combination with the lowest comprehensive operating cost as the target control scheme within the candidate region that meets safety and stability requirements for the candidate control combination that passes the consistency verification.

[0171] In further embodiments, the following is also provided: An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When executed by the processor, the computer instructions perform the method described in Embodiment 1. For brevity, further details are omitted here.

[0172] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0173] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.

[0174] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the method described in Embodiment 1.

[0175] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.

[0176] A computer program product includes a computer program that, when executed by a processor, implements the method described in Embodiment 1.

[0177] The present invention also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer-executable instructions, such as instructions included in program modules, which execute in a device on a target real or virtual processor to perform the processes / methods described above. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., that perform specific tasks or implement specific abstract data types. In various embodiments, the functionality of program modules can be combined or divided among program modules as needed. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside in both local and remote storage media.

[0178] The computer program code used to implement the methods of the present invention may be written in one or more programming languages. This computer program code may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the computer or other programmable data processing device, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a computer, partially on a computer, as a stand-alone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.

[0179] In the context of this invention, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like. Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.

[0180] Those skilled in the art will recognize that the units and algorithm steps described in conjunction with the embodiments herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0181] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A method for synergistic optimization of carbon source addition and dissolved oxygen under disturbed conditions, characterized in that, include: Based on the current actual operating data of the wastewater treatment plant, and according to the judgment boundary of each disturbance, it is determined whether the plant is currently in a disturbance and the disturbance state corresponding to the disturbance. The process delay is determined based on the actual hydraulic residence time of the wastewater from the control position to the effluent monitoring position, and a wastewater treatment state sequence is constructed based on the process delay. Slowly varying background features reflecting the long-term biochemical capacity of the system are extracted from the wastewater treatment state sequence. The slowly varying background features are then enhanced based on the slowly varying variables to obtain enhanced slowly varying background features. Based on the slowly varying background features, the rapid disturbance features of the rapidly changing influent load and process state are extracted, and the enhanced slowly varying background features are fused with the rapid disturbance features to obtain the basic state vector of the current operating condition. The gating coefficients of the basic state vector are generated based on the identified disturbance states, and the basic state vector is dynamically adjusted so that as the disturbance level increases, the effect of the corresponding state vector is simultaneously enhanced. Under a unified disturbance state baseline, the effluent response corresponding to each candidate control combination with candidate carbon source dosage and dissolved oxygen setpoint is simulated. Based on the current disturbance state, effective samples with similar disturbance background and similar treatment capacity are selected from historical operating data. The local change direction and response amplitude of the candidate response surface are checked for consistency. For the candidate control combinations that pass the consistency check, within the candidate region that meets the requirements of safety and stability, the combination candidate scheme with the lowest comprehensive operating cost is selected as the target control scheme.

2. The method for synergistic optimization of carbon source addition and dissolved oxygen under disturbed conditions as described in claim 1, characterized in that, Slowly varying background features reflecting the long-term biochemical capacity of the system are extracted from the wastewater treatment state sequence. The slowly varying background features are then enhanced based on the slowly varying variables to obtain enhanced slowly varying background features. Based on the slowly varying background features, rapid disturbance features of rapidly changing influent load and process state are extracted. The enhanced slowly varying background features are then fused with the rapid disturbance features to obtain the basic state vector for the current operating condition, specifically: Slowly varying background features reflecting the long-term biochemical capacity of the system were extracted from the wastewater treatment status sequence using an LSTM network. For any slowly changing variable, calculate the current value, time window average, rate of change, and historical deviation, and construct a slowly changing background enhancement vector based on the slowly changing variable and the corresponding calculated statistics. The slowly varying background enhancement vector is fused with the slowly varying background features extracted by the LSTM network to obtain the enhanced slowly varying background features. Based on the slowly varying background characteristics, a GRU network is used to extract the rapid disturbance characteristics of rapidly changing influent load and process state. The enhanced slowly varying background features are fused with the fast disturbance features to obtain the basic state vector of the current operating condition.

3. The method for synergistic optimization of carbon source addition and dissolved oxygen under disturbed conditions as described in claim 1, characterized in that, Based on the gate coefficients generated from the identified disturbance states, the basic state vector is dynamically adjusted, specifically as follows: Calculate the adjustment coefficient for each disturbance based on the current disturbance level of different disturbances; Based on the adjustment coefficients of each perturbation, a gate coefficient is constructed by combining the perturbation-feature mapping matrix; wherein, the perturbation-feature mapping matrix is ​​used to describe the influence relationship of different perturbations on different state feature groups; The basic state vector is dynamically adjusted based on the corresponding gating coefficients generated according to the current disturbance state.

4. The method for synergistic optimization of carbon source addition and dissolved oxygen under disturbed conditions as described in claim 1, characterized in that, Under a unified disturbance state baseline, the effluent response corresponding to each candidate control combination with candidate carbon source dosage and dissolved oxygen setpoint is derived. Based on the current disturbance state, effective samples with similar disturbance background and similar processing capabilities are selected from historical operating data. The local change direction and response amplitude of the candidate response surface are checked for consistency. For the candidate control combinations that pass the consistency check, within the candidate region that meets safety and stability requirements, the combination candidate scheme with the lowest overall operating cost is selected as the target control scheme, specifically: Based on the current disturbance state, multiple candidate schemes for the combination of candidate carbon source dosage and dissolved oxygen setpoint are generated according to the operating range of carbon source dosing equipment and aeration equipment. Each candidate scheme is concatenated with the dynamically adjusted basic state vector and then input into the shared prediction model to obtain the effluent quality prediction results corresponding to each candidate scheme. Based on the predicted effluent quality of each candidate scheme combination, it is determined whether each candidate scheme combination meets the effluent discharge constraints. In conjunction with the equipment operating range constraints and control change range constraints, a safety evaluation is conducted on each candidate scheme combination to form a binary safety matrix. A connected component search is performed on the valid candidate points in the binary security matrix. Adjacent valid candidate points are divided into the same connected region. The number of candidate points contained in each connected region is calculated. Isolated safe regions with fewer than the preset minimum connected area are deleted, and only connected feasible regions with continuous adjustment space are retained. The normalized distance from the candidate solution within the retained connected feasible region to the nearest infeasible region is calculated as the safety depth, and candidate solutions with a safety depth greater than a preset threshold are retained. For the retained candidate schemes, the comprehensive operating cost is calculated based on the carbon source consumption cost, aeration energy consumption cost, and control switching cost. The scheme with the lowest comprehensive operating cost is selected as the target control scheme according to the principle of safety first and cost second best.

5. The method for synergistic optimization of carbon source addition and dissolved oxygen under disturbed conditions as described in claim 1, characterized in that, This also includes a consistency check on each combination of candidate solutions, specifically: Based on the currently identified disturbances, select effective samples from historical operating data that are close to the operating conditions, and statistically analyze the reference change direction of effluent indicators when the carbon source dosage and dissolved oxygen setpoint change in the local area. The predicted effluent water quality values ​​of each candidate scheme are compared with adjacent grid points to obtain the predicted direction of change. The predicted change direction is compared with the reference change direction. When the predicted change direction is opposite to the reference direction and the change magnitude exceeds the preset tolerance, the corresponding combination candidate scheme is marked as inconsistent and excluded. When the predicted change direction is consistent with the reference change direction, or the change magnitude between the predicted change direction and the reference direction does not exceed the corresponding tolerance, the corresponding combination candidate scheme is retained.

6. The method for synergistic optimization of carbon source addition and dissolved oxygen under disturbed conditions as described in claim 1, characterized in that, It also includes closed-loop verification, specifically: The target carbon source dosage and target dissolved oxygen setpoint corresponding to the final determined target control scheme are converted into control commands and sent to the execution equipment. According to the process delay, after the control time, at the time step corresponding to the process delay, the measured values ​​of chemical oxygen demand and total nitrogen in the effluent of the corresponding batch of wastewater are obtained. The differences between the measured value of chemical oxygen demand (COD) in the effluent and the predicted value of COD in the effluent corresponding to the target control scheme, and the differences between the measured value of total nitrogen in the effluent and the predicted value of total nitrogen in the effluent corresponding to the target control scheme are calculated respectively, and are used as prediction residuals. When the predicted residual is within the preset range, the control result is recorded as a valid optimization result, and the current operating condition, target control scheme and corresponding measured effluent value are added as valid samples to the training data. When the predicted residual exceeds the preset threshold for K consecutive verification cycles, or the sensor data is abnormal, or a connected feasible region that meets the effluent safety constraints is not obtained, the current optimization result is stopped and the conservative control strategy under the corresponding disturbance is switched.

7. A system for synergistic optimization of carbon source addition and dissolved oxygen under disturbed conditions, characterized in that, include: The disturbance determination module is configured to: determine whether the current situation is under disturbance based on the current actual operating data of the wastewater treatment plant and the determination boundary of each disturbance, as well as the disturbance state corresponding to the disturbance, and determine the process delay based on the actual hydraulic residence time of the wastewater from the control position to the effluent monitoring position, and construct a wastewater treatment state sequence based on the process delay. The feature extraction module is configured to: extract slowly varying background features reflecting the long-term biochemical capacity of the system from the wastewater treatment state sequence, and enhance the slowly varying background features based on the slowly varying variables to obtain enhanced slowly varying background features. Based on the slowly varying background features, the rapid disturbance features of the rapidly changing influent load and process state are extracted, and the enhanced slowly varying background features are fused with the rapid disturbance features to obtain the basic state vector of the current operating condition. The disturbance adjustment module is configured to: generate a gating coefficient for the basic state vector based on the disturbance state of the identified disturbance, and dynamically adjust the basic state vector so that as the disturbance level increases, the effect of the corresponding state vector is simultaneously enhanced. The optimization module is configured to: deduce the effluent response corresponding to each candidate control combination with candidate carbon source dosage and dissolved oxygen setpoint under a unified disturbance state benchmark; select effective samples with similar disturbance background and similar processing capabilities from historical operating data based on the current disturbance state; perform consistency verification on the local change direction and response amplitude of the candidate response surface; and select the candidate combination with the lowest comprehensive operating cost as the target control scheme within the candidate region that meets safety and stability requirements for the candidate control combination that passes the consistency verification.

8. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, perform the method described in any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the method described in any one of claims 1-6.