A three-stage early warning processing method for sewage plant data anomaly detection

By combining multi-source data feature analysis and deep neural networks with knowledge graphs, a multi-dimensional scoring and hierarchical early warning system for anomaly detection in wastewater treatment plant data was achieved. This system addresses the problems of insufficient feature extraction, inadequate data fusion, and lack of hierarchical evaluation in existing technologies, thereby improving detection accuracy and system adaptability.

CN122113023APending Publication Date: 2026-05-29AI WO TE ZHI NENG SHUI WU (AN HUI) YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
AI WO TE ZHI NENG SHUI WU (AN HUI) YOU XIAN GONG SI
Filing Date
2025-12-31
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies for detecting anomalies in wastewater treatment plant data suffer from problems such as one-sided feature extraction, insufficient fusion of multi-source data, stepless anomaly assessment, and simplistic early warning response. These issues result in low detection accuracy, poor interpretability, and difficulty in supporting intelligent operation.

Method used

By employing spatiotemporal correlation feature analysis of multi-source data, scenario correlation analysis of abnormal data, and high-order nonlinear feature extraction, combined with knowledge graphs and deep neural networks, multi-dimensional anomaly scoring is achieved. Furthermore, through three-level early warning decision-making and root cause localization, hierarchical response linkage is implemented.

Benefits of technology

It improves the accuracy and interpretability of wastewater treatment plant data anomaly detection, provides precise hierarchical early warning and differentiated response, reduces operation and maintenance difficulty, and improves system stability and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122113023A_ABST
    Figure CN122113023A_ABST
Patent Text Reader

Abstract

The application discloses a three-level early warning processing method for sewage plant data anomaly detection, comprising the following steps: a data acquisition step; obtaining sewage plant operation data X from a database of a sewage treatment plant; a data preprocessing step; performing spatio-temporal correlation feature analysis, correlation analysis of abnormal data scenes and high-order nonlinear feature extraction on the sewage plant operation data X; a data analysis step; three-level early warning decision and root cause positioning; hierarchical response linkage and closed-loop management. The three-level early warning processing method for sewage plant data anomaly detection and the control method thereof have the advantages of improving the accuracy, explainability and engineering practicability of anomaly detection, providing strong support for intelligent and fine operation of the sewage treatment process and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a wastewater data processing technology, and more particularly to a three-level early warning processing method for detecting data anomalies in wastewater treatment plants. Background Technology

[0002] Smart water management is the deep integration of next-generation information technology and water technology. It fully leverages the value and logical relationships of data to achieve intelligent control, data resource utilization, precise management, and intelligent decision-making in water management systems. This ensures the safe operation of water facilities, making water operations more efficient, management more scientific, and services of higher quality. By breaking down data barriers, optimizing management processes, and improving service efficiency, smart water management not only solves the problem of cost reduction and efficiency improvement for water utilities but also strengthens the city's water security defenses and allows residents to enjoy more convenient and reassuring water services.

[0003] With the deepening of smart water management construction, wastewater treatment plants generate massive amounts of multi-source heterogeneous data during operation. This multi-source heterogeneous data includes online water quality monitoring data (such as influent and effluent CDO, ammonia nitrogen, and dissolved oxygen), equipment operating parameters (such as pump frequency, current, and pressure), flow information, and environmental variables. This heterogeneous data is characterized by high dimensionality, strong temporal sequence, and multi-variable coupling, providing fundamental support for intelligent operation. However, in actual data acquisition and transmission, factors such as sensor failure, communication interference, equipment aging, or extreme operating conditions often result in noise, missing data, drift, and even abnormal jumps in the data, severely affecting the reliability of subsequent data analysis, model prediction, and decision support.

[0004] Time series anomaly detection technology in industrial scenarios has mainly gone through the following three stages of development: 1. Rule- and threshold-driven detection; Early systems generally used fixed thresholds or simple statistical rules (such as the 3σ principle, upper and lower limit alarms) to determine anomalies. For example, an alarm was triggered when the CDO concentration exceeded the set threshold or the DO value remained below 2 mg / L. Although simple to implement and quick to respond, it had the following drawbacks: (1) it ignored the spatiotemporal correlation between variables, which could easily lead to false alarms or missed alarms; (2) it could not identify complex pattern anomalies (such as periodic shifts and gradual drifts); and it was difficult to adapt to the dynamic changes in different process sections and operating conditions. 2. Statistical and model-driven detection; To improve detection accuracy, researchers have introduced time series modeling methods, such as ARIMA, state-space models, and principal component analysis (PCA), to identify deviations by constructing normal behavior models. Some systems combine wavelet transform or Fourier analysis to extract periodic features for detecting periodic anomalies. Although they can capture certain time series patterns, they are only applicable to stationary processes and also have the following disadvantages: (1) weak ability to model nonlinear and non-stationary processes; (2) strict model assumptions (such as normal distribution and linear relationship), making it difficult to adapt to the complex dynamic environment of sewage treatment plants; (3) lack of ability to model multivariate collaborative anomalies. 3. Data-driven and deep learning-based detection; In recent years, with the development of deep learning, models based on autoencoders, LSTM, GAN, and graph neural networks (GNN) have been widely used in multivariate time series anomaly detection. These methods can automatically extract high-dimensional features and explore complex dependencies between variables, significantly improving detection performance. However, the following key problems still exist: (1) Insufficient feature extraction: Most models only focus on time series changes at a single scale, ignoring the fusion of multi-scale features such as data mutations, periodic disturbances, and trend evolution; (2) Weak cross-modal integration capability: Water quality, equipment, flow, and other multi-source data are diverse (continuous values, discrete signals, status codes), and existing methods lack effective cross-modal feature alignment and fusion mechanisms; (3) Lack of hierarchical mechanism for anomaly assessment: Most models only output "whether it is abnormal", lacking quantitative assessment of the severity of anomalies, making it difficult to support differentiated response strategies; (4) Poor model interpretability: Black-box models are difficult to provide anomaly cause analysis, affecting the trust and intervention decisions of operation and maintenance personnel. Current research has applied deep learning to anomaly monitoring in wastewater treatment processes, with typical approaches including the following: 1. Anomaly detection system based on LSTM-AE: This method reconstructs the input sequence using an encoder-decoder structure and identifies anomalies based on the reconstruction error. However, this method does not consider spatial correlations between variables and is not sensitive enough to short-term mutations. 2. Graph Neural Network-Based Approach: This approach treats process sections as nodes and constructs a static topology graph to model variable relationships. However, the operational status of wastewater treatment plants exhibits dynamic evolution characteristics, making it difficult for static graph structures to reflect the migration of correlations under changing operating conditions. 3. Ensemble learning framework: This approach combines Isolation Forest, One-Class SVM, and deep models for fusion judgment. While it improves robustness, it lacks a unified anomaly scoring system, making it difficult to prioritize anomalies.

[0005] In addition, existing systems generally lack a hierarchical early warning decision-making mechanism. Most platforms only provide unified alarm prompts and do not classify responses according to the degree of impact of anomalies on production operations (such as minor deviations, potential faults, and emergency shutdown risks), resulting in alarm overload or key events being overwhelmed. In summary, the current sewage treatment plant data anomaly detection technology still has the following core bottlenecks: (1) one-sided anomaly feature extraction: lack of joint modeling of time-series fluctuations, periodic patterns and mutation features; (2) insufficient multi-source data fusion: failure to effectively integrate semantic information of heterogeneous data such as water quality, equipment, and flow; (3) no hierarchical anomaly assessment: lack of quantitative assessment and priority ranking mechanism based on the degree of impact; (4) uniform early warning response: alarm strategies lack differentiated processing procedures, making it difficult to provide accurate guidance for operation and maintenance.

[0006] Therefore, it is necessary to effectively process multi-source heterogeneous data to solve the problems of one-sided features, insufficient fusion, stepless evaluation, and disconnected response in the current anomaly detection of sewage treatment plants. Summary of the Invention

[0007] To avoid the shortcomings of the existing technologies, this invention provides a three-level early warning and processing method for detecting data anomalies in wastewater treatment plants, thereby improving the accuracy, interpretability, and engineering applicability of anomaly detection, and providing strong support for the intelligent and refined operation of wastewater treatment processes.

[0008] The present invention adopts the following technical solution to solve the technical problem.

[0009] The present invention provides a three-level early warning processing method for detecting data anomalies in wastewater treatment plants, comprising the following steps: Step 1: Data Acquisition Steps; Obtain wastewater treatment plant operation data X from the wastewater treatment plant's database; Step 2: Data preprocessing steps; perform spatiotemporal correlation feature analysis, abnormal data scenario correlation analysis, and high-order nonlinear feature extraction on the wastewater treatment plant operation data X; Step 3: Data analysis step; For the preprocessed data in Step 2, data fusion is used to achieve multi-dimensional anomaly scoring and obtain a set of anomaly event fragments; Step 4: Three-level early warning decision-making and root cause identification; based on the event-level comprehensive score Danger e Assess abnormal events and determine the warning level based on the assessment results; at the same time, determine the root cause of the abnormal events. Step 5: Hierarchical response linkage and closed-loop management.

[0010] The three-level early warning processing method for detecting data anomalies in wastewater treatment plants, as described in this invention, is also characterized by: Furthermore, the collected data includes water quality parameters, equipment status parameters, and flow load parameters.

[0011] Further, step 2 includes the following steps: Step 21: Spatiotemporal correlation characteristic analysis of multi-source data; Step 22: Correlation analysis of abnormal data scenarios; Step 23: Obtain the anomaly feature matrix.

[0012] Furthermore, in step 21, during the analysis of the spatiotemporal correlation characteristics of multi-source data, a knowledge graph G=(V,E) of the wastewater treatment process is constructed to characterize the physical and statistical dependencies between variables. The knowledge graph G defines nodes and edges. Among them, V represents the set of nodes such as aeration equipment operating parameters and water quality indicators, and E represents the set of edges connecting different nodes.

[0013] Further, step 22 includes the following steps: Step 221: Use the CUSUM algorithm for each Eigenvector X i Calculate the cumulative positive deviation at time t. ; Step 222: Extract the main frequency and calculate the autocorrelation function ; Furthermore, in step 23, a deep neural network is used to extract high-order nonlinear features of the wastewater treatment plant operation data X.

[0014] Furthermore, step 3 includes the following steps: Step 31: Detect anomalies in raw data and calculate the out-of-limit score S. thresh (t); Step 32: Calculate the mutation intensity score S jump (t); Step 33: Calculate the period deviation score S peri (t); Step 34: Calculate the spatial diffusion score S spatial (t); Step 35: Calculate the overall anomaly intensity M(t); Step 36: Detection of anomalous data fragments.

[0015] Furthermore, in step 4, during the three-level early warning decision-making process, the event-level comprehensive score Danger for abnormal events is calculated. e At this time, it is necessary to calculate the severity indicators in three dimensions: average anomaly intensity of the event. Duration e and the breadth of influence e .

[0016] Furthermore, in step 4, during the three-level early warning decision-making process, the event-level comprehensive score Danger is used as the basis for the decision. e The quantiles are used to set dynamic thresholds θ1 and θ2; the three-level warning is divided using dynamic thresholds θ1 and θ2.

[0017] Furthermore, when dividing the three-level early warning system, it is divided into red warning, orange warning, and yellow warning.

[0018] Compared with existing technologies, the beneficial effects of this invention are reflected in: This invention discloses a three-level early warning processing method for detecting data anomalies in wastewater treatment plants, comprising: a data acquisition step; obtaining wastewater treatment plant operation data X from the wastewater treatment plant's database; a data preprocessing step; performing spatiotemporal correlation feature analysis, abnormal data scenario correlation analysis, and high-order nonlinear feature extraction on the wastewater treatment plant operation data X; a data analysis step; three-level early warning decision-making and root cause location; and graded response linkage and closed-loop management.

[0019] The three-level early warning and processing method for detecting abnormal data in wastewater treatment plants of the present invention has the following technical advantages.

[0020] (1) From a single alarm to a three-level risk assessment: no longer limited to the binary judgment of "whether the limit is exceeded", but based on multi-dimensional indicators to achieve risk quantification and classification, making the early warning more instructive; (2) From passive response to proactive prevention and control: By identifying early anomalies and providing trend warnings, we can support early intervention and reduce the probability of major events. (3) From manual investigation to intelligent assistance: providing root cause suggestions and handling guidance, greatly reducing the difficulty of operation and maintenance and labor costs; (4) From static model to adaptive system: It supports online evaluation and automatic update, has high long-term stability, and is suitable for large-scale deployment in multiple plants and multiple working conditions.

[0021] The three-level early warning and control method for detecting data anomalies in wastewater treatment plants, as described in this invention, has advantages such as improving the accuracy, interpretability, and engineering applicability of anomaly detection, and providing strong support for the intelligent and refined operation of wastewater treatment processes. Attached Figure Description

[0022] Figure 1 This is a flowchart of the three-level early warning processing method for detecting abnormal data in wastewater treatment plants according to the present invention.

[0023] The present invention will be further described below through specific embodiments and in conjunction with the accompanying drawings. Detailed Implementation

[0024] See Figure 1The present invention provides a three-level early warning processing method for detecting abnormal data in wastewater treatment plants, comprising the following steps: Step 1: Data Acquisition Steps; Obtain wastewater treatment plant operation data X from the wastewater treatment plant's database; Step 2: Data preprocessing steps; perform spatiotemporal correlation feature analysis, abnormal data scenario correlation analysis, and high-order nonlinear feature extraction on the wastewater treatment plant operation data X; Step 3: Data Analysis Step; Using data fusion to achieve multi-dimensional anomaly scoring on the preprocessed data from Step 2, a set of anomaly event fragments is obtained. ; In step 3, the enhanced anomaly feature matrix X obtained in step 2 is... (1) The data is processed to integrate anomalies, mutation intensity, periodic deviations, and deep hidden layer features from the original data to construct a multi-dimensional anomaly score. An attention mechanism is employed to achieve dynamic weighted fusion, generating a comprehensive anomaly intensity sequence and detecting anomalous event fragments, providing quantitative evidence for subsequent three-level early warning systems.

[0025] Step 4: Three-level early warning decision-making and root cause identification; based on the event-level comprehensive score Danger e Assess abnormal events and determine the warning level based on the assessment results; at the same time, determine the root cause of the abnormal events. Based on the comprehensive anomaly intensity M(t) and the set of anomaly event fragments obtained in step 3 By combining the aforementioned process knowledge graph G=(V,E) and deep nonlinear features H, the severity of each abnormal event is assessed and classified into three levels of warning: yellow, orange, and red. Root cause tracing is then performed using variable response time series and graph structure information, achieving a key leap from anomaly identification to risk classification and attribution.

[0026] Step 5: Hierarchical response linkage and closed-loop management.

[0027] Based on the warning level and root cause type output in step 4, the corresponding response mechanism is triggered to achieve automated linkage from risk identification to closed-loop treatment, thereby improving the operational safety and maintenance efficiency of the wastewater treatment plant.

[0028] Step 51: Tiered response strategy; activate different levels of response based on different warning levels.

[0029] If the warning level is yellow, a trend report will be generated and pushed to the team's WeChat group or the maintenance APP to remind them to pay attention; if the warning level is orange, an SMS alarm will be sent, an inspection task will be initiated, and relevant video surveillance will be retrieved; if the warning level is red, an audible and visual alarm will be activated, and the supervisor and duty leader will be notified to prepare for emergency response.

[0030] Step 52: Root cause-driven action recommendations; take appropriate action measures according to different root causes to eliminate the root cause of the abnormal event; then continue to monitor the abnormal event, reduce the warning level through action measures until the abnormality is completely eliminated and no more warnings appear.

[0031] According to the root cause matching and treatment recommendations, if the root cause is low DO, check the aeration valve opening and the aerator operating status; if the root cause is a sudden increase in current, check the motor load and bearing temperature; if the root cause is abnormal ORP, check the carbon source addition system.

[0032] In practice, the collected data includes water quality parameters, equipment status parameters, and flow load parameters.

[0033] The water quality parameters include chemical oxygen demand (CDO), ammonia nitrogen (NH3-N), and dissolved oxygen (DO). The equipment status parameters include current (I), pump frequency (f), and pressure (P).

[0034] Wastewater treatment plant operation data X is constructed by collecting monitoring indicators such as aeration equipment operating parameters and water quality indicators from multiple data tables in the wastewater treatment plant database, organized by time interval. The uniform time granularity for collecting wastewater treatment plant operation data X is 10 minutes (i.e., data is collected every 10 minutes). For missing data in the collected wastewater treatment plant operation data X, a forward imputation method is used to fill in the gaps; that is, if data is missing at a certain moment, it is filled with non-missing data from the nearest time point before that moment (e.g., the previous time point), thus constructing a complete time series dataset. Wastewater treatment plant operation data X is expressed as: X = ( X 1 , X 2 , ... X i ……, X m Each X i This represents the monitoring metrics of a monitored node.

[0035] In practice, step 2 includes the following steps: Step 21: Spatiotemporal correlation characteristic analysis of multi-source data; Step 22: Correlation analysis of abnormal data scenarios; To identify two typical anomalous scenarios, mutation and periodicity, CUSUM and FFT+autocorrelation algorithms are used to enhance the scene perception capability of features.

[0036] Step 23: Obtain the anomaly feature matrix.

[0037] Deep neural networks are used to further extract wastewater treatment plant operation data X (X iThe high-order nonlinear features of the monitoring index of the i-th node are shown in the following formula (9); (9) In formula (9), X represents the operating data of the wastewater treatment plant; W e and b e Here, S and H represent the weight matrix and bias vector of the neural network, respectively; S(.) is the sigmoid function. H represents the deep nonlinear characteristics of the original wastewater operation data X. .

[0038] Finally, all the intermediate features mentioned above are fused to generate an enhanced anomaly feature matrix X. (1) See formula (10) below; (10) In formula (10), The original data or initial value X representing the anomaly feature matrix is ​​( X 1 , X 2 , ... X i ……, X m D represents the mutation intensity feature, P represents the periodic embedding feature, H represents the deep nonlinear feature, and d represents the dimension of the hidden layer of the neural network. N represents the total number of time steps.

[0039] In specific implementation, in step 21, during the analysis of the spatiotemporal correlation characteristics of multi-source data, a knowledge graph G=(V,E) of the sewage treatment process is constructed to characterize the physical and statistical dependencies between variables; the knowledge graph G defines nodes and edges; where V represents the set of nodes such as aeration equipment operating parameters and water quality indicators, and E represents the set of edges connecting different nodes.

[0040] Define the node set V = X = ( X 1 , X 2 , ... X i ……, X m ). Among them, X i Let represent the set of monitoring metrics for the i-th node, which has m feature vectors. X i Monitoring indicators include, but are not limited to, chemical oxygen demand (COD), dissolved oxygen (DO), motor speed, motor current, total nitrogen (TN), and total phosphorus (TP).

[0041] In addition, each monitoring indicator has a dimension of N, where N represents the total number of samples. In practice, the data sampling frequency is 10 minutes, and the number of data points collected in a 24-hour day is N = 24 * 60 / 10 = 144, meaning the total number of samples N is 144. For example, at each node, the number of COD values ​​sampled per day is 144, meaning 144 COD values ​​are collected within 24 hours. The collection of other monitoring indicators is similar to that of COD.

[0042] Each node corresponds to a different monitoring location in the wastewater treatment process. For example, we can assume that the anaerobic tank is the i-th node and the aerobic tank is the k-th node. Each node corresponds to a wastewater treatment plant's operational data. X i The edge weights are initialized using the Pearson correlation coefficient matrix. r This is used to quantitatively measure the degree of association between two nodes. The edge weight between the i-th node and the k-th node. r ik The calculation is shown in the following formula (1): (1) In formula (1), Cov( x i , x k ) is the feature vector X i and eigenvectors X k covariance; r ik For feature vectors X i and eigenvectors X k edge weights, -1≤ r ik ≤1; σ i For feature vectors X i The sample variance, σ k For feature vectors X k The sample variance; i and k represent the i-th node and the k-th node, respectively, and m is the total number of feature nodes, 1≤i≤m, 1≤k≤m. The correlation matrix R is the edge weight. r ik The set is an m×m matrix.

[0043] Use Granger causality test for each pair of eigenvectors ( X i , X k ), and the directional influence is determined by fitting a VAR model, as shown in the following formula (2): (2) In formula (2), X i (t) Represents the i-th eigenvector X i At time t, It is a linear combination of the values ​​of the i-th feature vector itself over the past p time points; It is related to lag time The correlation coefficient is used to measure the feature vector. X i exist The value of time t with respect to the current time t Eigenvector X i The degree of influence of the value; Represents the k-th eigenvector X k The i-th time from p past time points to the current time t Eigenvector X i The impact, It is related to lag time The relevant regression coefficient, ε i It is the current time t. X i (t) The random error term.

[0044] If the regression coefficient If the value is non-zero at a display level of α=0.05, then the eigenvector is determined. X k arrive Eigenvector X i If a causal relationship exists, then construct a causal matrix C, where C∈{0,1}. m×m Finally, the initial adjacency matrix A is constructed by merging the components. (0) See formula (3) below; (3) In formula (3), A (0) Let R represent the initial adjacency matrix, which is used to determine the strength of the association between the variables; α is the weighting coefficient of the correlation matrix R, and β is the weighting coefficient of the causality matrix C; the correlation matrix R is used to determine the strength of the association between the variables. Feature vector The degree of linear correlation between them; C is the causal matrix; if the eigenvectors X k arrive Eigenvector X i If a causal relationship exists, then the corresponding matrix element C of the causal matrix is... ki If the value is 1, then there is no causal relationship between the two, then C ki The value is 0; S(.) is the Sigmoid function, which normalizes the adjacency matrix to (0, 1) for easier analysis and comparison.

[0045] In specific implementation, step 22 includes the following steps: Step 221: Use the CUSUM algorithm for each Eigenvector X i Calculate the cumulative positive deviation at time t. See formula (4) below; (4) In formula (4), Indicates the i-th Eigenvector X i The cumulative positive deviation at time point t, Indicates the i-th Eigenvector X i The cumulative positive deviation at time point t-1, 1≤t≤N, where N represents the total number of time steps. For the normal mean, δ i Minimum detectable offset; X i (t) Indicates the i-th Eigenvector X i The observation at time t; when When, determine the i-th feature Vector X i A mutation event occurs at time t; where h i For the i-th Eigenvector X i The mutation determination threshold is set by the process's sensitivity to anomalies.

[0046] Based on cumulative positive deviation Define the i-th Eigenvector X i mutation intensity vector See formula (5) below; (5) In formula (5), Indicates the i-th Eigenvector X i The mutation intensity vector, where N represents the total number of time steps, T represents the transpose, and R... N Let be the set of N-dimensional real numbers.

[0047] For the i-th Eigenvector X i Perform a fast Fourier transform, as shown in the following formula (6); (6) In formula (6), Indicates the i-th Eigenvector X iThe Fourier transform result at frequency f X i (t) Indicates the i-th Eigenvector X i The observation at time point t, j is the imaginary unit; 1≤t≤N, where N represents the total number of time steps.

[0048] Step 222: Extract the main frequency and calculate the autocorrelation function See formula (7) below; (7) In formula (7), Indicates the i-th Eigenvector X i The autocorrelation function in lag time The value at position i is used to measure the i-th... Eigenvector X i Linear correlation between different time points; Indicates the i-th Eigenvector X i The average value of t at different time points; This is the lag time. 1≤t≤N, where N represents the total number of time steps. Formula (7) calculates... To determine the "eigenvector" X i The basis for determining whether a variable is a periodic variable.

[0049] If R i (144) > 0.6, then mark Eigenvector X i It is a periodic variable. Define a variable that has been determined to be periodic. Eigenvector X i Periodic embedding feature P i (t), see formula (8) below; (8) In formula (8), P i (t) Indicates the i-th Eigenvector X i (Should Eigenvector X i The periodic embedding feature of a variable already identified as periodic at time point t; T represents the period length, i.e., the number of time steps contained in one period. Using a 10-minute granularity as an example, the period length corresponding to a 24-hour period is 144, and the period length corresponding to a 48-hour period is 288. A univariate at a single time point. X i The periodic embedding feature dimension is 2, univariate. X iThe periodic embedding feature dimension is 2N, and the overall dimension is N*2m. Formula (8) is the "periodic embedding feature" constructed for the "feature vector Xi that has been determined to be periodic".

[0050] For periodic eigenvectors X i ( X i For a single univariate time series, at a single time point t, the corresponding periodic embedding feature P i (t) The dimension is 2; when the feature vector X i When there are N time points, the feature vector X i Periodic embedding features P i (t) It is composed of 2D vectors from each time point concatenated sequentially. P i (t) The overall dimension is 2N; if there exist m such periodic eigenvectors ( X 1 , X 2 , ... X i ……, X m Then the periodic embedding features of all these feature vectors P i (t) After integration, the overall dimension is: N ×2 m .

[0051] Mutation trait D=[ , ,..., ] Periodic features are spliced ​​as ; Represents the i-th variable X i The mutation intensity vector (see Formula 5).

[0052] In specific implementation, in step 23, a deep neural network is used to extract high-order nonlinear features of the sewage treatment plant operation data X.

[0053] Deep neural networks are used to further extract wastewater treatment plant operation data X (X i The high-order nonlinear features of the monitoring index of the i-th node are shown in the following formula (9); (9) In formula (9), X represents the operating data of the wastewater treatment plant; W e and b e Here, S and H represent the weight matrix and bias vector of the neural network, respectively; S(.) is the sigmoid function. H represents the deep nonlinear characteristics of the original wastewater operation data X. .

[0054] Finally, all the intermediate features mentioned above are fused to generate an enhanced anomaly feature matrix X. (1) See formula (10) below; (10) In formula (10), The original data or initial value X representing the anomaly feature matrix is ​​( X 1 , X 2 , ... X i ……, X m D represents the mutation intensity feature, P represents the periodic embedding feature, H represents the deep nonlinear feature, and d represents the dimension of the hidden layer of the neural network. N represents the total number of time steps.

[0055] In practice, step 3 includes the following steps: Step 31: Detect anomalies in raw data and calculate the out-of-limit score S. thresh (t); Using the original data X = (from the anomaly feature matrix) X 1 , X 2 , ... X i ……, X m ) Capture threshold exceedances and abnormal trends; exceedance score S thresh The definition of (t) is given in the following formula (11); (11) In formula (11), low u Let x be the u-th variable of the original data X. u The historical minimum value of (t), high u Let x be the u-th variable of the original data X. u The historical maximum value of (t); (.) indicates an indicator function; the function evaluates to 1 if the condition within the parentheses is true, and 0 otherwise. U is the union operator, meaning that either of the two conditions must be met; that is, when x... u (t) compared to the minimum value low u Smaller than or equal to the maximum value high u When they were big, The dot (.) is set to 1, which means that the value x is determined to be 1. u (t) Exceeding the limit.

[0056] Step 32: Calculate the mutation intensity score S jump (t); For each time point t, calculate the L2 norm of the mutation intensity of all variables, as shown in the following formula (12). (12) In formula (12), This represents the mutation feature matrix at time point t, where the mutation feature D = [ , ,..., ]; Represents the i-th variable X i The mutation intensity vector (see Formula 5). S represents the square root of the sum of the squares of the elements in the vector. jump The larger the value of (t), the more significant the step change in the system.

[0057] Step 33: Calculate the period deviation score S peri (t); Periodic Deviation Score peri (t) is used to measure the degree of deviation of a periodic variable from a normal pattern, relative to the historical mean. The Euclidean distance of the periodic embedding vectors is calculated as shown in the following formula (13); (13) In formula (13), For a set of periodic variables, X represents the i-th periodic eigenvector. i The periodic embedding feature at time t is shown in formula (8); It is the i-th periodic eigenvector X i Corresponding periodic embedding features Historical average, It is the period deviation score.

[0058] Step 34: Calculate the spatial diffusion score S spatial (t); Spatial diffusion score S spatial (t) is used to evaluate the breadth and complexity of anomaly propagation in the system.

[0059] Hidden layer variance score The definition is shown in the following formula (14); (14) In formula (14), This represents the hidden layer feature vector at time point t. This represents the i-th element of the hidden layer feature matrix. This represents the mean of all elements in the hidden layer feature vector. (.) indicates variance.

[0060] In formulas (9) and (10), H represents deep nonlinear features; in formula (14), H(t) is the hidden feature vector at time point t. The two are a strict correspondence between the "overall matrix" and the "local slice" under the same feature system: H is a deep nonlinear feature matrix covering all time steps (integrating high-order features of the entire time series), and H(t) is the vector extraction of the matrix at a specific time point t (focusing on the hidden features of a single time series node).

[0061] Distribution Entropy Score It reflects the uniformity of abnormal distribution, and its definition is shown in the following formula (15); (15) In formula (15), (t) represents the normalized absolute value of the i-th hidden layer feature at time point t, and log() is the logarithmic function; This represents the i-th element of the hidden layer feature matrix. This represents the q-th element of the hidden layer feature matrix. This indicates a total of Q items. Summing the absolute values; This represents the distribution entropy score at time point t.

[0062] Based on the hidden layer variance score and distribution entropy score Calculate the spatial diffusion score S spatial (t), the final spatial diffusion score S is obtained. spatial (t) See formula (16) below; (16) In formula (16), This represents the spatial diffusion score at time point t; α1 and β1 are the hidden layer variance scores, respectively. and distribution entropy score The weighting coefficients are α1+β1=1.

[0063] In summary, the spatial diffusion score S spatial (t) comprehensively considers the breadth, complexity and uniformity of anomaly propagation in the system, and can be used to fully evaluate the spatial characteristics of anomalies.

[0064] Step 35: Calculate the overall anomaly intensity M(t); The four scores obtained in steps 31 to 34 above are concatenated into a vector s(t), as shown in the following formula (17); (17) right Z-score normalization is performed to obtain ,in for The average value, for The variance; then the self-learning dynamic parameter is defined, and the final output comprehensive anomaly intensity M(t) is shown in the following formula (18); (18) In formula (18), α l (t) represents the weight corresponding to time t; Indicates the first There are 4 ratings in Formula 17.

[0065] Step 36: Detection of anomalous data fragments.

[0066] 1. Calculate the dynamic threshold Thr of the comprehensive anomaly intensity M, as shown in the following formula (19). (19) In formula (19), For dynamic thresholds, The mean value of the overall anomaly intensity M. 2.5 is the standard deviation of the overall anomaly intensity M, and 2.5 is a constant factor.

[0067] 2. Detecting continuous abnormal intervals See formula (20) below; (20) In formula (19), It is the set of consecutive abnormal time points t, that is, the consecutive abnormal intervals; It is the overall anomaly intensity at time point t.

[0068] 3. Continuous abnormal intervals Clustering into a set of anomalous event fragments See formula (21) below; (twenty one) In formula (20), A collection of fragments of abnormal events. This represents the e-th abnormal event segment, denoted as a time interval Tanom= , Represents the start time of the abnormal segment. This represents the end time of the abnormal segment.

[0069] Based on the continuous abnormal interval Tanom output by formula (20), the abnormal event fragment set ℰ is obtained by clustering in formula (21). Together, they complete the hierarchical identification of “abnormal time point → continuous abnormal interval → abnormal event fragment”.

[0070] In specific implementation, during step 4 of the three-level early warning decision-making process, the event-level comprehensive score Danger for abnormal events is calculated. e At this time, it is necessary to calculate the severity indicators in three dimensions: average anomaly intensity of the event. Duration e and the breadth of influence e .

[0071] Step 41: Calculate the event-level comprehensive score Danger e ; For the e-th abnormal event fragment in step 3 Calculate the severity index in three dimensions: average event anomaly intensity. Duration e and the breadth of influence e .

[0072] Step 411: Average Anomaly Strength of Events The calculation process is shown in the following formula (22); (twenty two) In formula (22), This represents the average intensity of the event; a larger value indicates a more severe anomaly.

[0073] Step 412: Duration e The calculation process is shown in the following formula (23); (twenty three) In formula (23), This represents the segment of the e-th abnormal event. The duration reflects the persistence of the anomaly.

[0074] Step 413: Affecting the breadth e The calculation process is shown in the following formula (24); (twenty four) In formula (24), The mean variance of the hidden layer representation during the event period measures the range of variables affected by the anomaly. Step 414: Event-Level Comprehensive Score Danger e The calculation process is shown in the following formula (25); (25) In formula (25), α2, β2, and γ2 are the average anomaly intensities of the events, respectively. Duration e and the breadth of influence e The weighting coefficients.

[0075] In specific implementation, during step 4 of the three-level early warning decision-making process, the event-level comprehensive score Danger is used as the basis for the decision. e The quantiles are used to set dynamic thresholds θ1 and θ2; the three-level warning is divided using dynamic thresholds θ1 and θ2.

[0076] In practice, the three-level early warning system is divided into red, orange, and yellow warnings.

[0077] Step 42: Steps for classifying the three-level early warning system; Based on the event-level comprehensive score Danger obtained in step 41 e The quantiles are set with dynamic thresholds θ1 and θ2, as shown in formulas (26) and (27) below. (26) (27) In formulas (26) and (27), It indicates 75%. This represents 90%, i.e., θ1 = 0.75 Danger. e θ2=0.9 Danger e .

[0078] The following division rules are determined based on dynamic thresholds θ1 and θ2, as shown in formula (28). (28) In formula (28), θ1 and θ2 are dynamic thresholds that are adjusted in real time, thus adapting to the risk distribution under different working conditions. It is the warning level for the e-th event, used to trigger different response mechanisms.

[0079] Step 43: Locate the root cause.

[0080] In the root cause analysis phase, a graph propagation source tracing analysis is conducted using a process knowledge graph G=(V,E): starting from nodes with high activation levels in this knowledge graph, backpropagation calculations are performed. For each variable to be evaluated... (This variable is) X i ; X i (representing the set of monitoring metrics for the i-th node), first determine the variables affecting the knowledge graph. The set of downstream variables that are affected, combined with variables in the knowledge graph The association weights between these downstream variables (i.e., the edge weights between the i-th node and the k-th node) r ik And the maximum value of the hidden layer output of the neural network corresponding to each downstream variable within the current anomalous event segment, the product of "weight and corresponding maximum value" is accumulated, and this accumulated result is the variable. As a probability score for the abnormal root cause, see the following formula (29).

[0081] (29) In formula (29), The variable to be evaluated (Belongs to node set V, corresponding to monitoring metrics) X i (e) as the e-th abnormal event The probability score of the root cause; the higher the score, the greater the probability of the root cause. It is the set of downstream variables directly affected by variable ψ in the knowledge graph (G=(V,E)), and the causal relationship is determined based on the initial adjacency matrix A(0); The variables in the initial adjacency matrix A(0) The association weight with the downstream variable y; This is the e-th abnormal event fragment; (t) represents the element of the hidden layer feature matrix H at time t and the variable y; It is the hidden output of the downstream variable y in the current abnormal event segment. The maximum value within.

[0082] After calculating the scores of all variables, select the variable with the highest score; this variable is the root cause of the current abnormal event.

[0083] The final root cause variable of the anomaly It is based on all variables The score is determined by the source of influence: for example, for the variable "aerator electrical current". Its source of influence score is 0.92; regarding the variable "aerobic terminal DO" The corresponding value is 0.61; while the variable corresponding to "return pump vibration" is... The score was 0.33. By comparing these variables... The scores show that the "aerator motor current" has the highest score among the influencing sources, therefore, it can be determined that this variable is the root cause of this anomaly. An abnormality has occurred in the (aerator's electrical current); this abnormality may lead to insufficient air supply, which in turn will cause a decrease in the DO concentration at the aerobic end.

[0084] The three-level early warning and processing method for detecting data anomalies in wastewater treatment plants according to the present invention has the following technical features: 1. Achieve precise classification and differentiated response to abnormal risks: This invention constructs a three-level early warning system of yellow, orange, and red, which comprehensively assesses event-level risks based on the intensity, duration, and scope of impact of abnormalities. It breaks through the shortcomings of traditional systems that report every alarm, and achieves a leap from alarm overload to risk identification, significantly improving the accuracy and operability of early warning.

[0085] 2. Improve system response speed and operational safety: Through multi-scale feature fusion and dynamic scoring mechanism, the system can quickly complete detection and classification after an anomaly occurs. Red warning triggers audible and visual alarms and PLC linkage protection, effectively avoiding water quality exceeding standards or equipment damage due to response lag, and ensuring the safety and stability of the sewage treatment process.

[0086] 3. Reduce operation and maintenance costs and technical barriers: The early warning system automatically completes the entire process from data perception and anomaly scoring to root cause suggestions, reducing reliance on human experience; operation and maintenance personnel can respond quickly according to the early warning level and handling suggestions, and the average troubleshooting time is greatly shortened.

[0087] 4. Enhance cross-scenario adaptability and deployment efficiency: By adopting a dynamic threshold division and adaptive feature fusion mechanism, there is no need to repeatedly calibrate parameters for different wastewater treatment plants. The model can be quickly deployed and maintain stable performance in various process scenarios such as A² / O and oxidation ditch. It has strong generalization ability and high promotion value.

[0088] The three-level early warning and processing method for detecting data anomalies in wastewater treatment plants of the present invention has the advantages of improving the accuracy, interpretability and engineering applicability of anomaly detection, and providing strong support for the intelligent and refined operation of wastewater treatment processes.

[0089] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0090] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A three-level early warning and processing method for detecting data anomalies in wastewater treatment plants, characterized in that, Includes the following steps: Step 1: Data Acquisition Steps; Obtain wastewater treatment plant operation data X from the wastewater treatment plant's database; Step 2: Data preprocessing steps; perform spatiotemporal correlation feature analysis, abnormal data scenario correlation analysis, and high-order nonlinear feature extraction on the wastewater treatment plant operation data X; Step 3: Data analysis step; For the preprocessed data in Step 2, data fusion is used to achieve multi-dimensional anomaly scoring and obtain a set of anomaly event fragments; Step 4: Three-level early warning decision-making and root cause identification; based on the event-level comprehensive score Danger e Assess abnormal events and determine the warning level based on the assessment results; at the same time, determine the root cause of the abnormal events. Step 5: Hierarchical response linkage and closed-loop management.

2. The three-level early warning and processing method for detecting data anomalies in wastewater treatment plants according to claim 1, characterized in that, The collected data includes water quality parameters, equipment status parameters, and flow load parameters.

3. The three-level early warning and processing method for detecting data anomalies in wastewater treatment plants according to claim 1, characterized in that, Step 2 includes the following steps: Step 21: Spatiotemporal correlation characteristic analysis of multi-source data; Step 22: Correlation analysis of abnormal data scenarios; Step 23: Obtain the anomaly feature matrix.

4. The three-level early warning and processing method for detecting data anomalies in wastewater treatment plants according to claim 3, characterized in that, In step 21, during the analysis of the spatiotemporal correlation characteristics of multi-source data, a knowledge graph G=(V,E) of the wastewater treatment process is constructed to characterize the physical and statistical dependencies between variables. The knowledge graph G is defined with nodes and edges. V represents the set of nodes such as aeration equipment operating parameters and water quality indicators, and E represents the set of edges connecting different nodes.

5. The three-level early warning and processing method for detecting data anomalies in wastewater treatment plants according to claim 3, characterized in that, Step 22 includes the following steps: Step 221: Use the CUSUM algorithm for each Eigenvector X i Calculate the cumulative positive deviation at time t. ; Step 222: Extract the main frequency and calculate the autocorrelation function .

6. The three-level early warning and processing method for detecting data anomalies in wastewater treatment plants according to claim 3, characterized in that, In step 23, a deep neural network is used to extract high-order nonlinear features of the sewage treatment plant operation data X.

7. The three-level early warning and processing method for detecting data anomalies in wastewater treatment plants according to claim 1, characterized in that, Step 3 includes the following steps: Step 31: Detect anomalies in raw data and calculate the out-of-limit score S. thresh (t); Step 32: Calculate the mutation intensity score S jump (t); Step 33: Calculate the period deviation score S peri (t); Step 34: Calculate the spatial diffusion score S spatial (t); Step 35: Calculate the overall anomaly intensity M(t); Step 36: Detection of anomalous data fragments.

8. The three-level early warning and processing method for detecting data anomalies in wastewater treatment plants according to claim 1, characterized in that, In step 4, during the three-level early warning decision-making process, the event-level comprehensive score Danger for abnormal events is calculated. e At this time, it is necessary to calculate the severity indicators in three dimensions: average anomaly intensity of the event. Duration e and the breadth of influence e .

9. A three-level early warning processing method for detecting data anomalies in wastewater treatment plants according to claim 8, characterized in that, In step 4, during the three-level early warning decision-making process, the event-level comprehensive score Danger is used as the basis for the decision. e The quantiles are used to set dynamic thresholds θ1 and θ2; the three-level warning is divided using dynamic thresholds θ1 and θ2.

10. A three-level early warning processing method for detecting data anomalies in wastewater treatment plants according to claim 9, characterized in that, When classifying warnings into three levels, they are divided into red warnings, orange warnings, and yellow warnings.