A water quality early warning method based on uncertainty perception

By using a probability distribution model with frequency domain smoothing and Bayesian update, combined with moving average and trend analysis, the problems of uncertainty analysis and graded early warning in water quality monitoring are solved. This enables dynamic and reliable water quality early warning, adapts to different water environments, reduces false alarms, and improves the stability and accuracy of early warning.

CN121725940BActive Publication Date: 2026-06-02NANJING HYDRAULIC RES INST +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING HYDRAULIC RES INST
Filing Date
2026-02-25
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing water quality monitoring methods lack the ability to analyze data uncertainties, making it difficult to adapt to dynamic water quality changes under non-stationary conditions and noise interference. Early warning results are not graded, and some methods rely on complex models, resulting in poor engineering applicability.

Method used

High-frequency noise is removed by frequency domain smoothing, a probability distribution model is constructed, and parameters are adaptively adjusted using a Bayesian update mechanism. Combined with moving average and trend analysis, the probability of anomalies is calculated and graded early warning is provided.

Benefits of technology

It enables dynamic and uncertain perception of water quality monitoring signals, reduces false alarms, improves the stability and grading accuracy of early warnings, adapts to different water environments, and has practicality that is easy to implement in engineering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121725940B_ABST
    Figure CN121725940B_ABST
Patent Text Reader

Abstract

This invention discloses a water quality early warning method based on uncertainty perception, comprising the following steps: Step 1: Acquire historical time-series data of water quality parameters; Step 2: Preprocess the time-series data; Step 3: Construct a probability distribution model, and obtain the mean and variance of water quality indicators by combining historical time-series data; Step 4: Obtain the standardized deviation and the standardized deviation at the trend level; Step 5: Convert the standardized deviation into instantaneous anomaly probability to determine whether instantaneous anomalies have occurred in real-time water quality; Step 6: Acquire water quality parameter data from several time points prior to the current moment, calculate the moving average, compare the moving average with the mean, obtain the anomaly probability of the trend, and determine whether trend anomalies have occurred in real-time water quality based on the anomaly probability. This invention achieves accurate and reliable dynamic and uncertainty perception of water quality monitoring signals; realizes intelligent and dynamic early warning of water quality, and improves the practicality and reliability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality monitoring technology, and in particular to a water quality early warning method based on uncertainty perception. Background Technology

[0002] Water quality monitoring is a crucial foundation for environmental management in scenarios such as rivers, lakes, reservoirs, and wastewater treatment plants. Sensors for dissolved oxygen (DO), ammonia nitrogen, and pH are widely used; however, monitoring data often exhibit significant fluctuations and uncertainties due to hydrodynamic disturbances, environmental changes, and equipment noise. Therefore, monitoring systems need to effectively eliminate noise interference while reliably assessing water quality changes and providing timely early warnings.

[0003] Existing water quality early warning methods mainly include empirical threshold methods, statistical control methods, and machine learning-based identification methods. Threshold methods are simple to implement but cannot adapt to changes in environmental conditions and have a high false alarm rate; statistical control methods assume stable data distribution and are difficult to handle non-stationary features of water quality sequences; machine learning methods can identify complex patterns, but rely on a large number of training samples, have poor interpretability, and lack stability in field environments.

[0004] In actual water quality monitoring, sensor data often contains short-term noise and trend changes. Existing methods generally lack quantitative assessment of data uncertainty, making it difficult to distinguish between occasional fluctuations and real risks. At the same time, most systems can only provide relative results of "normal / abnormal," lacking risk level classification and failing to provide technicians with tiered early warning information.

[0005] In summary, the existing technologies currently have the following shortcomings:

[0006] (1) Lack of analytical capabilities for uncertainties in water quality monitoring data, resulting in insufficient reliability in anomaly identification;

[0007] (2) Traditional methods are difficult to adapt to dynamic water quality changes under non-stationary conditions and noise interference;

[0008] (3) The early warning results are not graded and cannot reflect the degree of risk;

[0009] (4) Some methods rely on complex models and are not very applicable to engineering.

[0010] Therefore, there is an urgent need for an early warning method that can perform noise reduction, probabilistic inference, and risk classification on water quality data in a dynamic environment, so as to achieve continuous, robust, and interpretable water quality monitoring. Summary of the Invention

[0011] To address the shortcomings of existing technologies, this invention provides a water quality early warning method based on uncertainty perception, in order to solve the technical problems of lack of adaptive capability, single warning level, and weak dynamic learning capability in existing technologies.

[0012] This invention provides a water quality early warning method based on uncertainty perception, comprising the following steps:

[0013] Step 1: Obtain historical time-series data of water quality parameters;

[0014] Step 2: Preprocess the time series data;

[0015] Step 3: Construct a probability distribution model and obtain the mean and variance of water quality indicators by combining historical time series data. The model adopts a normal distribution and adaptively adjusts the model parameters through a Bayesian update mechanism.

[0016] Step 4: Obtain real-time water quality parameter data, and combine the mean and variance obtained in Step 3 to obtain the standardized deviation and the standardized deviation at the trend level;

[0017] Step 5: Convert the standardized deviation into instantaneous outlier probability, and determine whether there is an instantaneous outlier in the real-time water quality based on the instantaneous outlier probability.

[0018] Step 6: Obtain water quality parameter data from several previous moments, calculate the moving average, and compare the moving average with the average obtained in Step 3 to obtain the probability of trend anomaly. Based on the probability of anomaly, determine whether the real-time water quality shows an abnormal trend.

[0019] Furthermore, in step 2, the preprocessing process specifically involves: performing frequency domain smoothing to filter out high-frequency noise.

[0020] Furthermore, in step 3, the normal distribution is modeled as follows:

[0021] ;

[0022] in, ;

[0023] In the formula, represents the smoothed data of water quality indicators at time t; μ is the average value of the water quality indicators under normal conditions; The normal fluctuation range is represented by n; n is the number of data points used in the modeling. Let be the actual water quality fluctuation value of the water quality index at time i; N represents that it follows a normal distribution, i.e. express It follows a normal distribution.

[0024] Furthermore, in step 3, the specific formula for adaptively adjusting the model parameters through the Bayesian update mechanism is as follows:

[0025] ;

[0026] In the formula, The learning rate, ranging from 0 to 1, is used to control the update speed. μ represents the normal fluctuation range at time t. t Let be the average value of the water quality index at time t under normal conditions.

[0027] Furthermore, in step 4, the formula for the standardized deviation is:

[0028] ;

[0029] In the formula, z t Let be the standardized deviation at time t; Real-time water quality parameter data; μ t Let be the average value of the water quality index at time t under normal conditions; Let be the size of the normal fluctuation range at time t.

[0030] Furthermore, in step 4, the formula for the standardized deviation at the trend level is:

[0031] ;

[0032] In the formula, The standardized deviation at time t represents the trend level. μ is the moving average at time t; t Let be the average value of the water quality index at time t under normal conditions; This represents the magnitude of the normal fluctuation range at time t in the trend dimension. Let W be the normal fluctuation range at time t, and let W be the number of selected water quality parameter data points.

[0033] Furthermore, in step 5, the formula for converting the standardized deviation into the instantaneous outlier probability is:

[0034] ;

[0035] In the formula, p t z is the anomaly probability at time t; t Let be the standardized deviation at time t; is the cumulative distribution function of the distribution.

[0036] Furthermore, in step 5, the specific method for determining whether a momentary anomaly has occurred in the real-time water quality is as follows:

[0037] An anomaly is considered to have occurred when the instantaneous probability of an anomaly is greater than or equal to 0.9.

[0038] Furthermore, in step 6, the formula for calculating the moving average is:

[0039] ;

[0040] In the formula, y is the moving average at time t; W is the number of selected preceding water quality parameter data; i This represents the actual water quality observation value collected at the i-th time point.

[0041] Furthermore, in step 6, the formula for calculating the anomaly probability at the trend level is as follows:

[0042] ;

[0043] In the formula, Let be the probability of an anomaly in the trend at time t. The standardized deviation at the trend level at time t; This is the cumulative distribution function for the trend level distribution.

[0044] Furthermore, after step 6, the method further includes: selecting the maximum value between the instantaneous anomaly probability and the trend anomaly probability as the comprehensive anomaly probability.

[0045] When the overall anomaly probability exceeds a certain preset level threshold several times in a row, an early warning will be issued for the corresponding preset level threshold; when the overall anomaly probability falls below the preset level threshold corresponding to the early warning several times in a row, the early warning will be stopped.

[0046] Furthermore, the types of instantaneous anomalies, trend anomalies, and combined anomalies include: slight fluctuations in water quality, potential pollution risks, and obvious anomalies, among which,

[0047] When the overall anomaly probability is greater than or equal to 0.9 and less than 0.97, it is considered a slight fluctuation in water quality.

[0048] When the overall anomaly probability is greater than or equal to 0.97 and less than 0.99, there is a potential pollution risk.

[0049] When the overall probability of anomaly is greater than or equal to 0.99, it is considered a significant anomaly.

[0050] The beneficial effects of this invention are:

[0051] This invention achieves dynamic and uncertain perception of water quality monitoring signals through frequency domain denoising, self-learning mean-variance modeling, and anomaly probability calculation. Furthermore, it introduces a continuous triggering and delayed recovery mechanism to effectively avoid false alarms caused by instantaneous fluctuations. This invention improves early warning stability while maintaining high sensitivity, enabling accurate, reliable, and tiered early warnings for water quality anomalies and trends of deterioration. This invention realizes intelligent and dynamic early warning of water quality, improves the system's practicality and reliability, and has significant engineering application value.

[0052] This invention has high accuracy: based on the uncertainty perception of probability distribution, it can effectively distinguish between normal fluctuations and real anomalies, reducing false alarms and missed alarms;

[0053] This invention provides a clear tiered early warning system: it uses instantaneous abnormal probability intervals to provide three levels of risk alerts—mild, moderate, and severe—making the information more intuitive.

[0054] This invention has strong adaptability: the model parameters are automatically updated with the data, it can run stably for a long time and adapt to different aquatic environments;

[0055] This invention has strong anti-interference capabilities: FFT smoothing filtering suppresses high-frequency noise and ensures the reliability of the warning signal;

[0056] This invention is easy to implement in engineering: the algorithm has low computational load and can be embedded into existing online water quality monitoring systems to achieve real-time early warning;

[0057] This invention has good scalability: the same model framework can process multiple water quality indicators simultaneously, supporting comprehensive evaluation. Attached Figure Description

[0058] The features and advantages of the invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the invention in any way. In the drawings:

[0059] Figure 1 This is a flowchart of a specific embodiment of the present invention;

[0060] Figure 2 This is a schematic diagram of the smoothing result in a specific embodiment of the present invention;

[0061] Figure 3 This is a schematic diagram illustrating the mean and normal fluctuation range of the uncertainty model in a specific embodiment of the present invention;

[0062] Figure 4 This is a schematic diagram of the instantaneous anomaly probability curve in a specific embodiment of the present invention;

[0063] Figure 5 This is a schematic diagram of the anomaly probability curve of the trend in a specific embodiment of the present invention;

[0064] Figure 6 This is a schematic diagram illustrating the warning effect in a specific embodiment of the present invention. Detailed Implementation

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

[0066] The present invention will be further illustrated below with reference to specific embodiments. Those skilled in the art should understand that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Modifications to the present invention in various equivalent forms all fall within the scope defined by the appended claims.

[0067] This invention provides a water quality early warning method based on uncertainty perception. In this embodiment, dissolved oxygen (DO) is used as the demonstration value, the sampling interval is set to 1 hour, and a total of 240 sample points are used. The learning rate is... The trend window is W=10, i.e., 10 h, the continuous trigger threshold is K=2, and the delayed recovery threshold is R=3.

[0068] like Figure 1 As shown, the specific process includes the following steps:

[0069] Step 1: Collect dissolved oxygen (DO) data in real time using an online water quality monitoring sensor. The sampling interval is set to 1 hour, and the total sampling time is 240 hours to obtain historical time-series data of dissolved oxygen (DO).

[0070] Step 2: Perform frequency domain smoothing on the time-series data, specifically as follows:

[0071] First, filter using Fast Fourier Transform (FFT):

[0072] ;

[0073] In the formula, X(f) is the frequency domain signal, representing the complex amplitude of the original time series at frequency f; t is time; N is the length of the time series, i.e., the number of sampling points used for FFT; y t This is time series data of water quality indicators; It is a complex exponential kernel function and a fundamental component of the FFT.

[0074] Next, calculate the cumulative energy ratio and select a cutoff frequency f where the energy ratio is R. c ,Right now:

[0075] ;

[0076] In the formula, f cR is the cutoff frequency; R is the energy retention threshold, which is generally set to 0.9~0.99, preferably 0.95.

[0077] Low-frequency components are retained and inversely transformed to obtain a smoothed signal, thereby removing high-frequency noise. The time series result after dissolved oxygen (DO) smoothing is as follows: Figure 2 As shown.

[0078] Step 3: Perform uncertainty modeling to automatically learn water quality characteristics under "normal conditions," including average levels and normal fluctuation ranges, specifically:

[0079] When water quality indicators are relatively stable, historical time-series water quality data after frequency domain smoothing can be approximated as randomly fluctuating around a certain average value μ, with the magnitude of the fluctuation determined by the variance. Therefore, a probability distribution model can be constructed, and the mean and variance of water quality indicators can be obtained by combining historical time-series data.

[0080] The model uses a normal distribution for modeling.

[0081] The normal distribution is modeled as follows:

[0082] ;

[0083] The system automatically calculates the average value and fluctuation range based on historical normal data, rather than manually setting thresholds. The specific formula is as follows:

[0084] ;

[0085] In the formula, represents the smoothed data of water quality indicators at time t; μ is the average value of the water quality indicators under normal conditions; The normal fluctuation range is represented by n; n is the number of data points used in the modeling. Let be the actual water quality fluctuation value of the water quality index at time i; N represents that it follows a normal distribution, i.e. express Follows a normal distribution;

[0086] Because water quality changes slightly over time, the concept of "uncertainty" is introduced. Bayesian updates enable the model to learn gradually, allowing it to adapt to long-term water quality changes and remain consistent with the actual environment. This eliminates the need for manual parameter resetting, ensuring the accuracy and stability of early warnings under different seasons and hydrological conditions. Specifically, when new data is received, or after the system has run for a period of time, or when environmental changes occur (such as seasonal, water temperature, or flow rate changes), the mean and variance are automatically adjusted as follows:

[0087] ;

[0088] In the formula, The learning rate, ranging from 0 to 1, is used to control the update speed, with the preferred value being: μ t Let be the average value of the water quality index at time t under normal conditions.

[0089] like Figure 3 As shown, after the modeling is completed, the mean μ will be obtained. t and variance These represent the normal level of the current water quality index and the normal fluctuation range of the current water quality index, respectively.

[0090] Step 4: Based on the current water quality data, determine the difference between it and the "normal state" to calculate the probability of an anomaly. The instantaneous anomaly probability curve for dissolved oxygen (DO) is shown below. Figure 4 As shown, the specific process is as follows:

[0091] Obtain real-time water quality parameter data Compare it with the mean μ learned by the model. t and variance By comparison, we obtain the standardized deviation and the standardized deviation at the trend level. The formula for standardized deviation is:

[0092] ;

[0093] In the formula, z t Let be the standardized deviation at time t; Real-time water quality parameter data; μ t Let be the average value of the water quality index at time t under normal conditions; The normal fluctuation range at time t;

[0094] The formula for standardized deviation at the trend level is:

[0095] ;

[0096] In the formula, The standardization deviation at time t represents the trend level. μ is the moving average at time t; t Let be the average value of the water quality index at time t under normal conditions; This represents the size of the normal fluctuation range at time t in the trend dimension.

[0097] Step 5: Substitute the standardized deviation into the standard distribution to convert it into the instantaneous outlier probability formula:

[0098] ;

[0099] In the formula, p tz is the anomaly probability at time t; t Let be the standardized deviation at time t; The cumulative distribution function of the distribution;

[0100] When p t A value less than 0.9 indicates that the current data is still within the normal range.

[0101] When p t A value that is larger than or equal to 0.9 indicates that the value deviates from the normal trend and is likely to be abnormal.

[0102] Step 6: Steps 4 and 5 calculate the "instantaneous anomaly probability" based solely on the deviation of a single sampling point. While this can respond promptly to sudden anomalies, it lacks sensitivity to slow, continuously changing trend anomalies. A "trend judgment" mechanism needs to be introduced to identify slowly deteriorating or continuously abnormal dissolved oxygen (DO) characteristics. The specific process is as follows:

[0103] Obtain water quality parameter data from W (10) time points prior to the current time point and calculate the moving average:

[0104] ;

[0105] In the formula, y is the moving average at time t; W is the number of selected preceding water quality parameter data; i This represents the actual water quality observation value collected at the i-th time point.

[0106] Next, compare the moving average with the mean obtained in step 3, and obtain the probability of trend anomaly based on the standardized deviation at the trend level. The specific results are as follows Figure 5 As shown, the formula for the probability of an anomaly in the trend is:

[0107] ;

[0108] In the formula, Let be the probability of an anomaly in the trend at time t. The standardization deviation at time t represents the trend level. This is the cumulative distribution function for the trend level distribution.

[0109] And based on the probability of anomalies, determine whether there are any abnormal trends in real-time water quality.

[0110] To comprehensively consider both the "instantaneous anomaly probability" and the "trend anomaly probability" of a single data point, the larger of the two values ​​is taken as the final comprehensive anomaly probability.

[0111] ;

[0112] In the formula, p t The instantaneous anomaly probability of a single point; This represents the probability of an anomaly in the trend.

[0113] When the overall anomaly probability p is obtained t After that, early warning judgment and classification can be carried out:

[0114] The overall anomaly probability P t Short-term spikes may occur in the time series. To improve the stability of the early warning signal, the "number of consecutive triggers K" and "number of delayed recoverys R" are further set, that is, when P t Only when the severity level exceeds a certain threshold (e.g., mild / moderate / severe) K times consecutively is the warning level corresponding to that level confirmed; only when the severity level falls below that threshold R times consecutively is recovery confirmed.

[0115] Based on the comprehensive anomaly probability P t The system classifies abnormal water quality conditions into three levels, forming the water quality abnormality early warning level classification standard shown in Table 1 below:

[0116] Table 1. Standards for Classifying Water Quality Anomaly Warning Levels

[0117] grade Probability range Status Description Level 1 (Mild Warning) 0.9 < P t < 0.97 Water quality fluctuations are slight, but attention is needed. Level 2 (Moderate Alert) <![CDATA[0.97≤P t <0.99]]> There is a potential risk of pollution. Level 3 (Severe Warning) <![CDATA[P t ≥0.99]]> The abnormality is obvious and needs to be addressed immediately.

[0118] Based on the above analysis results, the early warning result is as follows: Figure 6 As shown.

[0119] Once the system determines the warning level, it will immediately output the corresponding alarm signal, which can be distinguished and displayed in different colors on the monitoring interface of the host computer.

[0120] Green: Normal;

[0121] Yellow: Mild warning;

[0122] Orange: Moderate alert;

[0123] Red: Severe alert.

[0124] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A water quality early warning method based on uncertainty perception, characterized in that, Includes the following steps: Step 1: Obtain historical time-series data of water quality parameters; Step 2: Preprocess the time series data; Step 3: Construct a probability distribution model. Using historical time-series data, obtain the mean and variance of water quality indicators through the constructed probability distribution model. The model employs a normal distribution and uses a Bayesian update mechanism to adaptively adjust the model parameters. The normal distribution is modeled as follows: ; in, ; In the formula, represents the smoothed data of water quality indicators at time t; μ is the average value of the water quality indicators under normal conditions; The normal fluctuation range is represented by n; n is the number of data points used in the modeling. Let be the actual water quality fluctuation value of the water quality index at time i; N represents that it follows a normal distribution, i.e. express Follows a normal distribution; The specific formula for adaptively adjusting model parameters using the Bayesian update mechanism is as follows: ; In the formula, The learning rate, ranging from 0 to 1, is used to control the update speed. μ represents the normal fluctuation range at time t. t Let be the average value of the water quality index at time t under normal conditions; Step 4: Obtain real-time water quality parameter data. Based on the probability distribution model after updating the model parameters, obtain the real-time mean and variance. Combine the mean and variance obtained in Step 3 to obtain the standardized deviation and the standardized deviation at the trend level. The formula for standardized deviation is: ; In the formula, z t Let be the standardized deviation at time t; Real-time water quality parameter data; μ t Let be the average value of the water quality index at time t under normal conditions; The normal fluctuation range at time t; The formula for standardized deviation at the trend level is: ; In the formula, The standardized deviation at time t represents the trend level. μ is the moving average at time t; t Let be the average value of the water quality index at time t under normal conditions; This represents the magnitude of the normal fluctuation range at time t in the trend dimension. denoted as the normal fluctuation range at time t, and W represents the number of selected water quality parameter data points. Step 5: Convert the standardized deviation into an instantaneous anomaly probability using the cumulative distribution function, and determine whether an instantaneous anomaly has occurred in the real-time water quality based on the instantaneous anomaly probability; The formula for converting standardized deviation into instantaneous outlier probability using the cumulative distribution function is as follows: ; In the formula, p t z is the anomaly probability at time t; t Let be the standardized deviation at time t; The cumulative distribution function of the distribution; Step 6: Obtain water quality parameter data from several previous moments, calculate the moving average, and compare the moving average with the average obtained in Step 3 to obtain the probability of trend anomaly. Based on the probability of anomaly, determine whether the real-time water quality shows an abnormal trend.

2. The water quality early warning method based on uncertainty perception as described in claim 1, characterized in that, In step 2, the preprocessing process specifically involves: performing frequency domain smoothing to filter out high-frequency noise.

3. The water quality early warning method based on uncertainty perception as described in claim 1, characterized in that, In step 5, the specific method for determining whether there is a momentary anomaly in the real-time water quality is as follows: An anomaly is considered to have occurred when the instantaneous probability of an anomaly is greater than or equal to 0.

9.

4. The water quality early warning method based on uncertainty perception as described in claim 1, characterized in that, In step 6, the formula for calculating the moving average is: ; In the formula, y is the moving average at time t; W is the number of selected preceding water quality parameter data; i This represents the actual water quality observation value collected at the i-th time point.

5. The water quality early warning method based on uncertainty perception as described in claim 1, characterized in that, In step 6, the formula for calculating the anomaly probability at the trend level is as follows: ; In the formula, Let be the probability of an anomaly in the trend at time t. The standardized deviation at time t represents the trend level. This is the cumulative distribution function for the trend level distribution.

6. The water quality early warning method based on uncertainty perception as described in claim 1, characterized in that, Step 6 is followed by: selecting the maximum value between the instantaneous anomaly probability and the trend anomaly probability as the comprehensive anomaly probability. When the overall anomaly probability exceeds a certain preset level threshold several times in a row, an early warning will be issued for the corresponding preset level threshold; when the overall anomaly probability falls below the preset level threshold corresponding to the early warning several times in a row, the early warning will be stopped.

7. The water quality early warning method based on uncertainty perception as described in claim 6, characterized in that, The types of instantaneous anomalies, trend anomalies, and combined anomalies include: slight fluctuations in water quality, potential pollution risks, and obvious anomalies. When the overall anomaly probability is greater than or equal to 0.9 and less than 0.97, it is considered a slight fluctuation in water quality. When the overall anomaly probability is greater than or equal to 0.97 and less than 0.99, there is a potential pollution risk. When the overall probability of anomaly is greater than or equal to 0.99, it is considered a significant anomaly.