An industrial sewage treatment full-process automatic control method and system
Patent Information
- Application Number
- CN202611030220.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-11
- Publication Date
- 2026-10-16
AI Technical Summary
[0007]针对现有技术中工业污水处理各单元AI控制模块相互独立、缺乏跨单元级联决策机制导致全流程难以协同优化的技术问题,本发明提供一种工业污水处理全流程自动化控制方法及系统,通过在预处理、生化和深度处理三大单元之间构建基于多智能体协同强化学习的动态级联决策网络,实现前序单元根据后续单元状态反馈主动调整操作参数、后续单元根据前序出水特性预判性优化自身控制策略的全流程协同控制
[0014]This invention establishes a dynamic cascaded decision-making network based on multi-agent collaborative reinforcement learning among the three major units of industrial wastewater treatment: pretreatment, biochemical treatment, and advanced treatment. The decisions of each unit are no longer locally independent but are coupled bidirectionally through forward propagation and backward feedback channels. This allows preceding units to proactively adjust their operating parameters based on real-time feedback from subsequent units, and subsequent units to predictively optimize their control strategies based on the characteristics of the preceding effluent, thereby achieving optimal operation across the entire process. This invention unifies and couples the three optimization objectives—effect compliance, inter-unit coordination, and resource consumption—through a global reward function, avoiding the global suboptimal problem caused by independent optimization by each unit. Furthermore, through a hierarchical cascaded response mechanism, this invention enables the three units to coordinate and initiate joint response strategies of varying intensities based on the severity of influent anomalies, effectively improving the system's resilience and stable effluent compliance under conditions of drastic fluctuations in industrial wastewater quality.
Smart Images

Figure CN122924049A_ABST
Abstract
Description
Technical Field
[0001] This application relates to industrial automation, deep learning, the Internet of Things, and artificial intelligence algorithms, specifically to a method and system for automated control of the entire industrial wastewater treatment process. Background Technology
[0002] Industrial wastewater treatment is a key technological area in environmental protection and sustainable industrial development. A typical industrial wastewater treatment system consists of three main units connected in series: pretreatment, biochemical reaction, and advanced treatment. These units are coupled with complex material and energy flows. The pretreatment unit provides suitable conditions for subsequent biochemical treatment through operations such as oil removal, pH adjustment, and suspended solids removal. The biochemical unit utilizes microorganisms to degrade organic matter and achieve nitrogen and phosphorus conversion. The advanced treatment unit ensures that the final effluent meets discharge standards through membrane filtration and chemical precipitation. With the rapid development of deep learning, the Internet of Things, and artificial intelligence technologies, intelligent control methods have been increasingly widely applied in wastewater treatment, driving improvements in treatment efficiency and reductions in operating costs.
[0003] Currently, the application of intelligent control technology in wastewater treatment mainly includes two technical approaches. The first approach focuses on parameter optimization schemes for individual process units. Examples include intelligent aeration control systems based on deep reinforcement learning that dynamically optimize aeration rates using parameters such as dissolved oxygen concentration and sludge concentration; carbon source dosing control based on water quality prediction models that precisely adjusts the timing and dosage of external carbon sources based on predictions of effluent indicators; and intelligent phosphorus removal systems based on total phosphorus concentration monitoring that automatically adjust reagent dosage according to influent load. The characteristic of this type of scheme is that each control module focuses only on local optimization objectives within its own unit, limiting the optimization scope to a single process unit. The second approach involves centralized monitoring and operation management platforms covering the entire wastewater treatment plant. These platforms achieve unified data collection, visualization, and anomaly warnings from multiple units through IoT sensors and cloud platforms. While this type of platform achieves cross-unit information aggregation at the data level, the control logic of each unit remains independent at the decision-making level.
[0004] However, both of the aforementioned technical approaches suffer from the problems of missing cross-unit decision-making information flow and fragmented optimization objectives. Existing end-to-end control platforms essentially integrate multiple unit control modules into a single software system. Information interaction between these modules is limited to unidirectional monitoring data transmission, rather than bidirectional decision signal cascading. Each unit's AI control model makes independent calculations based solely on its own sensor data when making policy decisions, unable to acquire the decision-making intentions and operational expectations of other units. When a preceding unit makes operational adjustments, subsequent units cannot predict upcoming changes in influent characteristics; when subsequent units face load pressure or the risk of exceeding effluent standards, they cannot promptly transmit optimization signals to preceding units to guide parameter adjustments. This situation, where the decision-making agents of each unit are isolated and lack collaborative decision-making mechanisms, makes it difficult for the entire system to achieve optimal operating conditions at the global level.
[0005] Furthermore, existing research on the application of multi-agent reinforcement learning in wastewater treatment mainly focuses on the collaborative optimization of multiple control variables within a single biochemical unit. For example, multi-agent deep deterministic policy gradient algorithms are used to simultaneously optimize aeration rate and external carbon source dosage. Although these schemes introduce a multi-agent framework, each agent corresponds to different control parameters within the same unit. The agents achieve implicit collaboration through a shared global evaluation network, without establishing explicit decision signal transmission channels between physically separated units. Therefore, when dealing with unit collaboration spanning different physical spaces and time scales, such as pretreatment, biochemical treatment, and advanced treatment, existing schemes cannot provide effective technical means.
[0006] The aforementioned problems are particularly severe in industrial wastewater treatment scenarios where water quality and quantity fluctuate drastically. Compared to urban domestic sewage, industrial wastewater is characterized by complex and variable pollutant composition, large concentration fluctuations, and the potential presence of toxic substances that inhibit microorganisms. When the concentration of organic matter in the influent suddenly increases or inhibitory substances appear, the nonlinear coupling relationship between the various units becomes more complex. If the pretreatment unit cannot be adjusted according to the capacity of the biological treatment unit, incompatible pollutants may enter the biological treatment tank, causing shock or even collapse of the microbial system. Conversely, if the advanced treatment unit lacks the ability to anticipate and coordinate responses when the biological treatment unit malfunctions, it will face a serious risk of effluent exceeding standards. The independent decision-making mode of each unit is more prone to triggering cascading instability under conditions of drastic water quality fluctuations, and current technology has not yet provided an effective technical solution to establish real-time bidirectional decision-making coupling between multiple units. Summary of the Invention
[0007] To address the technical problem in existing industrial wastewater treatment technologies where the AI control modules of each unit are independent and lack a cross-unit cascade decision-making mechanism, making it difficult to achieve coordinated optimization of the entire process, this invention provides an automated control method and system for the entire industrial wastewater treatment process. By constructing a dynamic cascade decision-making network based on multi-agent collaborative reinforcement learning among the three major units of pretreatment, biochemical treatment, and advanced treatment, this invention enables coordinated control of the entire process, where preceding units actively adjust their operating parameters based on feedback from subsequent units, and subsequent units predictively optimize their control strategies based on the characteristics of the preceding effluent.
[0008] One aspect of the present invention provides a method for automated control of the entire industrial wastewater treatment process, comprising the following steps: Step S1 involves deploying multi-source sensor arrays in the pretreatment unit, biochemical unit, and advanced treatment unit to collect operational status data. The raw data collected by each unit is preprocessed by time alignment and normalization, and then encoded using a time-series feature extraction network based on an attention mechanism to generate state feature vectors for each unit. Specifically, the parameters collected by the pretreatment unit include influent flow rate, pH value, suspended solids concentration, oil concentration, COD concentration, and coagulant dosage; the parameters collected by the biochemical unit include dissolved oxygen concentration, mixed liquor suspended solids concentration, sludge return rate, effluent ammonia nitrogen concentration, effluent total nitrogen concentration, and microbial activity indicators; and the parameters collected by the advanced treatment unit include membrane flux, transmembrane pressure difference, reagent dosage, effluent COD concentration, and effluent total phosphorus concentration. Preferably, the time-series feature extraction network adopts a Transformer encoder-based architecture, capturing the temporal and cross-parameter correlations between parameters through a multi-head self-attention mechanism to generate state feature vectors containing temporal dynamic information.
[0009] Step S2 involves setting up decision agents for the pretreatment unit, biochemical unit, and deep processing unit. Each decision agent includes a policy network and a value network. The three decision agents interact with each other through a cascaded communication protocol. This cascaded communication protocol includes a forward propagation channel and a reverse feedback channel. The forward propagation channel transmits the decision vector and expected effluent characteristic vector of the preceding unit to the decision agent of the subsequent unit. The reverse feedback channel transmits the feedback optimization signal generated by the subsequent unit based on its own load status and effluent compliance pressure to the decision agent of the preceding unit. The decision signal transmitted in the cascaded communication protocol is a high-level semantic decision vector generated after processing by the policy network, containing three components: operation intention encoding, expected effect encoding, and constraint condition encoding. Specifically, the operation intention encoding represents the direction and intensity of the operation planned by the current unit, the expected effect encoding represents the effluent characteristics expected to be achieved by the current unit, and the constraint condition encoding represents the operational constraints imposed by the current unit on the upstream or downstream units. Furthermore, the working mechanism of the forward transmission channel is as follows: after the decision-making agent of the pretreatment unit makes an operational decision, it transmits the decision vector and the expected effluent characteristic vector to the decision-making agent of the biochemical unit. The decision-making agent of the biochemical unit adjusts the control strategy based on its own state and prior decision information, and then transmits the adjusted decision vector and the expected effluent characteristic vector to the decision-making agent of the deep treatment unit. The working mechanism of the reverse feedback channel is as follows: the decision-making agent of the deep treatment unit generates a feedback optimization signal based on its own load state and effluent compliance pressure, and transmits it to the decision-making agent of the biochemical unit through the reverse channel. After receiving the reverse feedback signal, the decision-making agent of the biochemical unit comprehensively evaluates its own adjustment space, generates a feedback signal for the pretreatment unit, and guides the pretreatment unit to adjust the coagulant dosage, pH adjuster dosage, and hydraulic retention time.
[0010] Step S3 involves constructing a global reward function to collaboratively train the three decision-making agents. This global reward function comprises three components: a reward for achieving effluent standards across the entire process, a reward for inter-unit collaboration, and a penalty for global resource consumption. Specifically, the reward for achieving effluent standards across the entire process is calculated based on the differences between various water quality indicators of the final effluent from the advanced treatment unit and the discharge standards. A positive reward is given when all indicators meet the standards, and a negative penalty is given when any indicator exceeds the standard. The reward for inter-unit collaboration is calculated as follows: a positive reward is given when the effluent characteristics of the preceding unit are within the optimal influent range of the subsequent units, and a penalty is given when they deviate from the optimal influent range. This component forces each unit to consider not only its own compliance but also the receiving conditions of the subsequent units when making decisions. The global resource consumption penalty uniformly constrains the reagent consumption, aeration energy consumption, and membrane cleaning frequency of all units. Preferably, the multi-agent collaborative training adopts a paradigm of centralized training and distributed execution. During the training phase, the three decision agents share global state information and global reward signals, and perform joint policy updates through a multi-agent proximal policy optimization algorithm. During the execution phase, each decision agent makes decisions based only on its local observations and received cascaded communication signals.
[0011] Step S4 involves initiating a tiered cascaded response based on the influent water quality anomaly detection results. Specifically, in step S4, real-time anomaly detection of influent water quality parameters is performed using sliding window statistical tests and the isolated forest algorithm. Anomalies are categorized into three levels based on severity: Level 1 anomalies are slight parameter fluctuations, Level 2 anomalies are significant parameter deviations, and Level 3 anomalies are drastic parameter mutations or the presence of inhibitory substances. Further, in Level 1 anomalies, parameter fine-tuning is performed only within the pretreatment unit, and a warning signal is sent to the biological treatment unit via the forward channel. In Level 2 anomalies, the pretreatment unit dynamically adjusts the coagulant dosage and hydraulic retention time based on the load capacity feedback from the biological treatment unit, while the biological treatment unit predictively adjusts the aeration intensity and sludge return rate. In Level 3 anomalies, the decision-making agents of the three units switch to the emergency strategy network: the pretreatment unit maximizes the removal of inhibitory substances, the biological treatment unit reduces its load, and the deep treatment unit increases the redundancy of reagent dosage. Further, after the anomaly subsides, the three decision-making agents negotiate through cascaded communication, gradually restoring normal operation in the order of downstream recovery followed by upstream adjustment.
[0012] Step S5 involves deploying the inference computation of the three decision-making agents on edge computing nodes, with cascaded communication signals transmitted between these nodes via industrial Ethernet. Specifically, the inference computation of the three decision-making agents is deployed on edge computing nodes close to the control cabinets of each unit, achieving millisecond-level local decision response; cascaded communication signals are transmitted directly between edge nodes via industrial Ethernet, ensuring communication latency is less than 100 milliseconds. The cloud server is responsible for the continuous training and updating of the model, incrementally learning the policy network based on the real-time operational data transmitted back from each unit, and periodically distributing the updated model parameters to the edge nodes. Furthermore, a security constraint layer is set on each edge computing node. When the cascaded communication link is interrupted or experiences abnormal latency, each decision-making agent automatically switches to an independent decision-making mode based on local observations. When sensor data is abnormally missing, compensation is performed using a data reconstruction algorithm based on data from adjacent time points and the correlation between units.
[0013] In another aspect, the present invention provides an automated control system for the entire industrial wastewater treatment process, comprising: a data acquisition layer, used to deploy multi-source sensor arrays in the pretreatment unit, biochemical unit, and deep treatment unit respectively to collect operating status data; the raw data collected by each unit is preprocessed by time alignment and normalization, and then encoded by a temporal feature extraction network based on an attention mechanism to generate state feature vectors for each unit; an edge decision layer, used to set decision agents for the pretreatment unit, biochemical unit, and deep treatment unit respectively, each decision agent including a policy network and a value network; and a cascaded communication layer, used to enable information interaction between the three decision agents through a cascaded communication protocol, the cascaded communication protocol including a forward transmission channel and a back feedback channel, the forward transmission channel transmitting the decision vectors and expected effluent feature vectors of the preceding unit to the decision of the subsequent unit. The intelligent agent, through a reverse feedback channel, transmits feedback optimization signals generated by subsequent units based on their own load status and effluent pressure compliance to the decision-making agent of the preceding unit. The decision signal transmitted in the cascaded communication protocol is a high-level semantic decision vector generated after processing by the policy network, containing three components: operation intention encoding, expected effect encoding, and constraint condition encoding. The cloud training layer is used to construct a global reward function for collaborative training of the three decision-making agents. The global reward function contains three components: full-process effluent compliance reward, inter-unit coordination reward, and global resource consumption penalty. The security layer is used to automatically switch each decision-making agent to an independent decision-making mode based on local observation when the cascaded communication link is interrupted or experiences abnormal delays. When sensor data is abnormally missing, compensation is performed through a data reconstruction algorithm based on adjacent time data and inter-unit correlation.
[0014] This invention establishes a dynamic cascaded decision-making network based on multi-agent collaborative reinforcement learning among the three major units of industrial wastewater treatment: pretreatment, biochemical treatment, and advanced treatment. The decisions of each unit are no longer locally independent but are coupled bidirectionally through forward propagation and backward feedback channels. This allows preceding units to proactively adjust their operating parameters based on real-time feedback from subsequent units, and subsequent units to predictively optimize their control strategies based on the characteristics of the preceding effluent, thereby achieving optimal operation across the entire process. This invention unifies and couples the three optimization objectives—effect compliance, inter-unit coordination, and resource consumption—through a global reward function, avoiding the global suboptimal problem caused by independent optimization by each unit. Furthermore, through a hierarchical cascaded response mechanism, this invention enables the three units to coordinate and initiate joint response strategies of varying intensities based on the severity of influent anomalies, effectively improving the system's resilience and stable effluent compliance under conditions of drastic fluctuations in industrial wastewater quality. Attached Figure Description
[0015] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0016] Figure 1 This is a schematic diagram of the overall process of the automated control method for the entire industrial wastewater treatment process provided in Embodiment 1 of the present invention.
[0017] Figure 2 This is a schematic diagram of the information interaction structure of the cascaded communication protocol between three decision-making agents in Embodiment 1 of the present invention.
[0018] Figure 3 This is a schematic diagram of the training architecture for multi-agent collaborative reinforcement learning in Embodiment 1 of the present invention.
[0019] Figure 4 This is a hierarchical block diagram of the fully automated control system for industrial wastewater treatment provided in Embodiment 4 of the present invention.
[0020] Figure 5 This is a dynamic schematic diagram of the cascaded decision signal timing propagation and bidirectional coupling of the present invention.
[0021] Figure 6 This is a schematic diagram of the physical layout and sensor deployment of the three units of the industrial wastewater treatment plant according to the present invention.
[0022] Figure 7 This is a schematic diagram of the physical deployment architecture of edge computing nodes and cloud servers of the present invention.
[0023] Figure 8 This is a comparison chart of the effluent compliance rate (sub-indicators) of the present invention.
[0024] Figure 9 This is a graph showing the ablation experiment (contribution of cascaded components to the compliance rate) of this invention.
[0025] Figure 10 This is a comparison chart of the reduced operating costs and shock recovery time of the present invention. Detailed Implementation
[0026] To make the objectives and technical solutions of this invention clearer, the embodiments of this invention will be further described in detail below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of this invention and should not be construed as limiting the scope of protection of this invention.
[0027] Example 1: This example provides a fully automated control method for industrial wastewater treatment, applied to an industrial wastewater treatment system comprising a pretreatment unit, a biochemical unit, and an advanced treatment unit, such as... Figure 1 As shown, the method includes the following steps.
[0028] Step S1: Deploy multi-source sensor arrays in the preprocessing unit, biochemical unit, and deep processing unit to collect operational status data. After time alignment and normalization preprocessing of the raw data collected by each unit, generate the state feature vector of each unit through a temporal feature extraction network based on an attention mechanism.
[0029] In the pretreatment unit, a sensor array collects six parameters: influent flow rate, pH value, suspended solids concentration, oil concentration, COD concentration, and coagulant dosage. Influent flow rate is collected at 1-second intervals using an electromagnetic flowmeter; pH value is collected at 5-second intervals using an online pH electrode; suspended solids concentration is collected at 10-second intervals using a light-scattering turbidity sensor; oil concentration is collected at 30-second intervals using an online oil analyzer with UV fluorescence; COD concentration is collected at 2-minute intervals using an online COD analyzer with UV-Vis dual-wavelengths; and coagulant dosage is recorded in real-time using a metering pump flowmeter. In the biochemical unit, six parameters are collected: dissolved oxygen concentration, mixed liquor suspended solids concentration, sludge return rate, effluent ammonia nitrogen concentration, effluent total nitrogen concentration, and microbial activity indicators. Microbial activity indicators are obtained at 15-minute intervals using an online ATP fluorescence detection device. In the advanced treatment unit, five parameters are collected: membrane flux, transmembrane pressure difference, reagent dosage, effluent COD concentration, and effluent total phosphorus concentration.
[0030] like Figure 6As shown, the industrial wastewater treatment plant adopts a three-unit cascaded physical layout. Influent sequentially passes through a coagulation sedimentation tank (pretreatment unit), an A2O biological treatment tank (biological unit), and an ultrafiltration membrane workshop (advanced treatment unit). Each unit is connected by pipes with the flow direction clearly marked. The coagulation sedimentation tank is equipped with three types of sensors: flow meters, pH electrodes, and turbidity meters, to monitor influent flow rate, pH, and suspended solids concentration in real time. The A2O biological treatment tank is subdivided into three functional zones: anaerobic, anoxic, and aerobic, and is equipped with dissolved oxygen probes, pH electrodes, and flow meters to monitor key parameters of the biochemical reactions. The ultrafiltration membrane workshop is equipped with pressure gauges, flow meters, and turbidity meters to monitor the membrane filtration operation status. An edge computing node is located next to each unit, and the three edge nodes are cascaded via gigabit industrial Ethernet to form a low-latency communication network.
[0031] Because the sampling frequencies of various sensors are inconsistent, the raw data needs to be time-aligned. Specifically, the time interval corresponding to the lowest sampling frequency is used as the baseline time window. The high-frequency sampling data is averaged within each baseline window, and the low-frequency sampling data is supplemented by linear interpolation, so that all parameter data have a uniform time resolution. In this embodiment, the baseline time window is set to 30 seconds. The time-aligned data is then Z-score normalized, that is, each parameter is subtracted from its sliding window mean and divided by the sliding window standard deviation, where the sliding window length is the data from the most recent 72 hours.
[0032] The normalized data for each unit is input into a corresponding temporal feature extraction network for encoding. This network employs a Transformer-based encoder architecture, comprising four encoder layers, each containing an eight-head self-attention mechanism and a feedforward network. The input sequence length is the parameter data from the most recent 60 time steps, with the input dimension for each time step equal to the number of parameters for that unit. The multi-head self-attention mechanism simultaneously models correlations in both the temporal and parameter dimensions, capturing, for example, the temporal causal relationship between pH changes and coagulant dosage, and the dynamic coupling relationship between dissolved oxygen concentration and microbial activity indicators. The encoder's final output state feature vector has a 128-dimensional dimension, containing the dynamic operating state information of the unit within the recent time window.
[0033] Step S2: Set up decision agents for the preprocessing unit, biochemical unit and deep processing unit respectively. Each decision agent includes a policy network and a value network. The three decision agents interact with each other through a cascaded communication protocol, which includes a forward propagation channel and a reverse feedback channel.
[0034] Each decision-making agent's policy network employs a fully connected network structure with three hidden layers, each with dimensions of 256, 256, and 128. The activation function is the GELU (Gaussian Error Linear Unit) function. The input to the policy network is the concatenated state feature vector of the current unit along with the received cascaded communication signals. The output is the adjustment actions for each controllable parameter of the current unit. Specifically, the action space of the pretreatment unit's decision-making agent includes adjustments to the coagulant dosage, pH adjuster dosage, and hydraulic retention time; the action space of the biochemical unit's decision-making agent includes adjustments to the aeration rate, sludge return rate, and external carbon source dosage; and the action space of the advanced treatment unit's decision-making agent includes adjustments to the membrane backwashing frequency, reagent dosage, and membrane module operating flux. Each action is represented by a continuous value ranging from -0.3 to 0.3, indicating the adjustment magnitude relative to the current setpoint. The value network structure is the same as the policy network, and its output is a scalar state value estimate.
[0035] like Figure 2 As shown, the three decision-making agents interact bidirectionally via a cascaded communication protocol. The workflow of the forward propagation channel is as follows: After completing its current round of decision-making, the pretreatment unit's decision-making agent compresses the decision vector into a 64-dimensional communication vector through a linear projection layer. This communication vector contains three components: operational intent encoding, expected effect encoding, and constraint condition encoding, each occupying several dimensions. The operational intent encoding occupies the first 22 dimensions, representing the semantic encoding of operational intentions such as the direction of coagulant addition, pH adjustment, and residence time change trends. The expected effect encoding occupies the middle 21 dimensions, representing the expected range of suspended solids concentration, COD removal rate, and pH stability in the pretreatment unit's effluent. The constraint condition encoding occupies the last 21 dimensions, representing the pretreatment unit's suggestions or constraints to subsequent units, such as notifying the biological unit to pay attention to the risk of oil in the influent when the oil removal effect is limited. The biological unit's decision-making agent concatenates its own state feature vector with the received forward communication vector and inputs it into the policy network for comprehensive decision-making. After the decision is completed, it transmits the forward communication signal to the deep processing unit in the same way.
[0036] The workflow of the reverse feedback channel is as follows: The decision-making agent of the advanced treatment unit generates feedback optimization signals based on the current transmembrane pressure difference growth trend, the effluent quality compliance margin, and the reagent consumption rate. When the effluent compliance margin is insufficient, the feedback signal includes constraint codes requiring the upstream unit to increase the treatment depth; when membrane fouling accelerates, the feedback signal includes constraint codes requiring the upstream unit to reduce the effluent concentration of suspended solids and organic matter. After receiving the feedback signals from the advanced treatment unit, the biological treatment unit assesses its own adjustment capabilities. If there is still room for improvement in aeration and reflux ratio, it increases the treatment intensity. Simultaneously, it generates feedback signals for the pretreatment unit, guiding the pretreatment unit to improve coagulation efficiency or extend sedimentation time.
[0037] The timing mechanism of cascaded communication is as follows: within each decision cycle, forward propagation is executed first, followed by reverse feedback, forming a complete round of bidirectional communication. The decision cycle is set to 5 minutes, meaning that every 5 minutes, each decision agent updates its operation instructions based on the latest state observations and cascaded communication signals. Between two decisions, the control parameters of each unit remain unchanged or undergo a smooth transition according to linear interpolation of the previous decision instruction.
[0038] like Figure 5 As shown, within each decision cycle (5 minutes), the three unit decision-making agents engage in cascaded information exchange. The forward propagation channel propagates the decision vector and expected effluent feature vector along the direction of pretreatment unit → biochemical unit → deep treatment unit, with communication latency controlled within 50 milliseconds. Simultaneously, the reverse feedback channel starts from the deep treatment unit and sequentially transmits feedback optimization signals to the biochemical unit and pretreatment unit, forming a bidirectional coupling mechanism. When an anomaly is detected with an inflow shock, a cascaded response is triggered, with the midstream biochemical unit and the upstream pretreatment unit entering early warning and adjustment states respectively, achieving coordinated response throughout the entire process.
[0039] Step S3: Construct a global reward function to conduct collaborative training on the three decision agents. The global reward function includes three components: reward for achieving water quality standards throughout the entire process, reward for inter-unit collaboration, and penalty for global resource consumption.
[0040] The calculation method for the overall effluent compliance reward is as follows: Let the measured value of the i-th water quality indicator in the effluent from the deep treatment unit be c_i, and the corresponding discharge standard limit be L_i. Then, the compliance reward R_comply = sum_i(w_i * max(0, 1 -c_i / L_i)), where w_i is the weight coefficient of the i-th indicator. When all indicators satisfy c_i < L_i, R_comply is a positive value; when any indicator exceeds the standard, the corresponding item of the exceeding indicator becomes a negative value, and the overall reward decreases. In this embodiment, the monitored effluent indicators include five items: COD, ammonia nitrogen, total nitrogen, total phosphorus, and suspended solids, with corresponding weight coefficients set to 0.25, 0.20, 0.20, 0.20, and 0.15, respectively.
[0041] The calculation method for inter-unit synergy reward is as follows: For the pretreatment-biochemical interface and the biochemical-advanced treatment interface, the optimal influent range for subsequent units is defined respectively. Taking the pretreatment-biochemical interface as an example, the optimal influent COD concentration range for the biochemical unit is 200 to 400 mg / L, the optimal influent pH range is 6.8 to 7.5, and the optimal influent suspended solids concentration range is 50 to 150 mg / L. When all parameters of the pretreatment effluent fall within the optimal influent range of the subsequent unit, a positive synergy reward is given; the further away from the optimal range, the greater the penalty. The synergy reward R_coord = sum_j(alpha_j * exp(-beta_j *d_j^2)), where d_j is the deviation of the j-th parameter from the center of the optimal range, alpha_j is the reward weight, and beta_j is the penalty decay coefficient.
[0042] The global resource consumption penalty is calculated as follows: R_cost = -lambda_1 * C_chem - lambda_2 * E_aer - lambda_3 * F_wash, where C_chem is the normalized value of the total reagent consumption of all units, E_aer is the normalized value of the aeration energy consumption of the biochemical unit, F_wash is the normalized value of the membrane cleaning frequency of the deep treatment unit, and lambda_1, lambda_2 and lambda_3 are penalty coefficients, set to 0.15, 0.10 and 0.08 respectively.
[0043] The following describes a specific implementation method for multi-agent collaborative training. For example... Figure 3 As shown, the training adopts a centralized training and distributed execution paradigm, using a multi-agent proximal policy optimization algorithm for joint policy updates. The training data comes from the historical operation database of an industrial wastewater treatment plant, containing 18 consecutive months of actual operating data, covering normal operating conditions, seasonal water quality fluctuations, and multiple influent impact events. The training data is divided into a training set and a validation set according to time sequence, with the first 14 months of data serving as the training set and the last 4 months as the validation set. In the data preprocessing stage, outlier removal, missing value imputation, and standardization were performed on the original operating data. Data augmentation was also performed by adding Gaussian noise and temporal perturbations, resulting in a training sample size approximately 3.2 times that of the original data.
[0044] During training, the policy network and value network of the three decision agents are updated using the Adam optimizer with an initial learning rate of 2.3 × 10⁻⁴ and a cosine annealing decay strategy. The minimum learning rate is 1.0 × 10⁻⁵. The batch size is set to 256 time-step sequences, with each sequence consisting of 60 time steps. The total number of training epochs is 800, with each epoch iterating through all training data once. The pruning parameter epsilon for proximal policy optimization is set to 0.18, the discount factor gamma for generalized advantage estimation is set to 0.97, and the GAE parameter lambda is set to 0.93. The loss function for the value network is the mean squared error loss, while the loss function for the policy network is the pruned policy gradient loss plus an entropy regularization term. The entropy coefficient is initially set to 0.015 and decays linearly to 0.003 during training. An early stopping mechanism is used during training; training stops when the average round reward on the validation set fails to improve for 50 consecutive rounds. The training hardware configuration consisted of four NVIDIA A100 GPUs, and a single training session took approximately 45 minutes.
[0045] The evaluation metrics after training included: overall effluent compliance rate, inter-unit synergy score, and comprehensive operating cost per unit volume of treated water. On the validation set, the trained multi-agent system achieved an effluent compliance rate of 98.7%, an improvement of 4.2 percentage points compared to the independent optimization strategy of each unit; the inter-unit synergy score reached 0.83 (out of 1.0); and the comprehensive operating cost decreased by 11.6%.
[0046] Step S4: Initiate a tiered cascade response based on the results of abnormal influent water quality detection.
[0047] The water inflow anomaly detection module operates in parallel using a sliding window statistical test and an isolated forest algorithm. The sliding window statistical test uses data from the most recent two hours as a window, calculating the mean and standard deviation of each parameter. Newly acquired data is marked as potentially anomaly when its deviation from the window mean exceeds twice the standard deviation. The isolated forest algorithm uses anomaly scores in a multi-parameter joint space for judgment. The training samples are normal operation data from the most recent 30 days. New data points are marked as anomaly when their anomaly scores exceed a threshold of 0.72. The results of the two detection methods are combined using a logical OR relation to ensure the sensitivity of anomaly detection.
[0048] The classification rules for abnormal events are as follows: Level 1 abnormality corresponds to a parameter deviation between 2 and 3 times the standard deviation and a duration not exceeding 15 minutes; Level 2 abnormality corresponds to a parameter deviation between 3 and 5 times the standard deviation or a duration exceeding 15 minutes but not exceeding 45 minutes; Level 3 abnormality corresponds to a parameter deviation exceeding 5 times the standard deviation or the detection of a known inhibitory substance characteristic spectrum in the influent or a deviation lasting more than 45 minutes.
[0049] In the event of a Level 1 anomaly, the pretreatment unit's decision-making agent makes fine-tuning adjustments within its local strategy space, limiting the coagulant dosage adjustment to within ±10%. Simultaneously, it sends a warning signal containing the anomaly type and expected duration to the biological unit via the forward channel. Based on this, the biological unit appropriately increases the dissolved oxygen setpoint by 0.2 to 0.3 mg / L as a preventative measure. In the event of a Level 2 anomaly, the biological unit's decision-making agent feeds back the current load capacity of the microbial system to the pretreatment unit via the reverse channel. Based on this, the pretreatment unit dynamically adjusts the coagulant dosage (up to 1.8 times the normal value) and hydraulic retention time (up to 1.5 times the normal value). The biological unit simultaneously increases the aeration rate by 15% to 30% and appropriately increases the sludge return rate. In the event of a Level 3 anomaly response, the three decision-making agents switch to a pre-trained emergency strategy network, which is specifically trained for extreme influent conditions. The pretreatment unit initiates an emergency coagulation procedure and switches to the backup equalization tank to increase buffer capacity. The biochemical unit reduces the influent load to 60% of the normal value to protect the activated sludge system. The advanced treatment unit increases the dosage of chemicals to 1.5 times the normal value and reduces the membrane operating flux to mitigate membrane fouling.
[0050] After the anomaly subsides, the advanced treatment unit first confirms that the effluent quality has recovered to the standard and remains stable for 15 minutes. Then, it sends a recovery signal to the biological treatment unit via a reverse channel. Once the biological treatment unit confirms its own effluent stability, it gradually restores the aeration rate and reflux rate to normal levels and sends a recovery signal to the pretreatment unit. Finally, the pretreatment unit resumes its normal dosing strategy. The entire recovery process lasts approximately 30 to 60 minutes, employing a linear gradual change method to avoid secondary disturbances caused by sudden parameter changes.
[0051] Step S5: Deploy the inference computation of the three decision agents on edge computing nodes, and transmit cascaded communication signals between edge nodes via industrial Ethernet.
[0052] Each unit corresponds to one edge computing node, configured with an industrial-grade embedded GPU computing module, with a single policy network inference time of no more than 15 milliseconds. Edge nodes are directly connected via gigabit industrial Ethernet, with a single-hop transmission latency of no more than 5 milliseconds for cascaded communication signals. The total communication latency for completing one round of forward propagation and back-feedback is no more than 50 milliseconds, far below the timescale of a 5-minute decision cycle. The cloud server collects the latest running data from each edge node every 24 hours, fine-tunes and updates the policy network based on incremental learning, and the updated model parameters are distributed to the edge nodes via an encrypted channel during the low-load period in the early morning and hot-loaded to take effect.
[0053] like Figure 7As shown, the system adopts an edge-cloud collaborative deployment architecture, divided into three physical layers. The edge layer consists of three industrial control cabinets, corresponding to the preprocessing unit, biochemical unit, and deep processing unit, respectively. Each control cabinet integrates a GPU acceleration module, achieving real-time decision-making capability with a single inference time of less than 15 milliseconds. A safety constraint layer is set at the bottom of the control cabinet to perform boundary checks and anomaly interception on the decision output. The communication layer is a gigabit industrial Ethernet switch, connecting the three edge nodes via solid lines. The one-way communication latency is controlled within 5 milliseconds, supporting cascaded information interaction of forward propagation and backward feedback. The cloud layer is a server rack, responsible for global reward function calculation, MAPPO joint policy update, and model training tasks. After training is completed, the updated parameters are sent to the edge nodes.
[0054] The security constraint layer design includes three mechanisms. The communication interruption detection mechanism monitors the health of the cascaded communication link via heartbeat packets. The heartbeat cycle is 1 second, and a communication interruption is determined by the loss of three consecutive heartbeats. After a communication interruption, each decision agent immediately switches to an independent decision-making mode based on local observations. In this mode, the policy network only receives the state feature vector of its own unit as input, and the input position of the cascaded communication signal is filled with a zero vector. Simultaneously, a communication recovery process is initiated. After successful recovery, a transition period of one decision cycle is followed before switching back to the cascaded collaborative mode. The sensor anomaly detection and data reconstruction mechanism sets a physically reasonable range for each acquired parameter. Data exceeding this range is marked as anomaly. For short-term missing data (no more than 3 time steps), linear interpolation based on adjacent time step data is used for reconstruction. For data with longer-term missing data or persistent anomalies, estimation and reconstruction are performed using a correlation model of other parameters within the same unit. This correlation model is constructed based on the Pearson correlation coefficient between parameters in historical data. The action safety constraint mechanism performs boundary pruning on the actions output by each decision agent to ensure that the adjustment range of all control parameters does not exceed the safe operating range of the equipment. When the action output by the policy network exceeds the safety boundary, it is pruned to the boundary value and the pruning event is recorded for subsequent model optimization.
[0055] Example 2: In a preferred embodiment of the present invention, the generation mechanism and transmission process of the decision vector in the cross-unit bidirectional cascaded communication protocol are described in detail.
[0056] The high-level semantic decision vector transmitted in the cascaded communication protocol is generated by the policy network of each unit's decision agent. Specifically, after receiving the state feature vector of its unit, the policy network maps it to three subspaces through a multi-layer fully connected network, generating operation intention encoding, expected effect encoding, and constraint condition encoding, respectively. The operation intention encoding is a vector with dimensions between 16 and 32, obtained by encoding the action output of the policy network. The first half represents the category information of the operation direction, represented by an approximate one-hot encoding generated by Gumbel-Softmax, and the second half represents the continuous value of the operation intensity. The expected effect encoding is a vector with dimensions between 8 and 16, generated by the effect prediction branch in the policy network. This branch receives the concatenation of the current state feature vector and the action vector as input, and maps it through two layers of fully connected networks to encode the expected key parameters of the effluent (such as COD removal rate, ammonia nitrogen removal rate, and suspended solids removal rate). The expected values of each parameter are normalized and used as components of the encoding. The constraint is encoded as a vector with dimensions between 8 and 12, which is output by the constraint generation branch in the policy network through the Sigmoid activation function. The value of each component is between 0 and 1, representing the constraint strength of the current unit on a certain operation parameter of the adjacent unit.
[0057] Preferably, the generation process of the expected effect code incorporates inter-unit state dependency modeling based on a graph attention network. The preprocessing unit, biochemical unit, and deep processing unit are abstracted as three nodes in a graph structure. The features of each node are the state feature vectors of the corresponding unit, and the edges between nodes represent the physical connections and material flow directions between units. The graph attention network dynamically calculates the degree of attention each unit pays to the states of adjacent units through attention coefficients. The attention coefficients are calculated as follows: the source node feature vector and the target node feature vector are mapped by linear transformation matrices Ws and Wt respectively, concatenated, processed by the LeakyReLU activation function, and then output as a scalar attention score through a single-layer fully connected network. Softmax normalization is then applied to the attention scores of all incoming edges of the same target node. Preferably, the graph attention network adopts a two-layer structure, with each layer containing four attention heads. The output dimension of each attention head is 16, and the multi-head outputs are concatenated and then linearly transformed to reduce the dimensionality to the same dimension as the state feature vector. After aggregating the state information of adjacent units through the graph attention network, the decision-making agent of each unit can perceive the real-time state of downstream units when generating the expected effect code, thereby generating a more targeted expected water output code.
[0058] Furthermore, the transmission of decision vectors in the forward propagation channel follows a time-series scheduling mechanism. Within each decision cycle, the decision agent of the preprocessing unit first performs policy inference, generates a decision vector, and then sends it to the edge computing node of the biochemical unit via a dedicated VLAN channel of the industrial Ethernet. Upon receiving the preceding decision vector, the decision agent of the biochemical unit integrates it with the state feature vector of its own unit through a gating fusion network. The gating fusion network operates as follows: after mapping the preceding decision vector and the state feature vector of the current unit to the same dimension through linear transformation, it performs weighted fusion using a learnable gating vector. The gating vector is generated by concatenating two input vectors and passing them through a Sigmoid layer, with a value between 0 and 1, dynamically adjusting the extent to which the current unit accepts decision guidance from the preceding unit. The fused features are input into the policy network of the biochemical unit to generate the unit's decision vector, which is then passed to the deep processing unit. The end-to-end latency of the entire forward propagation process is controlled within 50 milliseconds.
[0059] In the reverse feedback channel, the decision-making agent of the deep treatment unit evaluates its own load status at the end of each decision cycle, calculating the ratio of current membrane flux to rated membrane flux, the ratio of reagent consumption rate to inventory, and the margins of each effluent indicator to the discharge limit. When any of the above margin indicators falls below a preset threshold, the deep treatment unit generates a feedback optimization signal. The encoding method of the feedback optimization signal is as follows: the load assessment result is mapped into a feedback vector with dimensions between 8 and 16 through a fully connected network. Each component of this vector corresponds to a specific adjustment suggestion direction, such as suggesting that the preceding unit increase the suspended solids removal rate or reduce the organic load in the effluent. After the feedback vector is transmitted to the biological unit through the reverse channel, the biological unit filters and translates the feedback signal according to its own adjustment space, generating a secondary feedback signal for the pretreatment unit. The filtering mechanism is implemented by performing element-wise multiplication of the feedback vector with the current adjustable space vector of the biological unit. The adjustable space vector is output by an auxiliary branch of the value network, representing the current margin of each control parameter from the safe operating boundary.
[0060] During the training phase, the decision vectors transmitted in the cascaded communication protocol participate in gradient backpropagation. Specifically, when adopting a centralized training distributed execution paradigm, the input to the global Critic network includes not only the state feature vectors and action vectors of each unit, but also the decision vectors sent and received by each unit through the cascaded channel. During training, the gradient of the global reward signal is backpropagated to the policy network of each agent through the Critic network. The decision vectors received through the communication channel partially allow gradient penetration, enabling upstream agents to learn to send decision vectors that are more beneficial to the global objective through downstream reward feedback. Preferably, during training, L2 norm clipping is applied to the gradients of the communication channel, with the clipping threshold set between 0.5 and 1.0 to prevent gradient propagation across agents from causing training instability. Training employs a multi-agent proximal policy optimization algorithm, collecting 2048 to 4096 experience trajectories per policy update cycle. The mini-batch size is set between 256 and 512, and the learning rate is set between 1e-4 and 5e-4 with a cosine annealing decay strategy. Training lasts for 2000 to 5000 policy update cycles. Every 200 cycles, collaborative performance is evaluated on a validation environment, and the optimal model checkpoint is selected based on the collaborative performance index.
[0061] The beneficial effects of the cascaded communication protocol are as follows: by transmitting high-level semantic decision vectors encoded by a policy network between units instead of raw monitoring data, the decision-making agents of each unit can obtain information on the operational intentions and expected effects of adjacent units while maintaining decision-making autonomy. This avoids the problem of global state space dimension explosion in centralized control schemes and overcomes the defect of conflicting optimization objectives among units in completely independent decision-making schemes. The introduction of a dynamic communication topology based on graph attention networks enables the decision vector generation process to adaptively adjust the degree of attention to the states of different adjacent units. When the downstream unit is under high load, the attention weight to the downstream state is automatically increased, resulting in more forward-looking operational decisions. The design of the gated fusion network allows the receiving agent to dynamically adjust the degree of acceptance of preceding decision signals according to the current context. When the guidance information provided by the preceding unit is inconsistent with the actual state of the current unit, the fusion weight is automatically reduced, ensuring robust operation of the system even when some communication information is distorted. When the proportion of samples of a certain type of abnormal working condition in the training data is less than 5% of the total sample size, the learning effect of the gradient penetration mechanism under that type of working condition may be affected. In this case, the limitation can be alleviated by oversampling rare working condition samples through the priority experience replay strategy.
[0062] From a principle perspective, the fundamental mechanism by which the bidirectional cascaded communication protocol achieves the aforementioned beneficial effects lies in the natural material flow coupling relationship between the various units in industrial wastewater treatment. The effluent from the preceding unit becomes the influent for the subsequent unit. This physical coupling determines the interdependence between the optimal operating parameters of each unit. In traditional independent control schemes, each unit makes decisions based solely on its local observations, essentially solving for a local optimum while ignoring inter-unit coupling constraints. The resulting solution is usually suboptimal from a global perspective. This scheme transmits the operational intent and expected effluent encoding of the upstream unit to the downstream via the forward channel. This is equivalent to introducing the upstream decision information as an additional constraint on the downstream optimization problem, enabling the downstream to anticipate influent change trends and make predictive adjustments. The reverse channel transmits the downstream load pressure and constraint requirements back to the upstream, essentially mapping the downstream's demand for influent quality into a gradient direction signal of the upstream operating parameters. This guides the upstream to produce effluent that is beneficial to downstream treatment while meeting its own compliance requirements. The role of graph attention networks in this process is to dynamically quantify the coupling strength between units. When a downstream unit is in a critical load state, the corresponding attention weight naturally increases, making the expected effect encoding generated upstream more inclined to reduce the pressure on the downstream. This adaptive mechanism enables the cascaded decision network to automatically adjust the coordination strength between units under different operating conditions.
[0063] Example 3: In another embodiment of the present invention, a centralized planning and distributed execution architecture based on a shared world model is used to replace the direct communication cascading mechanism between multiple agents in Example 1, thereby realizing the collaborative control of the entire industrial wastewater treatment process.
[0064] Specifically, a unified end-to-end world model is constructed on a cloud server. This world model, with an environmental dynamics prediction network at its core, receives the current state feature vectors of the pretreatment, biochemical, and deep treatment units, as well as the action vectors to be executed by each unit, as input. It predicts the next state of each unit after the execution of the action and the overall effluent quality. The environmental dynamics prediction network adopts an architecture based on a cyclic state-space model. It captures the deterministic dynamic characteristics and stochastic disturbance characteristics of the wastewater treatment process through parallel computation of deterministic and stochastic state paths. The deterministic state path uses gated cyclic units to model the temporal evolution of the states of each unit, while the stochastic state path learns the posterior distribution of the current state through variational inference to characterize process noise and measurement uncertainty.
[0065] Based on the world model, a centralized planning approach is adopted using a model predictive control framework. In each decision cycle, the planner uses the world model to simulate the state evolution for several future steps, with the number of steps set between 5 and 10, each corresponding to approximately 5 to 15 minutes of actual operation. During the simulation, the planner uses the cross-entropy method to jointly optimize the action sequences of the three units. The optimization objective is to maximize the expected value of the cumulative global reward over multiple steps, where the calculation method for the global reward is consistent with the global reward function in Example 1. The specific execution method of the cross-entropy optimization process is as follows: the action sequence distribution is initialized as a Gaussian distribution, 200 to 500 candidate action trajectories are sampled, the state evolution of each trajectory is simulated step by step in the world model, and the cumulative reward is calculated. The top 20% of elite trajectories in terms of reward are selected to update the mean and variance of the action distribution. This sampling-evaluation-update process is repeated for 3 to 5 rounds, and the mean of the final distribution is taken as the planned action sequence.
[0066] After planning is completed, only the first step of the action sequence in the three units is issued to the edge computing nodes of each unit for execution. Upon receiving the issued action command, each edge node converts the high-level action command into specific device control signals through its local action refinement network. This action refinement network is a lightweight two-layer fully connected network; its input is the concatenation of the issued high-level action vector and the real-time state vector of the current unit, and its output is the control parameters that directly affect the actuators. At the start of the next decision cycle, the planner re-acquires the latest state of each unit and re-executes the model predictive control flow, forming a closed loop of rolling optimization.
[0067] The world model is trained as follows: historical operational data under normal system operation and various abnormal conditions are collected as the training set, with a data size ranging from 100,000 to 500,000 time-series samples. Each sample contains synchronous state observations and corresponding action records of three units. The training objective is to minimize the weighted combination of the world model's single-step prediction error and multi-step cumulative prediction error, where the single-step error weight is set between 0.6 and 0.8, and the multi-step error weight is 1 minus the single-step weight. Preferably, during training, KL divergence regularization constraints are applied to random state paths to keep the KL divergence between the prior and posterior distributions within a reasonable range, preventing random paths from degenerating into deterministic paths or generating excessive variance. The world model is incrementally updated every 24 to 72 hours using newly collected operational data. During the update, deterministic path parameters are frozen, and only random path parameters are fine-tuned to maintain the model's memory of known dynamics while adapting to distribution drift caused by changes in water quality.
[0068] When dealing with water inflow anomalies, this implementation method achieves robust planning by introducing uncertainty in the duration of the anomaly into the simulation of the world model. Specifically, after the anomaly detection module identifies a water inflow anomaly, the planner randomly samples the number of steps of the anomaly duration in each round of cross-entropy optimization. This allows candidate action trajectories to be evaluated under different anomaly recovery time assumptions, and the final selected elite trajectory has the characteristic of being the best performing on average across multiple possible durations. This approach enables the system to make more robust response decisions when facing water quality shocks of uncertain duration. When the world model's prediction accuracy for a type of unencountered anomaly is insufficient, the reliability of the planning results may decrease. In this case, the system relies on the local safety constraint layer of each edge node to ensure that the control parameters do not exceed the physical safety range.
[0069] Example 4: This example provides an automated control system for the entire industrial wastewater treatment process, such as... Figure 4 As shown, the system includes a data acquisition layer, an edge decision-making layer, a cascaded communication layer, a cloud training layer, and a security layer.
[0070] The data acquisition layer is used to deploy multi-source sensor arrays in the pretreatment unit, biochemical unit, and advanced treatment unit to collect operational status data. After time alignment and normalization preprocessing, the raw data collected from each unit is encoded by a time-series feature extraction network based on an attention mechanism to generate state feature vectors for each unit. Specifically, the data acquisition layer includes a sensor interface module, a time alignment module, a normalization module, and a time-series feature extraction module. The sensor interface module is configured to receive data on influent flow rate, pH value, suspended solids concentration, oil concentration, COD concentration, and coagulant dosage from the pretreatment unit; dissolved oxygen concentration, mixed liquor suspended solids concentration, sludge return rate, effluent ammonia nitrogen concentration, effluent total nitrogen concentration, and microbial activity indicators from the biochemical unit; and membrane flux, transmembrane pressure difference, reagent dosage, effluent COD concentration, and effluent total phosphorus concentration from the advanced treatment unit. The time alignment module is configured to align sensor data with inconsistent sampling frequencies using a reference time window, averaging high-frequency sampling data within the window and supplementing low-frequency sampling data through linear interpolation. The normalization module is configured to perform Z-score normalization on the time-aligned data. The temporal feature extraction module is configured to be based on the Transformer encoder architecture, and to model the correlation in both the time and parameter dimensions simultaneously through a multi-head self-attention mechanism, generating a 128-dimensional state feature vector for each unit.
[0071] The edge decision layer is used to set up decision agents for the pretreatment unit, biochemical unit, and advanced treatment unit, respectively. Each decision agent includes a strategy network and a value network. Specifically, the edge decision layer includes a pretreatment decision module, a biochemical decision module, and an advanced treatment decision module, which are deployed on edge computing nodes close to the control cabinet of their respective units. The pretreatment decision module is configured to output the adjustment ratios for coagulant dosage, pH adjuster dosage, and hydraulic retention time through the strategy network, based on the unit's state feature vector and received cascaded communication signals. The biochemical decision module is configured to output the adjustment ratios for aeration rate, sludge return rate, and external carbon source dosage through the strategy network, based on the unit's state feature vector and received forward communication signals and back feedback signals. The advanced treatment decision module is configured to output the adjustment ratios for membrane backwashing frequency, reagent dosage, and membrane module operating flux through the strategy network, based on the unit's state feature vector and received forward communication signals. Each policy network adopts a fully connected network structure with 3 hidden layers, and the output value of each action ranges from -0.3 to 0.3.
[0072] The cascaded communication layer enables information exchange between the three decision-making agents via a cascaded communication protocol, which includes a forward propagation channel and a reverse feedback channel. The forward propagation channel transmits the decision vector and expected effluent feature vector of the preceding unit to the decision-making agent of the subsequent unit. The reverse feedback channel transmits the feedback optimization signal generated by the subsequent unit based on its own load status and effluent pressure compliance to the decision-making agent of the preceding unit. The decision signal transmitted in the cascaded communication protocol is a high-level semantic decision vector generated after processing by the policy network, containing three components: operation intention encoding, expected effect encoding, and constraint condition encoding. Specifically, the cascaded communication layer transmits communication vectors between edge computing nodes via industrial Ethernet, with a single-hop transmission delay of no more than 5 milliseconds, and a total communication delay of no more than 50 milliseconds for completing one round of forward propagation and reverse feedback. The cascaded communication layer also includes an anomaly cascaded response submodule, configured to trigger a corresponding level of cascaded response process based on the graded detection results of influent anomalies, enabling the three decision-making modules to coordinate their actions according to a preset graded response strategy.
[0073] The cloud-based training layer is used to construct a global reward function for collaborative training of the three decision-making agents. This global reward function comprises three components: a reward for achieving water quality standards across the entire process, a reward for inter-unit collaboration, and a penalty for global resource consumption. Specifically, the cloud-based training layer is deployed on a cloud server and configured to collect the latest operational data from each edge node every 24 hours. It incrementally learns and fine-tunes the policy network based on a multi-agent proximal policy optimization algorithm, and distributes the updated model parameters to the edge nodes via an encrypted channel during periods of low load. The cloud-based training layer adopts a centralized training-distributed execution paradigm, sharing global state information and global reward signals during the training phase for joint policy updates.
[0074] The safety assurance layer is used to automatically switch each decision-making agent to an independent decision-making mode based on its own unit's observations when the cascaded communication link experiences interruption or abnormal delay. When sensor data is abnormally missing, compensation is performed using a data reconstruction algorithm based on data from adjacent time points and the correlation between units. Specifically, the safety assurance layer includes a communication health monitoring module, a mode switching module, a data reconstruction module, and an action safety constraint module. The communication health monitoring module is configured to monitor the status of the cascaded communication link via heartbeat packets; continuous loss of heartbeats is considered a communication interruption. The mode switching module is configured to switch each decision-making agent to an independent decision-making mode after a communication interruption, and switch back to the cascaded collaborative mode after a transition period once communication is restored. The data reconstruction module is configured to reconstruct short-term missing data using linear interpolation, and to estimate longer-term missing data using a correlation model of other parameters within the same unit. The action safety constraint module is configured to perform boundary clipping on the actions output by each decision-making agent, ensuring that the adjustment range of control parameters does not exceed the safe operating range of the equipment.
[0075] Example 5: This example demonstrates the implementation process and technical effects of the above-mentioned automated control method for the entire industrial wastewater treatment process through a specific application case.
[0076] A comprehensive wastewater treatment plant in a chemical industrial park has a daily treatment capacity of 50,000 tons, receiving mixed industrial wastewater from multiple companies within the park. The influent water quality fluctuates drastically, with COD concentrations ranging from 800 to 3500 mg / L and ammonia nitrogen concentrations ranging from 30 to 120 mg / L. It also intermittently contains inhibitory substances such as surfactants and heavy metal ions. The plant employs a three-stage process: coagulation and sedimentation pretreatment + A2O biological treatment + ultrafiltration membrane deep treatment. Due to the complex sources of influent and the irregular discharge times of various companies, traditional threshold-based rules and single-unit PID control methods are insufficient to coordinate the treatment load distribution among the three units. This frequently leads to cascading problems between units, such as high suspended solids (SS) in the pretreatment effluent causing sludge bulking in the biological unit and high residual organic matter in the biological effluent accelerating membrane fouling.
[0077] After adopting the method of this invention, multi-source sensor arrays and edge decision nodes are deployed in three units respectively, and a cascaded communication protocol is established to achieve cross-unit collaborative decision-making. Before the system is put into operation, the multi-agent system is trained offline using 18 months of historical operating data from the plant. The training data covers normal operating conditions, seasonal water quality changes, and 12 recorded water inrush events. The training uses four GPUs for parallel computing, with a total training time of approximately 52 hours. After training is completed and the system performance is confirmed to meet expectations on the validation set, the policy network is deployed to the edge nodes to begin online operation.
[0078] The evaluation results during the three-month online operation period are as follows. Regarding the effluent compliance rate, the effluent compliance rate of the full-process collaborative control system using the method of this invention was 97.8%, with COD compliance at 98.4%, ammonia nitrogen at 99.1%, total nitrogen at 97.2%, total phosphorus at 98.6%, and suspended solids at 99.3%. In comparison, the plant previously operated using an independent PID control strategy for each unit, achieving an effluent compliance rate of 91.3% during the same period, with compliance rates for each indicator as follows: COD 93.1%, ammonia nitrogen 95.6%, total nitrogen 90.8%, total phosphorus 92.4%, and suspended solids 96.7%. The method of this invention improved the overall effluent compliance rate by 6.5 percentage points. Figure 8 As shown, the method of the present invention is significantly better than independent PID control in all five water quality indicators, with the most significant improvement in total nitrogen and total phosphorus (more than 6 percentage points), indicating that the cascade synergistic mechanism of the present invention has obvious advantages in the treatment of recalcitrant indicators.
[0079] To further verify the technical contributions of each component in the cascaded communication protocol, an ablation comparison experiment was conducted. After removing the reverse feedback channel and retaining only the forward transmission channel, the system's effluent compliance rate dropped to 95.1%, indicating that the reverse feedback mechanism contributed approximately 2.7 percentage points to the compliance rate improvement by constraining and guiding the upstream units. After removing the inter-unit coordination bonus component in the cascaded communication protocol, the system's effluent compliance rate dropped to 94.6%, and the inter-unit interface water quality fluctuation increased by approximately 38%, indicating that the coordination bonus effectively constrained the behavior of each unit focusing only on its own compliance while ignoring downstream receiving conditions. Simultaneously removing both the reverse feedback channel and the coordination bonus, the system degenerates into a loosely coupled mode with only forward information transmission, and the effluent compliance rate drops to 93.4%, approaching the level of independent control by each unit. Figure 9 As shown, the contribution of each cascaded component to the overall compliance rate increases in a stepwise manner, with the reverse feedback channel contributing the most (2.7 percentage points), accounting for 41.5% of the total improvement, which verifies the necessity of the bidirectional cascaded communication protocol.
[0080] In terms of operating costs, the method of this invention reduces the total consumption of reagents throughout the entire process by approximately 13.2%, with a 9.7% reduction in pretreatment coagulant consumption and an 18.4% reduction in deep treatment membrane cleaning reagent consumption. Aeration energy consumption in the biological treatment unit is reduced by approximately 8.5%. The overall operating cost is reduced by approximately 11.8% compared to an independent control strategy. The main reason for the cost reduction is that cascaded collaborative decision-making ensures that the pretreated effluent quality more consistently falls within the optimal influent range of the biological treatment unit, reducing the energy waste caused by passively increasing aeration due to influent fluctuations. Simultaneously, the reduction in residual organic matter in the biological effluent slows down the membrane fouling rate, reducing the membrane cleaning frequency from an average of once every 48 hours to once every 67 hours.
[0081] Regarding shock resistance, five Level II anomalies and two Level III anomalies occurred during online operation. In the five Level II anomalies, the method of this invention, under cascaded synergistic response, did not result in effluent exceeding standards, with an average recovery time of 35 minutes. In the two Level III anomalies, the first involved a sudden increase in influent COD to 4.2 times the normal value, accompanied by abnormal surfactant concentration. In Level III response mode, the effluent COD experienced brief fluctuations, but the peak value did not exceed 90% of the discharge standard, and it fully recovered after approximately 72 minutes. The second involved a sudden drop in influent pH to 3.8 lasting approximately 25 minutes. In emergency mode, the system increased neutralization and regulation through the pretreatment unit, combined with reduced load operation of the biological treatment unit, maintaining compliance with all effluent indicators, and returning to normal mode after approximately 55 minutes. In contrast, similar influent shocks in the plant's historical records, under independent control mode, resulted in effluent exceeding standards for an average of 2 to 4 hours. Figure 10 As shown, the present invention achieves significant reductions in all operating costs, with the membrane cleaning agent showing the largest reduction (18.4%) and the overall operating cost reduced by 11.8%. In terms of shock recovery time, the present invention shortens the average recovery time to 23.6% of that of an independent control system, which is attributed to the cascade response mechanism that can quickly mobilize resources across the entire process to cope with shocks.
[0082] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for fully automated control of the entire industrial wastewater treatment process, characterized in that, Includes the following steps: Step S1: Deploy multi-source sensor arrays in the preprocessing unit, biochemical unit, and deep processing unit respectively to collect operational status data. After time alignment and normalization preprocessing of the raw data collected by each unit, generate the state feature vector of each unit through the encoding of the temporal feature extraction network based on the attention mechanism. Step S2: Decision agents are set up for the preprocessing unit, biochemical unit, and deep processing unit respectively. Each decision agent includes a policy network and a value network. The three decision agents interact with each other through a cascaded communication protocol. The cascaded communication protocol includes a forward propagation channel and a reverse feedback channel. The forward propagation channel transmits the decision vector and expected effluent feature vector of the preceding unit to the decision agent of the subsequent unit. The reverse feedback channel transmits the feedback optimization signal generated by the subsequent unit based on its own load status and effluent compliance pressure to the decision agent of the preceding unit. The decision signal transmitted in the cascaded communication protocol is a high-level semantic decision vector generated after processing by the policy network, which includes three components: operation intention encoding, expected effect encoding, and constraint condition encoding. Step S3: Construct a global reward function to conduct collaborative training on the three decision agents. The global reward function includes three components: full-process water discharge standard achievement reward, inter-unit coordination reward, and global resource consumption penalty. Step S4: Initiate a tiered cascade response based on the influent water quality anomaly detection results; Step S5: Deploy the inference computation of the three decision agents on edge computing nodes, and transmit cascaded communication signals between edge nodes via industrial Ethernet.
2. The method according to claim 1, characterized in that, The attention-based temporal feature extraction network adopts a Transformer encoder-based architecture. It captures the temporal correlation and cross-parameter correlation between parameters through a multi-head self-attention mechanism, generating a state feature vector containing temporal dynamic information.
3. The method according to claim 1, characterized in that, The operation intention code indicates the direction and intensity of the operation planned to be performed by the current unit, the expected effect code indicates the water output characteristics that the current unit expects to achieve, and the constraint condition code indicates the operational constraint requirements of the current unit on the upstream or downstream units.
4. The method according to claim 1, characterized in that, The working mechanism of the forward transmission channel is as follows: After the decision-making agent of the preprocessing unit makes an operational decision, it transmits the decision vector and the expected effluent feature vector to the decision-making agent of the biochemical unit. The decision-making agent of the biochemical unit adjusts the control strategy based on its own state and previous decision information, and then transmits the adjusted decision vector and the expected effluent feature vector to the decision-making agent of the deep processing unit.
5. The method according to claim 1, characterized in that, The calculation method for the inter-unit coordination reward is as follows: a positive reward is given when the water discharge characteristics of the preceding unit are within the optimal water inflow range of the subsequent unit, and a penalty is given when it deviates from the optimal water inflow range; the collaborative training adopts a centralized training and distributed execution paradigm. During the training phase, the three decision agents share global state information and global reward signals, and perform joint policy updates through the Multi-Agent Proximal Policy Optimization (MAPPO) algorithm. During the execution phase, each decision agent makes decisions only based on its own local observations and the received cascaded communication signals.
6. The method according to claim 1, characterized in that, In step S4, real-time anomaly detection of influent water quality parameters is performed based on sliding window statistical test and isolated forest algorithm. Anomalies are classified into three levels according to their severity: Level 1 anomalies are slight fluctuations in parameters, Level 2 anomalies are significant deviations in parameters, and Level 3 anomalies are drastic mutations in parameters or the detection of substances that inhibit microorganisms (such as heavy metal ions, surfactants, etc.).
7. The method according to claim 6, characterized in that, In the event of a Level 1 anomaly, only the parameters are fine-tuned within the pretreatment unit, and an early warning signal is sent to the biological unit via the forward channel. In the event of a Level 2 anomaly, the pretreatment unit dynamically adjusts the coagulant dosage and hydraulic retention time based on the load capacity feedback from the biological unit, while the biological unit predictively adjusts the aeration intensity and sludge return rate. In the event of a Level 3 anomaly, the three decision-making agents switch to the emergency strategy network, the pretreatment unit maximizes the removal of inhibitory substances, the biological unit reduces its load, and the deep treatment unit increases the redundancy of reagent dosage.
8. The method according to claim 7, characterized in that, After the anomaly subsides, the three decision-making agents negotiate through cascading communication and gradually restore normal operation mode in the order of downstream recovery first and upstream adjustment later.
9. The method according to claim 1, characterized in that, A security constraint layer is set on each edge computing node. When the cascaded communication link is interrupted or delayed, each decision agent automatically switches to an independent decision-making mode based on local observation. When sensor data is abnormally missing, it is compensated by a data reconstruction algorithm based on adjacent time data and inter-unit correlation.
10. An automated control system for the entire industrial wastewater treatment process, characterized in that, include: The data acquisition layer is used to deploy multi-source sensor arrays in the preprocessing unit, biochemical unit and deep processing unit to collect operational status data. After time alignment and normalization preprocessing, the raw data collected by each unit is encoded by a time-series feature extraction network based on an attention mechanism to generate the state feature vector of each unit. The edge decision layer is used to set up decision agents for the preprocessing unit, biochemical unit and deep processing unit respectively. Each decision agent includes a policy network and a value network. The cascaded communication layer enables information exchange between three decision-making agents via a cascaded communication protocol. The cascaded communication protocol includes a forward propagation channel and a reverse feedback channel. The forward propagation channel transmits the decision vector and expected effluent feature vector of the preceding unit to the decision-making agent of the subsequent unit. The reverse feedback channel transmits the feedback optimization signal generated by the subsequent unit based on its own load status and effluent compliance pressure to the decision-making agent of the preceding unit. The decision signal transmitted in the cascaded communication protocol is a high-level semantic decision vector generated after processing by the policy network, which includes three components: operation intention encoding, expected effect encoding, and constraint condition encoding. The cloud training layer is used to construct a global reward function to conduct collaborative training of the three decision-making agents. The global reward function includes three components: reward for achieving water discharge standards throughout the entire process, reward for inter-unit coordination, and penalty for global resource consumption. The security layer is used to automatically switch each decision agent to an independent decision-making mode based on local observation when the cascaded communication link is interrupted or delayed. When sensor data is abnormally missing, it is compensated by a data reconstruction algorithm based on data from adjacent time points and the correlation between units.