Online incremental learning and working condition case library construction method of sewage treatment model

By employing online incremental learning and a case study library construction method, the high cost of wastewater treatment models under limited computing resources was addressed, achieving rapid response and high adaptability, and improving the level of intelligence in wastewater treatment.

CN122432166APending Publication Date: 2026-07-21ZERO ONE ECOLOGICAL ENVIRONMENT R&D CENTER (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZERO ONE ECOLOGICAL ENVIRONMENT R&D CENTER (SHENZHEN) CO LTD
Filing Date
2026-04-28
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing wastewater treatment models are computationally expensive when computing resources are limited, and they do not make sufficient use of historical data, resulting in slow response speed and poor adaptability when dealing with sudden situations.

Method used

An online incremental learning method is adopted. Historical data is stored by establishing an index structure that supports fast retrieval, and error detection and working condition change detection are performed to generate a joint training dataset, build a working condition case library, and realize rapid response to new working conditions by using weighted cosine similarity calculation and freezing neural network parameters.

Benefits of technology

It reduces the consumption of computing resources, improves the response speed and adaptability of the wastewater treatment model in the face of sudden operating conditions, and enhances the level of intelligence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432166A_ABST
    Figure CN122432166A_ABST
Patent Text Reader

Abstract

The application discloses an online incremental learning and working condition case library construction method of a sewage treatment model, and relates to the technical field of artificial intelligence, and comprises the following steps: after collecting historical data in a sewage treatment operation process and performing pretreatment, an index structure supporting rapid retrieval is established and stored; the historical data comprises inflow characteristic data, control instruction data, outflow result data and operation economy data; data at a current time is acquired, and double detection including error detection and working condition change detection is performed; when error detection is performed, the error between a prediction result and an actual outflow result is acquired, and whether to enter an online incremental learning process is judged through a preset process activation threshold value; based on a judgment result, a joint training data set is generated to perform joint training; and the application can reduce the consumption of computing resources while improving the adaptability and intelligent level of sewage treatment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method for online incremental learning and construction of a case study library for wastewater treatment models. Background Technology

[0002] As wastewater treatment processes become increasingly complex, traditional wastewater treatment methods and models are showing their limitations. Traditional wastewater treatment models typically rely on pre-defined operating conditions and are optimized through offline batch training. This approach performs poorly when dealing with seasonal fluctuations and sudden changes in operating conditions, and the models are prone to "catastrophic forgetting," meaning that when learning new operating conditions, the models often lose their ability to effectively cope with older conditions. To improve the adaptability and robustness of models, more and more research is focusing on online incremental learning techniques, attempting to continuously update and optimize models to maintain high prediction accuracy when handling new operating conditions in real time, and to avoid catastrophic forgetting.

[0003] Existing technologies typically rely on training and updating the entire dataset, which can lead to high computational costs when computing resources are limited. Furthermore, existing technologies do not make sufficient use of historical data and fail to effectively transform historical operating conditions into a reusable knowledge base, resulting in an inability to respond quickly when dealing with special operating conditions. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides an online incremental learning method for wastewater treatment models and a method for constructing a case study library, which solves the problems of high computing costs and insufficient utilization of historical data that may result from existing technologies when computing resources are limited.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] This invention provides a method for online incremental learning and construction of a case study library for wastewater treatment models, comprising:

[0008] Historical data collected during the wastewater treatment process is preprocessed and then stored using an index structure that supports rapid retrieval. The historical data includes influent characteristic data, control command data, effluent result data, and operational economic data.

[0009] Obtain the data at the current moment and perform dual detection, including error detection and operating condition change detection;

[0010] When performing error detection, the error between the predicted result and the actual effluent result is obtained, and a preset process activation threshold is used to determine whether to enter the online incremental learning process. Based on the judgment result, a joint training dataset is generated for joint training.

[0011] When detecting changes in operating conditions, special operating condition events are identified, and the complete operation process of successfully handling the special operating condition is extracted and constructed into a standardized operating condition case, forming an operating condition case library.

[0012] As a preferred embodiment of the online incremental learning and operational case library construction method for the wastewater treatment model described in this invention, the historical data collected during the wastewater treatment operation is obtained by acquiring influent characteristic data through an online COD analyzer, an online ammonia nitrogen analyzer, an electromagnetic flow meter, and a temperature sensor; including chemical oxygen demand, ammonia nitrogen concentration, flow rate, and temperature under influent conditions;

[0013] Control command data is obtained by reading the execution variables in the PLC, including DO (dissolved oxygen) setpoint, internal reflux ratio, and reagent dosage.

[0014] Water quality monitoring equipment at the outlet is used to obtain water quality data, including COD, ammonia nitrogen, total nitrogen, and total phosphorus in the water at the outlet.

[0015] The system obtains operational economic data from the power metering system and the chemical dosing statistics system via API interface, including aeration energy consumption, reflux energy consumption, and chemical consumption.

[0016] As a preferred embodiment of the online incremental learning and operational case library construction method of the wastewater treatment model described in this invention, the preprocessing involves removing outliers and aligning timestamps on all data, writing all aligned data into the database in chronological order, and slicing the data in the database according to the time dimension to form operational case slices, thereby performing standardization on the data within each operational case slice.

[0017] As a preferred embodiment of the online incremental learning and operational case library construction method for the wastewater treatment model described in this invention, the step of establishing an index structure that supports fast retrieval for storage involves using the index label of each operational case slice as the key and the address of the data set corresponding to that slice as the value, constructing a key-value index table, and storing it in the database.

[0018] As a preferred embodiment of the online incremental learning and operational case library construction method for the wastewater treatment model described in this invention, the dual detection is a parallel operation.

[0019] As a preferred embodiment of the online incremental learning and operational case library construction method for the wastewater treatment model described in this invention, the step of obtaining the error between the predicted result and the actual effluent result, and determining whether to enter the online incremental learning process through a preset process activation threshold, is as follows:

[0020] Obtain the predicted effluent concentration value, calculate and statistically analyze the error value between the predicted and actual effluent concentration values, and generate the root mean square error.

[0021] The decision to enter or not execute the online incremental learning process is obtained by comparing the preset process activation threshold with the root mean square error.

[0022] As a preferred embodiment of the online incremental learning and operational case library construction method for the wastewater treatment model described in this invention, the method for generating a joint training dataset for joint training is as follows;

[0023] Construct feature vectors of historical and current operating conditions and perform weighted cosine similarity calculation;

[0024] Based on the weighted cosine similarity, historical data is filtered using a preset screening threshold and then merged to generate a joint training dataset.

[0025] A joint optimization objective function is constructed, and after iterative optimization based on a joint training dataset, a feedforward neural network with incremental learning is formed.

[0026] As a preferred embodiment of the online incremental learning and operational case library construction method for the wastewater treatment model described in this invention, the identification of special operational events specifically includes the following:

[0027] Calculate the rate of change and determine whether a variable meets the mutation condition through preset thresholds, thus forming a special working condition trigger point;

[0028] Based on specific operating conditions and trigger points, a complete event window is constructed, and all data records are extracted to form a complete runtime dataset.

[0029] As a preferred embodiment of the online incremental learning and operational case library construction method for the wastewater treatment model described in this invention, the construction consists of standardized operational case libraries, specifically as follows:

[0030] Based on the complete operation process dataset, the peak water level, recovery time, and additional energy consumption are calculated to determine successful and unsuccessful cases;

[0031] Based on successful cases, statistics and integration are carried out during the stable phase to form a standardized case structure.

[0032] As a preferred embodiment of the online incremental learning and operational case library construction method of the wastewater treatment model described in this invention, the operational case library is formed by generating unique IDs for standardized cases and writing them into the database.

[0033] The beneficial effects of this invention are as follows: By designing an online incremental learning framework, this invention can respond in real time to changes in operating conditions during the wastewater treatment process, avoiding the high computational cost of traditional full-scale training methods. At the same time, by freezing some parameters of the neural network, it ensures that the learning of new data does not affect the stability of the model. Furthermore, by slicing historical operating condition data, a dynamically updated operating condition case library is constructed, which can quickly retrieve and call historical successful cases when new operating conditions occur. This significantly improves the response speed and processing efficiency of wastewater treatment in the face of sudden operating conditions. Therefore, this invention can improve the adaptability and intelligence level of wastewater treatment while reducing the consumption of computational resources. Attached Figure Description

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

[0035] Fig. 1 The flowchart shows the method for online incremental learning and construction of a case study library for wastewater treatment models.

[0036] Fig. 2 This is a flowchart for online incremental learning.

[0037] Fig. 3 This is a flowchart for determining successful and unsuccessful cases. Detailed Implementation

[0038] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0039] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0040] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0041] Reference Figs. 1-3 As an embodiment of the present invention, this embodiment provides a method for online incremental learning and construction of a case study library for a wastewater treatment model, comprising the following steps:

[0042] S1. Collect historical data from the wastewater treatment process, preprocess it, and then store it using an index structure that supports rapid retrieval. The historical data includes influent characteristic data, control command data, effluent result data, and operational economic data.

[0043] Specifically, influent characteristic data are obtained through online COD analyzers, online ammonia nitrogen analyzers, electromagnetic flow meters, and temperature sensors; including chemical oxygen demand, ammonia nitrogen concentration, flow rate, and temperature of the influent.

[0044] Control command data is obtained by reading the execution variables in the PLC, including DO (dissolved oxygen) setpoint, internal reflux ratio, and reagent dosage.

[0045] Water quality monitoring equipment at the outlet is used to obtain water quality data, including COD, ammonia nitrogen, total nitrogen, and total phosphorus in the water at the outlet.

[0046] The system obtains operational economic data from the power metering system and the chemical dosing statistics system via API interface, including aeration energy consumption, reflux energy consumption, and chemical consumption.

[0047] It should be noted that when acquiring data through various acquisition devices and sensors, the devices and sensors should be deployed first. For example, an online COD analyzer should be installed at the inlet of the wastewater treatment plant to directly detect the chemical oxygen demand (COD) of the raw water entering the plant in real time. Since COD changes may be related to organic pollution load, the analyzer should be placed at the initial stage of the inlet pipe, no more than 5 meters from the pipe inlet. The inlet flow rate of the sensor should be kept constant to ensure the accuracy of the detection results.

[0048] Online ammonia nitrogen analyzer: Installed at the water inlet, alongside the COD analyzer, to monitor the ammonia nitrogen content of the incoming water. The ammonia nitrogen detector should be placed inside the inlet pipe, at least 10 meters away from the inlet, to avoid direct impact from unstable inlet water flow rates.

[0049] Electromagnetic flow meter: This flow meter is used to monitor the influent flow rate and should be installed in the initial section of the influent pipeline, typically in the same area as the online COD analyzer and online ammonia nitrogen analyzer. The flow meter should be installed perpendicular to the pipeline to avoid measurement deviations caused by the resistance of the pipeline wall.

[0050] Temperature sensor: To ensure accurate water temperature measurement, the temperature sensor should be installed in the center of the inlet pipe, away from the pipe inlet and outlet, to avoid unstable temperatures caused by pipe bends or junctions. It is recommended to use a high-precision digital temperature probe and install it in the middle section of the pipe, approximately 2 to 3 meters away, to ensure representative measurements.

[0051] COD effluent monitoring: Installed in the effluent water quality testing area, typically at the final discharge point of wastewater treatment, to monitor the chemical oxygen demand (COD) of the treated effluent. The installation location of the COD monitor should be selected within a stable flow velocity zone based on changes in effluent flow velocity to ensure that the results are not affected by water flow disturbance.

[0052] Ammonia nitrogen effluent monitoring: Installed parallel to the COD effluent monitoring equipment, ammonia nitrogen concentration is monitored at the effluent outlet. The ammonia nitrogen sensor should avoid direct friction with air bubbles; therefore, it is recommended to install it in a location with relatively stable water flow.

[0053] Total nitrogen (TN) and total phosphorus (TP) monitoring: Also installed at the outlet, these sensors are used to detect the total nitrogen and total phosphorus content in the effluent, respectively. The sensors should be positioned in the center of the water flow to avoid obstruction by sediment and ensure the accuracy of the monitoring data.

[0054] Furthermore, after outlier removal and timestamp alignment of all data, the aligned data is written into the database in chronological order, and the data is sliced ​​in the database according to the time dimension to form working condition slices. The standardization of data within each working condition slice is then performed.

[0055] It should be noted that: the slicing process divides the annual data into four categories according to the seasons: spring, summer, autumn, and winter, and further subdivides them into 12 monthly labels; then, it divides the data according to the operating condition dimension, dividing the data into different intervals based on influent load, water temperature, and sludge state; in practice, continuous variables can be discretized, for example, water temperature can be divided into low temperature (0–10℃), medium temperature (10–20℃), and high temperature (20–30℃); COD can be divided into low load, medium load, and high load; and MLSS (sludge concentration) can be divided into low concentration, medium concentration, and high concentration; then, the discretized labels are combined with time labels to form a unique operating condition slice with a number.

[0056] Furthermore, the index label of each working condition slice is used as the key, and the address of the corresponding data set is used as the value to construct a key-value index table and store it in the database.

[0057] It should be noted that when building the index table, in order to improve retrieval efficiency, inverted indexes or multi-level indexes can be further built, such as first indexing by season and then by load level, thereby reducing the retrieval scope.

[0058] S2. Obtain the data at the current moment and perform dual detection, including error detection and operating condition change detection;

[0059] Specifically, when new water inflow characteristic data are collected, dual detection is performed in parallel, including error detection and operating condition change detection.

[0060] It should be noted that parallel execution of dual detection avoids the delays that occur in serial execution, where one detection must be completed before the next can begin. Furthermore, since data acquisition frequency and processing requirements are typically high, parallel processing significantly reduces response time, thereby ensuring that the system can react in the shortest possible time.

[0061] S3. When performing error detection, obtain the error between the predicted result and the actual effluent result, and determine whether to enter the online incremental learning process through a preset process activation threshold. Based on the judgment result, generate a joint training dataset for joint training.

[0062] S3.1 Obtain the predicted effluent concentration value, calculate the error value between the predicted and actual effluent concentration values, perform statistical analysis, and generate the root mean square error;

[0063] Specifically, during error detection, a feedforward neural network is invoked to make predictions and obtain the predicted effluent concentration value.

[0064] Calculate the error between the predicted effluent concentration and the actual effluent concentration based on the new influent characteristic data; and statistically analyze the error within a certain time window (e.g., one week) to generate the root mean square error.

[0065] The root mean square error is expressed as:

[0066]

[0067] In the formula, This represents the root mean square error. This represents the number of error values ​​within a certain time window. Indicates the first One error value.

[0068] It should be noted that the feedforward neural network is constructed using an input layer, two hidden layers, and an output layer. During training, data from historical working condition slices are collected as the training set. The loss function is defined as the mean squared error between the predicted and actual values. The Adam optimizer is used for iterative updates of the feedforward neural network. The iteration stops when the loss value no longer decreases, and the trained feedforward neural network is output. The trained feedforward neural network should be deployed to the database in the initial stage.

[0069] S3.2. By comparing the preset process activation threshold with the root mean square error, a judgment result is obtained on whether to enter or not to execute the online incremental learning process.

[0070] Specifically, if the root mean square error is greater than the preset process activation threshold, the online incremental learning process will be initiated; otherwise, no operation will be performed, and new water inflow characteristic data will be continuously collected.

[0071] It should be noted that the process activation threshold can be obtained based on historical model performance statistics; for example, during the initial deployment phase of the model, record RMSE data for 30 consecutive days, and after calculating the mean and standard deviation of RMSE during this phase, sum the mean and twice the standard deviation to generate the result.

[0072] S3.3 Construct the feature vectors of historical and current working conditions and calculate the weighted cosine similarity.

[0073] Specifically, when entering the online incremental learning process, the feedforward neural network is first frozen, and then the influent characteristic data, control command data, effluent result data, and operational economic data at the current moment are extracted to form the data record set at the current moment; subsequently, a unified dimension operating condition feature vector is constructed and standardized for historical data and current data; the operating condition feature vector includes influent chemical oxygen demand, influent ammonia nitrogen, influent flow rate, water temperature, and sludge concentration;

[0074] We use weighted cosine similarity to calculate the cosine similarity between the current working condition feature vector and all historical working condition feature vectors.

[0075] The weighted cosine similarity is expressed as:

[0076]

[0077] In the formula, Represents the weighted cosine similarity. This indicates the number of feature dimensions in the working condition feature vector. Indicates the first Weights of each feature dimension, This represents the first element in the current time condition feature vector. Each feature dimension The first element in the historical operating condition feature vector represents the... Each feature dimension.

[0078] It should be noted that a layered assignment method can be used to calculate the weighted cosine similarity. Specifically, all features are first divided into two layers according to their strength of influence. The first layer consists of direct load-determining variables, including COD and ammonia nitrogen; the second layer consists of operating condition correction variables, including flow rate, water temperature, and MLSS. Then, under the constraint of a total weight of 1, a higher proportion of the weight is first allocated to the variables in the first layer, and the remaining weight is allocated to the variables in the second layer. Subsequently, it is preferable to allocate 55% of the total weight to the variables in the first layer and 45% to the variables in the second layer. This ensures that if the weight of the first layer is too low, the similarity calculation will be diluted by auxiliary variables such as temperature and flow rate, failing to highlight the differences in pollution load; if the weight of the first layer is too high, it will weaken the regulatory effect of water temperature, flow rate, and MLSS on specific operating conditions, making the judgment of operating condition similarity too coarse.

[0079] Within the first layer, although both COD and ammonia nitrogen are direct load variables, their effects on operating condition classification are not entirely the same. Changes in COD more directly affect the organic matter degradation load, oxygen demand level, and aeration requirements. Furthermore, in scenarios involving large-scale industrial mixing, illegal discharges, and sudden load increases, it is the core variable that first leads to adjustments in treatment strategies. Ammonia nitrogen, on the other hand, mainly characterizes nitrogen load and has a more significant impact on nitrification and denitrification processes. However, its influence is less widespread than that of COD in some short-term high-organic scenarios. Therefore, in the first layer with a total weight of 55%, COD should be slightly higher than ammonia nitrogen. The preferred allocation is 30% and 25%, which reflects both as core variables while also showing the slight priority of COD relative to ammonia nitrogen.

[0080] Secondly, within the second layer, flow rate, water temperature, and MLSS are all auxiliary key variables that significantly affect the state of the treatment process. However, their functional focuses are hydraulic load correction, reaction environment correction, and biomass state correction, respectively. From an engineering application perspective, the degree of influence of these three on "whether a case can be directly reused under known load conditions" is usually similar, and it is difficult to further differentiate them significantly in general scenarios. Therefore, to ensure the simplicity of the model structure and the stability of the judgment rules, the 45% total weight of the second layer can be evenly distributed among the three.

[0081] Therefore, the weights corresponding to each feature dimension are set as follows: COD -0.30, ammonia nitrogen -0.25, flow rate -0.15, water temperature -0.15, and sludge concentration MLSS -0.15. In this example, COD and ammonia nitrogen account for a total of 55%. When the load difference is large, even if the flow rate, water temperature, and MLSS are similar, the similarity will still be significantly reduced, thereby avoiding the incorrect reuse of historical cases. At the same time, the flow rate, water temperature, and MLSS still account for 45% in total, ensuring that under similar pollution loads, it is still possible to further distinguish between winter and summer, high and low biomass, and differences in hydraulic conditions, avoiding mixing up conditions with similar surface loads but significantly different operating environments. In addition, sludge concentration MLSS can be detected and recorded by an online sludge concentration meter.

[0082] S3.4. Based on the weighted cosine similarity, historical data is filtered using a preset screening threshold and then merged to generate a joint training dataset.

[0083] The system uses preset filtering thresholds to determine which historical data to retain.

[0084] If the cosine similarity is greater than or equal to the preset filtering threshold, the historical data corresponding to the historical working condition feature vector will be retained; otherwise, the historical working condition feature vector and the corresponding historical data will be removed.

[0085] Based on the preserved historical operating condition feature vectors and historical data, a replay dataset is constructed. The current data record set is then merged with the replay dataset to form a joint training dataset.

[0086] It should be noted that the preset screening threshold can be calculated by statistical analysis of historical data, calculating the similarity distribution of historical working conditions, and setting an appropriate screening threshold.

[0087] For example, in one implementation, in the initial stage of the model, the cosine similarity distribution between historical operating condition feature vectors is statistically analyzed to obtain the similarity distribution range. The mean and standard deviation of the similarity of all historical data are calculated, and then... The principle is to set a screening threshold; for example, the mean of the historical similarity distribution plus twice the standard deviation can be selected as the screening threshold to ensure that the threshold can cover a large portion of the historical operating condition data with high similarity.

[0088] S3.5 Construct a joint optimization objective function and perform iterative optimization based on the joint training dataset to form a feedforward neural network after incremental learning;

[0089] Specifically, the parameters of the feedforward neural network are loaded, and the parameters of the output layer are unfrozen and initialized. The model is trained according to the joint training dataset, a joint optimization objective function is constructed, and the Adam optimizer is used for iterative updates. When the objective value of the objective function no longer decreases, the iteration stops, and the updated output layer parameters are fed back to the feedforward neural network to obtain the incrementally learned feedforward neural network.

[0090] The joint optimization objective function is expressed as follows:

[0091]

[0092] In the formula, This represents the value of the joint optimization objective function. The weights represent the mean squared error values ​​on the joint training dataset. This represents the mean squared error value on the joint training dataset. This represents the weight of the mean squared error values ​​on the playback dataset. This represents the mean squared error value on the playback dataset. This indicates the weight of the regularization term. This represents the value of the regular expression term;

[0093] The value of the parameter regularization term is generated by calculating the L2 norm squared, which is used to compare the output layer parameters during the current training process with the output layer parameters of the feedforward neural network before incremental learning. Its expression is:

[0094]

[0095] In the formula, Represents the square of the L2 norm. This represents the parameters of the output layer during the current training process. This represents the output layer parameters of the feedforward neural network before incremental learning is triggered; the output layer parameters include the weight matrix and bias terms.

[0096] It should be noted that online incremental learning must first address the current model drift problem, so fitting to new operating conditions should be the primary focus; however, if only new data is considered, it will lead to catastrophic forgetting, so the loss from replay data must be preserved; at the same time, since only the parameters of the last layer are updated, regularization terms need to be added to prevent the last layer from generating excessive parameter shifts when adapting to new operating conditions.

[0097] For example, in one implementation, to reflect the idea of ​​"prioritizing adaptation to new operating conditions while maintaining historical operating conditions and suppressing excessive parameter fluctuations," it is necessary to satisfy the following: Each weight is set to a fixed constant; and its value can be exemplarily set to... , , .

[0098] S4. When performing operating condition change detection, identify special operating condition events, extract the complete operation process of successfully handling the special operating condition and build it into a standardized operating condition case to form an operating condition case library;

[0099] S4.1 Calculate the rate of change and determine whether a variable meets the mutation condition through preset thresholds to form a special working condition trigger point;

[0100] Specifically, when performing operating condition change detection, the rate of change is calculated for each variable (influent COD, ammonia nitrogen, flow rate, water temperature) in units of a sliding time window (e.g., 30 minutes).

[0101] Based on the rate of change, the system determines whether the condition of a sudden change in the rate of change exceeding the preset threshold is met by using preset thresholds. The thresholds include the rate of change thresholds for influent COD, ammonia nitrogen, flow rate, and water temperature.

[0102] If any variable meets the mutation condition, it is determined to be a special working condition trigger point; otherwise, it is determined to be a normal point, and new water intake characteristic data are continuously collected.

[0103] It should be noted that the preset thresholds, including those for influent COD, ammonia nitrogen, flow rate, and water temperature change rate, can all be calculated using historical data to generate mean and standard deviation, and then used... Principles are set.

[0104] S4.2 Based on special working condition trigger points, construct a complete event window and extract all data records to form a complete running process dataset;

[0105] Specifically, based on the trigger point of a special working condition, a complete event window is formed by tracing back and extending forward; then, all data records within this window are extracted to form a complete runtime dataset.

[0106] It should be noted that when the forward backtracking and backward extension form a complete event window, the forward backtracking should use 30 minutes as the stable baseline phase, while the backward extension should continue until stability is restored.

[0107] The criteria for determining the recovery of stability can be set as follows: the fluctuation of key effluent indicators (COD, ammonia nitrogen) is less than 5% for a continuous period of time (e.g., 30 minutes); let the event endpoint be... Then the full event window for: , Indicates the end time of the event. Indicates the starting time of a special operating condition.

[0108] S4.3. Based on the complete operation process dataset, calculate the peak water level, recovery time, and additional energy consumption to determine successful and unsuccessful cases;

[0109] Specifically, based on the operational data set, the highest COD or ammonia nitrogen value is extracted as the effluent peak value, and the recovery time and additional energy consumption are calculated.

[0110] Each judgment threshold is set. If the peak water output, recovery time, and additional energy consumption are all less than the corresponding judgment threshold, the event is marked as a successful case. If any one of the peak water output, recovery time, and additional energy consumption is less than the corresponding judgment threshold, the event is marked as a failed case and is removed. Each judgment threshold includes the peak water output, recovery time, and additional energy consumption thresholds.

[0111] The rate of change is expressed as:

[0112]

[0113] In the formula, Indicates time rate of change, Indicates time The variable value, Indicates time The variable value, Indicates a time interval;

[0114] Recovery time, expressed as:

[0115]

[0116] In the formula, Indicates recovery time;

[0117] Additional energy consumption, expressed as:

[0118]

[0119] In the formula, Indicates additional energy consumption. Indicates time Actual energy consumption This represents the average energy consumption under normal operating conditions.

[0120] It should be noted that the various judgment thresholds include peak effluent flow, recovery time, and additional energy consumption thresholds.

[0121] The threshold for the peak effluent flow can be set according to the pollutant discharge standards of wastewater treatment plants, such as COD emission limit: 50 mg / L, ammonia nitrogen emission limit: 5 mg / L;

[0122] The recovery time threshold can be determined based on the response mechanism of the biochemical system and engineering statistics. For example, measures such as DO regulation and reflux regulation usually produce significant effects within 30 to 90 minutes. Therefore, 120 minutes can be taken as an example as the recovery time threshold.

[0123] Secondly, the additional energy consumption threshold can be set based on the energy consumption structure analysis of the wastewater treatment plant. For example, in the total energy consumption of the wastewater treatment plant: the aeration system accounts for 50%~70%, and the return and pumping accounts for 20%~30%. In abnormal operating conditions, the main increase comes from increasing DO (aeration volume) and increasing the return ratio. In order to balance the three aspects of effluent compliance, rapid recovery and low-cost operation, 15% can be taken as the additional energy consumption threshold for example.

[0124] S4.4 Based on successful cases, conduct statistical analysis and integration during the stable phase to form a standardized case structure;

[0125] Specifically, when an event is marked as a successful case, the stable phase before the event's inception is statistically analyzed to obtain the average influent conditions (i.e., the average values ​​of influent COD, ammonia nitrogen, flow rate, and water temperature), which serve as the initial operating condition characteristics of the case. Subsequently, the change process of control variables is extracted to form a time series, and the category to which the current event belongs is read from the operating condition slice index. This data is then integrated with the effluent peak value, recovery time, and additional energy consumption to form a standardized case.

[0126] It should be noted that the statistics for the stable phase before the event initiation are as follows: This stable phase serves as the baseline operating condition before the anomaly. In the activated sludge process, the DO adjustment response is 5–15 min, the reflux adjustment effect is 10–30 min, and the microbial metabolic feedback is 20–60 min. Therefore, 30 min can be taken as the length of the stable phase for example. Based on this value, the stable phase… The generation is as follows: .

[0127] Furthermore, after generating a unique ID for the standardized case, it is written into the database to form a case library.

[0128] It should be noted that after the working condition case library is formed, further deduplication and optimization processing can be performed. For example, the current case can be compared with the cases in the existing case library (the similarity can be calculated using the Euclidean distance formula). If there are highly similar cases, only the statistical information of the existing cases will be updated. Otherwise, the case will be written into the case library as a new case, and the case index structure will be updated synchronously to keep it consistent with the previous working condition slice index, so as to ensure that subsequent searches can be directly called.

[0129] Secondly, in subsequent calls, the distance between the current working condition feature vector and the feature vector of each working condition case in the working condition case library can be calculated using Euclidean distance based on the working condition case library; the distances are sorted in descending order, and the case with the smallest distance is selected as the best matching case.

[0130] In summary, this invention, through the design of an online incremental learning framework, can respond in real time to changes in operating conditions during wastewater treatment, avoiding the high computational costs of traditional full-scale training methods. Furthermore, by freezing some parameters of the neural network, it ensures that learning from new data does not affect the model's stability. Moreover, by slicing historical operating condition data, a dynamically updated operating condition case library is constructed, enabling rapid retrieval and recall of historical successful cases when new operating conditions occur. This significantly improves the response speed and processing efficiency of wastewater treatment in the face of sudden operating conditions. Therefore, this invention can improve the adaptability and intelligence level of wastewater treatment while reducing computational resource consumption.

[0131] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for online incremental learning and construction of a case study library for a wastewater treatment model, characterized in that, include: Historical data collected during the wastewater treatment process is preprocessed and then stored using an index structure that supports rapid retrieval. The historical data includes influent characteristic data, control command data, effluent result data, and operational economic data. Obtain the data at the current moment and perform dual detection, including error detection and operating condition change detection; When performing error detection, the error between the predicted result and the actual effluent result is obtained, and a preset process activation threshold is used to determine whether to enter the online incremental learning process. Based on the judgment result, a joint training dataset is generated for joint training. When detecting changes in operating conditions, special operating condition events are identified, and the complete operation process of successfully handling the special operating condition is extracted and constructed into a standardized operating condition case, forming an operating condition case library.

2. The method for online incremental learning and construction of a case study library for a wastewater treatment model as described in claim 1, characterized in that: The historical data collected during the wastewater treatment process is obtained by using an online COD analyzer, an online ammonia nitrogen analyzer, an electromagnetic flow meter, and a temperature sensor to acquire influent characteristic data. This includes the chemical oxygen demand (COD), ammonia nitrogen concentration, flow rate, and temperature of the influent. Control command data is obtained by reading the execution variables in the PLC; This includes DO (dissolved oxygen) setpoint, internal reflux ratio, and reagent dosage; Water quality monitoring equipment at the outlet is used to obtain water quality data, including COD, ammonia nitrogen, total nitrogen, and total phosphorus in the water at the outlet. The system obtains operational economic data from the power metering system and the chemical dosing statistics system via API interface, including aeration energy consumption, reflux energy consumption, and chemical consumption.

3. The method for online incremental learning and construction of a case study library for a wastewater treatment model as described in claim 2, characterized in that: The preprocessing involves removing outliers and aligning timestamps on all data, then writing all aligned data into the database in chronological order, and slicing the data in the database according to the time dimension to form working condition slices. The standardization of data within each working condition slice is then performed.

4. The method for online incremental learning and construction of a case study library for a wastewater treatment model as described in claim 3, characterized in that: The process of establishing an index structure that supports fast retrieval for storage involves using the index label of each working condition slice as the key and the address of the data set corresponding to that slice as the value, constructing a key-value index table, and storing it in the database.

5. The method for online incremental learning and construction of a case study library for a wastewater treatment model as described in claim 4, characterized in that: The dual detection is a parallel operation.

6. The method for online incremental learning and construction of a case study library for a wastewater treatment model as described in claim 5, characterized in that: The process involves obtaining the error between the predicted result and the actual effluent result, and determining whether to enter the online incremental learning process through a preset activation threshold, as follows: Obtain the predicted effluent concentration value, calculate and statistically analyze the error value between the predicted and actual effluent concentration values, and generate the root mean square error. The decision to enter or not execute the online incremental learning process is obtained by comparing the preset process activation threshold with the root mean square error.

7. The method for online incremental learning and construction of a case study library for a wastewater treatment model as described in claim 6, characterized in that: The process of generating a joint training dataset for joint training is as follows; Construct feature vectors of historical and current operating conditions and perform weighted cosine similarity calculation; Based on the weighted cosine similarity, historical data is filtered using a preset screening threshold and then merged to generate a joint training dataset. A joint optimization objective function is constructed, and after iterative optimization based on a joint training dataset, a feedforward neural network with incremental learning is formed.

8. The method for online incremental learning and construction of a case study library for a wastewater treatment model as described in claim 7, characterized in that: The identification of special operating condition events is as follows: Calculate the rate of change and determine whether a variable meets the mutation condition through preset thresholds, thus forming a special working condition trigger point; Based on specific operating conditions and trigger points, a complete event window is constructed, and all data records are extracted to form a complete runtime dataset.

9. The method for online incremental learning and construction of a case study library for a wastewater treatment model as described in claim 8, characterized in that: The construction is a standardized operating condition case, as detailed below: Based on the complete operation process dataset, the peak water level, recovery time, and additional energy consumption are calculated to determine successful and unsuccessful cases; Based on successful cases, statistics and integration are carried out during the stable phase to form a standardized case structure.

10. The method for online incremental learning and construction of a case study library for a wastewater treatment model as described in claim 9, characterized in that: The process of forming a working condition case library involves generating a unique ID for each standardized case and writing it into the database.