Water-energy-medicine collaborative optimization method and system for sewage plant
By constructing a graph network structure model and a dynamically coupled graph neural network for a wastewater treatment plant, and combining multi-objective optimization functions and optimization algorithms, the problem of optimizing water quality, energy consumption, and reagents across the entire plant, which is difficult to achieve in existing technologies, is solved, thus realizing automated management and cost reduction throughout the entire process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUIZHOU UNIVERSITY OF FINANCE AND ECONOMICS
- Filing Date
- 2026-04-17
- Publication Date
- 2026-05-15
AI Technical Summary
Existing methods for optimizing the operation of wastewater treatment plants are insufficient to accurately model the dynamic coupling relationships across the entire plant, making it difficult to achieve comprehensive optimization of water quality compliance, energy consumption optimization, and rational use of chemicals, and thus failing to effectively reduce the cost per ton of water treated.
A graph network structure model of a wastewater treatment plant is constructed. By using a dynamically coupled graph neural network (GNN) model and combining multi-objective optimization functions and optimization algorithms, a water-energy-chemical synergistic optimization decision scheme is generated for the entire plant. The entire process is automated through data acquisition, model training, and optimization logic.
It enables accurate modeling of the dynamic coupling relationships between various process units in a wastewater treatment plant, reduces the cost per ton of water treated, improves the adaptability and robustness of optimization decisions, and provides technical support for refined operation management.
Smart Images

Figure CN122047656A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wastewater treatment technology, and in particular to a method and system for synergistic optimization of water, energy and chemicals in wastewater treatment plants. Background Technology
[0002] Wastewater treatment plants are an important part of urban infrastructure, responsible for purifying domestic and industrial wastewater to meet standards. Modern wastewater treatment systems typically include multiple process units such as pretreatment, primary sedimentation tanks, biological reactors, secondary sedimentation tanks, and advanced treatment, with complex hydraulic, biological, and chemical coupling relationships between these units.
[0003] Currently, the optimization of wastewater treatment plant operations mainly employs two approaches: mechanistic model-based and traditional data-driven model-based methods. Mechanistic model-based methods, such as the ASM model (activated sludge model), can describe the biodegradation process but struggle to accurately represent the multi-faceted coupling relationships across the entire plant. On the other hand, traditional data-driven models, such as neural networks or regression models, typically treat each process unit as an independent system, neglecting the dynamic transmission of influences between units.
[0004] In recent years, some studies have begun to introduce more complex algorithms to optimize wastewater treatment systems, such as fuzzy control and genetic algorithms. These methods have made progress in some aspects, such as the ability to optimize parameters for a single process unit (e.g., an aeration system). However, these methods still struggle to simultaneously consider the complex interactions between water quality, energy consumption, and chemicals. In particular, when the operation of a unit changes (e.g., adjusting the return ratio or aeration rate), this change can have a chain reaction on other units within the system through water flow, material migration, etc. Existing methods lack the ability to accurately model this "butterfly effect."
[0005] The main drawback of traditional methods is the difficulty in establishing a dynamic coupling model across the entire plant, which often limits optimization decisions to local systems and prevents true global collaborative optimization. Furthermore, due to the lack of accurate representation of the complex interactions between process units, existing methods struggle to achieve comprehensive optimization of energy consumption and reagent dosage while ensuring effluent quality, thus failing to effectively reduce the cost per ton of water treated. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a water-energy-chemical synergistic optimization method and system for wastewater treatment plants. This method can accurately model the dynamic coupling relationship between various process units within a wastewater treatment plant, achieve synergistic optimization of water quality compliance, energy consumption optimization, and rational use of chemicals throughout the plant, and effectively reduce the cost per ton of water treated.
[0007] To achieve the above objectives, the present invention provides a water-energy-chemical synergistic optimization method for wastewater treatment plants, comprising:
[0008] Data on the process flow and material transfer relationships between units of a wastewater treatment plant are obtained. A graph network structure model of the wastewater treatment plant is constructed by defining process units as nodes and material flow as edges. The graph data is then preprocessed to obtain dynamic coupled graph structure data of the wastewater treatment plant.
[0009] Based on the dynamic coupled graph structure data of the wastewater treatment plant, a dynamic coupled graph neural network (GNN) model architecture is constructed, which includes a node feature encoding layer, a temporal encoding module, a spatial message passing layer, and an attention mechanism layer. The model is trained using historical operating data to obtain a dynamic coupled GNN prediction model that can express the dynamic coupling relationship between process units.
[0010] Based on the dynamically coupled GNN prediction model, a water-energy-chemical synergistic multi-objective optimization function is constructed with the objective of minimizing the cost per ton of water treatment, and includes factors such as water quality compliance constraints, energy consumption, and chemical dosage. This results in a water-energy-chemical synergistic multi-objective optimization function for optimization decision-making.
[0011] Based on the water-energy-pharmaceutical synergistic multi-objective optimization function and the dynamically coupled GNN prediction model, the optimization algorithm is applied to solve for the optimal operating parameter settings of each process unit in the future time period, and to generate a water-energy-pharmaceutical synergistic optimization decision scheme for the entire plant.
[0012] Furthermore, the construction of the graph network structure model of the wastewater treatment plant and the preprocessing of the graph data to obtain the dynamically coupled graph structure data of the wastewater treatment plant include:
[0013] Based on the aforementioned process flow, design data, and mass transfer relationship data between each unit, the operating parameters and equipment parameters of the bar screen, biological tank, and secondary sedimentation tank are extracted as node features. The connection edges and edge weight attributes between nodes are determined according to the water flow, air flow, and sludge return relationships in the aforementioned mass transfer relationship data, resulting in a static graph structure.
[0014] Based on the static graph structure and time window parameters, a time slice subgraph is constructed, and an update mechanism for edge weights changing with time and a historical information encoding mechanism are designed to obtain a dynamic time-varying graph structure.
[0015] The dynamic time-varying graph structure is subjected to feature normalization, missing data processing, and outlier processing to obtain standardized dynamic coupling graph structure data of wastewater treatment plants.
[0016] Furthermore, the construction of a dynamically coupled graph neural network (GNN) model architecture, comprising a node feature encoding layer, a temporal encoding module, a spatial message passing layer, and an attention mechanism layer, and training the model using historical operating data, yields a dynamically coupled GNN prediction model capable of expressing the dynamic coupling relationships between process units, including:
[0017] Based on the dynamic coupled graph structure data of the wastewater treatment plant, a multilayer perceptron is used to perform nonlinear transformation on the original features of the nodes, and a recurrent neural network unit is used to encode the historical state sequence of the nodes to obtain the hidden state of the nodes containing spatiotemporal features.
[0018] The spatial messaging layer aggregates neighbor node information and uses a graph attention network mechanism to adaptively learn the importance of different neighbor nodes to obtain updated node features.
[0019] The updated node features are mapped to target predicted values, and the model is trained using the historical running data to obtain the dynamically coupled GNN prediction model.
[0020] Furthermore, the construction of a water-energy-chemical synergistic multi-objective optimization function, with the objective of minimizing the cost per ton of water treated, and incorporating factors such as water quality compliance constraints, energy consumption, and chemical dosage, yields a water-energy-chemical synergistic multi-objective optimization function for optimization decision-making, including:
[0021] Based on the dynamically coupled GNN prediction model, the effluent water quality indicators within the future time window are predicted, and a first sub-objective function is obtained with the goal of minimizing the deviation between the effluent water quality indicators and the standard values.
[0022] Based on the dynamic coupling GNN prediction model, the power and operating time of each device are predicted. By introducing the time-of-use electricity price factor, a second sub-objective function is obtained with the goal of minimizing energy consumption per unit of water treated.
[0023] Based on the aforementioned dynamically coupled GNN prediction model, the impact of different reagent dosages on the treatment effect is predicted, resulting in a third sub-objective function aimed at minimizing the reagent cost per unit volume of treated water.
[0024] Based on the first sub-objective function, the second sub-objective function, and the third sub-objective function, a weighted sum is performed on the first sub-objective function, the second sub-objective function, and the third sub-objective function. The energy cost, the reagent cost, and the water quality violation penalty are uniformly transformed into economic cost to obtain the water-energy-reagent synergistic multi-objective optimization function.
[0025] Furthermore, the application optimization algorithm solves for the optimal operating parameter settings of each process unit within a future time period, generating a plant-wide water-energy-chemical synergistic optimization decision scheme, including:
[0026] Based on the aforementioned water-energy-pharmaceutical synergistic multi-objective optimization function, a mathematical optimization model is established that includes constraints on equipment operating range, process parameters, and hydraulic balance, resulting in the mathematical optimization model.
[0027] Based on the mathematical optimization model, a multi-time-scale rolling optimization strategy is designed, and optimization variables at different time scales are determined to obtain the determined optimization variables.
[0028] Based on the mathematical optimization model and the determined optimization variables, a heuristic algorithm or decomposition strategy is selected according to the characteristics of the problem to solve the mathematical optimization model, obtain the optimal operating parameter settings of each process unit in the future time period, and generate the water-energy-pharmaceutical synergistic optimization decision scheme.
[0029] Furthermore, the step of training the model using historical operating data to obtain a dynamically coupled GNN prediction model capable of expressing the dynamic coupling relationship between process units includes:
[0030] Based on the dynamic coupling graph structure data of the wastewater treatment plant, cluster analysis is used to determine the cluster centers of each process parameter from the historical operation data. Hermite interpolation basis functions are constructed around the cluster centers. The Hermite interpolation basis functions and their corresponding derivative information are integrated into the message aggregation process of the spatial message passing layer to obtain the dynamic coupling GNN prediction model.
[0031] Furthermore, the construction of a water-energy-chemical synergistic multi-objective optimization function, with the objective of minimizing the cost per ton of water treated, and incorporating factors such as water quality compliance constraints, energy consumption, and chemical dosage, yields a water-energy-chemical synergistic multi-objective optimization function for optimization decision-making, including:
[0032] Based on the dynamically coupled GNN prediction model and the multi-source historical operation data of the wastewater treatment plant, a spatiotemporal matrix is constructed. The spatiotemporal matrix is decomposed using a smooth separable nonnegative matrix factorization algorithm to extract the basic operation modes of water, energy, and chemicals. Based on the basic operation modes, the cost per ton of water treated, water quality compliance constraints, and the weights of each sub-objective are reconstructed to obtain the water-energy-chemical synergistic multi-objective optimization function.
[0033] Furthermore, the application optimization algorithm solves for the optimal operating parameter settings of each process unit within a future time period, generating a plant-wide water-energy-chemical synergistic optimization decision scheme, including:
[0034] Based on the mathematical optimization model, the model is decomposed into multiple subdomains using the virtual element method. A coarse GDSW space is constructed by embedding the weights of the dynamically coupled GNN prediction model. A parallel solver is used to jointly solve each subdomain and the coarse GDSW space to obtain the water-energy-pharmaceutical collaborative optimization decision scheme.
[0035] Furthermore, it also includes:
[0036] Based on the aforementioned water-energy-pharmaceutical collaborative optimization decision-making scheme, a smart water affairs collaborative optimization system architecture is designed, comprising a data layer, a model layer, an application layer, and an integration layer. Data acquisition and processing logic is configured in the data layer, model training and optimization logic is configured in the model layer, and decision support and human-computer interaction logic is configured in the application layer, thus obtaining the smart water affairs collaborative optimization system architecture.
[0037] Based on the aforementioned smart water management collaborative optimization system architecture, computer programs corresponding to data acquisition and processing logic, model training and optimization logic, and decision support and human-computer interaction logic are developed and deployed to construct the aforementioned smart water management collaborative optimization system.
[0038] Based on the aforementioned smart water management collaborative optimization system, a communication connection is established with the existing control system of the wastewater treatment plant through the integration layer. The water-energy-chemical collaborative optimization decision scheme is converted into control commands and sent to the existing control system, thereby realizing the water-energy-chemical collaborative optimization of the wastewater treatment plant.
[0039] This invention also provides a wastewater treatment plant water-energy-chemical synergistic optimization system, comprising:
[0040] The dynamic coupling graph construction module is used to obtain the process flow and material transfer relationship data between units of the wastewater treatment plant. By defining process units as nodes and material flow as edges, a graph network structure model of the wastewater treatment plant is constructed, and the graph data is preprocessed to obtain the dynamic coupling graph structure data of the wastewater treatment plant.
[0041] The GNN model module is used to construct a dynamic coupled graph neural network (GNN) model architecture based on the dynamic coupled graph structure data of the wastewater treatment plant. This architecture includes a node feature encoding layer, a temporal encoding module, a spatial message passing layer, and an attention mechanism layer. The model is trained using historical operating data to obtain a dynamic coupled GNN prediction model that can express the dynamic coupling relationship between process units.
[0042] The optimization function construction module is used to construct a water-energy-chemical synergistic multi-objective optimization function based on the dynamically coupled GNN prediction model. The function aims to minimize the cost per ton of water treatment and includes factors such as water quality compliance constraints, energy consumption, and chemical dosage. The resulting water-energy-chemical synergistic multi-objective optimization function is used for optimization decision-making.
[0043] The decision generation module is used to solve the optimal operating parameter settings of each process unit in the future time period based on the water-energy-pharmaceutical synergistic multi-objective optimization function and the dynamic coupling GNN prediction model, and generate a water-energy-pharmaceutical synergistic optimization decision scheme for the entire plant.
[0044] The wastewater treatment plant water-energy-chemical synergistic optimization method and system provided by this invention have the following beneficial effects:
[0045] 1. By defining each process unit of the wastewater treatment plant as a node and the material flow as an edge, a graph network structure model covering the entire plant is constructed, which can accurately represent the complex dynamic coupling relationship between process units.
[0046] 2. A dedicated dynamic coupling graph neural network model was designed, which can learn the dynamic coupling rules between process units from historical data and achieve accurate prediction of system behavior;
[0047] 3. A multi-objective optimization function for water-energy-chemical synergy was constructed with the goal of minimizing the cost per ton of water treated. This function comprehensively considers the balance between water quality compliance, energy consumption, and chemical dosing, achieving true plant-wide synergistic optimization.
[0048] 4. A multi-timescale rolling optimization strategy was designed, which can adapt to the dynamic characteristics of different time scales in the wastewater treatment system and improve the adaptability and robustness of optimization decisions.
[0049] 5. A complete intelligent water affairs collaborative optimization system was developed, realizing full-process automation from data collection and model training to optimization decision-making, providing technical support for the refined operation and management of sewage treatment plants. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart of the wastewater treatment plant water-energy-chemical synergistic optimization method provided in the embodiments of the present invention;
[0052] Figure 2 This is a flowchart of the method for constructing a water-energy-pharmaceutical synergistic multi-objective optimization function provided in an embodiment of the present invention;
[0053] Figure 3 This is a schematic diagram of the water-energy-chemical synergistic optimization system for wastewater treatment plants provided in an embodiment of the present invention. Detailed Implementation
[0054] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0055] Example 1:
[0056] like Figure 1As shown, this embodiment provides a water-energy-chemical synergistic optimization method for wastewater treatment plants, including:
[0057] Step S1: Obtain the process flow and material transfer relationship data between each unit of the wastewater treatment plant. Construct a graph network structure model of the wastewater treatment plant by defining the process unit as a node and the material flow as an edge. Preprocess the graph data to obtain the dynamic coupled graph structure data of the wastewater treatment plant.
[0058] Step S2: Based on the dynamic coupling graph structure data of the wastewater treatment plant, construct a dynamic coupling graph neural network (GNN) model architecture that includes a node feature encoding layer, a temporal encoding module, a spatial message passing layer, and an attention mechanism layer. Use historical operating data to train the model and obtain a dynamic coupling GNN prediction model that can express the dynamic coupling relationship between process units.
[0059] Step S3: Based on the dynamically coupled GNN prediction model, construct a water-energy-chemical synergistic multi-objective optimization function with the objective of minimizing the cost per ton of water treatment, and including water quality compliance constraints, energy consumption, and chemical dosage factors, to obtain the water-energy-chemical synergistic multi-objective optimization function for optimization decision-making;
[0060] Step S4: Based on the water-energy-pharmaceutical synergistic multi-objective optimization function and the dynamically coupled GNN prediction model, apply the optimization algorithm to solve for the optimal operating parameter settings of each process unit in the future time period, and generate a water-energy-pharmaceutical synergistic optimization decision scheme for the entire plant.
[0061] In this embodiment, the construction of the graph network structure model of the wastewater treatment plant and the preprocessing of the graph data to obtain the dynamically coupled graph structure data of the wastewater treatment plant include:
[0062] Based on the aforementioned process flow, design data, and mass transfer relationship data between each unit, the operating parameters and equipment parameters of the bar screen, biological tank, and secondary sedimentation tank are extracted as node features. The connection edges and edge weight attributes between nodes are determined according to the water flow, air flow, and sludge return relationships in the aforementioned mass transfer relationship data, resulting in a static graph structure.
[0063] Based on the static graph structure and time window parameters, a time slice subgraph is constructed, and an update mechanism for edge weights changing with time and a historical information encoding mechanism are designed to obtain a dynamic time-varying graph structure.
[0064] The dynamic time-varying graph structure is subjected to feature normalization, missing data processing, and outlier processing to obtain standardized dynamic coupling graph structure data of wastewater treatment plants.
[0065] Specifically, firstly, a comprehensive analysis of the wastewater treatment plant's process flow diagram and design data is required to clearly identify all key process units constituting the treatment system. These units include the influent pumping station, bar screen, grit chamber, primary sedimentation tank, biological treatment tank (usually divided into anaerobic, anoxic, and aerobic zones), secondary sedimentation tank, advanced treatment units (such as membrane filtration, ozone contact tank, activated carbon adsorption, etc.), and sludge treatment units (such as thickening tank, digester, dewatering room, etc.). Each process unit will serve as a node in the graph network, representing the basic treatment stage in the system.
[0066] For each identified process unit node, a multi-dimensional feature vector needs to be extracted to comprehensively characterize its process characteristics and operating status. These features are mainly divided into three categories: operating parameters, equipment parameters, and design parameters. Operating parameters include water quality indicators (such as COD, BOD, NH3-N, TP, etc.), process control indicators (such as dissolved oxygen DO, mixed liquor suspended solids concentration MLSS, sludge age SRT, hydraulic retention time HRT, etc.), and environmental indicators (such as temperature, pH value, etc.). Equipment parameters include indicators directly related to energy consumption, such as blower power, water pump power, agitator power, sludge pump power, etc. Design parameters include physical and geometric characteristics such as tank volume, effective water depth, and surface loading. These features are obtained by extracting data from SCADA systems, online instruments, and laboratory testing data to form a high-dimensional feature vector describing the state of each node.
[0067] To ensure the completeness of feature representation, it is also necessary to integrate features from different time scales. For example, for biochemical pool nodes, it is necessary not only to extract the instantaneous DO value, but also to calculate statistical features such as the 24-hour average DO value and fluctuation range; it is also necessary not only to record the current MLSS concentration, but also to extract its changing trend. This multi-time-scale feature extraction helps subsequent models better capture the dynamic characteristics of the system.
[0068] Second, after defining the nodes in the graph network, the next step is to establish the connections between the nodes, i.e., the edge structure of the graph. Edges represent the material flow and energy transfer paths between process units and are a direct reflection of the coupling relationships in the wastewater treatment system. In wastewater treatment plants, there are four main types of basic edges: water flow edges, air flow edges, sludge return edges, and chemical dosing edges.
[0069] The water flow path represents the flow path of water within the treatment system, representing the most basic connection, such as water flow from the primary sedimentation tank to the biological treatment tank, or from the biological treatment tank to the secondary sedimentation tank. The water flow path carries various pollutants and nutrients from the water and is the main pathway for material transfer between process units. The airflow path mainly exists in aeration systems and represents the transport path of gases (primarily oxygen), such as the airflow from the blower to the aerobic zone of the biological treatment tank. The airflow path directly affects the efficiency and energy consumption of the biochemical reaction. The sludge return path represents the sludge circulation path in the system, such as the sludge returned from the secondary sedimentation tank to the biological treatment tank, or the internal return from the anaerobic zone to the anoxic zone of the biological treatment tank. Sludge return is crucial for maintaining the system's microbial community structure and treatment efficiency. The chemical addition path represents the path for adding chemical agents, such as adding coagulants to the primary sedimentation tank, or adding carbon sources or phosphorus removal agents to the biological treatment tank.
[0070] Assigning appropriate weights to each type of edge is crucial for constructing an effective graph network model. Edge weights represent the strength of a connection or the degree of influence, reflecting the magnitude of the source node's impact on the target node. For example, the weight of a sludge return edge can be related to the return ratio, indicating the strength of the sludge return's influence on the biological system; the weight of an airflow edge can be related to the aeration rate, indicating the degree of oxygen supply's influence on the biological reaction. These weights can be initialized in three ways: manually set based on expert knowledge, calculated using process design parameters, or determined through statistical correlation analysis of historical data. During subsequent model training, these initial weights will be further optimized and adjusted based on data to more accurately reflect the strength of coupling relationships in the actual system.
[0071] Third, a key characteristic of wastewater treatment systems is that their coupling relationships are not static but dynamically changing over time. Fluctuations in influent water quality, changes in water volume, seasonal temperature variations, and adjustments to process parameters all lead to changes in the coupling relationships between process units. To accurately capture this dynamic characteristic, a specialized time-varying diagram structure mechanism needs to be designed.
[0072] The first step in designing a dynamic time-varying graph structure is the division of time windows and the construction of time-slice subgraphs. Based on the characteristics of the wastewater treatment system, multiple time-scale windows can be set, such as hourly (suitable for capturing the effects of rapidly changing parameters like DO and reflux ratio), daily (suitable for capturing the effects of moderately changing parameters like MLSS and SRT), and monthly (suitable for capturing the effects of slowly changing parameters like temperature and microbial community structure). Within each time window, a corresponding time-slice subgraph is constructed, where nodes remain unchanged, while the existence and weights of edges may change over time.
[0073] The dynamic edge weight update mechanism is the core of the time-varying graph structure. This mechanism allows the edge weights to be automatically adjusted according to the current system state, reflecting real-time changes in coupling strength. For example, during the cold season, the nitrification rate decreases, and the weight of the DO level in the biological treatment tank on the effluent ammonia nitrogen should automatically increase; during the rainy season, the hydraulic load increases, affecting the solid-liquid separation effect in the sedimentation tank, and the weight of the overflow rate of the secondary sedimentation tank on the effluent suspended solids should be automatically adjusted. This dynamic edge weight can be achieved by designing a time-dependent weight function, which takes the current system state parameters as input and outputs the corresponding edge weight values.
[0074] Historical information encoding is another crucial component of time-varying graph structures. Wastewater treatment systems exhibit significant historical dependencies; the current state is influenced not only by the current input but also by the significant impact of historical states. To capture this historical dependency, the historical state information of nodes needs to be encoded into the current node features. This can be achieved through temporal feature engineering, such as calculating moving averages, rates of change, and periodic patterns of parameters, or by designing specialized temporal encoders (such as recurrent neural network units) to extract the implicit representations of historical sequences, and then incorporating this historical information as part of the node's current features.
[0075] Dynamic time-varying graph structures also need to consider event-triggered structural adjustment mechanisms. Certain special events (such as equipment failure, process adjustments, sudden pollution, etc.) may cause significant changes in the system's coupling relationships. To address this, an event detection and dynamic graph structure adjustment mechanism is designed to automatically update the graph structure when a specific event is detected, such as adding special edges, adjusting weight distribution, or modifying node characteristics.
[0076] Fourth, the completed dynamically coupled graph structure needs to be stored and managed in a data format suitable for graph neural network processing. Standard graph data representations include node feature matrices, adjacency matrices (or edge lists), and edge feature matrices. Each row of the node feature matrix corresponds to a process unit node, and each column corresponds to a feature dimension of that node. The adjacency matrix represents the connection relationships between nodes, where element values can be binary (indicating whether a connection exists) or weighted (indicating the strength of the connection). The edge feature matrix contains attribute information for each edge, such as the edge type and physical meaning.
[0077] For time-varying graph structures, a time dimension data representation is also required. This can be achieved by representing the time-varying adjacency matrix as a three-dimensional tensor (node × node × time), or by representing the dynamic graph structure through an edge list with timestamps. Simultaneously, an efficient data indexing mechanism needs to be designed to enable rapid access to graph structure data at specific points in time or time windows.
[0078] After data storage is complete, comprehensive preprocessing of the graph data is required to improve the efficiency and accuracy of subsequent model training. Feature normalization is a necessary preprocessing step, including min-max normalization, Z-score standardization, or quantile-based normalization, enabling features of different dimensions and ranges to be compared and processed on the same scale. For wastewater treatment data, the magnitudes of various indicators vary greatly (e.g., DO is typically in the range of 0-10 mg / L, while COD may range from tens to thousands of mg / L), making normalization particularly important.
[0079] Missing data handling is a key challenge in wastewater treatment data preprocessing. Missing data can be caused by sensor malfunctions, routine maintenance, or inconsistent sampling intervals. Depending on the missing pattern and proportion, various strategies can be employed: simple interpolation methods (such as linear interpolation and spline interpolation) are suitable for short-term missing data; imputation methods based on historical patterns (such as pattern imputation based on similar days) are suitable for regular missing data; and advanced missing value estimation methods (such as estimation based on multivariate statistics or machine learning) are suitable for missing data with complex patterns. In some cases, special graph neural network architectures can be designed to directly process inputs with missing values, avoiding biases that might be introduced by pre-imputation.
[0080] Outlier detection and handling are crucial for ensuring data quality. Outliers in wastewater treatment data may originate from instrument malfunctions, operational errors, or genuine process anomalies. Statistical methods (such as the 3σ rule and box plots), density-based methods (such as DBSCAN), or model-based methods (such as autoencoders and isolated forests) can be used to identify outliers in a multidimensional feature space. For detected outliers, options include direct removal, replacement with estimated values, or retention but labeling as anomalies (allowing the model to learn anomaly patterns). In wastewater treatment scenarios, some "anomalies" may represent significant process events (such as equipment failure or influent impact), therefore, anomaly handling requires caution to avoid losing valuable information.
[0081] Enhancing raw features through feature engineering is also a crucial part of data preprocessing. This includes generating derived features (such as parameter ratios, rates of change, etc.), extracting time-series features (such as trends, periodicity, autocorrelation, etc.), and creating interactive features (capturing the interaction effects between different parameters). Especially for systems like wastewater treatment with complex nonlinear relationships, effective feature engineering can significantly improve model performance.
[0082] After the above preprocessing, the final output is a standardized dynamic coupling graph structure dataset of a wastewater treatment plant, providing a high-quality data foundation for the next step of graph neural network model design and training. This data will be input into the subsequent GNN model in batch or stream processing to support the modeling and prediction of dynamic coupling relationships in the wastewater treatment system.
[0083] Fifth, the dynamic coupled graph structure can be mathematically represented as a time-varying weighted directed graph G(t)=(V, E(t), W(t),X(t)), where V is the set of process unit nodes, which remains unchanged; E(t) is the set of edges at time t, representing the connection relationship between units; W(t) is the edge weight matrix at time t, representing the connection strength; and X(t) is the node feature matrix at time t, containing the state information of each node.
[0084] The dynamic coupled graph structure of wastewater treatment plants exhibits multiple complexities: First, it is a heterogeneous graph containing various types of nodes (such as different process units) and edges (such as water flow edges, air flow edges, etc.); second, it is a dynamic graph, with node features and edge weights changing over time; and finally, it is a graph with long-term dependencies, where the current state is significantly influenced by historical states. This complex structure requires a specially designed graph neural network architecture for effective processing.
[0085] Sixth, to ensure the reliability of dynamically coupled graph structure data, a complete data quality assurance mechanism needs to be established. This includes data source verification (confirming the reliability of the data source), consistency checks (verifying the consistency between data from different sources), physical rationality verification (ensuring that the data conforms to physical laws such as the conservation of matter and energy), and spatiotemporal consistency analysis (verifying the continuity and rationality of the data in time and space).
[0086] A data quality scoring system also needs to be designed to assign a quality score to the graph data at each time point, enabling subsequent models to adjust their confidence levels based on data quality. For critical low-quality data segments, expert review and manual correction may be necessary to ensure that this critical data does not negatively impact model training.
[0087] By following the detailed steps above, high-quality dynamic coupling graph structure data for wastewater treatment plants can be constructed, laying the data foundation for water-energy-chemical synergistic optimization based on graph neural networks. This data structure can accurately express the complex dynamic coupling relationships between process units, effectively supporting subsequent model training and optimization decision generation.
[0088] In this embodiment, the construction of a dynamically coupled graph neural network (GNN) model architecture, comprising a node feature encoding layer, a temporal encoding module, a spatial message passing layer, and an attention mechanism layer, and the training of the model using historical operating data, yields a dynamically coupled GNN prediction model capable of expressing the dynamic coupling relationships between process units. This includes:
[0089] Based on the dynamic coupled graph structure data of the wastewater treatment plant, a multilayer perceptron is used to perform nonlinear transformation on the original features of the nodes, and a recurrent neural network unit is used to encode the historical state sequence of the nodes to obtain the hidden state of the nodes containing spatiotemporal features.
[0090] The spatial messaging layer aggregates neighbor node information and uses a graph attention network mechanism to adaptively learn the importance of different neighbor nodes to obtain updated node features.
[0091] The updated node features are mapped to target predicted values, and the model is trained using the historical running data to obtain the dynamically coupled GNN prediction model.
[0092] Specifically, firstly, based on the dynamic coupled graph structure of the wastewater treatment plant constructed in the previous step, a dedicated graph neural network model needs to be designed to fully capture the spatiotemporal coupling relationships between process units. Unlike traditional GNNs, the wastewater treatment system is unique in that it simultaneously possesses temporal dynamics, spatial connectivity, and multiple types of edge relationships. Therefore, a model architecture capable of handling these complex characteristics needs to be designed. This architecture consists of five key components, the functions and implementation methods of each component will be described in detail below.
[0093] First, the node feature encoding layer is responsible for converting the raw process parameters into hidden representations suitable for network processing. The raw features of each process unit node may contain 10-30 parameters of different scales and physical meanings, such as process indicators like DO, MLSS, and pH, as well as equipment parameters like blower power and pump flow rate. The node feature encoding layer adopts a multilayer perceptron (MLP) structure, mapping these heterogeneous features to a unified hidden space through multiple nonlinear transformations. Specifically, for each node's feature vector x... v The process is performed through 2-3 fully connected layers with activation functions, i.e., h v = MLP(x v Meanwhile, type-specific encoders are designed for different types of nodes (such as biological treatment tanks and secondary sedimentation tanks) to better preserve the feature information of various nodes. In addition, to address the common problem of missing values in wastewater treatment data, the encoding layer also integrates a feature reconstruction mechanism, which can infer complete feature representations from partial observation features.
[0094] The temporal coding module specifically handles the temporal evolution characteristics of node states. In wastewater treatment systems, the current state is often highly dependent on the historical state sequence; for example, the performance of a bioreactor is affected by the historical state of the microbial community, and the effect of a sedimentation tank is affected by historical hydraulic loads. To capture this temporal dependence, the temporal coding module uses a gated recurrent unit (GRU) or long short-term memory (LSTM) network structure to encode the historical state sequence of each node. Specifically, for the historical hidden state sequence of node v... , ..., The time-series encoded representation is obtained through processing by recurrent neural network units. To adapt to the multi-timescale characteristics of wastewater treatment systems (such as minute-level DO fluctuations, daily-level MLSS changes, and weekly-level microbial community evolution), a hierarchical time-series encoder was designed, which includes short-term memory units (capturing rapid changes) and long-term memory units (capturing slow changes), enabling the model to simultaneously perceive dynamic changes at different timescales.
[0095] The core innovation of Dynamically Coupled GNNs lies in the spatial message passing layer, whose design goal is to accurately model the spatial coupling relationships between process units. Unlike standard GNNs, message passing in wastewater treatment systems exhibits directionality (e.g., water flow direction), multiple types (water flow, air flow, sludge recirculation, etc.), and dynamic changes (coupling relationships change with operating conditions). To address this, a dedicated message passing mechanism is designed: First, type-specific message functions are defined based on edge types, such as the message function for water flow edges focusing on pollutant mass transfer, and the message function for air flow edges focusing on oxygen transfer efficiency; second, a dynamic edge weight update mechanism is designed, allowing edge weights to adaptively adjust according to the current system state; finally, multi-step message passing is implemented, allowing information to propagate multiple hops in the graph network and capturing indirect coupling relationships. Specifically, for node v, it receives messages from all neighboring nodes u and updates its own state, i.e., m... v = Aggregate({Transform(h u , e {u,v} ) for u inNeighbors(v)}), = Update(h v , m v ), where Transform is the message transformation function, Aggregate is the message aggregation function, and Update is the state update function.
[0096] The attention mechanism layer further enhances the model's ability to model complex coupling relationships. In wastewater treatment systems, the influence of different neighboring nodes on the current node is usually uneven. For example, the performance of a secondary sedimentation tank is more strongly affected by the state of the upstream biological treatment tank, while it is less affected by the downstream sludge treatment unit. The graph attention mechanism allows the model to adaptively learn this difference in the importance of influence. Specifically, an attention coefficient α is calculated for each edge (u,v). {u,v} The importance of node u to node v is represented by these attention coefficients, which are then used to weight and aggregate neighbor information. In this model, a multi-head attention mechanism is designed, allowing the learning of attention distributions from different perspectives, as well as a hierarchical attention structure, including node-level attention (focusing on which neighbor is more important), edge-type-level attention (focusing on which type of edge is more important), and time-dimensional attention (focusing on which historical moment is more important). Furthermore, attention regularization based on process knowledge is introduced to ensure that the learned attention distribution conforms to the physical meaning of the process.
[0097] The prediction output layer is responsible for mapping the final hidden state of nodes to the target predicted value. The design of the output layer is adjusted according to the different prediction tasks: for water quality prediction tasks (such as predicting effluent COD, ammonia nitrogen, etc.), a regression output head is designed; for operational condition classification tasks (such as determining whether the system is in a normal / abnormal state), a classification output head is designed; for multi-step prediction tasks, an autoregressive structure or a sequence-to-sequence structure is designed. To improve prediction accuracy, the output layer also integrates an uncertainty estimation mechanism, which can provide a confidence interval for each predicted value, helping operators assess the reliability of the prediction.
[0098] Second, high-quality training data is crucial for model success. Based on historical operational data, it is necessary to carefully prepare input-output data pairs that meet the training requirements of GNNs. Input data includes time-series graph structure data, specifically the node feature matrix, adjacency matrix, and edge feature matrix at each time point; output data includes target prediction values for future time points, such as water quality indicators, energy consumption data, or equipment status.
[0099] Constructing sequence samples using the sliding time window method is an effective approach for processing time series graph data. Specifically, the input window length T is set... in (e.g., the past 24 hours) and prediction window length T out (e.g., the next 6 hours), and then slide along the time axis, constructing a training sample from the data within each window. To increase the diversity of sample representation, the window sliding step size can be smaller than the window length, thus generating partially overlapping samples. In addition, special attention should be paid to seasonality and periodicity to ensure that the training data covers various seasonal conditions (e.g., high temperatures in summer, low temperatures in winter) and periodic changes (e.g., weekday / weekend traffic differences, intraday peak / valley changes).
[0100] Data augmentation techniques are an effective means of expanding the training sample set and are crucial for improving the model's generalization ability. In wastewater treatment scenarios, various augmentation strategies can be employed: adding Gaussian noise to simulate sensor measurement errors; randomly masking some features to simulate sensor malfunctions; applying time stretching / compression to simulate processing rate changes; generating synthetic anomaly samples to enhance the model's ability to identify abnormal situations; and using expert-guided data synthesis to generate synthetic data that conforms to physical constraints based on process rules. These augmentation techniques need to be applied cautiously to ensure that the generated samples are physically plausible and do not introduce misleading patterns.
[0101] For wastewater treatment scenarios, designing a specific data partitioning strategy is crucial. Unlike standard random partitioning, wastewater treatment data has strong temporal correlation, requiring a time-series partitioning approach: the first 70% of the data is used for training, the middle 10% for validation, and the last 20% for testing, arranged chronologically. This partitioning method can evaluate the model's ability to extrapolate over time and is more in line with real-world application scenarios. Furthermore, it is necessary to ensure that the data partitioning considers seasonal cycles, with validation and test sets including various seasonal and operating conditions to comprehensively evaluate the model's performance under different conditions.
[0102] During the training data preparation phase, special attention needs to be paid to label quality. Some key indicators from wastewater treatment plants may have low sampling frequencies (e.g., laboratory water quality testing typically occurs several times a day). Appropriate interpolation or alignment strategies need to be designed to match these low-frequency labels with high-frequency input features. Simultaneously, robust label handling mechanisms, such as anomaly detection and smoothing, should be implemented to address outliers and measurement errors in the labels, ensuring the model does not learn incorrect patterns.
[0103] Third, the designed dynamically coupled GNN model is fully trained using the prepared training dataset. The training process includes several key steps that need to be optimized and adjusted to suit the characteristics of the wastewater treatment system.
[0104] First, choosing a suitable optimization algorithm for the graph neural network is crucial. The Adam optimizer is typically used, as its adaptive learning rate characteristic is well-suited for handling the multi-scale features in wastewater treatment data. In the early stages of training, a large learning rate (e.g., 0.001) is used to quickly approach the optimal solution region, and then the learning rate is gradually reduced (e.g., to 0.0001) for fine-tuning. To address the potential gradient explosion problem in wastewater treatment data (such as rapid changes under extreme conditions), a gradient clipping strategy is implemented to limit the gradient norm within a reasonable range.
[0105] Designing an appropriate loss function is crucial for guiding the model to learn the correct patterns. The main loss functions consist of two parts: prediction error loss and regularization loss. Prediction error loss is selected based on the nature of the task; for example, mean squared error (MSE) or mean absolute error (MAE) is used for predicting continuous water quality indicators. For indicators with clear upper and lower limits (such as dissolved oxygen), a constrained loss function can be used. For joint prediction of multiple indicators, a weighted loss function is designed, assigning different weights according to the importance of the indicators. Regularization loss is used to introduce prior knowledge and constraints, including: graph structure regularization loss, which encourages the model to learn spatial dependencies that conform to the process flow; sparsity regularization, which prevents the model from over-relying on a single feature; smoothness regularization, which encourages the temporal smoothness of prediction results; and physical constraint regularization, which guides the model to learn representations that satisfy physical laws such as matter conservation and reaction kinetics. Through these composite loss functions, it is ensured that the model can both accurately fit the data and learn physically meaningful representations.
[0106] To address the computational challenges of processing large-scale graph data, a distributed training strategy is implemented. A complete graph model of a wastewater treatment plant may contain dozens of nodes, hundreds of edges, and thousands of time steps, resulting in enormous computational demands for direct training. A model parallelism strategy is employed, dividing the graph into multiple subgraphs for parallel processing on different computing devices; alternatively, a data parallelism strategy is used, processing different batches of samples on different devices and then merging the gradient updates. Simultaneously, efficient memory management strategies, such as gradient checkpointing, are implemented to strike a balance between saving intermediate results and recalculating, thus resolving the memory bottleneck issue in long-sequence training.
[0107] During training, model performance is monitored using a validation set, and a strict early stopping strategy is implemented to prevent overfitting. Specifically, the model is evaluated on the validation set after a certain number of training epochs (e.g., 10 epochs), and training is terminated when the validation loss fails to improve for multiple consecutive epochs (e.g., 5 epochs). For high-noise data such as wastewater treatment, the model is prone to overfitting to noise rather than the true pattern, making the early stopping strategy particularly important. Simultaneously, a model checkpoint saving mechanism is implemented, saving the model parameters with the best validation performance during training, rather than the parameters from the last epoch.
[0108] Hyperparameter optimization is used to find the most suitable model configuration for the current task. Key hyperparameters include: network architecture parameters (hidden layer dimension, number of attention heads, message passing steps, etc.), training parameters (learning rate, batch size, number of training epochs, etc.), and regularization parameters (weight coefficients of various regularization terms). Methods such as grid search or Bayesian optimization are used to find the optimal configuration in the hyperparameter space. Considering the complexity of wastewater treatment systems, different hyperparameter configurations may need to be optimized for different subsystems (such as bioreactor systems and sedimentation systems) or different prediction tasks (such as water quality prediction and energy consumption prediction).
[0109] Finally, to address the specific needs of wastewater treatment systems, incremental learning and online fine-tuning strategies are designed. Wastewater treatment processes may change with seasonal variations, equipment upgrades, or adjustments to treatment targets, and the model needs to be able to adapt to these changes. A mild online fine-tuning mechanism is designed to update the model with a small learning rate when new data becomes available, maintaining memory of historical patterns while adapting to new patterns. Simultaneously, knowledge distillation and model fusion strategies are implemented to integrate knowledge from multiple specialized models (such as models tailored to different seasons or operating conditions) into a unified model, improving the model's adaptability and robustness.
[0110] Through this series of training and optimization strategies, a GNN prediction model that can accurately express the dynamic coupling relationship between process units in a wastewater treatment plant is finally obtained, providing reliable prediction support for subsequent multi-objective optimization.
[0111] Fourth, a comprehensive and rigorous evaluation is conducted on the trained dynamically coupled GNN model to ensure its reliability and effectiveness in practical applications. The evaluation consists of three main aspects: performance evaluation, robustness testing, and interpretability analysis.
[0112] During the performance evaluation phase, various quantitative performance indicators are calculated using the retained test dataset. For regression-based prediction tasks (such as water quality indicators and energy consumption prediction), indicators such as root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R²) are calculated. For classification tasks (such as operating condition identification and anomaly detection), indicators such as accuracy, precision, recall, F1 score, and AUC are calculated. In addition to the overall performance evaluation, fine-grained evaluation is also required to analyze the model's performance under different conditions, such as different seasons (summer / winter), different load conditions (high load / low load), and different water quality conditions (normal / shock load), to identify the model's strengths and weaknesses. Special attention is paid to the model's predictive timeliness, evaluating short-term (e.g., within 1 hour), medium-term (e.g., within 24 hours), and long-term (e.g., within 7 days) predictive performance to determine the model's reliability within different prediction ranges.
[0113] Robustness testing is a crucial method for evaluating the reliability of a model in real-world applications. First, noise sensitivity testing is conducted by adding varying levels of noise to the test data to assess the stability of the model's predictions and ensure its resilience to sensor noise and measurement errors. Second, operational condition sensitivity testing is implemented to evaluate the model's adaptability to new operating conditions and extreme situations, such as handling high-concentration influent surges or partial equipment failures. Third, long-term stability testing uses long-term series data (e.g., months or years) to assess the long-term stability of the model's performance, ensuring it does not drift or degrade over time. Finally, adversarial testing attempts to construct boundary conditions that could cause model failure, verifying the model's robustness boundaries, which is particularly important for safety-critical wastewater treatment control. Through this series of rigorous tests, the adaptability and reliability limitations of the model are comprehensively evaluated, providing a basis for decision-making in practical deployment.
[0114] Interpretive analysis aims to reveal the process knowledge and coupling relationships learned within the "black box" GNN model, which is crucial for improving model credibility and supporting expert decision-making. First, attention weights are visualized to analyze the learned attention distribution and identify the most influential neighboring nodes and connection types for each node's prediction. For example, it might be found that effluent ammonia nitrogen in the biological treatment tank is mainly affected by DO levels and the state of the upstream denitrification zone, consistent with process knowledge. Second, feature importance analysis is performed, quantifying the contribution of each input feature to the prediction results through techniques such as ranking importance or SHAP values, identifying key control parameters. Then, node influence propagation path analysis is conducted, tracing the flow of information in the graph network to reveal indirect coupling relationships, such as how a parameter change affects distant nodes through multi-hop connections. Finally, counterfactual analysis is performed, simulating the model's response under different input conditions to explore "what if" scenarios, such as "how the effluent quality would change if the aeration rate were increased by 10%." This is invaluable for understanding the model's decision-making logic and supporting operational optimization.
[0115] Building upon interpretive analysis, specialized model interpretation tools were developed to support operators and process experts in understanding model predictions. These include interactive visualization dashboards displaying real-time predictions, attention distribution, and key influencing factors; process impact diagrams showing the propagation effects of parameter changes and supporting hypothesis-reasoning analysis; and natural language interpretation generators that translate model predictions into easily understandable textual descriptions, such as "Due to increased influent ammonia nitrogen and decreased temperature, it is anticipated that aeration will need to be increased to maintain effluent compliance." These interpretation tools not only enhance the transparency and credibility of the models but also help operators gain process insights from data-driven models, facilitating human-machine collaborative decision-making.
[0116] Through the comprehensive evaluation and interpretive analysis described above, it is ensured that the dynamically coupled GNN model not only possesses high predictive accuracy but also exhibits good robustness and interpretability, serving as a reliable foundation for subsequent water-energy-chemical synergistic optimization. This rigorous model validation and interpretation framework also lays a solid foundation for the deployment and application of the model in actual wastewater treatment plants.
[0117] Fifth, dynamically coupled graph neural networks (DNNs) offer several key advantages over traditional deep learning models, making them particularly suitable for the complexity of wastewater treatment systems. First, they possess an "inductive bias" advantage, meaning the model structure itself implicitly contains prior knowledge of the process flow topology, making learning more efficient. Second, they have "relational reasoning" capabilities, allowing the model to automatically discover and utilize implicit relationships between process units through message passing, without manual specification. Third, they have "transfer learning" potential; graph-based representation learning enables the model to transfer knowledge across wastewater treatment plants of different sizes or configurations, accelerating adaptation to new scenarios. Fourth, they offer "multi-task learning" convenience, allowing the same graph network framework to simultaneously predict multiple targets (water quality, energy consumption, equipment status, etc.), sharing underlying representations and improving overall performance.
[0118] Sixth, to further enhance the model's applicability in wastewater treatment, the dynamically coupled GNN model also includes several adaptive extensions. Heterogeneous graph processing capabilities allow the model to simultaneously handle different types of nodes (e.g., different process units) and edges (e.g., different transitive relationships), more accurately representing system complexity. The dynamic graph adaptive mechanism enables the model to handle graph structure changes caused by process adjustments, such as the addition of new treatment units or adjustments to connectivity. The uncertainty quantification framework allows the model to provide prediction confidence intervals, assessing risk during critical decision-making. Multi-source data fusion capabilities allow the model to integrate heterogeneous information such as online sensor data, laboratory testing data, and meteorological data to form a more comprehensive system representation. These extensions make the dynamically coupled GNN a comprehensive and flexible model framework capable of adapting to the complex and ever-changing operating environment of wastewater treatment plants.
[0119] Through this series of detailed design and optimization steps, a graph neural network model that can accurately capture the dynamic coupling relationship between process units in a wastewater treatment plant is finally obtained, providing a powerful prediction engine and decision support tool for subsequent water-energy-chemical synergistic optimization.
[0120] like Figure 2 As shown, in this embodiment, the construction of a water-energy-chemical synergistic multi-objective optimization function with the objective of minimizing the cost per ton of water treated, and incorporating factors such as water quality compliance constraints, energy consumption, and chemical dosage, yields a water-energy-chemical synergistic multi-objective optimization function for optimization decision-making, including:
[0121] Step S31: Based on the dynamically coupled GNN prediction model, predict the effluent water quality indicators within the future time window to obtain the first sub-objective function with the goal of minimizing the deviation between the effluent water quality indicators and the standard values.
[0122] Step S32: Based on the dynamically coupled GNN prediction model, predict the power and operating time of each device, introduce the time-of-use electricity price factor, and obtain the second sub-objective function with the goal of minimizing the energy consumption per unit of water treated.
[0123] Step S33: Based on the dynamically coupled GNN prediction model, predict the impact of different dosages of reagents on the treatment effect, and obtain a third sub-objective function with the goal of minimizing the reagent cost per unit volume of treated water.
[0124] Step S34: Based on the first sub-objective function, the second sub-objective function, and the third sub-objective function, perform a weighted summation of the first sub-objective function, the second sub-objective function, and the third sub-objective function, and uniformly convert the energy cost, the reagent cost, and the water quality violation penalty item into economic cost to obtain the water-energy-reagent synergistic multi-objective optimization function.
[0125] Specifically, firstly, based on wastewater discharge standards and environmental protection requirements, it is necessary to clearly define the compliance standards for effluent water quality from wastewater treatment plants. Specifically, effluent from urban wastewater treatment plants typically needs to meet the Class A standard or more stringent related standards stipulated in the Urban Wastewater Treatment Plant Pollutant Discharge Standard. Core control indicators include chemical oxygen demand (COD), biochemical oxygen demand (BOD5), ammonia nitrogen (NH3-N), total nitrogen (TN), total phosphorus (TP), suspended solids (SS), and pH value. Additionally, for specific industries or regions, there may be additional special indicator requirements, such as limits for heavy metals or specific organic compounds. Collecting and compiling these regulations and standards to establish a complete water quality indicator limit table serves as the basis for optimizing constraints.
[0126] The core of the water quality objective function is to minimize the deviation of effluent water quality indicators from standard values. First, a water quality prediction function needs to be constructed using a trained dynamically coupled GNN model. This function takes the current system state (such as the state parameters of each process unit, influent water quality, etc.) and control decisions (such as aeration rate, reflux ratio, and reagent dosage) as inputs to predict the effluent water quality time series within a future time window (such as the next 24 hours). Specifically, for each water quality indicator i (such as COD, NH3-N, etc.), the GNN model predicts the value at the next T time steps, forming a prediction sequence.
[0127] Based on the predicted time series of water quality indicators, a water quality deviation metric is designed. The standard deviation metric is calculated by summing the squared differences between the predicted and target values. However, considering the special characteristics of wastewater treatment, the following adjustments are necessary: First, an asymmetric penalty mechanism is introduced, imposing a higher penalty when the predicted value exceeds the standard limit and a lower penalty when the predicted value falls below the standard. Second, a safety margin coefficient is set so that the optimization objective is not merely to meet the standard, but to maintain a certain safe distance beyond that. Finally, considering the temporal stability of water quality indicators, large fluctuations in a short period are penalized, while stable compliance is encouraged.
[0128] Different water quality indicators have varying environmental impacts and treatment difficulties, thus requiring the design of a reasonable indicator weighting mechanism. Weights can be determined based on the following factors: the environmental sensitivity and ecological impact of the indicator (e.g., total phosphorus significantly affects eutrophication); the treatment difficulty and control cost of the indicator (e.g., the difficulty of removing ammonia nitrogen in winter); the regulatory focus of local environmental protection departments and the severity of penalties for exceeding standards; and historically challenging and highly volatile indicators. By comprehensively considering these factors, appropriate weight coefficients are assigned to each water quality indicator, constructing a weighted water quality objective function.
[0129] In addition to incorporating water quality as a component of the objective function, strict water quality constraints must be set to ensure that the effluent meets regulatory requirements under all circumstances. These constraints include: hard constraints—the predicted water quality indicators at any given time must not exceed the regulatory limits; soft constraints—a penalty function is used to significantly increase the cost when approaching the limits, forming a "safety buffer"; time-series constraints—the average value over a continuous period of time must meet the limit requirements, reflecting the composite sampling and testing methods commonly used by regulatory authorities; and stability constraints—limiting the fluctuation range of water quality indicators over a short period of time to ensure the stability of the treatment effect.
[0130] In practical implementation, to enhance the generalization and coping capabilities of the model, it is also necessary to consider the uncertainty of water quality prediction. This uncertainty can be incorporated into the optimization process by integrating multiple prediction models, considering historical prediction error distributions, or directly using prediction intervals (such as those obtained through quantitative regression forests or Bayesian neural networks). For example, constraints can be based on the upper limit of the 95% confidence interval of the prediction rather than point estimates to enhance the robustness of the decision; or different safety margins can be set for different levels of uncertainty, with larger safety margins for higher uncertainty levels.
[0131] Through the above steps, a first sub-objective function is obtained, which aims to minimize the deviation of the effluent water quality index from the standard value. This function considers both the compliance requirements and the treatment stability and safety margin, providing an optimization objective for the water quality dimension for collaborative optimization.
[0132] Secondly, wastewater treatment plants are typical high-energy-consuming facilities, with energy costs accounting for a large proportion of operating costs. Therefore, energy optimization has significant economic and environmental benefits. The first step is to comprehensively analyze the energy consumption composition of wastewater treatment plants, which mainly includes five categories: aeration system energy consumption (typically accounting for 50%-70% of total energy consumption, including blowers, surface aerators, etc.); pump system energy consumption (including influent pumps, return sludge pumps, internal return pumps, effluent pumps, etc.); mixing equipment energy consumption (including anaerobic and anoxic zone mixers, primary sedimentation tank scrapers, etc.); sludge treatment system energy consumption (including sludge dewatering, drying, and digestion, etc.); and auxiliary facility energy consumption (such as lighting, office space, and laboratories). For each category of energy consumption, equipment nameplate parameters, historical operating data, and energy consumption monitoring data are collected to establish a baseline energy consumption model.
[0133] An energy consumption prediction function is constructed using a dynamically coupled GNN model. This function takes control decisions (such as aeration rate, pump frequency, and agitator start / stop) and system states (such as water volume, water quality, and ambient temperature) as inputs to predict the power and operating time of each major device within a future time window, thereby calculating the total energy consumption. Specific energy consumption calculation modules need to be designed for different types of equipment: for variable frequency equipment (such as variable frequency fans and pumps), real-time power is calculated based on the speed-power curve; for fixed-frequency but intermittently operating equipment (such as some agitators), energy consumption is calculated based on the start / stop sequence; for continuously operating fixed-frequency equipment, energy consumption is calculated based on operating time and rated power. The total system energy consumption is obtained by summing the energy consumption of all equipment.
[0134] In energy optimization, introducing time-of-use (TOU) pricing is a key strategy for improving economic efficiency. Most regions in China implement TOU pricing policies, where electricity prices vary according to the time of day, typically divided into peak, off-peak, and valley periods, with peak-valley price differences reaching 2-3 times. This involves collecting TOU pricing tables from the local power grid and establishing a 24-hour price time-series matrix. Based on the price time-series and predicted energy consumption time-series, energy costs are calculated. The core strategy of energy optimization is "peak shaving and valley filling"—arranging high-energy-consuming operations during off-peak periods as much as possible to reduce energy consumption during peak hours.
[0135] When designing the energy objective function, multiple dimensions need to be considered. First, minimizing the energy consumption per unit of water treated (kWh / m³) is the basic objective, which is the core indicator for measuring energy efficiency. Second, minimizing energy costs is also considered, that is, optimizing equipment operating time and power settings to minimize electricity expenses while meeting treatment requirements. Third, the carbon emission impact of energy consumption is considered, calculating the carbon footprint caused by energy use based on the local power grid's carbon emission factor and incorporating it into the optimization considerations. Finally, the stability of energy use is considered to avoid drastic power fluctuations, extend equipment life, and reduce maintenance costs.
[0136] Energy optimization requires consideration of a series of practical constraints: equipment operation constraints (such as minimum / maximum power limits, start-stop frequency limits, etc.); process constraints (such as minimum aeration requirements, minimum reflux ratio requirements, etc.); system response constraints (such as the maximum rate of change of certain process parameters); and safety constraints (such as the minimum standby capacity that must be maintained). These constraints ensure that the optimization results are feasible and safe in practice.
[0137] Specific energy optimization strategies are designed to address the characteristics of wastewater treatment systems. For example, the "ammonia nitrogen-energy trade-off strategy" dynamically adjusts aeration intensity based on influent ammonia nitrogen load and effluent requirements, minimizing aeration energy consumption while ensuring ammonia nitrogen compliance; the "hydraulic-energy balance strategy" optimizes pump operation based on influent flow rate changes, minimizing pump energy consumption while ensuring hydraulic transmission; and the "sludge-energy synergy strategy" optimizes sludge treatment timing, scheduling energy-intensive dewatering operations during periods of low electricity prices.
[0138] Through the above steps, a second sub-objective function is obtained, which aims to minimize energy consumption per unit volume of water treated while also considering time-of-use electricity pricing. This function can minimize energy costs while ensuring treatment effectiveness, achieving a dual optimization of economic and environmental benefits.
[0139] Next, chemicals are crucial consumables in wastewater treatment. Proper use of chemicals can ensure treatment effectiveness while reducing operating costs and minimizing the environmental impact of chemicals. First, it's necessary to identify the main chemical usage stages and types in the wastewater treatment process. In typical wastewater treatment plants, the main chemicals include: coagulants (such as polyaluminum chloride (PAC), polyacrylamide (PAM), etc.), used to improve solid-liquid separation in primary and secondary sedimentation tanks; pH adjusters (such as lime, caustic soda, sulfuric acid, etc.), used to adjust the system pH and optimize biological treatment; phosphorus removal agents (such as ferric chloride, polyaluminum chloride, etc.), used for chemical phosphorus removal or enhanced biological phosphorus removal; carbon sources (such as methanol, sodium acetate, etc.), used to provide electron donors in the denitrification process; disinfectants (such as sodium hypochlorite, chlorine dioxide, etc.), used for effluent disinfection; and sludge conditioners (such as lime, ferric chloride, etc.), used to improve sludge dewatering performance. For each chemical, data on usage, unit price, application point, application method, and historical effects should be collected to establish a baseline model for chemical usage.
[0140] A chemical efficacy prediction function is constructed using a dynamically coupled Generative Neural Network (GNN) model. This function takes the dosage, timing, and location of the chemical as input variables to predict the impact of the chemical on the treatment effect, such as the effect of coagulants on SS removal rate and phosphorus removal agents on TP removal rate. The advantage of the GNN model lies in its ability to capture the complex nonlinear relationships between chemicals and water quality and process parameters, such as the interaction between chemical efficacy and factors like pH, temperature, and sludge characteristics. Based on the predicted chemical efficacy and the known unit price of the chemical, the chemical cost per unit of treatment effect is calculated as a basic metric for optimization.
[0141] A key characteristic of pesticide dosing optimization is the nonlinear nature of the "pesticide dosing response curve." Typically, the relationship between pesticide effect and dosage is not a simple linear one, but rather exhibits a typical "S-shaped curve" or "saturation curve"—the effect is significantly improved in the low dosage range; after reaching a certain threshold, the marginal benefit diminishes; and exceeding the optimal dosage may lead to overdosing and reduced effectiveness. By analyzing historical data or conducting small-scale experiments, a pesticide dosing response curve model can be constructed to identify the optimal dosing range, avoiding pesticide waste or poor results.
[0142] Another important dimension of reagent optimization is the synergistic and substitution relationships between different reagents. For example, in phosphorus removal, chemical phosphorus removal (reagents) and biological phosphorus removal (process control) can complement or partially substitute for each other; in pH adjustment, different alkaline or acidic reagents can be flexibly replaced based on price and availability. By analyzing these synergistic and substitution relationships, a reagent combination optimization model can be established to find the most economical reagent ratio scheme while ensuring treatment effectiveness.
[0143] The timing and method of chemical dosing are also crucial aspects of optimization. For example, based on the daily variation patterns of influent water quality, dynamic dosing strategies can be designed, increasing the dosage during high-load periods and reducing or stopping dosing during low-load periods. The type and dosage of chemicals can be adjusted according to seasonal changes; for instance, in winter, it may be necessary to increase carbon source dosage to maintain denitrification efficiency. Utilizing the time-series predictive capabilities of GNN models, feedforward control of chemical dosing can be achieved, adjusting chemical dosing in advance based on predicted future water quality changes, thereby improving response speed and treatment stability.
[0144] In optimizing pesticides, the environmental impact and sustainability of pesticide use must also be considered. The ecotoxicity, bioaccumulation, and residue risks of different pesticides should be assessed, and environmentally friendly pesticides should be prioritized. The carbon footprint of pesticide production and transportation should be considered, and the pesticide supply chain should be optimized to reduce environmental impact. The possibility of waste resource utilization should be explored, such as using waste (e.g., waste acid, waste alkali) as pH adjusters or using fermentation products as carbon sources to achieve a circular economy.
[0145] Based on the above considerations, an objective function is designed to minimize the chemical cost per unit volume of treated water. This function comprehensively considers the dosage, unit price of the chemical, treatment effect, and environmental impact, seeking the most economical and environmentally friendly chemical usage scheme while meeting treatment requirements.
[0146] Then, after constructing the three sub-objective functions of water quality, energy consumption, and chemicals, they need to be integrated into a unified water-energy-chemical synergistic multi-objective optimization function to support global optimization decisions. Multi-objective optimization is a methodology for handling decision problems with multiple conflicting objectives, which is particularly important in wastewater treatment scenarios because there is usually an inverse relationship between improving water quality, reducing energy consumption, and reducing chemicals.
[0147] The weighted summation method is the most direct approach in multi-objective optimization. It involves multiplying each sub-objective function by its corresponding weight coefficient and then summing the results to form a single objective function. In wastewater treatment optimization, the appropriate setting of weights is crucial and needs to reflect the strategic priorities and operational strategies of management. Weights can be determined based on the following dimensions: regulatory compliance—water quality targets are typically given higher weights to ensure compliance with discharge standards; economic efficiency—weights are allocated based on the proportion of energy and chemicals in the total cost; environmental impact—the overall environmental impact of each target is considered; and operational stability—targets that promote stable system operation are prioritized. By integrating these dimensions, an initial weight configuration can be determined, such as a possible weight allocation of: 50% for water quality targets, 30% for energy consumption targets, and 20% for chemical targets.
[0148] To make multiple objective functions with different dimensions and physical meanings comparable and integrated, unified quantification is required. The most effective method is to unify all objectives into economic costs, forming a comprehensive indicator of "cost per ton of water treated." Specific conversion methods include: energy costs—calculated directly based on predicted energy consumption and electricity prices; chemical costs—calculated based on predicted chemical dosage and unit price; water quality violation penalty costs—estimated based on predicted levels of water quality exceedances, combined with local environmental protection department penalty standards or excessive discharge fees; and indirect costs—considering the long-term cost impact of factors such as equipment wear and tear and increased maintenance needs. This unified economic cost framework allows different objectives to be compared and weighed on the same scale, facilitating decision-makers' understanding and evaluation of the comprehensive benefits of optimization schemes.
[0149] Another approach to multi-objective optimization is Pareto optimization, which seeks a set of non-dominated solutions such that improvement in any one objective necessarily leads to the deterioration of at least one other objective. In wastewater treatment optimization, a Pareto front is constructed to represent the optimal solution set in the three-dimensional space of water quality, energy consumption, and chemicals, providing decision-makers with diverse options. Based on the current operating strategy and external conditions, the solution that best meets the requirements is selected from the Pareto solution set as the final decision.
[0150] In actual operation, wastewater treatment plants face frequently changing external conditions, such as temperature variations due to seasonal changes, water volume fluctuations due to the rainy season, and pollutant concentration changes due to holidays. These changes affect the relative importance of each objective. Therefore, it is necessary to design an adaptive weight adjustment mechanism so that the optimization function can dynamically adjust the weight of each sub-objective according to external conditions. For example, in cold winters, nitrification weakens, so it may be necessary to increase the weight of water quality objectives to ensure ammonia nitrogen meets standards; during peak electricity consumption periods, it may be necessary to increase the weight of energy objectives to reduce peak energy consumption; and when chemical supplies are tight, it may be necessary to increase the weight of chemical objectives to optimize chemical usage efficiency.
[0151] The weight adjustment rules, triggered by design conditions, automatically adjust the weight configuration based on monitored key indicators (such as water temperature, influent load, and electricity price level). For example, when the water temperature is below 15℃, the water quality weight automatically increases by 10%; during peak electricity price periods, the energy consumption weight automatically increases by 15%; and when abnormal concentrations of harmful substances in the influent are detected, the water quality weight is automatically increased to ensure safe treatment. This dynamic adjustment mechanism ensures that the optimization strategy can adapt to changing environments and operational needs, maintaining the flexibility and adaptability of decision-making.
[0152] In addition to dynamic weight adjustment, a multi-timescale optimization framework needs to be designed. Different decision variables act on different time scales: fast-adjusting variables (such as DO setpoints) can be adjusted at the minute or hour level; medium-adjusting variables (such as reflux ratio) are suitable for daily optimization; and slow-adjusting programming variables (such as MLSS control targets) are adjusted at the weekly or monthly level. A hierarchical optimization structure is designed to process decisions at different time scales in layers, ensuring the temporal consistency of decisions and system stability.
[0153] Finally, robustness and uncertainty handling in optimization should be considered. Real-world wastewater treatment systems face various uncertainties, such as influent fluctuations, equipment performance variations, and measurement errors. Robust optimization methods should be employed to consider worst-case system performance, ensuring acceptable treatment results even under uncertain conditions. Alternatively, scenario analysis methods can be used to evaluate the performance of the optimization scheme under multiple possible scenarios, selecting a "robust" scheme that performs well under all conditions.
[0154] Through the detailed steps described above, a comprehensive water-energy-chemical synergistic multi-objective optimization function is finally constructed. This function can balance the three dimensions of water quality compliance, energy conservation, and chemical reduction, providing scientific decision support for the refined operation and management of wastewater treatment plants and achieving a win-win situation for both economic and environmental benefits.
[0155] Furthermore, the water-energy-pharmaceutical synergistic optimization function is not static but requires continuous adjustment and improvement based on system operation and changes in the external environment. A real-time monitoring and evaluation mechanism for the optimization function should be established to periodically compare optimization results with actual operational effects, identifying potential model biases or objective conflicts. A self-learning and adaptive mechanism for the optimization function should be designed to automatically adjust objective weights, constraint parameters, and prediction models based on the actual effects of historical optimization decisions, continuously improving optimization accuracy and applicability.
[0156] Simultaneously, expert rule bases are developed for specific operating conditions, such as rainy season operation strategies, low-temperature response strategies, and high-load shock treatment strategies. These rules allow for rapid switching to preset optimized configurations in special circumstances, ensuring the system's safe and stable operation. Through this continuous improvement and adaptive management, the water-energy-chemical synergistic optimization function can effectively guide the refined operation of wastewater treatment plants in the long term, maximizing technical, economic, and environmental benefits.
[0157] Finally, the ultimate goal of collaborative optimization is to support decision-making; therefore, a comprehensive benefit assessment system needs to be established to quantify the value of optimization solutions from multiple dimensions. Economic dimension assessment includes direct cost savings (reduction in energy and chemical costs) and indirect economic benefits (extended equipment lifespan, reduced maintenance costs, avoidance of fines for violations, etc.); environmental dimension assessment includes the ecological benefits of improved effluent quality to receiving water bodies, carbon emission reductions resulting from energy savings, and the environmentally friendly improvements from reduced chemical use; operational dimension assessment includes improved system stability, changes in operational complexity, and the impact on human resources.
[0158] This multi-dimensional comprehensive benefit assessment not only provides a basis for management to make decisions, but also helps to demonstrate the social value and environmental contribution of wastewater treatment plant operation to regulatory authorities, the public and stakeholders, thereby enhancing public awareness and support for water environmental protection.
[0159] Through the detailed process of constructing the water-energy-chemical synergistic multi-objective optimization function described above, wastewater treatment plants can achieve balanced optimization in three dimensions: water quality, energy consumption, and chemicals. Under the premise of ensuring compliance with discharge standards, they can minimize operating costs, improve resource utilization efficiency, and contribute to water environmental protection and sustainable development.
[0160] In this embodiment, the application optimization algorithm solves for the optimal operating parameter settings of each process unit within a future time period, generating a plant-wide water-energy-chemical synergistic optimization decision scheme, including:
[0161] Based on the aforementioned water-energy-pharmaceutical synergistic multi-objective optimization function, a mathematical optimization model is established that includes constraints on equipment operating range, process parameters, and hydraulic balance, resulting in the mathematical optimization model.
[0162] Based on the mathematical optimization model, a multi-time-scale rolling optimization strategy is designed, and optimization variables at different time scales are determined to obtain the determined optimization variables.
[0163] Based on the mathematical optimization model and the determined optimization variables, a heuristic algorithm or decomposition strategy is selected according to the characteristics of the problem to solve the mathematical optimization model, obtain the optimal operating parameter settings of each process unit in the future time period, and generate the water-energy-pharmaceutical synergistic optimization decision scheme.
[0164] Specifically, firstly, based on the water-energy-chemical synergistic multi-objective optimization function constructed in the previous step, a comprehensive mathematical optimization model needs to be established. This model not only includes the optimization objective but also needs to encompass various real-world constraints of the wastewater treatment system's operation. A complete mathematical model is the foundation for ensuring the feasibility and safety of the optimization results. Its core is to transform the physical limitations, process requirements, and operating procedures in engineering practice into precise mathematical expressions.
[0165] First, equipment operating range constraints are the most fundamental type of constraint in the model, directly affecting whether the optimization results can be implemented on actual equipment. For different types of equipment, their operating boundaries need to be defined in detail: for aeration equipment, constraints include the minimum / maximum airflow range of the blower, the operating pressure range of the aerator, and air-to-water ratio limits; for pump equipment, constraints include the minimum / maximum flow range, the head-flow operating curve, and minimum flow protection against dry running; for chemical dosing equipment, constraints include the flow range of the chemical pump, minimum continuous operating time, and maximum rate of change limits; for mechanical mixing equipment, constraints include the speed range, minimum mixing intensity, and energy consumption curve. In addition to operating range, equipment start-up and shutdown constraints must also be considered, such as minimum operating time, minimum downtime, and maximum start-up and shutdown frequency. These constraints are crucial for protecting the equipment and extending its service life.
[0166] Process parameter constraints are crucial for ensuring stable system operation and treatment effectiveness. These constraints vary depending on the treatment process and target pollutant: For activated sludge processes, core constraints include the allowable range of MLSS (mixed liquor suspended solids concentration) (typically 2000-5000 mg / L), the control range of sludge retention time (SRT) (adjusted according to process type and temperature variations), the reasonable range of the feed / microorganism ratio (F / M ratio, characterizing load intensity), and the control range of DO (dissolved oxygen) concentration; for nitrification-denitrification processes, constraints include the internal recirculation ratio range (typically 100%-400%), the external recirculation ratio range (typically 50%-100%), the minimum HRT (hydraulic retention time) in the anoxic zone, and the maximum capacity for nitrified liquor recirculation; for chemical phosphorus removal processes, constraints include the reagent dosage range, minimum contact time, and maximum allowable residue. In addition, the stability constraints of the biological system must be considered, such as the allowable fluctuation range of pH (usually 6.5-8.5), the temperature adaptation range, and the maximum rate of change of process parameters, to avoid mutations that could impact the microbial community.
[0167] Hydraulic balance constraints are fundamental requirements for ensuring the continuity of material flow in a system. In complex wastewater treatment systems, it is necessary to ensure flow balance among treatment units: the total influent volume must equal the sum of the treatment volumes of all treatment units; the influent flow at each distribution point must equal the sum of all effluent flows; the total return flow of the recirculation system must not exceed the system's treatment capacity; and the actual treatment load of each treatment unit must not exceed its design capacity. Simultaneously, hydraulic retention time (HRT) constraints must be considered to ensure that the water has sufficient retention time in each treatment unit to complete the corresponding treatment process. For example, primary sedimentation tanks typically require 1.5-2.5 hours of HRT, biological reactors require 6-12 hours of HRT (depending on the process), and secondary sedimentation tanks require 2-4 hours of HRT. During rainy seasons or when water volume fluctuates significantly, storage capacity constraints must also be considered to ensure that the system can absorb short-term high loads without causing shocks.
[0168] In addition to the three main categories of basic constraints mentioned above, system-specific operational constraints also need to be considered: seasonal constraints, such as special operational requirements under low-temperature conditions in winter (e.g., increasing MLSS concentration and extending SRT); special operating condition constraints, such as coping strategies for high water volume during the rainy season, load fluctuations during holidays, or industrial wastewater impacts; maintenance plan constraints, such as special operational plans for regular equipment maintenance or partial system shutdowns; and emergency response constraints, such as contingency plans for dealing with sudden pollution events or equipment failures. These specific constraints enable the optimization model to adapt to the changing conditions in real-world operations, enhancing its practicality.
[0169] When constructing mathematical optimization models, constraints can be divided into two categories: hard constraints and soft constraints. Hard constraints are conditions that must be strictly satisfied, such as physical limitations of equipment, safety requirements, and regulatory standards. Violating these constraints will lead to an infeasible or unsafe solution. Soft constraints are conditions that are expected to be satisfied but can be appropriately relaxed when necessary, such as the ideal range of certain process parameters. These can be reflected in the objective function by introducing a penalty function, allowing for limited deviations from the ideal state in special cases, but at a certain "cost." Through a reasonable combination of hard and soft constraints, the optimization model can ensure the feasibility and safety of the results while retaining sufficient flexibility to cope with complex and changing operating conditions.
[0170] Finally, the model also needs to incorporate an uncertainty handling mechanism to cope with various variations and disturbances in real-world operation. Robust optimization methods can be used to consider the uncertainties of key parameters (such as influent water quality, water quantity, and equipment efficiency) to ensure that the optimized scheme maintains good performance within the parameter fluctuation range; alternatively, scenario analysis can be used to pre-develop alternative schemes for various possible operating conditions, and the most suitable scheme can be selected and implemented based on the conditions during actual operation.
[0171] Through the above steps, a mathematical optimization model containing comprehensive constraints is established. This model can not only minimize the cost per ton of water treated, but also ensure that the optimization results meet various limitations and requirements of real-world operation, laying a solid foundation for the subsequent solution process.
[0172] Secondly, wastewater treatment systems simultaneously involve rapidly changing processes (such as dissolved oxygen dynamics) and slowly evolving processes (such as changes in sludge properties). Directly optimizing the entire system involves enormous computational costs and struggles to balance the demands across different time scales. Therefore, designing a multi-time-scale rolling optimization strategy is an effective method for optimizing such complex systems. Rolling optimization refers to performing optimization within a finite time domain at the current point in time, implementing decisions made in the most recent period, and then optimizing again as time progresses, continuously rolling forward. This method can comprehensively consider accurate short-term predictions and long-term trend assessments, balancing the needs of immediate response and long-term planning.
[0173] First, it's necessary to determine the time-scale structure for optimization, dividing decision variables into different time scales. This can typically be divided into three main levels: Long-term planning (weekly or monthly), focusing on slowly changing processes and structural decisions, such as sludge settling time (SRT), MLSS control targets, and waste sludge discharge strategies. Decisions at this level are usually updated weekly or monthly, providing a framework constraint for short- to medium-term decisions. Medium-term control (daily), focusing on daily-scale process parameter adjustments and resource allocation, such as intraday aeration strategy planning, daily chemical dosage allocation, and energy use optimization (considering peak and off-peak electricity prices). Decisions at this level are usually updated daily, based on forecasts for the next 1-7 days. Short-term operation (hourly or minute-by-minute), focusing on real-time or near-real-time parameter adjustments and rapid responses, such as DO setpoint adjustments, real-time reflux ratio control, and fine-tuning of chemical dosing rates. Decisions at this level may be updated hourly or less, primarily responding to short-term fluctuations in water quality and quantity and changes in equipment status.
[0174] For different time scales, corresponding sets of optimization variables are determined. Long-term planning layer optimization variables typically include process structure parameters and operating mode selection, such as the target range of MLSS concentration for the activated sludge system (affecting system treatment capacity and energy consumption), sludge age (SRT) control targets (affecting microbial community characteristics), sludge discharge strategies (affecting system material balance), and seasonal process adjustment schemes (such as switching between winter and summer process modes). These variables change slowly but have a profound impact on the overall system performance. Medium-term control layer optimization variables focus on resource allocation and intraday operation planning, including 24-hour time-segmented aeration volume allocation schemes (combining electricity price fluctuations and load changes), daily return ratio variation curves (adapting to intraday water volume and quality fluctuations), total daily chemical usage and allocation strategies (based on predicted influent characteristics), and the operating schedule of key equipment (such as prioritizing dewatering equipment operation during off-peak electricity price periods). The optimization variables of the short-term operation layer focus on real-time control parameters, such as the DO setpoint of each aeration zone (to precisely control biological reaction conditions), the stirring intensity of the mixing zone, the real-time dosing rate of chemicals, and the water pump flow rate regulation. These variables need to be frequently adjusted to cope with real-time changing conditions.
[0175] Coordinating decisions at different levels across time is a key challenge in multi-timescale optimization. A hierarchical optimization structure is adopted, where the results of upper-level optimizations provide constraints for lower-level optimizations. Specifically, the optimization results of the long-term planning layer (such as MLSS targets and SRT control ranges) serve as constraints for the medium-term control layer; the optimization results of the medium-term control layer (such as resource allocation schemes for different time periods within the day) provide a framework and reference for the short-term operational layer. Simultaneously, feedback and execution results from lower-level optimizations influence subsequent optimizations at higher levels, forming a closed-loop decision-making system. For example, if the short-term operational layer finds that the actual DO control effect is unsatisfactory, it may trigger the medium-term control layer to re-optimize the aeration strategy, and even affect the long-term planning layer's decision to adjust the MLSS level.
[0176] To address the characteristics of wastewater treatment systems, a specialized rolling optimization mechanism is designed. The rolling time domain refers to the future time range considered in each optimization iteration. Typically, the uncertainty of the prediction increases with the length of the forecast period; therefore, a "fine-grained for the near, coarse-grained for the far" strategy is adopted: For the near term (e.g., the next 24 hours), a shorter time step (e.g., 1 hour) is used for fine-grained optimization; for the medium term (e.g., the next 2-7 days), a longer time step (e.g., 6-12 hours) is used for coarse planning; and for the long term (e.g., the next 8-30 days), only trend changes are considered, and an even longer time step (e.g., 1 day) is used. The rolling frequency refers to the time interval between re-optimizations, requiring a balance between computational resource consumption and response speed to changes. Typically, the short-term operational layer may roll every 1-4 hours, the medium-term control layer every 24 hours, and the long-term planning layer every 7 days or longer.
[0177] To handle information transfer across different time scales, specific time-scale interfaces are designed. The upward interface aggregates short-term state data into long-term input, such as aggregating hourly water quality data into daily averages. The downward interface decomposes long-term decisions into specific short-term operations, such as breaking down daily aeration targets into hourly setpoints. These interfaces ensure seamless integration of optimizations across time scales, forming a coordinated and unified decision-making system.
[0178] In multi-timescale optimization, special attention needs to be paid to the timeliness and accuracy of forecasts. Short-term forecasts (such as those for the next 24 hours) are usually relatively accurate (e.g., weather, water inflow), allowing for more precise optimization. Medium- and long-term forecasts, however, rely more on historical patterns and trend judgments, resulting in higher uncertainty. Therefore, designing optimization strategies that adapt to forecast uncertainty is crucial. This could involve adopting more conservative decisions for long-term forecasts, allowing for greater margins of uncertainty, or preparing multiple alternative plans based on different scenarios to address changes in actual conditions.
[0179] This multi-timescale rolling optimization strategy effectively balances the needs of long-term planning and short-term response, while considering constraints and objectives at various time scales, making the optimization results more practical and feasible. This method is particularly suitable for complex dynamic systems such as wastewater treatment, maximizing operational efficiency and economy while ensuring system stability.
[0180] Third, a complete water-energy-chemical synergistic optimization model for wastewater treatment plants is typically a large-scale, nonlinear, multivariate mixed-integer optimization problem, which traditional exact algorithms (such as linear programming and quadratic programming) cannot solve directly and effectively. Therefore, it is necessary to select appropriate heuristic algorithms or decomposition strategies based on the characteristics of the problem to find a high-quality approximate optimal solution within a reasonable computation time, balancing computational efficiency and solution quality.
[0181] Based on the characteristics of wastewater treatment optimization problems, the first step is to determine the appropriate solution method. If the optimization model mainly contains continuous variables (such as DO setpoints, reflux ratios, etc.) and the objective function and constraints are relatively smooth, gradient-based methods can be considered. If the model contains a large number of discrete variables (such as equipment start-up and shutdown decisions) or has highly nonlinear characteristics, gradient-free heuristic algorithms are more suitable. If the problem is particularly large, a problem decomposition strategy can be considered, breaking down the original problem into multiple sub-problems for separate solutions.
[0182] For situations where heuristic algorithms are suitable, the following methods can be chosen: Genetic Algorithm (GA) is a global search method based on natural selection and genetic mechanisms, particularly suitable for handling multi-objective, nonlinear problems, and widely used in wastewater treatment optimization. GA continuously improves the population of solutions by simulating natural selection, crossover, and mutation processes, gradually converging to a high-quality solution. When applying it, it is necessary to design an encoding scheme suitable for the characteristics of wastewater treatment (e.g., binary encoding to represent equipment start-up and shutdown status, and real number encoding to represent continuous control parameters), as well as specialized crossover and mutation operators to ensure that the generated new solutions still satisfy process constraints. Particle Swarm Optimization (PSO) simulates the foraging behavior of bird flocks, finding the optimal solution through information sharing among individuals. PSO has a fast convergence speed, fewer parameters, and is suitable for handling continuous variable optimization, such as the optimization of continuous control variables like DO setpoints and reagent dosages. Differential Evolutionary Algorithm (DE) is a population-based random search algorithm that guides the search through differential mutation and competitive selection mechanisms. It is insensitive to noise and nonlinearity and is suitable for handling complex nonlinear relationships in wastewater treatment. Simulated Annealing (SA) simulates the metal cooling process and can escape local optima, making it suitable for handling multimodal optimization problems, such as finding the optimal configuration among different process modes.
[0183] To address the specific needs of wastewater treatment systems, hybrid algorithm strategies can be designed, combining the advantages of multiple algorithms. For example, Global Algorithm (GA) can be combined with local search methods, where GA handles the global search to find the promising region, and the local search method refines the optimization based on this. Alternatively, Particle Search (PSO) can be combined with simulated annealing (SA), where PSO provides the overall search framework and SA provides the ability to escape local optima. This hybrid strategy can balance global exploration and local exploitation, improving both the efficiency of the algorithm and the quality of the solution.
[0184] For large-scale optimization problems, problem decomposition strategies are an effective way to improve computational efficiency. Time decomposition breaks down long-term optimization problems into a series of short-term problems, solving them segment by segment. This is suitable for handling long-term planning problems, such as weekly or monthly operational optimization. Spatial decomposition breaks down complex systems into multiple subsystems. For example, a wastewater treatment plant can be divided into water treatment lines and sludge treatment lines for separate optimization, or a biological reaction system and a chemical treatment system can be optimized separately. Then, the solutions of each subsystem are integrated through a coordination mechanism. Objective decomposition breaks down multi-objective problems into single-objective sub-problems. For example, water quality objectives and energy consumption objectives can be optimized separately, and then the equilibrium point can be found through Pareto analysis. Hierarchical decomposition, based on a multi-timescale structure, decomposes the problem into different levels, optimizing them layer by layer from top to bottom. For example, long-term planning decisions are optimized first, then medium-term controls are optimized based on the results, and finally short-term operations are optimized to form a complete optimization scheme.
[0185] In practical applications, a balance between computational efficiency and solution quality must also be considered. Online optimization requires algorithms to provide feasible solutions within a finite timeframe (e.g., minutes) to support real-time decision-making; while offline planning can tolerate longer computation times (e.g., hours) in exchange for higher-quality solutions. Therefore, algorithm parameters and termination conditions need to be adjusted for different application scenarios: for online optimization at the short-term operation layer, more lenient convergence criteria and a limited number of iterations can be set to prioritize computational speed; for offline optimization at the medium- to long-term planning layer, stricter convergence criteria and more iterations can be set to pursue higher-quality solutions.
[0186] To address the uncertainties in wastewater treatment systems, robust optimization strategies are implemented. Traditional optimization often assumes that model parameters (such as equipment efficiency and water quality characteristics) are deterministic, while in reality, these parameters are uncertain. Robust optimization considers the range of parameter uncertainty and seeks solutions that still perform well in the worst-case scenario. At the algorithmic level, robust optimization can be achieved through methods such as multi-scenario evaluation (evaluating the performance of candidate solutions under multiple possible conditions), Monte Carlo simulation (randomly generating a large number of scenarios to evaluate the statistical performance of solutions), or multi-stage stochastic programming based on scenario trees (considering multiple possible future paths), ensuring the reliability of the optimization results in practical applications.
[0187] Finally, the optimization results are transformed into actionable engineering decisions. The raw results output by the optimization algorithm may contain a large number of detailed parameters, requiring post-processing and integration to form clear and concise operational instructions. First, the results are validated using detailed wastewater treatment models (such as the ASM model) or historical data to verify the feasibility and effectiveness of the optimization results. Then, the results are simplified, converting the continuous optimization output into discrete operational steps (e.g., simplifying the continuous DO variation curve into a piecewise constant control strategy). Finally, a decision scheme is generated, including equipment operating parameter setpoints (such as blower speed, pump frequency, and chemical dosage), process control parameter adjustment suggestions (such as DO setpoints, MLSS control range, and reflux ratio), and operational timing arrangements (such as equipment start-up and shutdown times and maintenance plans), forming a comprehensive water-energy-chemical synergistic optimization decision scheme.
[0188] Through this series of algorithm selection and optimization steps, the optimal operating parameter settings for each process unit in the future time period are finally obtained, generating an executable and efficient water-energy-chemical synergistic optimization decision scheme, providing a scientific basis and specific guidance for the refined operation of wastewater treatment plants.
[0189] Fourth, in practical applications, the optimization process faces the dual challenges of computational efficiency and solution quality, requiring a series of key technologies for acceleration and improvement. First, model simplification is a crucial strategy for improving computational efficiency. Establishing suitable simplified models for complex wastewater treatment processes, such as using input-output response models instead of complex mechanistic models, or using low-order dynamic models to approximate high-order dynamic processes, can significantly reduce computational burden while maintaining the model's basic accuracy. Second, parallel computing techniques can accelerate the optimization process. Heuristic algorithms (such as GA and PSO) are naturally suited for parallel processing, allowing for the simultaneous evaluation of multiple candidate solutions on multi-core processors or distributed systems, greatly improving search efficiency. For large-scale decomposition problems, sub-problems can also be solved in parallel, with results coordinated and integrated through a distributed computing framework.
[0190] For the specific optimization problem of wastewater treatment, specialized constraint handling techniques are designed. Wastewater treatment optimization typically involves numerous process and equipment constraints, and effectively handling these constraints is crucial for successful solutions. The penalty function method transforms constraint violations into penalty terms in the objective function, but requires careful adjustment of the penalty parameters. Feasibility preservation strategies ensure that all candidate solutions always satisfy the constraints through special encoding and operations. Repair strategies allow the generation of infeasible solutions but repair them into feasible solutions through specific rules. Based on the characteristics of wastewater treatment systems, domain-specific constraint handling methods can be designed, such as flow distribution repair strategies based on automatic adjustment of hydraulic balance, or parameter range adaptive adjustment methods based on process knowledge.
[0191] Utilizing historical optimization experience to improve search efficiency is also a practical technique. A database of historical optimization results can be built, recording optimal solutions under different conditions. When a new optimization problem is similar to a historical problem, the historical solution can be used as an initial solution to accelerate convergence; or patterns and rules can be extracted from historical solutions to form heuristic rules that guide the search direction for new problems. With the long-term operation of the optimization system, this "experience accumulation" mechanism can continuously improve the system's solution efficiency and quality.
[0192] Finally, designing flexible termination strategies is an effective way to balance computation time and solution quality. Termination strategies based on convergence criteria stop iteration when the improvement in the solution falls below a threshold; termination strategies based on computational budget stop after reaching a preset maximum number of iterations or computation time; and termination strategies based on solution quality stop when the solution reaches the expected quality target. For online optimization, an "always feasible" strategy can also be designed, where the algorithm always maintains a currently best feasible solution, returns to the current solution when a decision is needed, and continues optimization in the background to provide a better solution for the next time step.
[0193] Through these key technologies and optimization acceleration strategies, it is possible to effectively solve the water-energy-chemical synergistic optimization problem of wastewater treatment plants under limited computing resources and time constraints, and generate practical and efficient optimization decision-making schemes.
[0194] Fifth, after generating the optimized decision-making scheme, a comprehensive evaluation and verification are required to ensure its feasibility and effectiveness in practical applications. First, an in-model evaluation is conducted to verify whether the optimized scheme meets all constraints and achieves the expected improvement goals. Then, digital twin simulation verification is performed, using a high-fidelity wastewater treatment model (such as the ASM model) or a digital twin system to simulate the system's dynamic response after the implementation of the optimized scheme and evaluate its performance under complex conditions. Finally, a small-scale pilot verification is conducted, where the optimized scheme is tested on a specific treatment line or unit of the actual system, collecting actual operational data to verify the optimization effect.
[0195] After confirming the effectiveness of the optimization plan, a phased implementation strategy was designed. First, a transitional adjustment period was implemented to avoid abrupt changes in system parameters, designing a smooth parameter adjustment path so that the system could gradually adapt to the new operating state. Next, key indicator monitoring was conducted, closely monitoring key indicators of system response (such as DO, MLSS, and effluent quality) to promptly identify potential problems. Finally, iterative optimization of the plan was carried out, continuously adjusting and improving the optimization plan based on actual operational feedback, forming a closed loop of optimization-implementation-feedback-re-optimization.
[0196] For significant system changes, design emergency response plans, clearly defining potential problems (such as equipment failure, abnormal water ingress, etc.) and corresponding countermeasures during the implementation of optimization solutions to ensure the safe and stable operation of the system. Simultaneously, develop operator training programs to help frontline operators understand the principles and key points of optimization decision-making, improving their ability and cooperation in implementing optimization plans.
[0197] Through the detailed steps outlined above, from constructing the mathematical optimization model to designing multi-timescale rolling optimization strategies, and then to solving the problem using heuristic algorithms and evaluating and implementing the optimization decision scheme, a complete process for generating water-energy-chemical synergistic optimization decision schemes for wastewater treatment plants has been formed. This process considers both theoretical optimization performance and feasibility and operability in engineering practice, effectively supporting the refined operation and management of wastewater treatment plants and achieving a win-win situation for both environmental and economic benefits.
[0198] Example 2:
[0199] In this embodiment, the step of training the model using historical operating data to obtain a dynamically coupled GNN prediction model capable of expressing the dynamic coupling relationship between process units includes:
[0200] Based on the dynamic coupling graph structure data of the wastewater treatment plant, cluster analysis is used to determine the cluster centers of each process parameter from the historical operation data. Hermite interpolation basis functions are constructed around the cluster centers. The Hermite interpolation basis functions and their corresponding derivative information are integrated into the message aggregation process of the spatial message passing layer to obtain the dynamic coupling GNN prediction model.
[0201] Specifically, complex dynamic coupling relationships exist between various process units in wastewater treatment systems, and traditional graph neural network (GNN) models struggle to accurately capture these nonlinear coupling characteristics that vary with operating conditions. To address this issue, this embodiment proposes a dynamic coupling GNN prediction model based on Hermite interpolation. By introducing condition-aware interpolation representations into the message passing mechanism, the model's ability to model dynamic changes in process parameters is enhanced.
[0202] First, a dynamic coupling graph structure is constructed based on the process flow and parameter relationships of the wastewater treatment plant. In this graph, nodes represent key process parameters (such as DO, MLSS, ammonia nitrogen, etc.) or treatment units, and edges represent the influence relationships between parameters. Unlike traditional graph structures, the edge attributes here include not only connection strength but also time delay and operating condition dependence characteristics to express the dynamic coupling relationships between parameters. For example, the impact of DO changes on ammonia nitrogen has obvious time-delay characteristics and operating condition dependence—the impact is faster and stronger at high temperatures and slower and weaker at low temperatures.
[0203] Next, cluster analysis is performed on historical operating data to identify typical operating conditions for each process parameter. For each key process parameter (such as DO, MLSS, reflux ratio, etc.), historical data under different operating conditions are collected, including the parameter's value, rate of change, and related environmental conditions (such as water temperature, load, etc.). Clustering algorithms such as K-means or Gaussian mixture models are applied to divide the operating data of each parameter into 3-7 typical operating condition categories. For example, the DO parameter may be divided into typical states such as low load-low DO condition (approximately 0.5-1.0 mg / L), medium load-medium DO condition (approximately 1.5-2.5 mg / L), and high load-high DO condition (approximately 3.0-4.0 mg / L). These cluster centers represent typical steady-state operating points of the system and will serve as the basis for subsequent Hermite interpolation.
[0204] After determining the cluster centers, Hermite interpolation basis functions are constructed around these points. Hermite interpolation is a high-order interpolation method that considers not only the matching of function values but also the matching of derivative values, thus more accurately describing the local variation characteristics of the data. For each cluster center x of each process parameter... i Construct two basis functions: h {i,1} (x) satisfies x i The function value is 1 and the derivative is 0 at h; at other center points, both the function value and the derivative are 0. {i,2} (x) satisfies x i At one center point, the function value is 0 and the derivative is 1; at other center points, both the function value and the derivative are 0. Thus, through a linear combination of these basis functions, a smooth interpolation function can be constructed that satisfies both the function value and the derivative value at all center points, accurately expressing the dynamic changes of process parameters under different operating conditions.
[0205] The construction of Hermite basis functions requires special consideration of the characteristics of the wastewater treatment system: for parameters with drastic changes (such as DO during load shocks), a narrower support range should be set to accurately capture local dynamics; for parameters with gradual changes (such as MLSS), a wider support range should be set to avoid oversensitivity. Furthermore, different interpolation weights can be designed for different operating condition ranges to reflect the differences in parameter sensitivity across different ranges, such as the saturation effect of DO on biochemical reaction rates.
[0206] The core innovation of this model lies in integrating the constructed Hermite interpolation basis function into the spatial message passing layer of the GNN. First, the node feature mapping layer is modified to generate enhanced node representations based on Hermite interpolation. For each node v, the original feature vector x... vThe similarity between the value and the cluster center is calculated to determine its current operating condition range. Then, the corresponding Hermite basis functions are used to calculate the interpolation weights and generate an enhanced feature representation, which includes three components: state value, rate of change, and acceleration rate, calculated based on the interpolation function value, the first derivative, and the second derivative, respectively.
[0207] Next, a novel message generation function was designed to include richer dynamic characteristics in the information transmitted between nodes. In the improved design, the messages sent by node u to node v include: status messages (transmitting u's current state), rate of change messages (transmitting u's changing trend, providing early warning of impending changes in v), and operating condition indication messages (indicating u's current operating condition range, helping v adjust its response strategy). This richer message content makes the information exchange between nodes more comprehensive and better reflects complex coupling relationships.
[0208] The message aggregation mechanism is improved to apply different aggregation strategies based on the operating conditions of the message source node. An operating condition aggregation network is designed to receive operating condition indication messages from all neighboring nodes, dynamically calculate the importance weights of different messages, and then perform weighted aggregation. This adaptive aggregation mechanism allows the model to flexibly adjust the degree of influence between nodes according to the current system state, more accurately reflecting the dynamic coupling relationships in actual processes.
[0209] For the boundary region of operating condition transitions, the smooth transition characteristics of Hermite interpolation are utilized to accurately capture the transition behavior of parameters when switching between different operating conditions. An operating condition transition detection mechanism is designed: when a node is in the operating condition boundary region, a special boundary modeling unit is activated, and Hermite basis functions from multiple adjacent operating conditions are used for interpolation to achieve a smooth transition in state representation. Simultaneously, a time-delay model is introduced to capture the response delay of different parameters during operating condition transitions, such as "after DO increases, there is a 30-60 minute lag period in the decrease of ammonia nitrogen concentration."
[0210] Finally, the above mechanisms are integrated into a unified dynamically coupled GNN architecture. This architecture includes a preprocessing layer (for raw feature processing and condition identification), a Hermite encoding layer (for generating enhanced representations based on centroids and basis functions), a dynamic message passing layer (containing improved message generation and aggregation mechanisms), and a prediction output layer (for generating the final prediction result). A multi-task loss function is designed to simultaneously optimize state prediction accuracy and rate of change prediction accuracy, ensuring that the model can capture both static patterns and dynamic characteristics.
[0211] The model training adopts a phased strategy: First, cluster analysis is performed on each process parameter to determine the representative center point of the operating condition; then, Hermite interpolation basis functions are constructed to establish the mapping relationship from operating condition to state representation; next, the basic GNN model is trained to learn the basic connection relationship between process units; finally, the Hermite interpolation mechanism is integrated to fine-tune the complete model and optimize the dynamic coupling representation capability.
[0212] Through the above steps, a predictive model that can accurately express the dynamic coupling relationship between process units is obtained. Compared with traditional GNNs, this dynamic coupling model based on Hermite interpolation can more accurately capture the nonlinear response characteristics, time delay effects, and operating condition transition behavior of the wastewater treatment system under different operating conditions, providing reliable predictive support for subsequent multi-objective optimization.
[0213] Example 3:
[0214] In this embodiment, the construction of a water-energy-chemical synergistic multi-objective optimization function with the objective of minimizing the cost per ton of water treated, and incorporating factors such as water quality compliance constraints, energy consumption, and chemical dosage, yields a water-energy-chemical synergistic multi-objective optimization function for optimization decision-making, including:
[0215] Based on the dynamically coupled GNN prediction model and the multi-source historical operation data of the wastewater treatment plant, a spatiotemporal matrix is constructed. The spatiotemporal matrix is decomposed using a smooth separable nonnegative matrix factorization algorithm to extract the basic operation modes of water, energy, and chemicals. Based on the basic operation modes, the cost per ton of water treated, water quality compliance constraints, and the weights of each sub-objective are reconstructed to obtain the water-energy-chemical synergistic multi-objective optimization function.
[0216] Specifically, the optimization of wastewater treatment systems involves three interrelated dimensions: water quality, energy, and chemicals. Traditional optimization methods struggle to effectively handle this multi-dimensional synergistic relationship. This embodiment proposes a method based on smooth separable nonnegative matrix factorization (NMF). By extracting basic operating patterns from historical data, a physically meaningful water-energy-chemical synergistic multi-objective optimization function is constructed to minimize the overall cost per ton of water treated.
[0217] First, multi-source historical operational data from the wastewater treatment plant are integrated to construct a structured spatiotemporal matrix. This data includes online sensor data (real-time parameters such as DO and pH), laboratory testing data (water quality indicators such as COD, BOD, and TN), equipment operation data (blower power, pump flow, etc.), control parameter records, and external environmental data. Data from different sources are time-aligned and quality-controlled to identify and handle outliers, missing values, and noise, ensuring data reliability. Then, a three-dimensional tensor X∈R is constructed. (m×n×p)Where m represents the number of monitoring indicators, n represents the number of time sampling points, and p represents the number of spatial locations. To facilitate subsequent matrix decomposition, the three-dimensional tensor is converted into a two-dimensional matrix, with each row representing a monitoring indicator and each column representing a time-space combination point.
[0218] Next, a smooth, separable nonnegative matrix factorization (NMF) algorithm is designed to extract basic operating patterns from the spatiotemporal matrix. Standard NMF decomposes the data matrix X into the product of two nonnegative matrices: X ≈ W·H, where W is the basis matrix (containing the basic patterns) and H is the coefficient matrix (representing the activation strength of the patterns). In wastewater treatment system optimization, NMF is enhanced in two ways: first, a smoothness constraint is added, requiring the coefficient matrix H to change smoothly over time, reflecting the continuity of the system state; second, a separability constraint is added, encouraging the patterns in the basis matrix W to have a clear physical interpretation, facilitating correspondence with actual operating conditions.
[0219] Smoothness constraints are implemented by introducing a time-smoothing regularization term into the objective function. This term calculates the first-order difference L2 norm of each row of the coefficient matrix H, penalizing drastic changes in mode activation intensity. An adaptive smoothing parameter mechanism is also designed to allow for appropriate relaxation of smoothness constraints during operational transitions (such as heavy rain events or shock loads), preserving the true rapid response characteristics of the system. Separability constraints are implemented by applying structured sparse constraints to the columns of the basis matrix W, guiding each base model to focus on a specific subset of indicators, forming a more interpretable "pure" state representation. Furthermore, inter-mode orthogonality constraints are introduced to reduce redundancy and overlap between base models.
[0220] To improve the algorithm's robustness to noise in wastewater treatment data, the Huber loss function is used instead of the standard Frobenius norm error metric. This approximates a quadratic loss when the data is normal and a linear loss when outliers exist, reducing the impact of outliers. Simultaneously, a reliability-weighted mechanism is introduced, assigning error weights based on the reliability and importance of different data sources.
[0221] Domain knowledge constraints are introduced into the NMF optimization process to ensure that the results conform to the physical characteristics of the wastewater treatment system. Material conservation constraints (requiring that indices involving the transformation of the same substance into different forms satisfy mass balance relationships), energy balance constraints, and reaction kinetic constraints are designed (guiding the model to learn pattern relationships that conform to the laws of biochemical reactions). These physical constraints are integrated into the optimization objective through special regularization terms, improving the physical rationality and interpretability of the model.
[0222] The algorithm employs an alternating optimization framework, optimizing one matrix while simultaneously fixing another until convergence. To improve computational efficiency, techniques such as block coordinate descent, accelerated gradients, and online learning are used to optimize the solution process. The final output includes a basis matrix W and a coefficient matrix H, where each column of W represents a basic operating mode, and each row of H represents the activation sequence of that mode in the time dimension.
[0223] Based on the extracted fundamental operating modes, an in-depth analysis is conducted across three dimensions: water quality, energy consumption, and chemicals. First, fundamental modes related to effluent water quality are identified, such as stable compliance mode, ammonia nitrogen control mode, total nitrogen control mode, and enhanced phosphorus removal mode. Second, fundamental modes related to energy consumption are identified, such as high-efficiency aeration mode, peak energy consumption mode, low energy consumption mode, and pumping optimization mode. Finally, fundamental modes related to chemical usage are identified, such as chemical phosphorus removal mode, pH adjustment mode, carbon source replenishment mode, and enhanced disinfection mode. This mode decomposition breaks down complex system behavior into a small number (typically 5-15) combinations of fundamental modes, greatly simplifying the representation and understanding of system behavior.
[0224] Further research into the transition relationships between models was conducted. By analyzing the temporal changes in model activation intensity in the coefficient matrix H, the triggering conditions for model transitions (such as load changes, temperature changes, and changes in influent characteristics) and typical transition paths were identified. This information provides important guidance for model transition strategies in optimization decision-making. Finally, a three-dimensional coupling relationship map of water, energy, and pharmaceuticals was constructed, mapping the extracted performance indicators of the basic models in three dimensions to three-dimensional space, visually displaying the model distribution and Pareto front, and providing a reference for setting optimization objectives.
[0225] Based on the extracted basic operating modes, a water-energy-chemical synergistic multi-objective optimization function is constructed. First, for each water quality-related basic mode i, its corresponding water quality objective function is defined. This represents the water quality performance evaluation under this mode. The activation function of the design mode is used to calculate the activation intensity α of mode i based on the current system state. i This reflects the degree of matching between the system and the model. The overall water quality objective function is a weighted sum of the objectives of each model: f water = ∑(α i · Similarly, construct the energy consumption objective function f. energy = ∑(β j · ) and the objective function f of the drug chemical = ∑(γ k · ), where β j and γ k These are the activation intensities of energy consumption mode j and drug mode k, respectively.
[0226] The core innovation lies in the dynamic weight optimization mechanism, which adjusts the activation intensity of patterns and the weights of sub-objectives in real time based on system status and external conditions. A pattern recognizer is designed to assess the degree of matching between system behavior and historical patterns; an environmental sensor is designed to adjust the weight coefficients of the three sub-objectives based on external conditions such as water temperature, influent characteristics, and electricity price levels. For example, during cold seasons, the water quality weight may be increased to address decreased nitrification efficiency; during peak electricity price periods, the energy consumption weight may be increased to enhance energy conservation; and during special water quality events, the chemical weight may be increased to ensure treatment effectiveness.
[0227] To ensure stable system operation, a smooth mode transition mechanism is designed to limit the rate of change in mode activation intensity between adjacent time steps, avoiding unnecessary fluctuations caused by frequent jumps. Simultaneously, mode transition costs are considered, incorporating additional energy consumption, temporary performance degradation, and equipment wear caused by state switching into the objective function to encourage stable operation. In necessary mode transitions, optimized transition trajectories are designed based on successful transition paths from historical data to minimize total cost and risk.
[0228] Finally, the evaluations of water quality, energy consumption, and chemicals are uniformly converted into economic costs, forming a comprehensive indicator: "cost per ton of water treated." Water quality targets are converted into sewage discharge fees or penalties for exceeding standards; energy consumption targets are directly converted into electricity costs; and chemical targets are converted into chemical procurement costs. This unified economic measurement makes the targets of the three dimensions comparable and weighable, helping decision-makers understand the comprehensive economic benefits of different optimization schemes.
[0229] Through the steps described above, based on a dynamically coupled GNN prediction model and a smooth, separable NMF, a water-energy-chemical synergistic multi-objective optimization function was constructed. This function aims to minimize the cost per ton of water treated and incorporates factors such as water quality compliance constraints, energy consumption, and chemical dosage. This hybrid approach, based on data-driven and domain knowledge, overcomes the complexity limitations of pure mechanistic models and the insufficient generalization of pure data models, providing a practical and reliable decision support tool for the synergistic optimization of wastewater treatment plants.
[0230] Example 4:
[0231] In this embodiment, the application optimization algorithm solves for the optimal operating parameter settings of each process unit within a future time period, generating a plant-wide water-energy-chemical synergistic optimization decision scheme, including:
[0232] Based on the mathematical optimization model, the model is decomposed into multiple subdomains using the virtual element method. A coarse GDSW space is constructed by embedding the weights of the dynamically coupled GNN prediction model. A parallel solver is used to jointly solve each subdomain and the coarse GDSW space to obtain the water-energy-pharmaceutical collaborative optimization decision scheme.
[0233] Specifically, the water-energy-chemical synergistic optimization of wastewater treatment plants involves a large number of process parameters and complex constraints, forming a large-scale nonlinear optimization problem. Direct solutions are computationally intensive and prone to getting trapped in local optima. This embodiment proposes a multi-domain parallel solution strategy based on the virtual element method and GDSW coarse space, which effectively reduces problem complexity and improves solution efficiency and robustness.
[0234] First, based on the constructed mathematical optimization model, the virtual element method is used for domain decomposition. The virtual element method is a technique to enhance the domain decomposition effect by introducing virtual computing units at the subdomain boundaries, thereby improving information transfer and coordination between subdomains. In wastewater treatment optimization, decomposition is performed along three dimensions: functional decomposition into three subdomains—water quality optimization, energy optimization, and chemical optimization; physical spatial decomposition into process units such as pretreatment zone, biochemical zone, secondary sedimentation zone, and advanced treatment zone; and temporal decomposition into three time scales: short-term (hourly), medium-term (daily), and long-term (weekly). This multidimensional decomposition adapts to the natural structure of the wastewater treatment system, facilitating independent solutions for each subdomain.
[0235] Building upon subdomain decomposition, a novel "virtual coupling element" is introduced to handle cross-domain variables and constraints. The virtual coupling element is a mathematical construct used to represent and propagate the mutual influence between subdomains. For example, the DO (Discharge) setpoint affects both effluent ammonia nitrogen (water quality target) and aeration energy consumption (energy target). By introducing the DO control strategy as a virtual coupling element, the two subdomains can be optimized independently while maintaining coordination through this virtual element. The virtual coupling element comprises three components: a representation of coupling variables, an influence propagation function, and a coordination update mechanism. It preserves subdomain independence while accurately capturing complex interdomain coupling relationships.
[0236] For cross-domain constraints (such as total energy consumption limits and water balance), the Lagrange relaxation method is used to transform them into penalty terms in the objective function, enabling each subdomain to gradually satisfy the global constraint requirements while satisfying its own constraints. Combined with the augmented Lagrange method, an adaptive penalty parameter update strategy is designed to accelerate convergence and improve stability.
[0237] Next, a coarse GDSW space is constructed, embedding the weights of the dynamically coupled GNN prediction model. GDSW (Generalized Dryja-Smith-Widlund) coarse space is an efficient preprocessing technique in domain decomposition methods. By constructing a low-dimensional "coarse" problem, it captures global behavior, significantly improving solution efficiency and convergence. In wastewater treatment optimization, the GDSW coarse space is innovatively applied and embedded with GNN model weights, forming an efficient global-local collaborative solution framework.
[0238] The GDSW coarse space construction first identifies interface variables and constraints between all subdomains, such as flow and water quality parameters between adjacent processing units, allocation variables for shared resources, and coupling parameters across functional domains. These interface variables form the "glue" between subdomains, and their consistency is a necessary condition for the global optimum.
[0239] Then, coarse-space basis functions are designed, including three categories: interface basis functions (describing direct coupling relationships between subdomains), global constraint basis functions (expressing global constraints spanning multiple subdomains), and system pattern basis functions (capturing the main operating modes of the system). In particular, the system pattern basis functions are constructed based on the main operating modes extracted from historical data analysis, which can effectively capture the global behavioral characteristics of the system.
[0240] The innovation lies in embedding the weights of the dynamically coupled GNN prediction model into the GDSW coarse space, enhancing the coarse space's ability to express the dynamic characteristics of the system. The GNN model learns the complex dynamic coupling relationships between process units through a graph structure, and its weight matrix contains rich system knowledge. These weight matrices are transformed into enhanced basis functions of the GDSW coarse space through eigenvalue decomposition and projection operations, enabling the coarse space to accurately reflect the dynamic response characteristics and temporal dependencies of process parameters.
[0241] In terms of specific implementation, firstly, the weight matrices of key layers are extracted from the trained GNN model; then, eigenvalue decomposition is performed on these matrices, and the main eigenvectors are selected as candidate basis functions; next, these candidate basis functions are integrated with the existing GDSW basis functions through orthogonalization; finally, an enhanced GDSW coarse space matrix is constructed for the global-local collaborative solution process.
[0242] The two-stage iterative framework ensures coordination between the coarse-space and subdomain solvers: the inner iteration solves local optimization problems in parallel across subdomains, given a fixed coarse-space solution; the outer iteration solves the coarse-space problem based on updated subdomain information, generating a new globally guiding solution. This framework guarantees both the autonomy and parallel efficiency of subdomain solving, while providing a global perspective through the coarse-space problem, accelerating overall convergence.
[0243] To address the nonlinear characteristics of optimization problems, an adaptive coarse space update strategy is designed. During the optimization iteration process, the coarse space is dynamically adjusted based on the system state and convergence characteristics. When significant conflicts occur in the solutions of a subdomain or convergence stalls, coarse space reconstruction is triggered, updating the basis functions and the coarse space matrix to better adapt to the problem characteristics near the current iteration point.
[0244] Based on the aforementioned domain decomposition and coarse space construction, an efficient parallel solution framework is developed. First, suitable optimization algorithms are selected for different subdomains: nonlinear programming methods (such as sequential quadratic programming or interior-point methods) are used to handle complex biochemical dynamic relationships in the water quality subdomain; mixed-integer programming or heuristic algorithms are used to handle discrete decisions such as equipment start-up and shutdown in the energy subdomain; and global search methods (such as particle swarm optimization or differential evolution algorithms) are used to handle multimodal characteristics in the reagent subdomain. This targeted algorithm selection significantly improves the efficiency and quality of local solutions.
[0245] The objective function of the subdomain optimization problem consists of three parts: the original objective of the subdomain (such as water quality compliance, energy cost, etc.), a virtual coupling penalty term (expressing the coupling relationship with other subdomains), and a global coordination term (derived from the coarse space solution). Through this design, subdomain optimization can maintain relative independence while also being aware of global requirements.
[0246] The parallel computing framework is implemented based on a message passing interface (MPI) or a distributed computing framework, employing a master-slave parallel architecture: the master process is responsible for coarse-space solving and global coordination, while each slave process is responsible for optimizing one or more subdomains. An asynchronous iteration strategy is used, allowing different subdomains to iterate independently according to their respective convergence characteristics. The subdomain that completes the current iteration immediately begins the next round of computation, maximizing the efficiency of computing resource utilization. A dynamic load balancing mechanism is also designed to dynamically adjust subdomain allocation based on the computational complexity of the subdomain and the host performance.
[0247] Global convergence is determined using a multi-criteria comprehensive evaluation, including subdomain solution consistency measurement, global objective improvement rate, and constraint satisfaction. Iterative convergence is determined when all three metrics simultaneously reach preset thresholds. To prevent iteration from getting stuck in a loop or stalling, a maximum iteration limit and a stall detection mechanism are added.
[0248] To address the multi-timescale characteristics of wastewater treatment systems, a multi-timescale decomposition technique is employed. Different time steps and update frequencies are used for rapidly changing parameters (such as DO setpoints) and slowly changing parameters (such as MLSS targets) to avoid unnecessary fine-grained calculations. Simultaneously, a hot-start strategy is implemented by leveraging the temporal correlation of the problem: the optimization results of the previous time step are used as the initial solution for the next time step.
[0249] To enhance system robustness, parameter uncertainties are considered in the subdomain optimization problem to generate solutions that still perform well under perturbations. Simultaneously, an anomaly detection and recovery mechanism is designed to automatically detect and take remedial measures when subdomain solutions fail or generate incompatible solutions, ensuring the robustness of the overall solution process.
[0250] Finally, post-processing and decision generation are performed. The final solutions from all subdomains are aggregated to construct a complete global optimization scheme, including operating parameter setpoints for each process unit, equipment operation recommendations, and resource allocation strategies. The original continuous optimization results are then engineered, such as mapping continuous variables to practically settable discrete levels, considering the physical constraints of equipment and operations, and generating easily implementable engineering decisions. Simultaneously, multiple levels of decision output are provided, ranging from detailed technical parameters to advanced management recommendations, to meet the needs of different users.
[0251] This multi-domain parallel solution method based on virtual elements and a coarse-space GDSW successfully decomposes the complex water-energy-chemical co-optimization problem into subproblems that can be solved in parallel. Simultaneously, by maintaining global optimality through the coarse-space approach, it significantly improves solution efficiency and solution quality, enabling real-time optimization decisions. The final output plant-wide water-energy-chemical co-optimization decision scheme minimizes energy consumption and chemical usage while ensuring water quality meets standards, achieving economical and efficient operation of the wastewater treatment plant.
[0252] Example 5:
[0253] In this embodiment, the method further includes:
[0254] Based on the aforementioned water-energy-pharmaceutical collaborative optimization decision-making scheme, a smart water affairs collaborative optimization system architecture is designed, comprising a data layer, a model layer, an application layer, and an integration layer. Data acquisition and processing logic is configured in the data layer, model training and optimization logic is configured in the model layer, and decision support and human-computer interaction logic is configured in the application layer, thus obtaining the smart water affairs collaborative optimization system architecture.
[0255] Based on the aforementioned smart water management collaborative optimization system architecture, computer programs corresponding to data acquisition and processing logic, model training and optimization logic, and decision support and human-computer interaction logic are developed and deployed to construct the aforementioned smart water management collaborative optimization system.
[0256] Based on the aforementioned smart water management collaborative optimization system, a communication connection is established with the existing control system of the wastewater treatment plant through the integration layer. The water-energy-chemical collaborative optimization decision scheme is converted into control commands and sent to the existing control system, thereby realizing the water-energy-chemical collaborative optimization of the wastewater treatment plant.
[0257] Specifically, after generating the water-energy-chemical collaborative optimization decision-making scheme, a complete smart water management collaborative optimization system needs to be constructed to transform the optimization algorithms and models into practical engineering applications, thereby realizing the intelligent operation of wastewater treatment plants. This embodiment details the system architecture design and implementation process, including key steps such as multi-layer architecture design, implementation of functions at each layer, system integration, and deployment.
[0258] First, based on the water-energy-pesticide collaborative optimization decision-making scheme, a smart water management collaborative optimization system architecture is designed, comprising a data layer, a model layer, an application layer, and an integration layer. This layered design follows modern software engineering principles, achieving functional modularization and logical decoupling, facilitating system maintenance and expansion. The data layer is responsible for data acquisition, processing, storage, and management; the model layer is responsible for algorithm implementation, model training, and optimization calculations; the application layer provides decision support and a human-computer interaction interface; and the integration layer is responsible for communication and collaboration with existing control systems.
[0259] The data layer configures data acquisition and processing logic to handle multi-source heterogeneous data from wastewater treatment plants. The data layer comprises four core components: a data acquisition gateway, a data preprocessing engine, a time-series database, and a data service API. The data acquisition gateway supports various industrial protocols (such as OPC UA, Modbus, and Profibus), enabling connections with various sensors, control devices, and existing systems to ensure real-time data acquisition. The data preprocessing engine performs a series of data cleaning and transformation operations, including outlier detection and correction, data interpolation, smoothing filtering, and feature calculation, improving data quality. The time-series database is specifically optimized for storing and querying time-series data, supporting high write rates, high compression ratios, and efficient time-range queries. The data service API provides standardized data access interfaces, enabling upper-layer applications to easily obtain the required data.
[0260] To ensure data quality, a multi-layered data validation framework is implemented, including basic legality checks, statistical anomaly detection, and domain knowledge validation. A self-learning data repair model is developed to automatically fill in missing data and correct outliers based on historical patterns, relevant parameters, and physical models. A data quality scoring system is introduced to assign a reliability score to each data point, reflecting the accuracy and credibility of the data, which allows upper-level models to adjust data usage strategies accordingly.
[0261] The model layer configures the model training and optimization logic, implementing the aforementioned dynamically coupled GNN prediction model and virtual element multi-domain optimization algorithm. The model layer comprises three main functional modules: a prediction modeling system, an optimization solution system, and a model management system. The prediction modeling system implements a dynamically coupled GNN model based on Hermite interpolation, with core components including a graph structure definition module, a feature engineering module, a GNN model training module, and a prediction inference module. The optimization solution system implements a multi-domain parallel optimization algorithm based on virtual elements and a GDSW coarse space, including a problem modeling module, a domain decomposition module, a coarse space construction module, a parallel solution module, and a result synthesis module. The model management system is responsible for model version control, performance monitoring, and lifecycle management.
[0262] To achieve high-performance computing, model compilation technology is employed to convert trained deep learning models into optimized computation graphs and machine code, significantly improving inference speed. Computationally intensive core algorithms are implemented using C++ or CUDA, offering higher performance than general-purpose optimization frameworks. A distributed computing framework is designed to support multi-node parallel computing and implement load-balanced scheduling, dynamically allocating computing tasks based on task complexity and available resources. Dynamic computation graph optimization, computation caching, and pre-computation techniques are introduced to further improve algorithm execution efficiency.
[0263] The application layer configures decision support and human-computer interaction logic, providing an intuitive and efficient user interface. The application layer comprises four main functional modules: a decision analysis system, a visualization system, an interactive control system, and a report management system. The decision analysis system transforms optimization results into understandable decision recommendations, including process parameter optimization, equipment operation optimization, reagent dosing optimization, and energy management optimization. The visualization system displays system status, optimization results, and predicted trends through charts and an interactive interface. The interactive control system provides users with interfaces to configure optimization parameters, trigger optimization calculations, and adjust decisions. The report management system is responsible for data statistics, report generation, and historical record management.
[0264] The core innovation at the application layer is knowledge-enhanced visualization, which transforms complex data relationships and professional knowledge into intuitive expressions. A multi-dimensional data visualization framework is designed to support interactive exploration of the three-dimensional relationship between water quality, energy consumption, and chemicals; spatiotemporal situation visualization is developed to display the spatiotemporal evolution of process status and predicted trends; and knowledge fusion visualization is implemented, combining data presentation with domain knowledge to enhance user understanding. To support team decision-making, a role-aware functional architecture is designed, providing customized function sets and information views based on user roles (such as operators, process engineers, and managers) to ensure that each type of user can efficiently obtain relevant information.
[0265] The integration layer focuses on seamless integration with the existing control system of the wastewater treatment plant, enabling optimization decisions to be translated into actual control commands. The core components of the integration layer include communication interface management, control command conversion, and system status monitoring. Communication interface management is responsible for establishing and maintaining connections with external systems, supporting multiple industrial communication protocols to ensure real-time data exchange and reliable command transmission. Control command conversion translates the high-level decisions generated by the optimization system into specific control commands, adapting to the requirements of different control devices. System status monitoring tracks the execution status and feedback of control commands in real time, promptly detecting communication anomalies or execution deviations.
[0266] The integration layer adopts a hierarchical control architecture, building an optimized control layer on top of the existing basic control system. The basic control layer is handled by the existing DCS / PLC system, processing basic process control and safety protection functions; the optimized control layer is handled by the collaborative optimization system, providing optimized setpoints and operating strategies. An active-passive mode switching mechanism is designed, allowing the system to flexibly switch between optimized control (active mode) and monitoring mode (passive mode), ensuring that operators can take over control when necessary.
[0267] To ensure control security, a multi-layered instruction verification mechanism is implemented, including range checks, rate of change checks, consistency checks, and security rule checks. A progressive instruction execution strategy is adopted, breaking down large parameter adjustments into multiple small steps. After each step, the system response is checked, and the next step is executed only after stability is confirmed. Instruction priority management and rollback recovery mechanisms are designed to quickly restore a stable state in abnormal situations, minimizing risk.
[0268] Based on the designed system architecture, computer programs corresponding to each layer of logic were developed and deployed to construct a complete smart water management collaborative optimization system. A microservice architecture was adopted for system implementation, decoupling each functional component into independent services that work collaboratively through an API gateway and message queues. Each service can be independently extended, upgraded, and maintained, improving system flexibility and reliability. Container technologies (such as Docker) and container orchestration platforms (such as Kubernetes) were used to achieve automatic service deployment, scaling, and fault recovery.
[0269] A phased implementation strategy is adopted, breaking down system deployment into consecutive small steps to reduce risk. The first phase is the parallel monitoring phase, during which the system only collects and analyzes data without intervening in control. The second phase is the suggested control phase, where the system generates optimization suggestions, but operators decide whether to adopt them. The third phase is the partial control phase, where the system takes over the control of some non-critical parameters. The fourth phase is the comprehensive control phase, where the system gradually expands its control scope, ultimately achieving comprehensive water-energy-chemical synergistic optimization control.
[0270] To ensure the successful application of the system, a comprehensive training plan and benefit evaluation mechanism should be developed. Customized training should be provided for different roles, including management, technical, and operational training, to ensure that users at all levels can use the system proficiently. A benefit evaluation system should be designed, including technical benefits (such as water quality improvement), economic benefits (such as energy conservation), and environmental benefits (such as carbon emission reduction), to quantitatively assess the overall value of the system implementation.
[0271] Finally, a communication connection is established with the existing control system of the wastewater treatment plant through the integration layer. The water-energy-chemical synergistic optimization decision scheme is converted into control commands and sent to the existing control system, realizing the synergistic optimization of the wastewater treatment plant's water-energy-chemical processes. A closed-loop feedback mechanism is designed to monitor the actual effect of the optimized control, analyze the deviation between expectations and reality, and continuously adjust and improve the optimization strategy. Adaptive control parameter adjustment is implemented, automatically fine-tuning the control parameters based on actual feedback, so that the control effect continuously approaches the optimal state.
[0272] Through this series of system architecture design and implementation steps, the theory and algorithms of water-energy-chemical synergistic optimization have been transformed into a practically usable engineering system, realizing intelligent and refined operation and management of wastewater treatment plants. This system not only improves treatment efficiency but also reduces energy consumption and chemical usage, lowering operating costs and environmental impact, thus providing strong support for the sustainable development of the wastewater treatment industry.
[0273] Example 6:
[0274] like Figure 3 As shown, the present invention also provides a wastewater treatment plant water-energy-chemical synergistic optimization system, comprising:
[0275] The dynamic coupling graph construction module 10 is used to acquire the process flow and material transfer relationship data between units of the wastewater treatment plant. By defining process units as nodes and material flow as edges, a graph network structure model of the wastewater treatment plant is constructed, and the graph data is preprocessed to obtain the dynamic coupling graph structure data of the wastewater treatment plant.
[0276] GNN model module 20 is used to construct a dynamic coupled graph neural network (GNN) model architecture based on the dynamic coupled graph structure data of the wastewater treatment plant. This architecture includes a node feature encoding layer, a temporal encoding module, a spatial message passing layer, and an attention mechanism layer. The model is trained using historical operating data to obtain a dynamic coupled GNN prediction model that can express the dynamic coupling relationship between process units.
[0277] The optimization function construction module 30 is used to construct a water-energy-chemical synergistic multi-objective optimization function based on the dynamically coupled GNN prediction model, with the objective of minimizing the cost per ton of water treatment, and including factors such as water quality compliance constraints, energy consumption, and chemical dosage, so as to obtain a water-energy-chemical synergistic multi-objective optimization function for optimization decision-making.
[0278] The decision generation module 40 is used to solve the optimal operating parameter settings of each process unit in the future time period based on the water-energy-pharmaceutical synergistic multi-objective optimization function and the dynamic coupling GNN prediction model, and generate a water-energy-pharmaceutical synergistic optimization decision scheme for the entire plant.
[0279] The implementation principles of the functions of each module in this system and the corresponding steps in the method embodiment are the same, and will not be repeated here.
[0280] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for synergistic optimization of water, energy, and chemical processes in wastewater treatment plants, characterized in that: include: Data on the process flow and material transfer relationships between units of a wastewater treatment plant are obtained. A graph network structure model of the wastewater treatment plant is constructed by defining process units as nodes and material flow as edges. The graph data is then preprocessed to obtain dynamic coupled graph structure data of the wastewater treatment plant. Based on the dynamic coupled graph structure data of the wastewater treatment plant, a dynamic coupled graph neural network (GNN) model architecture is constructed, which includes a node feature encoding layer, a temporal encoding module, a spatial message passing layer, and an attention mechanism layer. The model is trained using historical operating data to obtain a dynamic coupled GNN prediction model that can express the dynamic coupling relationship between process units. Based on the dynamically coupled GNN prediction model, a water-energy-chemical synergistic multi-objective optimization function is constructed with the objective of minimizing the cost per ton of water treatment, and includes factors such as water quality compliance constraints, energy consumption, and chemical dosage. This results in a water-energy-chemical synergistic multi-objective optimization function for optimization decision-making. Based on the water-energy-pharmaceutical synergistic multi-objective optimization function and the dynamically coupled GNN prediction model, the optimization algorithm is applied to solve for the optimal operating parameter settings of each process unit in the future time period, and to generate a water-energy-pharmaceutical synergistic optimization decision scheme for the entire plant.
2. The method according to claim 1, characterized in that, The process involves constructing a graph network structure model of the wastewater treatment plant and preprocessing the graph data to obtain dynamically coupled graph structure data of the wastewater treatment plant, including: Based on the aforementioned process flow, design data, and mass transfer relationship data between each unit, the operating parameters and equipment parameters of the bar screen, biological tank, and secondary sedimentation tank are extracted as node features. The connection edges and edge weight attributes between nodes are determined according to the water flow, air flow, and sludge return relationships in the aforementioned mass transfer relationship data, resulting in a static graph structure. Based on the static graph structure and time window parameters, a time slice subgraph is constructed, and an update mechanism for edge weights changing with time and a historical information encoding mechanism are designed to obtain a dynamic time-varying graph structure. The dynamic time-varying graph structure is subjected to feature normalization, missing data processing, and outlier processing to obtain standardized dynamic coupling graph structure data of wastewater treatment plants.
3. The method according to claim 1, characterized in that, The constructed dynamic coupled graph neural network (GNN) model architecture includes a node feature encoding layer, a temporal encoding module, a spatial message passing layer, and an attention mechanism layer. Historical operational data is used for model training to obtain a dynamic coupled GNN prediction model capable of expressing the dynamic coupling relationships between process units, including: Based on the dynamic coupled graph structure data of the wastewater treatment plant, a multilayer perceptron is used to perform nonlinear transformation on the original features of the nodes, and a recurrent neural network unit is used to encode the historical state sequence of the nodes to obtain the hidden state of the nodes containing spatiotemporal features. The spatial messaging layer aggregates neighbor node information and uses a graph attention network mechanism to adaptively learn the importance of different neighbor nodes to obtain updated node features. The updated node features are mapped to target predicted values, and the model is trained using the historical running data to obtain the dynamically coupled GNN prediction model.
4. The method according to claim 1, characterized in that, The construction of the water-energy-chemical synergistic multi-objective optimization function, with the objective of minimizing the cost per ton of water treated, and incorporating factors such as water quality compliance constraints, energy consumption, and chemical dosage, yields the water-energy-chemical synergistic multi-objective optimization function for optimization decision-making, including: Based on the dynamically coupled GNN prediction model, the effluent water quality indicators within the future time window are predicted, and a first sub-objective function is obtained with the goal of minimizing the deviation between the effluent water quality indicators and the standard values. Based on the dynamic coupling GNN prediction model, the power and operating time of each device are predicted. By introducing the time-of-use electricity price factor, a second sub-objective function is obtained with the goal of minimizing energy consumption per unit of water treated. Based on the aforementioned dynamically coupled GNN prediction model, the impact of different reagent dosages on the treatment effect is predicted, resulting in a third sub-objective function aimed at minimizing the reagent cost per unit volume of treated water. Based on the first sub-objective function, the second sub-objective function, and the third sub-objective function, a weighted sum is performed on the first sub-objective function, the second sub-objective function, and the third sub-objective function. The energy cost, the reagent cost, and the water quality violation penalty are uniformly transformed into economic cost to obtain the water-energy-reagent synergistic multi-objective optimization function.
5. The method according to claim 1, characterized in that, The application optimization algorithm solves for the optimal operating parameter settings of each process unit within a future time period, generating a plant-wide water-energy-chemical synergistic optimization decision scheme, including: Based on the aforementioned water-energy-pharmaceutical synergistic multi-objective optimization function, a mathematical optimization model is established that includes constraints on equipment operating range, process parameters, and hydraulic balance, resulting in the mathematical optimization model. Based on the mathematical optimization model, a multi-time-scale rolling optimization strategy is designed, and optimization variables at different time scales are determined to obtain the determined optimization variables. Based on the mathematical optimization model and the determined optimization variables, a heuristic algorithm or decomposition strategy is selected according to the characteristics of the problem to solve the mathematical optimization model, obtain the optimal operating parameter settings of each process unit in the future time period, and generate the water-energy-pharmaceutical synergistic optimization decision scheme.
6. The method according to claim 3, characterized in that, The process of training a model using historical operational data to obtain a dynamically coupled GNN prediction model capable of expressing the dynamic coupling relationships between process units includes: Based on the dynamic coupling graph structure data of the wastewater treatment plant, cluster analysis is used to determine the cluster centers of each process parameter from the historical operation data. Hermite interpolation basis functions are constructed around the cluster centers. The Hermite interpolation basis functions and their corresponding derivative information are integrated into the message aggregation process of the spatial message passing layer to obtain the dynamic coupling GNN prediction model.
7. The method according to claim 4, characterized in that, The construction of the water-energy-chemical synergistic multi-objective optimization function, with the objective of minimizing the cost per ton of water treated, and incorporating factors such as water quality compliance constraints, energy consumption, and chemical dosage, yields the water-energy-chemical synergistic multi-objective optimization function for optimization decision-making, including: Based on the dynamically coupled GNN prediction model and the multi-source historical operation data of the wastewater treatment plant, a spatiotemporal matrix is constructed. The spatiotemporal matrix is decomposed using a smooth separable nonnegative matrix factorization algorithm to extract the basic operation modes of water, energy, and chemicals. Based on the basic operation modes, the cost per ton of water treated, water quality compliance constraints, and the weights of each sub-objective are reconstructed to obtain the water-energy-chemical synergistic multi-objective optimization function.
8. The method according to claim 5, characterized in that, The application optimization algorithm solves for the optimal operating parameter settings of each process unit within a future time period, generating a plant-wide water-energy-chemical synergistic optimization decision scheme, including: Based on the mathematical optimization model, the model is decomposed into multiple subdomains using the virtual element method. A coarse GDSW space is constructed by embedding the weights of the dynamically coupled GNN prediction model. A parallel solver is used to jointly solve each subdomain and the coarse GDSW space to obtain the water-energy-pharmaceutical collaborative optimization decision scheme.
9. The method according to claim 1, characterized in that, Also includes: Based on the aforementioned water-energy-pharmaceutical collaborative optimization decision-making scheme, a smart water affairs collaborative optimization system architecture is designed, comprising a data layer, a model layer, an application layer, and an integration layer. Data acquisition and processing logic is configured in the data layer, model training and optimization logic is configured in the model layer, and decision support and human-computer interaction logic is configured in the application layer, thus obtaining the smart water affairs collaborative optimization system architecture. Based on the aforementioned smart water management collaborative optimization system architecture, computer programs corresponding to data acquisition and processing logic, model training and optimization logic, and decision support and human-computer interaction logic are developed and deployed to construct the aforementioned smart water management collaborative optimization system. Based on the aforementioned smart water management collaborative optimization system, a communication connection is established with the existing control system of the wastewater treatment plant through the integration layer. The water-energy-chemical collaborative optimization decision scheme is converted into control commands and sent to the existing control system, thereby realizing the water-energy-chemical collaborative optimization of the wastewater treatment plant.
10. A water-energy-chemical synergistic optimization system for wastewater treatment plants, characterized in that, include: The dynamic coupling graph construction module is used to obtain the process flow and material transfer relationship data between units of the wastewater treatment plant. By defining process units as nodes and material flow as edges, a graph network structure model of the wastewater treatment plant is constructed, and the graph data is preprocessed to obtain the dynamic coupling graph structure data of the wastewater treatment plant. The GNN model module is used to construct a dynamic coupled graph neural network (GNN) model architecture based on the dynamic coupled graph structure data of the wastewater treatment plant. This architecture includes a node feature encoding layer, a temporal encoding module, a spatial message passing layer, and an attention mechanism layer. The model is trained using historical operating data to obtain a dynamic coupled GNN prediction model that can express the dynamic coupling relationship between process units. The optimization function construction module is used to construct a water-energy-chemical synergistic multi-objective optimization function based on the dynamically coupled GNN prediction model. The function aims to minimize the cost per ton of water treatment and includes factors such as water quality compliance constraints, energy consumption, and chemical dosage. The resulting water-energy-chemical synergistic multi-objective optimization function is used for optimization decision-making. The decision generation module is used to solve the optimal operating parameter settings of each process unit in the future time period based on the water-energy-pharmaceutical synergistic multi-objective optimization function and the dynamic coupling GNN prediction model, and generate a water-energy-pharmaceutical synergistic optimization decision scheme for the entire plant.