A sewage state prediction method and system for a sewage treatment plant

By constructing a wastewater state prediction model based on Takens' theorem and graph structure, and combining it with a spatiotemporal attention mechanism, the problem of lag in influent state prediction for wastewater treatment plants under complex external environments is solved. This enables early control of changes in the external environment, improving the prediction accuracy and the foresight of the control strategy of the wastewater treatment system.

CN122198271BActive Publication Date: 2026-07-21XINTONG EMPOWERMENT (CHANGSHA) ARTIFICIAL INTELLIGENCE IND APPLICATION SYSTEM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XINTONG EMPOWERMENT (CHANGSHA) ARTIFICIAL INTELLIGENCE IND APPLICATION SYSTEM CO LTD
Filing Date
2026-05-15
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing wastewater status prediction models for wastewater treatment plants are unable to detect regional disturbances in a timely manner under complex external environmental conditions, resulting in delayed response of control strategies and difficulty in reflecting the correlation of influent changes among multiple wastewater treatment plants. This can easily lead to overload of the treatment system or substandard effluent.

Method used

A wastewater state prediction model is constructed by adopting a neural network model based on Takens' theorem and a local spatiotemporal modeling branch of graph structure, combined with a spatiotemporal attention mechanism. The model considers the influence of external environmental conditions on the influent state and captures the spatial correlation and temporal dynamics between wastewater treatment plants through the encoder of the neural network model and the graph structure learning mechanism, thereby achieving city-level state prediction.

Benefits of technology

It effectively solves the problem of delayed response to changes in the external environment, enables advance control of the influent status of wastewater treatment plants, and improves the prediction accuracy and forward-looking nature of wastewater treatment system control strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122198271B_ABST
    Figure CN122198271B_ABST
Patent Text Reader

Abstract

The application discloses a sewage state prediction method and system for a sewage treatment plant, and relates to the field of sewage treatment, which comprises the following steps: obtaining a first sewage state, other sewage states, external environment data and equipment operation actions; inputting the external environment data into a neural network model based on Takens theorem to obtain an encoding sequence of the external environment data; inputting the other sewage states into an external world environment model to obtain sewage state change conditions of the sewage treatment plant at a city scale; inputting the first sewage state, the equipment operation actions, the encoding sequence and the sewage state change conditions into a sewage state prediction model to obtain a predicted sewage state, so that the obtained sewage state fully considers the influence of external environment conditions on the evolution of the inflow state, the inflow change is predicted in advance, and the problem that the prediction result of the sewage state in the prior art responds to external environment changes with lag and is difficult to control in advance is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wastewater treatment, and in particular to a method and system for predicting the state of wastewater in a wastewater treatment plant. Background Technology

[0002] Wastewater treatment at wastewater treatment plants relies on the operation of a series of specialized equipment to achieve purification goals. To achieve the optimal balance between wastewater treatment efficiency and equipment energy consumption, we use a predictive model, inputting real-time wastewater data, to generate corresponding equipment operation commands. To verify the accuracy of this predictive model, it needs to be tested in an actual wastewater treatment plant environment. Based on multi-source operational data from the wastewater treatment plant, a high-fidelity simulation environment was constructed, allowing the commands output by the predictive model to be verified in a virtual scenario. Using this high-fidelity simulation environment, the response and operation of wastewater treatment equipment under actual working conditions can be simulated, and simulated wastewater data after executing the command can be output. This allows for closed-loop verification and pre-evaluation of the operational strategy within a virtual environment.

[0003] Currently, existing wastewater condition prediction models mainly focus on modeling and controlling the internal process state and operating parameters of a single wastewater treatment plant, enabling prediction and optimization of the wastewater treatment process under normal operating conditions. However, under complex external environmental conditions, disturbances caused by factors such as regional rainfall and meteorological changes are difficult to detect in a timely manner, thus limiting the proactiveness of control strategies. Furthermore, within a city or region, influent changes at different wastewater treatment plants are often not independent but are influenced by shared meteorological conditions, pipeline structure, and residents' water usage behavior, exhibiting significant spatial correlations. Existing models typically treat influent as an exogenous input, lacking the ability to model the correlation of influent disturbances between multiple wastewater treatment plants, and failing to reflect the propagation and superposition effects of disturbances in the spatial dimension. Since the models primarily acquire information on influent changes that have already occurred or are about to occur, when sudden events such as heavy rainfall or peak water usage occur, the control system often adjusts only after changes in influent load or water quality have already manifested, easily leading to untimely predicted adjustment strategies and increasing the risk of overloaded operation of the treatment system or substandard effluent.

[0004] To address the aforementioned challenges, providing a method and system for predicting the state of wastewater in wastewater treatment plants that takes into account prior variables related to the regional scale of the wastewater treatment plant and the external environmental conditions is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] To address the aforementioned technical problems, the purpose of this application is to provide a wastewater state prediction method and system for wastewater treatment plants. This method considers the impact of external environmental conditions on the evolution of influent state during the wastewater state prediction stage, fundamentally changing the traditional modeling approach that relies solely on internal states for deduction. This effectively solves the problems of delayed response to changes in the external environment and difficulty in early control in existing technologies.

[0006] To achieve the above objectives, this application provides a method and system for predicting the state of wastewater in a wastewater treatment plant.

[0007] The above-mentioned objective of this application is achieved through the following technical solution: A method for predicting the state of wastewater in a wastewater treatment plant, comprising: Acquire the first wastewater status data of the first wastewater treatment plant, the other wastewater status data of other wastewater treatment plants in the city, the external environmental data of the first wastewater treatment plant, and the equipment operation data of the first wastewater treatment plant, and perform data preprocessing; The external environment data is input into a neural network model built based on Takens' theorem, and the encoder in the neural network model is used to obtain the encoded sequence of the external environment data, which is defined as the first external environment data state variable. The other wastewater state data are input into the external world environment model constructed by fusing the local spatiotemporal modeling branch based on graph structure and the global spatiotemporal dependency modeling branch based on spatiotemporal attention, to obtain the wastewater state changes of the wastewater treatment plant at the city scale, which is defined as the city-level state variable. The first wastewater state data, the equipment operation actions, the first external environmental data state variables, and the city-level state variables are input into the trained wastewater state prediction model to obtain the predicted second wastewater state data.

[0008] Preferably, the external environmental data of the first wastewater treatment plant includes: Rainfall, temperature, and air pressure data for the city where the first wastewater treatment plant is located.

[0009] Preferably, the graph-based local spatiotemporal modeling branch specifically comprises: An initial spatial topology is constructed based on other wastewater treatment plants in the city. A graph structure learning mechanism is introduced to learn and update the spatial association strength between other wastewater treatment plants, thereby obtaining a dynamic spatial graph structure. Graph spatiotemporal modeling and temporal modeling are performed on the dynamic spatial graph structure, and finally, a representation of local spatial associations and short-term dynamic environmental states is output.

[0010] Preferably, the global spatiotemporal dependency modeling branch based on spatiotemporal attention specifically includes: Based on the spatiotemporal attention mechanism, the global evolution trend is obtained by modeling the global dependency relationship between the attention of other wastewater treatment plants in the time dimension and the attention in the spatial dimension.

[0011] Preferably, the state transition function of the wastewater state prediction model is as follows: ; in, This refers to the predicted second wastewater state data; To obtain the wastewater state data at time t; To obtain the device's operating actions at time t; This refers to the first external environment data state variable; For the city-level state variables; These are random disturbance parameters within the wastewater treatment plant.

[0012] Preferably, after obtaining the predicted second wastewater state data, the method further includes: The second wastewater status data is input into the control strategy model to obtain the second equipment control action; The process is repeated multiple times, and once the preset conditions are met, the predicted wastewater status data for multiple time steps are obtained.

[0013] Preferably, after obtaining wastewater state data for multiple prediction time steps, the method further includes: Based on the wastewater state data, the control strategy model is trained and optimized using a near-end strategy optimization algorithm to obtain the trained and optimized control strategy model. The reward function optimized during training includes rewards for achieving effluent water quality standards, rewards for penalties related to operating costs and energy consumption, and rewards for proactive operational adjustments.

[0014] Preferably, the control strategy model and the wastewater state prediction model are trained in the cloud and then transmitted to edge devices for deployment.

[0015] Preferably, after obtaining the trained and optimized control policy model, the method further includes: The first wastewater state data is input into the edge device to train the optimized control strategy model and obtain the predicted device control actions.

[0016] A wastewater status prediction system for a wastewater treatment plant, comprising: The acquisition module is used to acquire the first wastewater status data of the first wastewater treatment plant, the other wastewater status data of other wastewater treatment plants in the city, the external environmental data of the first wastewater treatment plant, and the equipment operation actions of the first wastewater treatment plant, and to perform data preprocessing. The first state variable acquisition module uses the external environment data input into a neural network model constructed based on Takens' theorem, and obtains the encoded sequence of the external environment data through the encoder in the neural network model, which is defined as the first external environment data state variable; The second state variable acquisition module uses an external world environment model constructed by fusing the other wastewater state data into a graph-based local spatiotemporal modeling branch and a spatiotemporal attention-based global spatiotemporal dependency modeling branch to obtain the wastewater state changes of the wastewater treatment plant at the city scale, which is defined as a city-level state variable. The prediction module is used to input the first wastewater state data, the equipment operation actions, the first external environment data state variables, and the city-level state variables into the trained wastewater state prediction model to obtain the predicted second wastewater state data.

[0017] In establishing the wastewater state prediction model, this application fully considers other factors affecting wastewater influent flow and quality. It inputs external environmental data from wastewater treatment plants into the constructed neural network model to obtain changes in wastewater influent over a time delay. Furthermore, by acquiring data from wastewater treatment plants within the region and employing structural constraints and feature interaction mechanisms, it obtains the wastewater state changes of the wastewater treatment plant system at the urban scale. This allows the wastewater state prediction model to consider the impact of external environmental conditions on the evolution of influent state, fundamentally changing the traditional modeling approach that relies solely on internal states for deduction. This effectively solves the problems of delayed response to changes in the external environment and difficulty in early intervention in existing technologies. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart of a wastewater state prediction method for a wastewater treatment plant according to an embodiment of this application; Figure 2 This is a structural diagram of a wastewater status prediction system for a wastewater treatment plant, as described in an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] Furthermore, the technical features in the various embodiments or individual embodiments provided in this application can be arbitrarily combined with each other to form a feasible technical solution. Such combination is not constrained by the order of steps and / or the structural composition mode, but must be based on the ability of those skilled in the art to implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0022] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described below are merely illustrative. For example, the division of units and modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or modules can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, and can be electrical, mechanical or other forms.

[0023] In addition, each functional unit in the various embodiments of this application can be integrated into a single processor, or each unit can be a separate device, or two or more units can be integrated into a single device; each functional unit in the various embodiments of this application can be implemented in hardware or in the form of hardware plus software functional units.

[0024] Those skilled in the art will understand that all or part of the steps of the following method embodiments can be implemented by program instructions and related hardware. The aforementioned program instructions can be stored in a computer-readable storage medium. When the program instructions are executed, they perform the steps of the following method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0025] It should be understood that the use of terms such as "system," "device," "unit," and / or "module" in this application is merely one method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.

[0026] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "a plurality of" or "several" means two or more, unless otherwise explicitly specified.

[0027] It should be noted that the structures, proportions, sizes, etc., shown in the accompanying drawings of this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed in the specification, and are not intended to limit the conditions under which this application can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size should still fall within the scope of the technical content disclosed in this application, provided that they do not affect the effects and purposes that this application can produce.

[0028] If a flowchart is used in this application, it is used to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0029] It should also be noted that, in this document, terms such as “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the article or device that includes the aforementioned element.

[0030] like Figure 1 As shown, a method for predicting the state of wastewater in a wastewater treatment plant includes: Step S1: Obtain the first wastewater status data of the first wastewater treatment plant, other wastewater status data of other wastewater treatment plants in the city, external environmental data of the first wastewater treatment plant, and equipment operation data of the first wastewater treatment plant, and perform data preprocessing. Specifically, wastewater status data includes the influent flow rate and water quality of the wastewater treatment plant during wastewater treatment, the water quality and quantity data of each process stage during the treatment process, and the operating parameters of each piece of equipment; External environmental data refers to the data on the state of wastewater affected by the external environment of the wastewater treatment plant; Equipment operation actions refer to the various equipment actions taken by the wastewater treatment plant during wastewater treatment.

[0031] The above data is then processed by timestamp alignment, outlier detection and removal, and data standardization or normalization before being packaged into a unified data format.

[0032] Step S2: Input the external environment data into the neural network model built based on Takens' theorem, and obtain the encoded sequence of the external environment data through the encoder in the neural network model, which is defined as the first external environment data state variable; Specifically, the impact of external environmental data (e.g., weather factors) on wastewater state data has nonlinear and non-stationary dynamic characteristics and has a time lag effect. Delayed embedding is achieved through Takens' theorem to construct a high-dimensional state vector that can maintain the original system dynamic topology. Then, the delayed embedded state vector is constructed into a matrix to characterize the evolution trajectory of the influent disturbance in the time dimension. Establish time series data from external environment data: ; Based on Takens' delayed embedding theorem, a delayed reconstruction operator is defined. Mapping time series data to a high-dimensional representation: ; in, This is the time delay interval; p is the embedding dimension, used to represent the historical state information of the system.

[0033] In Takens' delayed embedding theorem, when the value of p exceeds 2d+1, the mapping preserves the original system state evolution structure in a topological sense, so that the trajectory in the delayed reconstruction space can equivalently characterize the dynamic behavior of the original system. Stack consecutive delayed state vectors to construct a delay embedding matrix from the time series using delay embedding: ; in, , representing the j-th delayed state component in the i-th time window.

[0034] This matrix simultaneously characterizes the cross-correlation relationships between time series at different historical moments, forming a structured representation of the system's dynamic trajectory; After obtaining the delayed embedding matrix Z, in order to further characterize the dynamic evolution of the time series within a local time range, the matrix Z is divided into rows and columns according to a fixed window size, resulting in several two-dimensional sub-blocks. Each two-dimensional sub-block represents the joint changes of the system within a continuous time window at different historical delay scales. Then, the encoder of the Transformer model is used to model the correlation between different time windows. Through a multi-head self-attention mechanism, the encoded sequence of long-range dependencies between local time series is captured, which is the trajectory of the change of external environmental data in different time series.

[0035] Step S3: Input other wastewater state data into the external world environment model constructed by fusing the local spatiotemporal modeling branch based on graph structure and the global spatiotemporal dependency modeling branch based on spatiotemporal attention, and obtain the wastewater state changes of the wastewater treatment plant at the city scale, which are defined as city-level state variables. Specifically, the external world environment model consists of two branches. The first branch, namely the local spatiotemporal modeling branch, is used to characterize local spatial relationships and short-term dynamic propagation characteristics. The second branch, namely the global spatiotemporal dependency modeling branch, is used to capture global dependencies across regions and time scales; The dynamic spatial association structure obtained in the first branch is used as a structural prior to constrain the calculation process of the spatiotemporal self-attention weights in the second branch, thereby enhancing the physical consistency of attention modeling with actual spatial relationships. At the same time, the global spatiotemporal dependency features in the second branch are used to reversely adjust the update process of the spatial association weights in the first branch, thereby improving the ability of local modeling to perceive the propagation of long-term disturbances. After the bi-branch modeling is completed, the environmental state representations output by the two branches are weighted and fused to form a unified city-level external environmental state variable. This environmental state variable, as a recursive representation of the external world environment, is used to describe the spatiotemporal evolution of various wastewater treatment plant systems at the city scale. The weighted fusion formula is expressed as: ; in, , These are the weight parameters for the outputs of the first and second branches, respectively.

[0036] Step S4: Input the first wastewater state data, equipment operation actions, first external environment data state variables, and city-level state variables into the trained wastewater state prediction model to obtain the predicted second wastewater state data.

[0037] Specifically, the first wastewater state prediction model is a neural network model that predicts the wastewater state data after execution based on the current wastewater state data and the operating status of the equipment. The state transition function of the first wastewater state prediction model is: ; in, This refers to the wastewater status data at time t. This is the operating status of the equipment at this time; This represents random disturbances within the plant.

[0038] By incorporating the first external environmental data state variables and city-level state variables into the model, the improved wastewater state prediction model gains insight into the impact of external environmental conditions on the evolution of influent state. Furthermore, by characterizing the spatial correlation and disturbance propagation features among multiple wastewater treatment plants at the city-level scale, it changes the traditional prediction model's approach of relying solely on internal factors of wastewater treatment plants for extrapolation. By considering the impact of external environmental changes on influent conditions in advance during the state prediction stage, it effectively solves the problems of delayed response to external environmental changes and difficulty in early control in existing technologies.

[0039] In some embodiments, the external environmental data of the first wastewater treatment plant includes: Rainfall, temperature, and air pressure data for the city where the first wastewater treatment plant is located.

[0040] In some embodiments, the local spatiotemporal modeling branch based on graph structure is specifically as follows: An initial spatial topology is constructed based on other wastewater treatment plants in the city. A graph structure learning mechanism is introduced to learn and update the spatial association strength between other wastewater treatment plants, thereby obtaining a dynamic spatial graph structure. Graph spatiotemporal modeling and temporal modeling are performed on the dynamic spatial graph structure, and finally, a representation of local spatial associations and short-term dynamic environmental states is output.

[0041] Specifically, each wastewater treatment plant is used as a graph node to construct an initial spatial topology, thereby obtaining the physical connections and prior spatial adjacency relationships between multiple wastewater treatment plants. The graph structure is represented as follows: ; Where V represents the set of wastewater treatment plant nodes; T represents the connection relationship between nodes.

[0042] The adjacency matrix of adjacent wastewater treatment plants can be represented as: ; in This indicates the degree of spatial or physical correlation between adjacent wastewater treatment plants; (0) represents the input layer features; These are learnable parameters that represent the correlation between nodes; d is the embedding vector dimension, that is, the dimension of the space to which it is projected.

[0043] Then, adaptive graph structure learning is introduced to represent the time-varying relationships between various wastewater treatment plants. The calculation formula is as follows: ; in: The learned dynamic adjacency matrix; This is the correction term for the dynamic relationship learned.

[0044] The dynamic relationship correction term can be calculated based on the node state characteristics, and the formula is: ; in: This represents the state characteristics of each wastewater treatment plant at time t; N is the number of nodes in the wastewater treatment plant; F is the dimension of the input state features; It is a learnable mapping function.

[0045] After replacing the dynamic relationship correction term, the final dynamic space graph structure is obtained, represented as: .

[0046] By performing graph-temporal modeling on the dynamic spatial graph structure, the spatial relationships between wastewater treatment plants can be obtained, as shown in the formula: ; in, Representing spatial characteristics; W is the weight matrix; It is an activation function.

[0047] The obtained spatial features are then input into a temporal modeling network to characterize the dynamic evolution over time, thereby obtaining an environmental state representation of local spatial relationships and short-term temporal dynamics at the city scale.

[0048] In some embodiments, the global spatiotemporal dependency modeling branch based on spatiotemporal attention is specifically as follows: Based on the spatiotemporal attention mechanism, the global evolution trend is obtained by modeling the global dependency relationship between the attention of other wastewater treatment plants in the time dimension and the attention in the spatial dimension.

[0049] Specifically, the second branch models the global dependencies of all sewage treatment plants in the city in the time and space dimensions through a spatiotemporal attention mechanism. Through adaptive learning of self-attention weights, it establishes potential relationships between any sewage treatment plants, thereby capturing long-range dependency features across regions and time scales. Finally, it outputs the global evolution trend and long-range disturbance impact of the external environment at the city scale. The wastewater status data X from multiple wastewater treatment plants is obtained and linearly mapped. The Query, Key, and Value are represented as follows: ; in, It is a learnable parameter matrix.

[0050] Then, spatial attention and temporal attention representations are performed separately: Self-attention in spatial dimension N, ; Self-attention in the time dimension T ; Finally, the self-attention in the spatial and temporal dimensions is fused to output the features: This allows us to obtain the global evolution trend and long-range disturbance impact of the external environment at the urban scale.

[0051] In other embodiments, the state transition function of the wastewater state prediction model is specifically: ; in, This refers to the predicted second wastewater state data; To obtain the wastewater state data at time t; To obtain the device's operating actions at time t; This is the first external environment data state variable; For city-level state variables; These are random disturbance parameters within the wastewater treatment plant.

[0052] By introducing external environmental data state variables and urban state variables, the improved wastewater state prediction model incorporates external environmental information and urban-scale wastewater state data, making the prediction results more accurate and comprehensive.

[0053] In other embodiments, after obtaining the predicted second wastewater state data, the method further includes: Input the second wastewater status data into the control strategy model to obtain the control actions of the second equipment; The process is repeated multiple times, and once the preset conditions are met, the predicted wastewater status data for multiple time steps are obtained.

[0054] Specifically, in addition to creating a more realistic simulation environment, the wastewater state prediction model enables the control strategy model to directly run the control strategy of the predicted equipment in the simulation environment, thus avoiding the abnormal situations that would occur if the control strategy model were run in the real environment.

[0055] The wastewater state is predicted by the wastewater state prediction model, and then the predicted wastewater state is input into the control strategy model to obtain the equipment operation strategy to be executed. Then, the control action generated by the obtained equipment operation strategy is input into the wastewater state prediction model to obtain the result of prediction again. This process is repeated multiple times. By using the constructed wastewater state prediction model as a simulation model of the wastewater treatment plant, the control strategy model is trained, so that the equipment operation control actions generated by the control strategy model are more in line with the operation of the real environment.

[0056] In other embodiments, after obtaining wastewater state data for multiple predicted time steps, the method further includes: Based on wastewater status data, the control strategy model is trained and optimized using a near-end strategy optimization algorithm to obtain the trained and optimized control strategy model. The reward function optimized during training includes rewards for achieving effluent water quality standards, rewards for penalties related to operating costs and energy consumption, and rewards for proactive operational adjustments.

[0057] Specifically, wastewater state data is input into the control strategy model to obtain the predicted equipment control strategy. The obtained equipment control strategy and the first wastewater state data are then input into the wastewater state prediction model (i.e., the simulation environment of the wastewater treatment plant) to obtain the wastewater state after the strategy is executed. Based on the results, the control strategy model is optimized using a strategy optimization algorithm. When training the control strategy model, the defined reward function includes rewards for achieving effluent quality standards, rewards for penalties related to operating costs and energy consumption, and rewards for proactive operational adjustments. The formula for the reward for achieving effluent quality standards is as follows: ; in, For the quality of the effluent; This indicates the upper limit threshold for compliance control of the effluent water quality indicators.

[0058] The weight w is used to reflect the adjustment of the penalty sensitivity of water quality indicators under different external environmental conditions. For example, the penalty weight is increased during high load or strong disturbance phases.

[0059] Operating costs and energy consumption penalties are calculated using the following formula: ; in, This indicates that in wastewater treatment, the higher the dosage of PAC (polyaluminum chloride), the higher the cost of the reagent, serving as a negative penalty. It is a comprehensive index of aeration intensity. The higher the DO (dissolved oxygen) value is set, the greater the equipment load and the higher the power consumption. Indicates the operating action of the corresponding device; It is a cost weight.

[0060] The formula for adjusting rewards is: ; in, It represents the control trend predicted by the external environment state, and is used to guide the control strategy model to adjust in advance before changes in the external environment.

[0061] In other embodiments, the control strategy model and the wastewater state prediction model are trained in the cloud and then transmitted to edge devices for deployment.

[0062] Specifically, during model training, the calculations required are more complex, so the model is deployed on a cloud server, optimized, and then transmitted to edge devices for deployment. Finally, the control strategy model's control strategy is sent to the PLC, and the PLC controls the operation of each device.

[0063] By training in the cloud and running at the edge, the equipment configuration at the runtime is reduced, and the deployment difficulty is lowered.

[0064] In some embodiments, after obtaining the trained and optimized control policy model, the method further includes: The first wastewater state data is input into the edge device to train the optimized control strategy model and obtain the predicted device control actions.

[0065] Specifically, after training and optimizing the control strategy model through the wastewater state prediction model, the predicted equipment control actions are obtained by inputting the first wastewater state data, and then sent to the PLC to control the operation of the equipment.

[0066] like Figure 2 As shown, a wastewater status prediction system for a wastewater treatment plant includes: The acquisition module 101 is used to acquire the first wastewater status data of the first wastewater treatment plant, the other wastewater status data of other wastewater treatment plants in the city, the external environmental data of the first wastewater treatment plant, and the equipment operation actions of the first wastewater treatment plant, and to perform data preprocessing. The first state variable acquisition module 102 uses external environment data input into a neural network model built based on Takens' theorem, and obtains the encoded sequence of external environment data through the encoder in the neural network model, which is defined as the first external environment data state variable. The second state variable acquisition module 103 uses an external world environment model constructed by fusing other wastewater state data into a graph-based local spatiotemporal modeling branch and a spatiotemporal attention-based global spatiotemporal dependency modeling branch to obtain the wastewater state changes of wastewater treatment plants at the city scale, which is defined as city-level state variables. The prediction module 104 is used to input the first wastewater state data, equipment operation actions, first external environment data state variables and city-level state variables into the trained wastewater state prediction model to obtain the predicted second wastewater state data.

[0067] In establishing the wastewater state prediction model, this application fully considers other factors affecting wastewater influent flow and quality. It inputs external environmental data from wastewater treatment plants into the constructed neural network model to obtain changes in wastewater influent over a time delay. Furthermore, by acquiring data from wastewater treatment plants within the region and employing structural constraints and feature interaction mechanisms, it obtains the wastewater state changes of the wastewater treatment plant system at the urban scale. This allows the constructed wastewater state prediction model to take into account the impact of external environmental conditions on the evolution of influent state, fundamentally changing the traditional modeling approach that relies solely on internal states for deduction. This effectively solves the problems of delayed response to changes in the external environment and difficulty in early intervention in existing technologies.

[0068] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0069] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0070] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for predicting the state of wastewater in a wastewater treatment plant, characterized in that, include: Acquire the first wastewater status data of the first wastewater treatment plant, the other wastewater status data of other wastewater treatment plants in the city, the external environmental data of the first wastewater treatment plant, and the equipment operation data of the first wastewater treatment plant, and perform data preprocessing; The external environment data is input into a neural network model built based on Takens' theorem, and the encoder in the neural network model is used to obtain the encoded sequence of the external environment data, which is defined as the first external environment data state variable. The other wastewater state data are input into the external world environment model constructed by fusing the local spatiotemporal modeling branch based on graph structure and the global spatiotemporal dependency modeling branch based on spatiotemporal attention, to obtain the wastewater state changes of the wastewater treatment plant at the city scale, which is defined as the city-level state variable. The first wastewater state data, the equipment operation action, the first external environment data state variables, and the city-level state variables are input into the trained wastewater state prediction model to obtain the predicted second wastewater state data. Specifically, the graph-based local spatiotemporal modeling branch is as follows: An initial spatial topology is constructed based on other wastewater treatment plants in the city. A graph structure learning mechanism is introduced to learn and update the spatial association strength between other wastewater treatment plants to obtain a dynamic spatial graph structure. Graph spatiotemporal modeling and temporal modeling are performed on the dynamic spatial graph structure, and finally, a representation of local spatial association and short-term dynamic environmental state is output. The global spatiotemporal dependency modeling branch based on spatiotemporal attention is specifically as follows: Based on the spatiotemporal attention mechanism, the global evolution trend is obtained by modeling the global dependency relationship between the attention of other wastewater treatment plants in the time dimension and the attention in the spatial dimension.

2. The wastewater status prediction method for wastewater treatment plants according to claim 1, characterized in that, External environmental data for the No. 1 wastewater treatment plant includes: Rainfall, temperature, and air pressure data for the city where the first wastewater treatment plant is located.

3. The wastewater status prediction method for wastewater treatment plants according to claim 1, characterized in that, The state transition function of the wastewater state prediction model is as follows: ; in, This refers to the predicted second wastewater state data; To obtain the wastewater state data at time t; To obtain the device's operating actions at time t; This refers to the first external environment data state variable; For the city-level state variables; These are random disturbance parameters within the wastewater treatment plant.

4. The wastewater status prediction method for wastewater treatment plants according to claim 1, characterized in that, After obtaining the predicted second wastewater state data, the following is also included: The second wastewater status data is input into the control strategy model to obtain the second equipment control action; The process is repeated multiple times, and once the preset conditions are met, the predicted wastewater status data for multiple time steps are obtained.

5. The wastewater status prediction method for wastewater treatment plants according to claim 4, characterized in that, After obtaining wastewater state data for multiple prediction time steps, the process also includes: Based on the wastewater state data, the control strategy model is trained and optimized using a near-end strategy optimization algorithm to obtain the trained and optimized control strategy model. The reward function optimized during training includes rewards for achieving effluent water quality standards, rewards for penalties related to operating costs and energy consumption, and rewards for proactive operational adjustments.

6. The wastewater status prediction method for wastewater treatment plants according to claim 5, characterized in that, The control strategy model and wastewater state prediction model are trained in the cloud and then transmitted to edge devices for deployment.

7. The wastewater status prediction method for wastewater treatment plants according to claim 5, characterized in that, After obtaining the trained and optimized control policy model, the following is also included: The first wastewater state data is input into the edge device to train the optimized control strategy model and obtain the predicted device control actions.

8. A wastewater state prediction system for a wastewater treatment plant, applied to the wastewater state prediction method for a wastewater treatment plant as described in claim 1, characterized in that, include: The acquisition module is used to acquire the first wastewater status data of the first wastewater treatment plant, the other wastewater status data of other wastewater treatment plants in the city, the external environmental data of the first wastewater treatment plant, and the equipment operation actions of the first wastewater treatment plant, and to perform data preprocessing. The first state variable acquisition module uses the external environment data input into a neural network model constructed based on Takens' theorem, and obtains the encoded sequence of the external environment data through the encoder in the neural network model, which is defined as the first external environment data state variable; The second state variable acquisition module uses an external world environment model constructed by fusing the other wastewater state data into a graph-based local spatiotemporal modeling branch and a spatiotemporal attention-based global spatiotemporal dependency modeling branch to obtain the wastewater state changes of the wastewater treatment plant at the city scale, which is defined as a city-level state variable. The prediction module is used to input the first wastewater state data, the equipment operation actions, the first external environment data state variables, and the city-level state variables into the trained wastewater state prediction model to obtain the predicted second wastewater state data.