Sewage plant water quality prediction and management operation method, computer program product and electronic product

By combining GeoMAN and time series models, a water quality prediction method has been developed that addresses the issues of parameter complexity and long time periods in wastewater quality prediction using the ASM model, thereby achieving higher accuracy in water quality prediction and optimized operation management.

CN120877962APending Publication Date: 2025-10-31CHENGDU ENVIRONMENTAL INVESTMENT GROUP CO LTD +1

Patent Information

Application Number
CN202511034370.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing ASM models suffer from problems such as complex parameter measurement, long time periods, and neglect of dynamic effects in wastewater quality prediction. Shallow LSTMs are unable to capture complex nonlinear relationships, resulting in insufficient prediction accuracy.

Method used

A cascaded GeoMAN model and a time series model are adopted, combined with a hydraulic residence time misalignment compensation module, an environmental feature encoder, and a multi-scale dilated convolutional block. Through multi-layer residual bidirectional LSTM layers and gated adaptive attention layers, the spatial and temporal features of water quality data are captured, a misalignment processing database is constructed, and multi-source data is used for training to improve prediction accuracy.

Benefits of technology

By fully understanding the spatial and temporal complexity of water quality data, the problem of data misalignment is solved, the accuracy and robustness of water quality prediction are improved, and it can adaptively adjust in complex environmental changes to achieve precise pollutant reduction and cost optimization strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120877962A_ABST
    Figure CN120877962A_ABST
Patent Text Reader

Abstract

The invention discloses a sewage plant water quality prediction and management operation method, a computer program product and an electronic product, and belongs to the technical field of water quality prediction.The method comprises the steps that a water quality prediction model is constructed, the water quality prediction model comprises a GeoMAN model and a time sequence model which are cascaded, and the GeoMAN model comprises an HRT dislocation compensation module; the dynamic alignment module is used for carrying out dynamic alignment treatment on the effluent quality data of each treatment unit according to the actual hydraulic retention time of each process section treatment unit; and after training the water quality prediction model, performing water quality prediction based on the real-time data, and outputting a water quality prediction result. The spatial features of the data are captured through the GeoMAN model, and the time features of the data are captured through the time sequence model, so that the spatial and time complexity of the water quality data and the process control parameter data is comprehensively understood, and the water quality prediction precision is improved. And the HRT dislocation compensation module is used for carrying out time alignment treatment on the effluent quality data of the treatment units in different process sections, so that the accuracy of water quality prediction can be further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality prediction technology, and in particular to a method for predicting and managing water quality in wastewater treatment plants, a computer program product, and an electronic product. Background Technology

[0002] The influent water quality and the water quality of each unit within a wastewater treatment plant are key reference indicators for the design and upgrading of wastewater treatment facilities. They determine the selection of core treatment processes and critical equipment, and are also important bases for adjusting process parameters and optimizing production operation management. Accurately predicting wastewater quality and constructing a parameter adjustment management and operation optimization system that outputs multi-objective optimization can provide data support for wastewater treatment plants, effectively reduce operating costs, and achieve intelligent water quality prediction and optimal intelligent strategy management for wastewater treatment plants.

[0003] The ASM model, developed by the International Water Association, is based on biodynamics for wastewater quality prediction. However, it suffers from drawbacks such as complex parameter determination, long time periods, and neglect of kinetic influences, leading to limitations in its water quality prediction capabilities. Standard LSTM, as a type of deep learning time series model, can handle long-term dependencies well; however, shallow LSTMs struggle to capture complex nonlinear relationships, thus its prediction accuracy still needs further improvement. Summary of the Invention

[0004] The purpose of this invention is to overcome the problems of the prior art and provide a method for predicting and managing the water quality of a wastewater treatment plant, a computer program product, and an electronic product.

[0005] The objective of this invention is achieved through the following technical solution: a method for predicting water quality in wastewater treatment plants, comprising the following steps:

[0006] Collect water quality data and process control parameter data from each inlet and outlet of the wastewater treatment plant and the end of each process section.

[0007] A water quality prediction model is constructed. The water quality prediction model includes a cascaded GeoMAN model and a time series model. The GeoMAN model includes a first input layer, a preprocessing unit, an encoder, and a decoder connected in sequence. The preprocessing unit includes a hydraulic residence time misalignment compensation module, which is used to dynamically align the effluent water quality data of each treatment unit according to the actual hydraulic residence time of each process section treatment unit.

[0008] Water quality prediction models are trained using water quality data and process control parameter data;

[0009] The real-time water quality data and process control parameter data of the wastewater treatment plant are input into the trained water quality prediction model to obtain the water quality prediction results.

[0010] In one example, after collecting water quality data and process control parameter data from each inlet and outlet of the wastewater treatment plant and the end of each process section, the method further includes:

[0011] Based on the actual residence time range of different process sections, water quality data of different process sections are collected and recorded to construct a misaligned treatment database.

[0012] In one example, before inputting the real-time water quality data and process control parameter data of the wastewater treatment plant into the trained water quality prediction model, the process further includes:

[0013] Collect traffic data, external environment data, and weather data. Traffic data includes cumulative traffic and instantaneous traffic, while external environment data includes seasonal and time-of-day characteristics.

[0014] The water quality prediction model is trained using water quality data, process control parameter data, flow rate data, external environmental data, and weather data.

[0015] In one example, the GeoMAN model also includes an environmental feature encoder for periodically embedding encoded seasonal and time-period features, and uses an attention mechanism to weight the meteorological data.

[0016] In one example, the output of the environmental feature encoder is connected to a multi-scale dilated convolutional block, including multiple dilated convolutional layers, for capturing local and / or global spatial relationships of different processing units.

[0017] In one example, the time series model includes a second input layer connected in sequence, a stacked multi-layer residual bidirectional LSTM layer, a gated adaptive attention layer, and a second output layer;

[0018] The multi-layer residual bidirectional LSTM layer includes bidirectional LSTM layers, and the input of each bidirectional LSTM layer is the sum of the residuals between the output of the previous bidirectional LSTM layer and the original input;

[0019] The gated adaptive attention layer is used to first compute global and local context vectors, and then generate a gated vector through an activation function to dynamically fuse the global and local context vectors. Finally, a context vector for prediction is generated based on the attention weights.

[0020] It should be further noted that the technical features corresponding to the above examples of water quality prediction methods can be combined or replaced to form new technical solutions.

[0021] The present invention also includes a wastewater treatment plant water quality management and operation method, implemented based on the water quality prediction method formed by any or more of the above examples, the management and operation method comprising:

[0022] Construct the objective function for the target pollutant reduction amount :

[0023] ;

[0024] in, , These represent the input pollutant concentration and the output pollutant concentration, respectively. , These are all data labels, representing the upper and lower bounds of the summation calculation;

[0025] Solve the objective function based on the water quality prediction results. The pollutant reduction strategy is obtained, and the wastewater treatment is controlled according to the pollutant reduction strategy.

[0026] In one example, the management operation method further includes:

[0027] Construct a cost minimization objective function :

[0028] ;

[0029] in, Indicates the energy consumption coefficient; This indicates the aeration volume adjustment parameter; Indicates the dosage coefficient; This indicates the parameter for adjusting the dosage; , , All are data tags;

[0030] According to the objective function Objective function Establish the overall objective function :

[0031] ;

[0032] in, Indicates the weighting coefficient;

[0033] Solve the overall objective function based on the water quality prediction results. This leads to a comprehensive control strategy for pollutant reduction and cost minimization, and wastewater treatment is controlled based on this comprehensive control strategy.

[0034] The present invention also includes a computer program product comprising a computer program that, when executed by a processor, implements the steps of the wastewater treatment plant water quality prediction method formed by any or a combination of the above examples.

[0035] The present invention also includes an electronic product comprising a memory and a processor, the memory storing computer instructions executable on the processor, the processor executing the steps of the wastewater treatment plant water quality prediction method formed by any or more of the above examples when executing the computer instructions.

[0036] Compared with the prior art, the beneficial effects of the present invention are:

[0037] 1. In one example, the GeoMAN model is used to capture the spatial characteristics of the data, and the time series model is used to capture the temporal characteristics of the data. This allows for a more comprehensive understanding of the spatial and temporal complexity of water quality data and process control parameter data, thereby improving the accuracy of water quality prediction. At the same time, the hydraulic residence time misalignment compensation module is used to perform time alignment processing on the effluent water quality data of different process units. This can effectively solve the data misalignment problem caused by the difference in actual hydraulic residence time between different treatment units, thereby ensuring the consistency of water quality data in time and further improving the accuracy of water quality prediction.

[0038] 2. In one example, by constructing a misalignment processing database, it is convenient to query and compare water quality data from different process stages, providing a data foundation for subsequent data analysis.

[0039] 3. In one example, water quality data and process control parameter data directly affect the wastewater treatment effect. Flow data can help the model understand the impact of changes in wastewater input on the treatment effect. External environment and weather data also affect the wastewater treatment effect. Using multi-source data (water quality data, process control parameter data, flow data, external environment data, and weather data) to train the model can more comprehensively capture various factors affecting water quality changes and further improve the model's prediction accuracy.

[0040] 4. In one example, an environmental feature encoder is used to process seasonal and time-period features to capture periodic patterns in time series data; at the same time, an attention mechanism is used to weight meteorological data, thereby dynamically adjusting the importance of meteorological data, making the model more adaptable to complex environmental changes, and thus further improving the model's prediction accuracy.

[0041] 5. In one example, multi-scale dilated convolutional blocks are used to capture the local and global spatial relationships between different process units. By setting convolutional kernels with different dilation rates, it is possible to capture the local relationships between adjacent processing units, the medium-range dependencies across a single processing unit, and the remote correlations at the plant level. This enables the model to fully understand the complex geospatial relationships between processing units, thereby improving the accuracy of water quality prediction.

[0042] 6. In one example, the multi-layer residual bidirectional LSTM layer, through the stacked bidirectional LSTM structure and residual connections, can effectively capture long-term dependencies in time series data, while alleviating the gradient vanishing problem in deep networks and enhancing the model's ability to learn complex time series features. The gated adaptive attention layer calculates global and local context vectors and uses activation functions to generate gate vectors to dynamically fuse this information, enabling the model to adaptively focus on important features at different time steps, further improving the modeling accuracy of complex data. As a result, time series models can more accurately capture key information when processing complex time series data, improving the accuracy and robustness of predictions.

[0043] 7. In one example, by constructing a target pollutant reduction objective function and combining it with water quality prediction results, a pollutant reduction strategy can be obtained, thereby achieving precise control of the wastewater treatment scheme. By constructing a cost minimization objective function and combining it with water quality prediction results, a cost minimization optimization strategy can be obtained to achieve pollutant reduction at the lowest economic cost. Based on the target pollutant reduction objective function and the cost minimization objective function, a total objective function is constructed, and combined with water quality prediction results, a comprehensive control strategy is obtained. This quantifies the relationship between pollutant reduction and cost, clarifies the specific impact mechanism of input data on output results, and facilitates decision-making and control in practical applications. That is, under the premise of meeting wastewater treatment standards, the optimal wastewater operation and management scheme is formulated. Attached Figure Description

[0044] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. The accompanying drawings are provided to provide a further understanding of the present application and constitute a part of the present application. The same reference numerals are used in these drawings to denote the same or similar parts. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application.

[0045] Figure 1 This is a flowchart of a water quality prediction method provided as an example of the present invention;

[0046] Figure 2 This is a GeoMAN model architecture diagram provided as an example of the present invention;

[0047] Figure 3 This is a time series model architecture diagram provided as an example of the present invention;

[0048] Figure 4 A flowchart of a preferred water quality prediction method provided as an example of the present invention. Detailed Implementation

[0049] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0050] In the description of this invention, it should be noted that the directions or positional relationships indicated by terms such as "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer" are based on the directions or positional relationships shown in the accompanying drawings. They are used only for the convenience of describing this invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention. Furthermore, the use of ordinal numbers (e.g., "first and second," "first to fourth," etc.) is for distinguishing objects and is not limited to this order, and should not be construed as indicating or implying relative importance.

[0051] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0052] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0053] In one example, such as Figure 1 As shown, a method for predicting water quality in wastewater treatment plants includes the following steps:

[0054] S1: Collect water quality data and process control parameter data at each inlet and outlet of the wastewater treatment plant and at the end of each process section.

[0055] Specifically, various types of sensors are installed in typical wastewater treatment plants (with treatment capacities of 500,000 to 1,000,000 cubic meters per day; 200,000 to 500,000 cubic meters per day; 100,000 to 200,000 cubic meters per day; 50,000 to 100,000 cubic meters per day; and 10,000 to 50,000 cubic meters per day, respectively). These include water quality monitoring sensors and process control parameter sensors. Specifically, these sensors measure chemical oxygen demand (COD), biochemical oxygen demand (BOD), ammonia nitrogen (NH3-N), total phosphorus (TP), and total ammonia (TN) at the inlet and outlet of the wastewater treatment plant and at the front and rear ends of each process section. The sensor probes are fixed and extend a certain distance into the wastewater, and the sensors collect data at certain time intervals.

[0056] S2: Construct a water quality prediction model. Specifically, the water quality prediction model includes a cascaded GeoMAN model and a time series model, such as... Figure 2 As shown, the GeoMAN model includes a first input layer (N-dimensional input), a preprocessing unit, an encoder, and a decoder connected in sequence. The preprocessing unit includes a hydraulic residence time misalignment compensation module (HRT misalignment compensation module), which is used to dynamically align the effluent water quality data of each treatment unit according to the actual hydraulic residence time of each process section treatment unit.

[0057] More specifically, the first input layer receives multivariate time-series data with a time window length of T (in hours), including: water quality data, process control parameter data, and hydraulic retention time (HRT) parameters for each treatment unit. Water quality data includes influent COD, BOD, NH3-N, TP, TN, etc., and effluent COD, BOD, NH3-N, etc., from each treatment unit (primary sedimentation tank, biological treatment tank, secondary sedimentation tank, and advanced treatment unit). Process control parameter data includes aeration flow rate, chemical dosage (C source + disinfectant), etc. The pretreatment layer includes an HRT misalignment compensation module, used to establish a time-shift matrix based on the actual HRT of each treatment unit, dynamically aligning the effluent water quality data. Specifically, the HRT misalignment compensation module includes a time-shift matrix construction layer, used to establish a dynamic time-shift matrix. This matrix aligns the effluent water quality data from different treatment units according to their hydraulic retention time (HRT). For example, if the default HRT for the biological process is 16 hours, its effluent data needs to be shifted forward by 16 hours; if the HRT for advanced treatment is 1 hour, it is shifted by 1 hour. Then, based on the calculated time shift, the effluent water quality data from each treatment unit is filled into the time-shift matrix. This invention utilizes the HRT misalignment compensation module to align the effluent water quality data from different process stages, effectively solving the data misalignment problem caused by differences in actual hydraulic retention time between different treatment units. This ensures the consistency of water quality data over time and further improves the accuracy of water quality prediction. Furthermore, the encoder encodes the input multivariate time series data into a context vector, and the decoder uses the context vector to generate prediction results.

[0058] Optionally, the GeoMAN model may also include an external factor fusion module, the output of which is connected to the decoder. The external factor fusion module extracts feature information such as flow data, external environmental data, and weather data, and performs feature fusion processing by combining the corresponding sensor ID, data acquisition time, and sensor spatial information. Finally, the fused feature vector is input into the decoder, where it is used together with the context vector generated by the encoder for water quality prediction.

[0059] Furthermore, the time series model can be any of the following: Long Short-Term Memory Network (LSTM), Gated Recurrent Unit (GRU), Sequence-to-Sequence Model (Seq2Seq), etc. In this example, a Long Short-Term Memory Network is preferred.

[0060] S3: Train the water quality prediction model using water quality data and process control parameter data, including:

[0061] After preprocessing and feature selection of water quality data and process control parameter data, the datasets are divided into training, validation, and test sets for model training, tuning, and evaluation. The training set, typically comprising 70% of the total data, is used to train the model and optimize parameters, enabling the model to capture patterns and regularities in the data. The validation set, typically comprising 15% of the total data, is used for model tuning and hyperparameter selection, evaluating the model's performance during training and preventing overfitting. The test set, typically comprising 15% of the total data, is used for final performance evaluation, assessing the model's generalization ability and ensuring good performance even on unseen data.

[0062] Dataset partitioning can be based on time series, random partitioning, or partitioning based on data distribution consistency. Specifically, partitioning according to time series is chosen because water quality data has time-series characteristics; the dataset should be partitioned in chronological order, typically into training, validation, and test sets, to ensure the model can learn temporal dependencies. If the data does not have obvious time dependencies, random partitioning can be used to ensure consistent distribution across the training, validation, and test sets. To ensure consistent data distribution across the training, validation, and test sets and avoid model bias caused by inconsistent data distribution, the consistency of data distribution can be verified by statistically analyzing metrics such as the mean and variance of each dataset; that is, partitioning based on data distribution consistency.

[0063] To further ensure the model's stability and generalization ability, cross-validation can be used. Specifically, the training set is further divided into multiple subsets, and one subset is used as the validation set in turn, while the remaining subsets are used as the training set. This process is repeated multiple times, and the average value is taken as the model's performance evaluation result.

[0064] In addition, if the amount of data is small, data augmentation methods can be used, such as sliding windows for time series data and data interpolation, to increase the diversity of training data and improve the generalization ability of the model.

[0065] S4: Input the real-time water quality data and process control parameter data of the wastewater treatment plant into the trained water quality prediction model to obtain the water quality prediction results.

[0066] In step S4, the spatial characteristics of the data are captured by the GeoMAN model, and the temporal characteristics of the data are captured by the time series model. When processing the biological treatment tank data, the GeoMAN model captures the spatial relationship between the biological treatment tank and the primary sedimentation tank, while the time series model captures the change pattern of dissolved oxygen concentration over time. The two work together to consider both spatial and temporal characteristics, thereby gaining a more comprehensive understanding of the spatial and temporal complexity of the input real-time water quality data and real-time process control parameter data, and thus outputting high-precision water quality prediction results.

[0067] In one example, after collecting water quality data and process control parameter data from each inlet and outlet of the wastewater treatment plant and the end of each process section, the process also includes:

[0068] Based on the actual residence time range of different process sections, water quality data of different process sections are collected and recorded to construct a misaligned treatment database.

[0069] Specifically, the process stages include pretreatment, biological treatment, and advanced treatment. Pretreatment typically lasts 10 minutes to 2 hours, with water quality data recorded and categorized according to specific retention time ranges (e.g., 10 minutes, 1 hour, etc.). Biological treatment typically lasts 12 to 24 hours, with water quality data recorded and categorized according to retention time ranges (e.g., 12 hours, 24 hours, etc.). Advanced treatment typically lasts 1 to 3 hours, with water quality data recorded and categorized according to retention time ranges (e.g., 1 hour, 3 hours, etc.). To address the data discrepancies caused by different treatment process retention times, separate databases for different process stages are established. This facilitates data misalignment, aligning monitoring data from different process stages in time, enabling more accurate analysis of the impact of each process stage on water quality and the overall operational effectiveness of the wastewater treatment system.

[0070] In one example, before inputting real-time water quality data and process control parameter data from the wastewater treatment plant into the trained water quality prediction model, the following steps are also included:

[0071] (1) Collect flow data, external environment data, and weather data. Flow data includes cumulative flow and instantaneous flow, while external environment data includes seasonal characteristics and time-period characteristics. Cumulative flow records the total volume of water passing through the treatment process over a period of time (such as a day or a week), which helps to understand the overall treatment scale and operating efficiency of the wastewater treatment plant. Instantaneous flow records the flow value at a certain moment, which helps to analyze flow fluctuations and flow changes in different time periods (such as peak and off-peak periods). Seasonal characteristics are seasonal identifiers, which divide the data into four seasons: spring, summer, autumn, and winter based on the month information in the date column. Environmental factors such as temperature and rainfall in different seasons will affect the wastewater treatment effect. Time-period characteristics are daily time-period identifiers, which divide the day into three periods: morning, afternoon, and evening based on the hour information in the date column. Temperature, sunlight, and other conditions in different time periods will also affect the wastewater treatment process. Weather data, such as different rainstorm intensities (medium, heavy, and light), will lead to different increases in wastewater volume and may carry a large amount of pollutants into the wastewater treatment plant, which will have a significant impact on the treatment effect.

[0072] (2) The water quality prediction model is trained using water quality data, process control parameter data, flow rate data, external environment data, and weather data. At this time, the flow rate data, external environment data, and weather data after preprocessing and feature engineering can be directly input into the first input layer or into the external factor fusion module. Feature engineering refers to extracting more features from the original data according to specific needs, such as calculating the rate of change of flow rate and the duration of weather.

[0073] Preferably, after collecting water quality data, process control parameter data, flow data, external environment data, and weather data, the process also includes preprocessing the collected data, i.e., data cleaning, including removing outliers and / or data normalization and / or data missing value filling. The above three data cleaning methods are preferred to be used to achieve data preprocessing.

[0074] The process includes removing outliers from water quality data, process control parameter data, flow rate data, external environment data, and weather data. This involves removing obviously erroneous data points, such as data exceeding the sensor's range. Normalization of these data maps them to a specific interval (e.g., [0, 1]) to eliminate the influence of different data magnitudes on the model. Missing values ​​in these data are filled in by averaging the values ​​of adjacent data points. For example, the formula for filling in missing values ​​for Chemical Oxygen Demand (COD) data is as follows:

[0075]

[0076] Among them, among them, yes Missing chemical oxygen demand (COD) data in real-time water quality monitoring data. yes real-time wastewater quality monitoring data, yes real-time wastewater quality monitoring data, yes real-time wastewater quality monitoring data, yes real-time wastewater quality monitoring data, yes real-time wastewater quality monitoring data, yes real-time wastewater quality monitoring data, For data labels.

[0077] In one example, the GeoMAN model also includes an environmental feature encoder, which can be integrated into the external factor fusion module or the preprocessing layer; that is, the output of the HRT misalignment compensation module is connected to the environmental feature encoder. In this example, the environmental feature encoder is used to periodically embed and encode seasonal and time-period features, that is, to convert discrete periodic features such as seasons and time periods into vector representations, and to use an attention mechanism to weight the meteorological data.

[0078] Specifically, for seasonal feature encoding, the seasons are mapped to continuous values ​​from 0 to 1, such as spring = 0.0, summer = 0.25, autumn = 0.5, and winter = 0.75, and periodic codes are generated using sine and cosine functions:

[0079] ;

[0080] ;

[0081] in, This represents a periodic encoding of seasonal features generated based on a sine function; This represents a periodic encoding of seasonal features generated based on a cosine function; Indicates the season number.

[0082] For time-based feature encoding, a day is divided into five periods: morning, noon, afternoon, evening, and early morning, and encoded using the sin / cos function. Specifically, the 24 hours of a day are divided into five periods: morning (7-11 AM), noon (11 AM-2 PM), afternoon (2 PM-5 PM), evening (5 PM-11 PM), and early morning (11 PM-7 AM), mapped to continuous values ​​of 0-1, and periodic codes are generated using sine and cosine functions.

[0083] ;

[0084] ;

[0085] in, This represents a periodic encoding of time-period features generated based on a sine function; This represents a periodic encoding of time-segment features generated based on a cosine function; Indicates the season number.

[0086] Through the aforementioned periodic coding process, the periodic patterns of time-period changes and differences in water use patterns can be captured, thereby more accurately reflecting the inherent laws of water quality changes. This enables water quality prediction models to better understand the dynamic changes of water quality indicators under daily, seasonal, and special events (such as rainstorms and holidays), thus improving the accuracy and reliability of water quality prediction.

[0087] Furthermore, attention mechanisms are used to weight the meteorological data, including:

[0088] (1) Encode the intensity of rainstorm events, that is: divide rainstorms into three levels: "small, medium and large" and assign initial values ​​to them respectively (e.g., small = 0.2, medium = 0.5, large = 0.8);

[0089] (2) Attention weight calculation:

[0090] Attention weights for rainstorm events are generated using fully connected layers. :

[0091] ;

[0092] in, This represents the activation function, used to convert the result of a linear combination into attention weights in the form of a probability distribution; This represents the weight matrix, used to learn the importance of rainstorm events; The feature vector representing the intensity of a rainstorm; This indicates the bias term.

[0093] In this example, an attention mechanism is used to weight meteorological data, dynamically adjusting its impact on forecasts based on rainfall intensity. Under extreme weather conditions such as torrential rain, assigning higher weights allows the model to more accurately capture the significant impact of rainfall on water quality, thereby improving forecast accuracy and reliability. This dynamic adjustment capability enables the model to adaptively adjust its focus when facing complex and changing meteorological conditions, enhancing its sensitivity to key factors and ultimately improving overall water quality forecasting performance and robustness.

[0094] In one example, the output of the environmental feature encoder is connected to a multi-scale dilated convolutional block, comprising multiple dilated convolutional layers, used to capture local and / or global spatial relationships between different processing units. In this example, the multi-scale dilated convolutional block includes three dilated convolutional layers: a first dilated convolutional layer, a second dilated convolutional layer, and a third dilated convolutional layer. The first dilated convolutional layer has a 3×3 kernel and a dilation rate of 1, used to capture local and global spatial relationships between adjacent processing units; the second dilated convolutional layer has a 3×3 kernel and a dilation rate of 2, used to capture mid-range dependencies spanning one processing unit; and the third dilated convolutional layer has a 3×3 kernel and a dilation rate of 4, used to capture long-range correlations across the entire plant, enabling the model to comprehensively understand the complex geospatial relationships between processing units, thereby improving the accuracy of water quality prediction.

[0095] In one example, such as Figure 3 As shown, the time series model includes a second input layer connected in sequence, stacked multi-layer residual bidirectional LSTM layers (Bi-ResLSTM layers), a gated adaptive attention layer, and a second output layer. In this example, the time series model includes two stacked residual bidirectional LSTM layers, namely Bi-ResLSTM layer 1 and Bi-ResLSTM layer 2, to progressively extract higher-order temporal features.

[0096] Specifically, the residual bidirectional LSTM layer comprises bidirectional LSTM layers, with skip connections added between them to mitigate gradient vanishing and enhance the ability to reuse temporal features. Specifically, the bidirectional LSTM layer includes a forward LSTM and a backward LSTM; the forward LSTM computes the hidden state. Backward LSTM computes hidden state splicing to obtain the first Output of bidirectional LSTM layer Then the first The input to each layer is the sum of the residuals between the output of the previous layer and the original input. In other words, the input to each bidirectional LSTM layer is the sum of the residuals between the output of the previous bidirectional LSTM layer and the original input. The calculation expression is:

[0097] ;

[0098] in, Indicates the first The input to a layer can be either the original input data or the output of the previous layer. Indicates the first The input of a layer, i.e., the output of the current layer; This is a learnable parameter, with an initial value of 0.3; This indicates that a bidirectional LSTM layer is used for data processing. Through residual processing...

[0099] Furthermore, the gated adaptive attention layer is used to first compute the global context vector. and local context vectors And generate gate vectors through activation functions. The system dynamically fuses global and local context vectors, and finally generates a context vector for prediction based on attention weights.

[0100] Specifically, global context vector The expression for calculating the local context vector is:

[0101] ;

[0102] ;

[0103] Where T represents the length of the time series; This represents the hidden state at time step t in the last LSTM layer; This represents a one-dimensional convolution operation used to extract local features.

[0104] Furthermore, a gated vector is generated using the Sigmoid function. Dynamically fusing global and local information, the calculation expression is as follows:

[0105] ;

[0106] in, Indicates the activation function; This indicates the bias term.

[0107] Finally, based on attention weights Generate context vectors for prediction. The calculation expression is:

[0108] ;

[0109] ;

[0110] in, This represents the original weights. In this example, the second output layer of the time series model, such as a fully connected layer, outputs predicted values ​​based on the context vector. , To predict the step size.

[0111] Combining the above examples yields preferred examples of the present invention, such as... Figure 4 As shown, the method includes the following steps:

[0112] S100: Collect water quality data, process control parameter data, flow data, external environment data, and weather data from each inlet and outlet of the wastewater treatment plant and the end of each process section. Then, perform data cleaning, feature engineering, and selection processing on the above data, and divide the dataset to obtain training set, test set, and validation set.

[0113] S200: Construct a water quality prediction model, which includes a cascaded GeoMAN model and a time series model. The GeoMAN model includes a first input layer, a preprocessing unit, an encoder and a decoder connected in sequence. The preprocessing unit includes a hydraulic residence time misalignment compensation module, an environmental feature encoder and a multi-scale dilated convolution block connected in sequence.

[0114] S300: Train the water quality prediction model using the training set;

[0115] S400: Input the real-time water quality data, process control parameter data, flow data, external environmental data, and weather data from the wastewater treatment plant into the trained water quality prediction model to obtain the water quality prediction results.

[0116] The present invention also includes a wastewater treatment plant water quality management and operation method, which is implemented based on any one or more of the above examples to form a water quality prediction method, and the management and operation method includes:

[0117] S51: Constructing the objective function for the target pollutant reduction amount :

[0118] ;

[0119] in, , These represent the input pollutant concentration and the output pollutant concentration, respectively. , These are all data labels, representing the upper and lower bounds of the summation calculation;

[0120] S52: Solve the objective function based on the water quality prediction results. The pollutant reduction strategy is obtained, and the wastewater treatment is controlled according to the pollutant reduction strategy.

[0121] Preferably, the management and operation method further includes:

[0122] S51': Establish a dual-objective matrix model for the target pollutant reduction amount and minimizing monthly operating costs, i.e.: Construct the objective function for the target pollutant reduction amount. and minimizing the cost objective function :

[0123] ;

[0124] ;

[0125] The constraints are: process limitations: 8 ≤ hydraulic retention time ≤ 16, 100 ≤ sludge external return ≤ 400;

[0126] Emission standards: ≤Level 1 emission standard;

[0127] in, Indicates the energy consumption coefficient; This indicates the aeration volume adjustment parameter; Indicates the dosage coefficient; This indicates the parameter for adjusting the dosage; , , All are data tags;

[0128] S52': Optimization Solution: The bi-objective problem is transformed into a single objective using a linear weighted method. The weights are set according to the operational priority of the wastewater treatment plant. The overall objective function is then... for:

[0129] ;

[0130] in, Indicates the weighting coefficient;

[0131] S53': Input the water quality prediction results into the optimization matrix, that is: solve the overall objective function based on the water quality prediction results. This allows for the development of comprehensive control strategies to reduce pollutants and minimize costs. These strategies include production adjustment instructions for aeration volume, sludge return ratio, and chemical dosage. These instructions are then fed back to the wastewater treatment control unit, which controls the wastewater treatment process accordingly. This enables precise management and control of wastewater treatment and reduces operating costs.

[0132] The present invention also provides a computer program product, comprising a computer program that, when executed by a processor, implements the steps of the wastewater treatment plant water quality prediction method formed by any or a combination of the above examples. The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.

[0133] This invention also provides an electronic product having the same inventive concept as any or a combination of examples corresponding to the above-described wastewater treatment plant water quality prediction method, including a memory and a processor. The memory stores computer instructions executable on the processor, which, when executing the computer instructions, performs the steps of the above-described wastewater treatment plant water quality prediction method. The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement this invention.

[0134] In one example, the electronic product, i.e., the electronic device, is represented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit (processor) mentioned above, at least one storage unit mentioned above, and a bus connecting different system components (including storage units and processing units).

[0135] The storage unit stores program code that can be executed by the processing unit to perform the steps described in the "Exemplary Methods" section of this specification, based on various exemplary embodiments of the present invention. For example, the processing unit can execute the aforementioned wastewater treatment plant water quality prediction method.

[0136] The storage unit may include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 3201 and / or a cache storage unit, and may further include a read-only memory (ROM).

[0137] The storage unit may also include a program / utility having a set (at least one) of program modules, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0138] A bus can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus that uses any of the various bus structures.

[0139] The electronic device can also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can be performed via input / output (I / O) interfaces. Furthermore, the electronic device can communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. The network adapter communicates with other modules of the electronic device via a bus. It should be understood that other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0140] Through the above description, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to this exemplary embodiment can be embodied in the form of a software product, which can be stored on a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, electronic device, or network device, etc.) to execute the method of the exemplary embodiment of this application.

[0141] The above detailed embodiments are a description of the present invention. It should not be considered that the specific embodiments of the present invention are limited to these descriptions. For those skilled in the art, several simple deductions and substitutions can be made without departing from the concept of the present invention, and all of these should be considered to fall within the protection scope of the present invention.

Claims

1. A method for predicting water quality in wastewater treatment plants, characterized in that, Includes the following steps: Collect water quality data and process control parameter data from each inlet and outlet of the wastewater treatment plant and the end of each process section. A water quality prediction model is constructed. The water quality prediction model includes a cascaded GeoMAN model and a time series model. The GeoMAN model includes a first input layer, a preprocessing unit, an encoder, and a decoder connected in sequence. The preprocessing unit includes a hydraulic residence time misalignment compensation module, which is used to dynamically align the effluent water quality data of each treatment unit according to the actual hydraulic residence time of each process section treatment unit. Water quality prediction models are trained using water quality data and process control parameter data; The real-time water quality data and process control parameter data of the wastewater treatment plant are input into the trained water quality prediction model to obtain the water quality prediction results.

2. The wastewater treatment plant water quality prediction method according to claim 1, characterized in that, After collecting water quality data and process control parameter data from each inlet and outlet of the wastewater treatment plant and the end of each process section, the following is also included: Based on the actual residence time range of different process sections, water quality data of different process sections are collected and recorded to construct a misaligned treatment database.

3. The wastewater treatment plant water quality prediction method according to claim 1, characterized in that, Before inputting the real-time water quality data and process control parameter data from the wastewater treatment plant into the trained water quality prediction model, the process also includes: Collect traffic data, external environment data, and weather data. Traffic data includes cumulative traffic and instantaneous traffic, while external environment data includes seasonal and time-of-day characteristics. The water quality prediction model is trained using water quality data, process control parameter data, flow rate data, external environmental data, and weather data.

4. The wastewater treatment plant water quality prediction method according to claim 3, characterized in that, The GeoMAN model also includes an environmental feature encoder for periodically embedding and encoding seasonal and time-period features, and uses an attention mechanism to weight the meteorological data.

5. The wastewater treatment plant water quality prediction method according to claim 4, characterized in that, The output of the environmental feature encoder is connected to a multi-scale dilated convolutional block, including multiple dilated convolutional layers, for capturing the local and / or global spatial relationships of different processing units.

6. The wastewater treatment plant water quality prediction method according to claim 1, characterized in that, The time series model includes a second input layer connected in sequence, a stacked multi-layer residual bidirectional LSTM layer, a gated adaptive attention layer, and a second output layer; The multi-layer residual bidirectional LSTM layer includes bidirectional LSTM layers, and the input of each bidirectional LSTM layer is the sum of the residuals between the output of the previous bidirectional LSTM layer and the original input; The gated adaptive attention layer is used to first compute global and local context vectors, and then generate a gated vector through an activation function to dynamically fuse the global and local context vectors. Finally, a context vector for prediction is generated based on the attention weights.

7. A method for water quality management and operation in a wastewater treatment plant, characterized in that, The management and operation method is implemented based on the water quality prediction method according to any one of claims 1-6, and includes: Construct the objective function for the target pollutant reduction amount : ; in, , These represent the input pollutant concentration and the output pollutant concentration, respectively. , These are all data labels, representing the upper and lower bounds of the summation calculation; Solve the objective function based on the water quality prediction results. The pollutant reduction strategy is obtained, and the wastewater treatment is controlled according to the pollutant reduction strategy.

8. The wastewater treatment plant water quality management and operation method according to claim 7, characterized in that, The management and operation method also includes: Construct a cost minimization objective function : ; in, Indicates the energy consumption coefficient; This indicates the aeration volume adjustment parameter; Indicates the dosage coefficient; This indicates the parameter for adjusting the dosage; , , All are data tags; According to the objective function Objective function Establish the overall objective function : ; in, Indicates the weighting coefficient; Solve the overall objective function based on the water quality prediction results. This leads to a comprehensive control strategy for pollutant reduction and cost minimization, and wastewater treatment is controlled based on this comprehensive control strategy.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the wastewater treatment plant water quality prediction method according to any one of claims 1-6, and / or, when the computer program is executed by the processor, it implements the steps of the wastewater treatment plant water quality management and operation method according to claim 7 or 8.

10. An electronic product comprising a memory and a processor, wherein the memory stores computer instructions executable on the processor, characterized in that, When the processor executes the computer instructions, it performs the steps of the wastewater treatment plant water quality prediction method according to any one of claims 1-6, and / or, when the processor executes the computer instructions, it implements the steps of the wastewater treatment plant water quality management and operation method according to claim 7 or 8.

Citation Information

Patent Citations

  • Water quality prediction method and device

    CN107688871A

  • Method for improving effluent prediction precision of sewage plant by coupling hydraulic retention time

    CN117388457A

  • Industrial sewage water quality prediction method and device based on deep learning

    CN118260574A

  • Lightweight real-time target detection method and device, server and storage medium

    CN119810428A

  • Electric load prediction method and system based on GLA-UNet model structure

    CN119944671A

Cited By

  • Water plant raw water quality data fault diagnosis method and system

    CN121144761A

  • Water quality prediction method for water treatment plant based on neural network algorithm

    CN121256506A