Warning method for abnormal inflow water quality of sewage plant

Through the pretreatment of the historical detection data of the sewage treatment plant and the prediction of ARIMA model, combined with the isolated forest algorithm to detect residual sequences, the timeliness and accuracy of abnormal warnings of incoming water quality in the sewage treatment plant is solved, ensuring the stable operation of the sewage treatment plant and the effluent water quality meets the standards.

CN120429786APending Publication Date: 2025-08-05YANGTZE ECOLOGY & ENVIRONMENT CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510492976.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

The existing technology cannot promptly and accurately warn of abnormal water quality inlets in sewage treatment plants, especially industrial wastewater with high concentrations of difficult biodegradation and high biotoxicity, which have impact on sewage treatment plants. The existing monitoring equipment is easy to damage and has high operating and maintenance costs. The single water quality index threshold method cannot fully reflect the hazards of inlet water quality.

Method used

By pre-treating the historical detection data of the sewage treatment plant, using the ARIMA model to predict, obtain the predicted residual sequence, and combining the isolated forest algorithm to determine the residual sequence abnormality, we construct an early warning method for abnormal water quality inlet in the sewage plant.

Benefits of technology

It has achieved a timely warning of abnormal water quality inlets in the sewage treatment plant, reduced operating costs, ensured the stable operation of the sewage treatment plant and met the water quality of the effluent, and improved the accuracy and reliability of the early warning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429786A_ABST
    Figure CN120429786A_ABST
Patent Text Reader

Abstract

The invention discloses a sewage plant inflow water quality abnormity early warning method, comprising the following steps: analyzing an inflow water high-frequency time sequence data fluctuation rule of a sewage plant through an algorithm, constructing an inflow water quality prediction model, obtaining a prediction residual sequence on the basis of water quality prediction, and eliminating an inflow water normal fluctuation rule of the sewage plant; and substituting the residual error sequence into an isolated forest algorithm to realize water quality abnormity monitoring and water inflow early warning for water quality abnormity. A water quality anomaly detection method based on time sequence prediction is constructed, and the requirement of inflow water quality prediction of a sewage treatment plant can be met; the problem that water quality abnormity is not obvious in water quality indexes is solved by excavating the water quality fluctuation rule of sewage treatment inlet water and combining with an unsupervised abnormity detection algorithm to realize abnormity judgment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sewage treatment plant inlet water detection, in particular to a sewage treatment plant inlet water quality abnormality early warning method. Background Art

[0002] Ensuring that the effluent from urban sewage treatment plants consistently meets standards is of great significance for protecting the water environment. However, high-concentration, difficult-to-biodegrade, and highly biotoxic industrial wastewater far exceeds the designed treatment capacity of urban sewage treatment plants, which can easily lead to the collapse of the biological treatment system and impact the stable operation of urban sewage treatment plants. This puts sewage treatment plants at risk of effluent quality exceeding standards and causes harm to the aquatic ecological environment.

[0003] To alleviate the operational pressure on sewage treatment plants, timely and accurate early warning and response to influent water quality anomalies will effectively reduce sewage treatment plant operating costs and ensure that effluent from urban sewage treatment plants consistently meets discharge standards. This is of great significance for ecological and environmental protection and economic benefits. However, the shortcomings of existing influent water quality monitoring technology and hardware at urban sewage treatment plants hinder timely and accurate early warning of influent anomalies. For example, the common manual sampling and testing methods have long testing cycles, and influent water quality monitoring is generally conducted on a daily basis. This low monitoring frequency makes it difficult to identify and warn of water quality anomalies in a timely manner. Although sewage treatment plants are gradually improving their influent online monitoring equipment to enable continuous monitoring of influent chemical oxygen demand (COD) and ammonia nitrogen (NH3-N), the complex composition of wastewater makes online monitoring equipment susceptible to damage, resulting in high operating and maintenance costs. Furthermore, industrial wastewater contains a wide variety of pollutants. Even if indicators such as COD and NH3-N meet the discharge standards, the discharge of some wastewater containing heavy metals and biotoxic substances can still impact the normal operation of sewage treatment plants. Therefore, simply using a single water quality indicator combined with the inlet threshold method cannot fully and accurately reflect whether the inlet water quality has an impact and harm on the sewage treatment plant, and it is difficult to make timely judgments on water quality abnormalities. Summary of the Invention

[0004] The technical problem to be solved by the present invention is that a single water quality indicator combined with the inlet threshold method cannot fully and accurately reflect whether the inlet water quality brings impact and harm to the sewage treatment plant.

[0005] To solve the above technical problems, the technical solution adopted by the present invention is: a method for early warning of abnormal water quality in the sewage treatment plant, comprising the following steps: Step 1: Data preprocessing: preprocess the historical test data of the sewage treatment plant, fill in the missing values through median interpolation, and use the Lowess method to smooth and remove the historical water inlet test data; Step 2: Components of the forecasting model, using the ARIMA model to forecast historical data; Step 3: Obtain the prediction residual sequence by subtracting the historical monitoring data from the prediction historical data obtained in step 2 to obtain the prediction residual sequence; Step 4: Detection of water quality anomalies, using the isolation forest algorithm to identify anomalies in the residual sequence; Step 5: Early warning of abnormal water quality. For the detection data obtained in real time, the prediction residual sequence is obtained by subtracting the predicted data. The prediction residual sequence is input into the random forest model. When the prediction residual is abnormal, an early warning of abnormal water quality is issued.

[0006] Preferably, in step 2, model building includes the following steps: S2.1. Sequence stationarity test: Use Augmented Dickey-Fuller Testing (ADF) to determine whether the sequence is stationary. For non-stationary sequences, perform d-times difference to make them stationary, and determine the parameter d of ARIMA (p, d, q). S2.2. Sequence Plots and Parameter Ranges Draw the autocorrelation diagram (ACF) and partial autocorrelation diagram (PACF) of the time series, and determine the approximate p and q ranges by truncating and tailing the autocorrelation diagram and partial autocorrelation diagram; S2.3. Sequence parameter confirmation Within the range of p and q values obtained by the autocorrelation plot and partial autocorrelation plot, the final model p and q parameters are determined by calculating the Akaike information criterion under different p and q values; S2.4 Model Construction For the historical water quality monitoring data of different water quality indicators obtained, separate models are built to construct prediction models, predict the historical data, and predict the water quality of the incoming water at the next moment based on the monitoring frequency.

[0007] Preferably, in step S2.4, the prediction model algorithm includes: autoregressive model, moving average model and difference process; When the data belongs to a stationary sequence, the autoregressive model and the moving average model are used to directly model and predict the stationary sequence. In this case, the model is ARMA.

[0008] Preferably, when the data belongs to a non-stationary sequence, the data is differentially processed to make the data a stationary sequence and then modeling and predicting the stationary sequence. In this case, the model is ARIMA.

[0009] Preferably, ARMA model building includes the following steps: Pick is the predicted value at the tth moment, is the random error at the tth moment, arrive 、 arrive are model parameters; The p-order autoregressive model is recorded as AR(p), and the p-order autoregressive model equation is as follows: ; is the predicted value at the tth moment, arrive are model parameters, is a random error; When defining the p-order movement operator B: ; The model can be written as: ; The q-order moving average model is recorded as MA(q), and the q-order moving average equation is as follows: ; is the predicted value at the tth moment, arrive are model parameters, is the random error at the tth moment; When defining the q-order movement operator: ; The model is recorded as: ; The p-order autoregressive and q-order moving average autoregressive moving average models are recorded as ARMA (p, q), and the model equation is as follows:

[0010] It can also be written as: .

[0011] Preferably, when the data belongs to a non-stationary series, the time series is differentiated, the i-order difference is recorded as d, and the corresponding model is recorded as ARIMA (p, d, q). The model equation is as follows: .

[0012] Preferably, in step 4, the isolation forest detection model building includes the following steps: S4.1. Randomly select n features from the residual sequence and randomly generate a cut point p between the maximum and minimum values of the selected features; S4.2, divide n features into 2 subsets according to the cut point p; S4.3. Repeat step (2) until all subsets contain only one feature; S4.4. Repeat steps (1) and (2) to build a random forest anomaly detection model; S4.5. For each water quality monitoring indicator, abnormality identification is achieved by calculating the tree depth.

[0013] Preferably, the isolation forest algorithm detection includes: in a first stage, training t isolated trees to form an isolation forest; then bringing each sample point into each isolated tree in the forest, calculating the average height, and then calculating the outlier score of each sample point.

[0014] Preferably, the training steps of the isolation tree are as follows: Step 1: For a given data set, from Randomly select Sample points Subset of Put in the root node; Step 2: From Randomly select one dimension from the , randomly generate a cutting point in the current data , ; Step 3: This cutting point Generate a hyperplane that divides the current data space into two subspaces: Sample points with a specified dimension less than p are placed in the left child node, and those greater than or equal to p are placed in the right child node; Step 4: Recursively repeat steps 2 and 3 until all leaf nodes have only one sample point or isolated tree. The specified altitude has been reached; Step 5: Repeat steps 1 to 4 until a Isolated tree .

[0015] Preferably, the outlier score of each sample point is calculated as follows: For each data point , let it traverse each isolated tree , calculation point Average height in the forest ,normalize the average height of all points; The outlier score is calculated as follows:

[0016] in, .

[0017] 1. The present invention provides a method for early warning of abnormal influent water quality of a sewage treatment plant. For the historical monitoring data of the sewage treatment plant obtained, the historical influent monitoring data are first preprocessed, the missing values are interpolated by median to fill the missing values, and the historical influent monitoring data of the sewage treatment plant are smoothed and denoised using the Lowess method; for the acquired monitoring data, the model parameters are determined through a stationarity test, an autocorrelation plot, and a partial autocorrelation plot, and an influent water quality prediction model based on ARIMA is constructed. The sewage treatment plant influent monitoring data and the predicted value of the ARIMA model are subtracted to obtain a prediction residual sequence; the prediction residual sequence is used to train an isolation forest model to realize abnormal detection of the influent water quality of the sewage treatment plant.

[0018] 2. In response to the shortcomings of the existing monitoring system of sewage treatment plants, a water quality anomaly detection method based on time series prediction was constructed to meet the needs of influent water quality prediction of sewage treatment plants.

[0019] 3. In order to solve the problem that industrial wastewater is difficult to identify through conventional water quality indicators, we explored the fluctuation patterns of water quality of sewage treatment inlet and combined it with unsupervised anomaly detection algorithm to achieve anomaly identification, thus solving the problem that water quality anomalies are not significant in water quality indicators.

[0020] 4. A sewage treatment plant influent water quality abnormality early warning method uses a prediction algorithm and anomaly detection algorithm that do not involve a neural network method, has a simple modeling process, is simple to calibrate model parameters, and has a fast running speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The present invention will be further described below with reference to the accompanying drawings and examples: Figure 1 It is the algorithm flow chart of the present invention.

[0022] Figure 2 This is a schematic diagram of identifying abnormal fluctuations in the influent water quality of a sewage treatment plant according to an embodiment of the present invention. DETAILED DESCRIPTION

[0023] For urban sewage treatment plants, affected by the acceptance of domestic sewage, the influent water quality indicators have a periodic fluctuation pattern, and influent anomalies caused by various reasons can easily affect the influent water quality fluctuation pattern. Therefore, by constructing a water quality prediction model, obtaining a residual sequence that excludes the periodic fluctuation pattern of influent, and combining it with anomaly detection algorithms, influent water quality anomalies can be effectively identified.

[0024] like Figure 1 As shown, the present invention provides a method for early warning of abnormal water quality in a sewage treatment plant, comprising the following steps: Step 1: Data preprocessing: preprocess the historical test data of the sewage treatment plant, fill in the missing values through median interpolation, and use the Lowess method to smooth and remove the historical water inlet test data; Step 2: Components of the forecasting model, using the ARIMA model to forecast historical data; Step 3: Obtain the prediction residual sequence by subtracting the historical monitoring data from the prediction historical data obtained in step 2 to obtain the prediction residual sequence; Step 4: Detection of water quality anomalies, using the isolation forest algorithm to identify anomalies in the residual sequence; Step 5: Early warning of abnormal water quality. For the detection data obtained in real time, the prediction residual sequence is obtained by subtracting the predicted data. The prediction residual sequence is input into the random forest model. When the prediction residual is abnormal, an early warning of abnormal water quality is issued.

[0025] The data collected included various water quality indicators, including influent chemical oxygen demand (COD), ammonia nitrogen (NH3-N), and heavy metal content. Missing values for the COD indicator were found at some time points. Median interpolation was then used to fill these gaps. This method takes several known COD values before and after the missing value, calculates their median, and uses this median as an estimate to fill in the missing value. This method can reasonably fill in missing values without introducing excessive bias, making the data more complete and providing a reliable data foundation for subsequent analysis and modeling.

[0026] The Lowess method is used to smooth and de-noise historical water inlet test data. All water quality indicator data is input into the Lowess algorithm in chronological order. By setting appropriate smoothing parameters, the data is smoothed and noise fluctuations are removed. This helps to more accurately capture the changing trends of water quality data, improving data quality and usability.

[0027] As a preferred embodiment of the present invention, in step 2, model building includes the following steps: S2.1. Sequence Stationarity Test: Using the historical monitoring data series of ammonia nitrogen (NH3-N) from the wastewater treatment plant as an example, we used the Augmented Dickey-Fuller Test (ADF) to determine the stationarity of the series. The test found the series to be non-stationary. We then performed a single difference process and an ADF test. The results showed that the processed series became stationary, thus confirming that parameter d = 1 in the ARIMA (p, d, q) model. S2.2. Sequence Plots and Parameter Ranges Draw the autocorrelation plot (ACF) and partial autocorrelation plot (PACF) of the processed ammonia nitrogen data time series. By observing that the ACF plot is truncated after lag 2 and the PACF plot is tailed after lag 1, it is preliminarily determined that the approximate range of parameter p is 1 and the approximate range of q is 2; S2.3. Sequence parameter confirmation The Akaike Information Criterion (AIC) was calculated for different values of p and q when p was 1 and q was between 0 and 2, and when p was between 0 and 2 and q was 2. After comparison, the AIC value was minimized when p = 1 and q = 1, thus determining the final model parameters p = 1 and q = 1. S2.4 Model Construction For each of the historical water quality monitoring data obtained for different water quality indicators (such as COD and heavy metal content), we constructed a separate prediction model according to the above steps. Given the sewage treatment plant's hourly monitoring frequency, we used the constructed ARIMA (1, 1, 1) model to predict the ammonia nitrogen indicator and obtain the predicted value of ammonia nitrogen in the influent at the next moment.

[0028] Through strict sequence stationarity testing and reasonable parameter determination methods, the constructed ARIMA model can accurately fit the changing patterns of water quality data, improve the prediction accuracy of influent water quality, and provide a reliable prediction basis for subsequent anomaly detection.

[0029] Different water quality indicators are modeled separately, taking into account the uniqueness of each indicator, which can more comprehensively reflect the influent water quality and make the prediction results more accurate and reliable.

[0030] As a preferred embodiment of the present invention, in step S2.4, the prediction model algorithm includes: autoregressive model, moving average model and difference process; When the data belongs to a stationary sequence, the autoregressive model and the moving average model are used to directly model and predict the stationary sequence. In this case, the model is ARMA.

[0031] When the data belongs to a non-stationary sequence, the data is differentiated to make it a stationary sequence and then the stationary sequence is modeled and predicted. In this case, the model is ARIMA.

[0032] ARMA model building includes the following steps: Pick is the predicted value at the tth moment, is the random error at the tth moment, set , (p=2), =0.3, (q=2) is the model parameter; According to the p-order autoregressive model equation ; Calculate the predicted value, for example, given Predicted value at time =1.5mg / L, =1.3mg / L, random error =0.1mg / L, then the predicted value at time t =1.26mg / L.

[0033] When defining the p-order movement operator B: ; The model can be written as: ; For the q-order moving average model, according to the equation ; Assume that the random error at time t =0.2mg / L, Random error in time =0.15mg / L, Random error in time =0.1mg / L, then = =0.145mg / L.

[0034] For the definition of q-order movement operator: ; The model is recorded as: ; For the p-order autoregressive and q-order moving average autoregressive moving average models, they are recorded as ARMA (2, 2). The model equation is as follows:

[0035] It can also be written as: .

[0036] Taking the historical monitoring data of lead content in a sewage treatment plant as an example, when the data belongs to a non-stationary series, the time series is processed by second-order difference, the i-order difference is recorded as d=2, and the corresponding model is recorded as ARIMA (p, 2, q). Assuming that p=1 and q=1 are determined after processing, according to the model equation: ,in =1- B( =0.5), =1- B( =0.3), is a random error.

[0037] Modeling and forecasting are performed on the processed stationary series to obtain the predicted lead content value at the next moment. For example, the predicted value calculated based on historical data and model parameters provides a reference for monitoring and controlling heavy metal content in sewage treatment plants. For non-stationary water quality data series, the ARIMA model converts them into stationary series through differencing, and then performs modeling and forecasting. This effectively handles non-stationary data and expands the model's scope of application.

[0038] In step three, continuing with the ammonia nitrogen index of the aforementioned sewage treatment plant as an example, the historical monitoring data is subtracted from the predicted historical data obtained using the ARIMA (1, 1, 1) model to obtain a series of predicted residuals for the ammonia nitrogen index. For example, at a certain moment, the actual monitored value of ammonia nitrogen is 25 mg / L, and the model predicts 23 mg / L. The residual value at that moment is 2 mg / L. Using this method, the prediction residuals for the entire time series are calculated.

[0039] The prediction residual sequence can reflect the difference between the actual monitoring data and the model prediction data. By analyzing the residual sequence, abnormal fluctuations not captured in the model prediction can be discovered, providing an important source of information for water quality anomaly detection.

[0040] In step 4, the isolation forest detection model is built by the following steps: S4.1. Randomly select 10 features from the residual sequence and randomly generate a cut point p between the maximum and minimum values of the selected features. For example, if the maximum value of the 10 selected residual values is 5 mg / L and the minimum value is -3 mg / L, the randomly generated cut point p = 1 mg / L is generated. S4.2. Divide the 10 features into two subsets based on the cut point p. Place the residual values less than 1 mg / L into the left subset, and the residual values greater than or equal to 1 mg / L into the right subset. S4.3. Repeat step S4.2 until all subsets contain only one feature; S4.4. Repeat the steps of randomly selecting features, generating cut points, and dividing subsets in steps S4.1 and S4.2 to build 50 random forest anomaly detection models; S4.5. For each water quality monitoring indicator (such as the residual sequence corresponding to COD, heavy metal content, etc.), anomaly discrimination is achieved by calculating the tree depth; when the tree depth of a residual value in an isolated tree is short, the residual value is judged to be an anomaly.

[0041] The isolation forest algorithm involves training 50 isolated trees in the first stage to form an isolation forest. Each sample point (i.e., each residual value) is then introduced to each isolated tree in the forest and its average height is calculated. For example, if the heights of 50 isolated trees for a given ammonia nitrogen residual value are 3, 4, 2, and so on, the average height is calculated to be 3. The outlier score for each sample point is then calculated using the formula s (x, ψ) = 2^(E (h (x)) / c (ψ) ), where c (ψ) is calculated based on the sample size ψ = 10. When the outlier score exceeds a certain threshold (e.g., 0.8), the water quality indicator is considered abnormal.

[0042] The Isolation Forest algorithm can effectively detect outliers in residual sequences and is highly sensitive to unusual fluctuations in the influent quality of sewage treatment plants. By randomly selecting features and constructing multiple isolation trees, it can comprehensively capture unusual patterns in the data.

[0043] This algorithm does not depend on the specific distribution of the data and is suitable for processing complex sewage water quality data. It can accurately detect anomalies without understanding the specific characteristics of the data, solving the problem that water quality anomalies are not significant in water quality indicators.

[0044] The training steps of the isolation tree are as follows: Step 1: For a given data set, from Randomly select Sample points Subset of Put in the root node; Step 2: From Randomly select one dimension from the , randomly generate a cutting point in the current data , ; Step 3: This cutting point Generate a hyperplane that divides the current data space into two subspaces: Sample points with a specified dimension less than p are placed in the left child node, and those greater than or equal to p are placed in the right child node; Step 4: Recursively repeat steps 2 and 3 until all leaf nodes have only one sample point or isolated tree. The specified altitude has been reached; Step 5: Repeat steps 1 to 4 until a Isolated tree .

[0045] The outlier score calculation method for each sample point is as follows: For each data point , let it traverse each isolated tree , calculation point Average height in the forest ,normalize the average height of all points; The outlier score is calculated as follows: ; in, .

[0046] When providing an abnormal water quality warning, the system collects real-time influent water quality data from the sewage treatment plant, using COD as an example. The real-time COD value is subtracted from the predicted COD value for the next moment using the ARIMA model to generate a prediction residual sequence. This residual sequence is then fed into a random forest model (previously trained using a large number of historical residual sequences). If the prediction residual is identified as abnormal—that is, if the random forest model identifies certain values in the residual sequence as outliers and the outlier score exceeds a threshold—an alert is issued regarding abnormal water quality. For example, an alert may be issued to notify sewage treatment plant staff that the current influent COD indicator may be abnormal and requires further inspection and action. It can provide timely warnings for abnormal water quality, allowing sewage treatment plant staff to understand changes in influent water quality at the first opportunity and take appropriate measures to deal with it, avoiding the collapse of the sewage treatment plant's biological treatment system due to abnormal water quality, ensuring the stable operation of the sewage treatment plant and the compliance of effluent water quality standards; and it combines the prediction of the ARIMA model with the anomaly detection of the random forest model to improve the accuracy and reliability of the warning and reduce false alarms and missed reports.

[0047] like Figure 2 As shown in the figure, a sewage treatment plant in Yuanjiang City has abnormal influent water quality due to regular instrument maintenance and water inflow. The results after algorithm anomaly detection are as follows, which can effectively identify abnormal fluctuations in the influent water quality of the sewage treatment plant.

Claims

1. A method for early warning of abnormal water quality in a sewage treatment plant, characterized in that: The steps include: Step 1: Data preprocessing: preprocess the historical test data of the sewage treatment plant, fill in the missing values through median interpolation, and use the Lowess method to smooth and remove the historical water inlet test data; Step 2: Components of the forecasting model, using the ARIMA model to forecast historical data; Step 3: Obtain the prediction residual sequence by subtracting the historical monitoring data from the prediction historical data obtained in step 2 to obtain the prediction residual sequence; Step 4: Detection of water quality anomalies, using the isolation forest algorithm to identify anomalies in the residual sequence; Step 5: Early warning of abnormal water quality. For the detection data obtained in real time, the prediction residual sequence is obtained by subtracting the predicted data. The prediction residual sequence is input into the random forest model. When the prediction residual is abnormal, an early warning of abnormal water quality is issued.

2. A sewage treatment plant influent abnormal water quality early warning method as claimed in claim 1, characterized in that: In the second step, model building includes the following steps: S2.

1. Sequence stationarity test: Use Augmented Dickey-Fuller Testing (ADF) to determine whether the sequence is stationary. For non-stationary sequences, perform d-times difference to make them stationary, and determine the parameter d of ARIMA (p, d, q). S2.

2. Sequence Plots and Parameter Ranges Draw the autocorrelation diagram (ACF) and partial autocorrelation diagram (PACF) of the time series, and determine the approximate p and q ranges by truncating and tailing the autocorrelation diagram and partial autocorrelation diagram; S2.

3. Sequence parameter confirmation Within the range of p and q values obtained by the autocorrelation plot and partial autocorrelation plot, the final model p and q parameters are determined by calculating the Akaike information criterion under different p and q values; S2.4 Model Construction For the historical water quality monitoring data of different water quality indicators obtained, separate models are built to construct prediction models, predict the historical data, and predict the water quality of the incoming water at the next moment based on the monitoring frequency.

3. A sewage treatment plant influent abnormal water quality early warning method as claimed in claim 2, characterized in that: In step S2.4, the prediction model algorithm includes: autoregressive model, moving average model and difference process; When the data belongs to a stationary sequence, the autoregressive model and the moving average model are used to directly model and predict the stationary sequence. In this case, the model is ARMA.

4. A method for early warning of abnormal water quality in a sewage treatment plant according to claim 3, characterized in that: When the data belongs to a non-stationary sequence, the data is differentiated to make it a stationary sequence and then the stationary sequence is modeled and predicted. In this case, the model is ARIMA.

5. A sewage treatment plant influent abnormal water quality early warning method as claimed in claim 4, characterized in that: ARMA model building includes the following steps: Pick is the predicted value at the tth moment, is the random error at the tth moment, arrive 、 arrive are model parameters; The p-order autoregressive model is recorded as AR(p), and the p-order autoregressive model equation is as follows: ; is the predicted value at the tth moment, arrive are model parameters, is a random error; When defining the p-order movement operator B: ; The model can be written as: ; The q-order moving average model is recorded as MA(q), and the q-order moving average equation is as follows: ; is the predicted value at the tth moment, arrive are model parameters, is the random error at the tth moment; When defining the q-order movement operator: ; The model is recorded as: ; The p-order autoregressive and q-order moving average autoregressive moving average models are recorded as ARMA (p, q), and the model equation is as follows: It can also be written as: 。 6. A method for early warning of abnormal water quality in a sewage treatment plant according to claim 5, characterized in that: When the data belongs to a non-stationary series, the time series is differentiated, the i-order difference is recorded as d, and the corresponding model is recorded as ARIMA (p, d, q). The model equation is as follows: 。 7. A sewage treatment plant influent water quality abnormality early warning method as claimed in claim 1, characterized in that: In step 4, the isolation forest detection model is built by the following steps: S4.

1. Randomly select n features from the residual sequence and randomly generate a cut point p between the maximum and minimum values of the selected features; S4.2, divide n features into 2 subsets according to the cut point p; S4.

3. Repeat step S4.2 until all subsets contain only one feature; S4.

4. Repeat steps S4.1 and S4.2 to build a random forest anomaly detection model; S4.

5. For each water quality monitoring indicator, abnormality identification is achieved by calculating the tree depth.

8. A method for early warning of abnormal water quality in a sewage treatment plant as claimed in claim 7, characterized in that: The isolation forest algorithm detection includes: in the first stage, t isolated trees are trained to form an isolation forest; then each sample point is brought into each isolated tree in the forest, the average height is calculated, and then the outlier score of each sample point is calculated.

9. A sewage treatment plant influent abnormality water quality early warning method as claimed in claim 8, characterized in that: The training steps of the isolation tree are as follows: Step 1: For a given data set, from Randomly select Sample points Subset of Put in the root node; Step 2: From Randomly select one dimension from the dimensions , randomly generate a cutting point in the current data , ; Step 3: This cutting point Generate a hyperplane that divides the current data space into two subspaces: Sample points with a specified dimension less than p are placed in the left child node, and those greater than or equal to p are placed in the right child node; Step 4: Recursively repeat steps 2 and 3 until all leaf nodes have only one sample point or isolated tree. The specified altitude has been reached; Step 5: Repeat steps 1 to 4 until a Isolated tree .

10. A sewage treatment plant influent abnormality water quality early warning method as claimed in claim 9, characterized in that: The outlier score calculation method for each sample point is as follows: For each data point , let it traverse each isolated tree , calculation point Average height in the forest ,normalize the average height of all points; The outlier score is calculated as follows: in, 。

Citation Information

Cited By

  • Energy consumption anomaly detection method and device based on divide-and-conquer fusion architecture

    CN120822165A

  • Method for predicting inflow water quality of sewage treatment plant based on impact trigger refitting

    CN122310381A

  • Sewage treatment plant operation abnormity diagnosis method based on process topological graph and unsupervised learning

    CN122490368A