Drinking water quality monitoring and early warning method and system based on intelligent water rack

By constructing time series and nonlinear normalization treatment combined with quadratic polynomial fitting trend model and K-means clustering, the accuracy problem of water quality monitoring and early warning technology under complex dynamic changes is solved, and efficient water quality early warning is achieved.

CN120354293APending Publication Date: 2025-07-22WESTGREND AUTOMATION TECHNOLOGY (ZHENGZHOU) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510293542.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing water quality monitoring and early warning technology faces complex water quality fluctuations and dynamic changes, and the prediction accuracy of the model is low and it is difficult to provide accurate early warning.

Method used

By collecting water quality data to construct a time series, perform nonlinear normalization, use quadratic polynomial fitting trend model to monitor and early warning, and combine K-means clustering and visual interface to display the monitoring results to improve the accuracy and timeliness of early warning.

Benefits of technology

The prediction ability of the early warning model in different water quality changes has been enhanced, the prediction accuracy and timeliness of early warning have been improved, and the water quality abnormalities can be identified in a timely manner and alarms can be issued.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354293A_ABST
    Figure CN120354293A_ABST
Patent Text Reader

Abstract

The invention discloses a drinking water quality monitoring and early warning method and system based on an intelligent water rack, and relates to the technical field of water quality monitoring, and the method comprises the following steps: collecting water quality data to construct a time sequence, and carrying out nonlinear normalization processing on the time sequence to obtain a normalized sequence; calculating a predicted value of future time based on the normalized sequence, and performing monitoring and early warning by using a quadratic polynomial fitting trend model based on the predicted value of the future time; and classifying abnormal monitoring results by using K-means clustering, calculating time distribution density, and constructing a visual interface to display the monitoring and classification results. According to the method, the nonlinear normalization processing of the time sequence is realized through the dynamic scaling factor calculated by the generalized fuzzy entropy and the dynamic characteristic value, and through the combination of the value of the interpolation point and the change rate of the fractional derivative, the prediction capability of the early warning model under different water quality change situations is enhanced, and the accuracy of water quality monitoring and the timeliness of early warning in advance are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water quality monitoring, and in particular to a drinking water quality monitoring and early warning method and system based on an intelligent water rack. Background Art

[0002] With the continuous improvement of the society's requirements for drinking water quality, water quality monitoring has become an important link in ensuring public health. Most traditional water quality monitoring methods rely on manual sampling and chemical analysis. This method is not only time-consuming but also has delays in data collection and analysis, making it difficult to detect potential safety hazards caused by water quality changes in a timely manner. In recent years, with the rapid development of sensor technology and Internet of Things technology, intelligent water quality monitoring systems have gradually become the mainstream trend in the industry's development. These systems can monitor the physical and chemical properties of water bodies in real time by deploying a variety of sensors, and can issue alarms in a timely manner when the water quality changes, so as to achieve early warning and risk control. Especially in the context of the accelerating industrialization and urbanization processes, intelligent water quality monitoring systems have great application potential.

[0003] Existing water quality monitoring and early warning technologies still have deficiencies in some aspects. Due to the non-linear characteristics and complex dynamic behaviors of water quality prediction based on statistics, the prediction accuracy of the model is relatively low in the case of drastic water quality fluctuations or pollutant source inputs. Existing methods based on data-driven models can predict water quality changes through historical data, but many methods are often unable to provide accurate early warnings when facing complex water quality fluctuations and dynamic changes. Summary of the Invention

[0004] In view of the problems existing in the above-mentioned existing drinking water quality monitoring and early warning method and system based on an intelligent water rack, the present invention is proposed.

[0005] Therefore, the present invention provides a drinking water quality monitoring and early warning method and system based on an intelligent water rack, which solves the problem that due to the non-linear characteristics and complex dynamic behaviors of water quality prediction based on statistics, the prediction accuracy of the model is relatively low in the case of drastic water quality fluctuations or pollutant source inputs, and existing methods based on data-driven models can predict water quality changes through historical data, but many methods are often unable to provide accurate early warnings when facing complex water quality fluctuations and dynamic changes.

[0006] To solve the above technical problems, the present invention provides the following technical solutions:

[0007] In the first aspect, a drinking water quality monitoring and early warning method based on an intelligent water rack, which includes,

[0008] Collect water quality data to construct a time series, perform non-linear normalization on the time series to obtain a normalized series; calculate the predicted values for future time based on the normalized series, and use a quadratic polynomial fitting trend model for monitoring and early warning based on the predicted values for future time; use K-means clustering to classify the abnormal monitoring results, calculate the time distribution density, and construct a visualization interface to display the monitoring and classification results.

[0009] As a preferred embodiment of the drinking water quality monitoring and early warning method based on an intelligent water rack according to the present invention, wherein: the step of collecting water quality data to construct a time series refers to collecting water quality data using intelligent sensors at the water intake and performing preprocessing.

[0010] The intelligent sensors used include spectral sensors, total organic carbon sensors, and heavy metal ion sensors.

[0011] The water quality data includes turbidity, pH value, dissolved oxygen concentration, total organic carbon, and heavy metal ion concentration data.

[0012] The preprocessing includes aligning the water quality data in time using the dynamic time warping method, denoising the water quality data using a Kalman filter, constructing a time series from the denoised water quality data in chronological order using the time series construction method, and slicing the time series using a time series segmentation algorithm.

[0013] As a preferred embodiment of the drinking water quality monitoring and early warning method based on an intelligent water rack according to the present invention, wherein: the step of performing non-linear normalization on the time series to obtain a normalized series refers to calculating the maximum distance d between the i-th and j-th data segments using the Chebyshev distance method. ij ;

[0014] Set the fuzzy radius r using the standard deviation estimation method, and use the fuzzy membership function to transform the maximum distance d ij into the membership value μ(d ij,r ) between the i-th and j-th data segments.

[0015] Based on the membership value μ(d ij,r ), calculate the average membership A of the i-th data segment using the weighted average method. i ;

[0016] Based on the logarithm calculation of the average membership A i , obtain the generalized fuzzy entropy FEn(X, m, r).

[0017] Use the difference formula to calculate the instantaneous change rate and instantaneous acceleration of the data segment at the current time t respectively.

[0018] Based on the instantaneous rate of change and instantaneous acceleration at the current time t, the dynamic characteristic value D(X) is calculated using the dynamic characteristic quantification method;

[0019] Based on the generalized fuzzy entropy FEn(X, m, r) and the dynamic characteristic value D(X), the dynamic scaling factor s(X) is calculated as follows:

[0020]

[0021] Where max(X) and min(X) are the maximum and minimum values in the time series, respectively, X is the time series, m is the embedding dimension, and ∈ is a minimum constant;

[0022] Use the dynamic scaling factor S(X) to perform nonlinear normalization on the time series and calculate the normalized value f(x). The formula is:

[0023]

[0024] Where x is the water quality data of the data segment;

[0025] The normalized values f(x) are combined to generate a normalized sequence f(X).

[0026] As a preferred solution of the drinking water quality monitoring and early warning method based on the intelligent water rack of the present invention, wherein: the prediction value of the future time calculated based on the normalized sequence refers to estimating the fractional order ∝ using the self-similarity analysis method;

[0027] Construct a fractional calculus model for the normalized sequence f(X) and use the Caputp fractional derivative formula to calculate the fractional derivative D of the normalized value. ∝ f(x t );

[0028] Use the difference formula to calculate the trend change rate v of the fractional derivative at the current time t ∝ (x t );

[0029] Based on the trend change rate v ∝ (x t ), using the local extreme point identification method to identify the local extreme points;

[0030] Use the Lagrange interpolation formula to calculate the value of the interpolation point F(x t );

[0031] Based on the trend change rate v ∝ (x t ) and the interpolation point value F(x t ), use the interpolation correction prediction method to calculate the predicted value F(x) for the future time t+ K), the formula is:

[0032]

[0033] where K is the number of predicted time points, Δt′ is the predicted time step, and v ∝ (x t+ o -1 ) is the trend change rate at the predicted time t + p - 1, and o is the index of the time step.

[0034] As a preferred embodiment of the drinking water quality monitoring and early warning method based on the intelligent water rack of the present invention, wherein: for the predicted value based on future time, using the quadratic polynomial fitting trend model for monitoring and early warning means collecting historical water quality data and performing non - linear normalization processing to generate a training set;

[0035] Performing least - squares fitting on the training set to obtain model coefficients;

[0036] Based on the model coefficients, using the quadratic polynomial fitting trend model Q(x t );

[0037] Using statistical analysis method to set a risk threshold, comparing the combined trend model with the risk threshold. When the combined trend model is greater than or equal to the risk threshold, it is judged as an abnormal state, an early warning is issued and the maintenance personnel are notified by email. When the combined trend model is less than the risk threshold, it is judged as a normal state and the monitoring continues.

[0038] As a preferred embodiment of the drinking water quality monitoring and early warning method based on the intelligent water rack of the present invention, wherein: using K - means clustering to classify the abnormal monitoring results, and calculating the time distribution density means using the normalized value corresponding to the abnormal state as the input data of K - means clustering;

[0039] Using the percentile method to set a stop threshold, using the elbow method to set the number of clusters c, randomly selecting c samples from the normalized values corresponding to the abnormal state as the initial clustering centers, using the dynamic time warping method to calculate the DTW distance between the normalized values corresponding to the abnormal state and the cluster centers, and assigning the normalized values corresponding to the abnormal state to the nearest clustering center to form new clusters until the cluster centers are less than the stop threshold to stop the iteration, and defining the clustering centers as risk types;

[0040] Based on the risk types, using the Gaussian kernel function to calculate the time distribution density at the current time t.

[0041] As a preferred embodiment of the drinking water quality monitoring and early warning method based on the intelligent water rack of the present invention, wherein: constructing a visualization interface to display the monitoring and classification results means sorting the time distribution density according to time to generate a density distribution curve;

[0042] Build a visualization interface using the front-end framework React.js, including the main chart area and the top information bar;

[0043] Display the monitoring results and density distribution curves in the main chart area, and display the risk types in the top information bar;

[0044] Allow users who have passed real-name verification to view.

[0045] In a second aspect, the present invention provides a drinking water quality monitoring and early warning system based on an intelligent water rack, including,

[0046] A collection and normalization module for collecting water quality data to construct a time series, performing non-linear normalization processing on the time series, and obtaining a normalized series;

[0047] A prediction and monitoring module for calculating predicted values at future times based on the normalized series, and performing monitoring and early warning using a quadratic polynomial fitting trend model based on the predicted values at future times;

[0048] A classification and visualization module for classifying abnormal monitoring results using K-means clustering, calculating the time distribution density, and constructing a visualization interface to display the monitoring and classification results.

[0049] In a third aspect, the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program, and: when the computer program is executed by the processor, any step of the drinking water quality monitoring and early warning method based on an intelligent water rack as described in the first aspect of the present invention is implemented.

[0050] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and: when the computer program is executed by the processor, any step of the drinking water quality monitoring and early warning method based on an intelligent water rack as described in the first aspect of the present invention is implemented.

[0051] The beneficial effects of the present invention are as follows: The present invention collects water quality data to construct a time series, performs non-linear normalization processing on the time series to obtain a normalized series; calculates predicted values at future times based on the normalized series, and performs monitoring and early warning using a quadratic polynomial fitting trend model based on the predicted values at future times; solves the problems of inaccurate capture of dynamic changes, insufficient sensitivity of anomaly detection, and noise interference in traditional methods, enhances the prediction ability of the early warning model in different water quality change scenarios, and improves the prediction accuracy and timeliness of early warning. Description of the Drawings

[0052] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0053] Figure 1 It is a flowchart of the drinking water quality monitoring and early warning method based on an intelligent water rack in Embodiment 1;

[0054] Figure 2 It is a structural diagram of the drinking water quality monitoring and early warning system based on an intelligent water rack in Embodiment 1. Specific Embodiments

[0055] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will make a detailed description of the specific embodiments of the present invention in conjunction with the accompanying drawings of the specification.

[0056] In the following description, many specific details are set forth to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar generalizations without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.

[0057] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that can be included in at least one implementation manner of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that excludes other embodiments.

[0058] Embodiment 1, referring to Figure 1 and Figure 2 , is the first embodiment of the present invention. This embodiment provides a drinking water quality monitoring and early warning method based on an intelligent water rack, including the following steps:

[0059] S1. Collect water quality data to construct a time series, and perform non-linear normalization processing on the time series to obtain a normalized series;

[0060] Specifically, collecting water quality data to construct a time series means using an intelligent sensor at the water intake to collect water quality data and perform preprocessing;

[0061] The use of intelligent sensors includes spectral, total organic carbon, and heavy metal ion sensors;

[0062] The water quality data includes turbidity, pH value, dissolved oxygen concentration, total organic carbon, and heavy metal ion concentration data;

[0063] The preprocessing includes time-aligning the water quality data using the dynamic time warping method, denoising the water quality data using a Kalman filter, constructing the denoised water quality data into a time series in chronological order using a time series construction method, and slicing the time series using a time series segmentation algorithm.

[0064] Intelligent sensors can monitor multiple water quality parameters in real time and continuously, greatly improving the comprehensiveness and accuracy of monitoring. Intelligent sensors integrate data acquisition and processing functions, can reduce human intervention, improve the automation level of the data acquisition process, reduce errors and improve work efficiency. By using the dynamic time warping method, it is possible to effectively align data from different sensors, not only handle the deformation problem of time series, but also eliminate errors caused by time delay or different sampling frequencies, enabling various water quality data to be compared and analyzed within the same time frame, thereby improving the accuracy and reliability of data processing. Traditional denoising methods may lose valuable signals or fail to effectively remove noise, while the Kalman filter can continuously optimize the data quality through recursive estimation methods, effectively eliminate noise and maintain the authenticity of the data. Systematically organizing and arranging water quality data reveals the trends and periodic characteristics of water quality changes, laying a foundation for further data modeling and prediction. By segmenting the time series, the computational complexity can be reduced and the efficiency of data analysis can be improved. The segmented data segments facilitate independent analysis of water quality changes in different time periods, and more precisely identify potential anomalies and change trends.

[0065] Furthermore, performing non-linear normalization on the time series to obtain a normalized series means calculating the maximum distance d between the i-th and j-th data segments using the Chebyshev distance method ij , and the formula is:

[0066]

[0067] where m is the embedding dimension, representing the length of each data segment, k is the relative index within the data segment, and x i+k and x j+k are the k-th data point values of the i-th and j-th data segments respectively;

[0068] Setting the fuzzy radius r using the standard deviation estimation method, and converting the maximum distance d ij into the membership value μ(d ij,r ) between the i-th and j-th data segments, and the formula is:

[0069]

[0070] Based on the membership value μ(d ij,r), use the weighted average method to calculate the average membership A of the i-th data segment i , the formula is:

[0071]

[0072] Where n-m+1 is the number of data segments, and n is the total length of the time series X;

[0073] Based on the average membership A i The logarithmic calculation of , we get the generalized fuzzy entropy FEn(X, m, r), the formula is:

[0074]

[0075] Where X is a time series;

[0076] Use the difference formula to calculate the instantaneous rate of change and instantaneous acceleration of the data segment at the current time t respectively. The formula is:

[0077]

[0078] Where v′(t) and a(t) are the instantaneous rate of change and instantaneous acceleration at the current time t, respectively, and x t+Δt and x t-Δt are the water quality data of the data segments at time points t+Δt and t-Δt, respectively, t is the water quality data of the data segment at the current time t, and Δt is the sampling time step;

[0079] Based on the instantaneous rate of change and instantaneous acceleration at the current time t, the dynamic characteristic value D(X) is calculated using the dynamic characteristic quantification method. The formula is:

[0080]

[0081] Where N is the number of data points in the time series, and l is the index of the data point in the time series;

[0082] Based on the generalized fuzzy entropy FEn(X, m, r) and the dynamic characteristic value D(X), the dynamic scaling factor s(X) is calculated as follows:

[0083]

[0084] Where max(X) and min(X) are the maximum and minimum values in the time series, respectively, and ∈ is a minimum constant;

[0085] Traditional scaling factor calculations are often based only on the amplitude range of the time series, without considering the complexity of the time series. For example, in a single normalization method, the complexity and change rules of the signal are completely ignored, resulting in the scaling factor being unable to adapt to signals of different complexities. By introducing generalized fuzzy entropy to characterize the complexity of the signal, many traditional methods only process the static characteristics of the signal (such as amplitude range, standard deviation), without considering the dynamic behavior in the time series (such as trend change rate or acceleration). The dynamic characteristics (constructed by the first-order derivative and second-order derivative of the signal) can capture the trend change and acceleration characteristics of the signal. When the signal trend changes rapidly (such as when the upward or downward trend is significant), the dynamic characteristics of the signal are also very important. The value of the dynamic characteristic will increase, thereby reducing the scaling factor and avoiding amplifying abnormal fluctuations. In traditional scaling methods, when the complexity or dynamic characteristics are close to zero, the scaling factor may be too large or cannot be calculated, which ultimately leads to an unstable calculation process. Introducing a very small constant in the denominator of the formula ensures that it can still be calculated when the complexity or dynamic characteristics are close to zero, avoiding the instability problem. Conventional scaling methods are usually based on linear models and are difficult to deal with complex signals in nonlinear and dynamic environments (such as multi-parameter signals in drinking water quality monitoring). This method combines fuzzy entropy and dynamic characteristics to adapt to the processing needs of nonlinear and dynamic signals, and is particularly suitable for modeling and analysis of multidimensional time series in water quality monitoring.

[0086] Use the dynamic scaling factor S(X) to perform nonlinear normalization on the time series and calculate the normalized value f(x). The formula is:

[0087]

[0088] Where x is the water quality data of the data segment;

[0089] The normalized values f(x) are combined to generate a normalized sequence f(X).

[0090] Traditional linear normalization methods often fail to effectively process complex time - series data. Especially when the data shows non - linear relationships, the adaptability of linear methods is poor. Through non - linear normalization, the present invention can overcome this limitation. By using a dynamic scaling factor to normalize time - series data, the data becomes more consistent and comparable. This non - linear method can better capture the internal laws of the data, ensuring more accurate analysis results between different time series. By calculating the maximum distance between data segments through the Chebyshev distance method, the differences between data can be measured more accurately. By converting the distance into membership values through a fuzzy membership function, the uncertainty and volatility of the data can be effectively quantified, enabling the processing process to adapt to different fluctuation amplitudes when facing complex data. By calculating the logarithm of the average membership, the generalized fuzzy entropy can reveal the complexity and uncertainty of the data, providing theoretical support for further trend prediction and anomaly detection, and improving the sensitivity and accuracy of the early - warning system. By using a dynamic characteristic quantification method to calculate the instantaneous change rate and instantaneous acceleration of data segments at the current time, dynamic characteristic indicators are provided for the real - time monitoring of water - quality changes. This method can reflect the speed and acceleration of water - quality changes in real time, thus promptly identifying potential abnormal changes and providing key dynamic information for the early - warning system, avoiding the lag in response of traditional methods when the data changes rapidly. The dynamic scaling factor calculated based on the generalized fuzzy entropy and dynamic characteristic values can perform more precise non - linear normalization processing on time - series data. By adjusting the fluctuation amplitudes of data at different time points, the dynamic scaling factor ensures that the data has a unified scale at different analysis stages, making the analysis results more stable and reliable.

[0091] S2. Calculate the predicted value for future time based on the normalized sequence, and based on the predicted value for future time, use a quadratic polynomial fitting trend model for monitoring and early warning;

[0092] Specifically, calculating the predicted value for future time based on the normalized sequence means using the self - similarity analysis method to estimate the fractional - order order ∝;

[0093] Construct a fractional - order calculus model for the normalized sequence f(X), and use the Caputo fractional - order derivative formula to calculate the fractional - order derivative D ∝ f(x t ), and the formula is:

[0094]

[0095] where f(x0) and f(x τ ) are the normalized values at the initial and historical time points respectively, Γ(1 - ∝) is the Gamma function used to normalize the integral formula, and τ is the historical time, representing the historical data from the initial time point to the current time point;

[0096] Calculate the Gamma function, the formula is:

[0097]

[0098] When \(1 - \alpha\) is a positive integer, \(\Gamma(1 - \alpha)=(1 - \alpha - 1)!\), that is, the factorial;

[0099] When \(1 - \alpha\) is a non-integer, The extended result of the factorial;

[0100] Use the difference formula to calculate the trend change rate \(v\) of the fractional derivative at the current time \(t\) ∝ (x t ),the formula is:

[0101] v ∝ (x t ) = D ∝ f(x t + 1)-D ∝ f(x t ),

[0102] Based on the trend change rate \(v\) ∝ (x t ),use the local extreme point identification method to identify local extreme points;

[0103] Use the Lagrange interpolation formula to calculate the value \(F(x\) t ) of the interpolation point at the current time \(t\), the formula is:

[0104]

[0105] Where \(G\) is the number of local extreme points, \(x\) s and \(x\) g are the \(s\)th and \(g\)th local extreme points respectively, \(f( xg ) is the normalized value of the local extreme point \(x\) g ;

[0106] Based on the trend change rate \(v\) ∝ (x t ) and the value \(F(x\) t ) of the interpolation point, use the interpolation correction prediction method to calculate the predicted value \(F(x\) t + K) at the future time, the formula is:

[0107]

[0108] Where \(K\) is the number of predicted time points, \(\Delta t'\) is the predicted time step, indicating the interval between two adjacent points in the future time series, \(v\) ∝ (x t+ o -1)To predict the trend change rate at time t+o-1, where o is the index of the time step.

[0109] Traditional time series prediction methods (such as ARIMA or LSTM) usually rely solely on model parameter fitting, ignoring the role of dynamic correction. Interpolation prediction is commonly used for short-term trend analysis but does not incorporate dynamic characteristics for correction. It provides a basic trend prediction through the values of interpolation points. By using the fractional derivative change rate to dynamically correct the trend, the adaptability of the model to nonlinear dynamic changes is enhanced. When using integer-order derivatives or fixed parameters for dynamic correction, it is difficult to capture the complex changes of long-term memory signals and unable to adaptively adjust the correction intensity according to the dynamic behavior of the signals. The fractional derivative is used to capture long-term memory and nonlinear dynamic characteristics. The fractional change rate is directly superimposed on the interpolation result to dynamically adjust the predicted value of future points. In conventional methods, the influence of the time interval on the prediction result is usually handled by a fixed coefficient, which cannot reflect the changing characteristics of the time series and has poor adaptability to non-uniform time series. The prediction time step is introduced to ensure that the prediction formula can adapt to non-uniform time series. The superposition correction of the time step makes the predicted result of future points consistent with the change of the time axis. Through the combination of the values of interpolation points and the fractional derivative change rate, the unity of the basic trend and dynamic correction is achieved, which is the only prediction formula that can adapt to the complex dynamic behavior of time series;

[0110] In time series analysis, the self-similarity analysis method can reveal the self-similar characteristics of time series by estimating the fractional order. By estimating the fractional order, the present invention can establish a fractional calculus model that better conforms to the actual data change law, thereby improving the accuracy and stability of prediction. It is especially suitable for processing time series data that exhibits complex nonlinear and non-stationary characteristics. Traditional integer-order calculus methods have certain limitations in describing the nonlinear dynamic changes of complex systems. By introducing the fractional calculus model, the present invention can better fit the non-integer-order dynamic changes in water quality data. Especially when facing the irregularity and complexity of water quality changes, it can more accurately capture the subtle differences in data changes. The Caputo fractional derivative formula can handle the nonlinear characteristics that are difficult to characterize by traditional calculus in time series. Especially in the case where the water quality changes rapidly and irregularly, the fractional derivative can provide a more accurate description, enabling the prediction model to track the trend of data changes in real time, thereby improving the sensitivity and accuracy of the prediction results. In time series analysis, the local extreme point identification method can effectively capture the peaks and valleys in the data and help identify significant changes that occur in the system at certain moments. By identifying these extreme points, the present invention can timely capture the critical moments of water quality changes and issue timely warnings at these moments, enhancing the response ability of the monitoring system. The Lagrange interpolation formula can smooth the changes in the time series by calculating the values of the interpolation points at the local extreme points, reducing the oscillations in the prediction process. The interpolation correction prediction method combines the trend change rate and the values of the interpolation points to make a more accurate prediction of future time points, correcting the limitations of traditional interpolation methods by using the trend change information of the time series, making the predicted values more conform to the actual dynamics. This method is especially suitable for complex nonlinear data and can effectively improve the prediction ability of water quality data, providing higher reliability and practicality. Especially when facing rapidly changing water quality data, it can timely and accurately reflect future trends.

[0111] Further, based on the predicted values for future times, using a quadratic polynomial to fit the trend model for monitoring and early warning means collecting historical water quality data and performing non-linear normalization processing to generate a training set;

[0112] Performing least squares fitting on the training set to obtain model coefficients;

[0113] Based on the model coefficients, using a quadratic polynomial to fit the trend model Q(x t ), the formula is:

[0114]

[0115] where β2, β1, and β0 are model coefficients;

[0116] Set the risk threshold using statistical analysis methods, compare the combined trend model with the risk threshold. When the combined trend model is greater than or equal to the risk threshold, it is judged as an abnormal state, an alarm is issued and the maintenance personnel are notified via email. When the combined trend model is less than the risk threshold, it is judged as a normal state, and the monitoring continues.

[0117] The quadratic polynomial fitting trend model can effectively capture the non-linear fluctuations of water quality data by using a quadratic function to express the change trend of data. Especially when there are accelerating or decelerating changes in the data, the quadratic polynomial can provide a more flexible fitting result. This fitting method has good adaptability and can accurately predict the future trend of water quality changes, providing a reliable prediction basis for the early warning function of the water quality monitoring system. By minimizing the sum of the squared errors between the actual data and the fitting curve, the least squares method can find the optimal parameters for the quadratic polynomial fitting, thus effectively reducing the prediction error and enhancing the accuracy of the prediction. Using the least squares fitting can accurately integrate these influencing factors into the model, improving the accuracy and reliability of the prediction of future water quality values. By comparing all historical water quality data with the current predicted values in real time and combining the setting of the risk threshold, an alarm can be quickly issued when the water quality trend is abnormal, improving the real-time performance and response speed of water quality monitoring, ensuring that measures are taken in a timely manner to avoid the expansion of water quality problems, reducing the manual intervention in dealing with water quality anomalies, and improving the efficiency and accuracy of the monitoring system.

[0118] S3. Use K-means clustering to classify the abnormal monitoring results, calculate the time distribution density, and construct a visualization interface to display the monitoring and classification results;

[0119] Specifically, use K-means clustering to classify the abnormal monitoring results. Calculating the time distribution density means using the normalized values corresponding to the abnormal state as the input data for K-means clustering;

[0120] Set the stop threshold using the percentile method, set the number of clusters c using the elbow method. Randomly select c samples from the normalized values corresponding to the abnormal state as the initial clustering centers. Use the dynamic time warping method to calculate the DTW distance between the normalized values corresponding to the abnormal state and the cluster centers. Assign the normalized values corresponding to the abnormal state to the nearest clustering center to form new clusters until the cluster centers are less than the stop threshold to stop the iteration. Define the clustering centers as the risk types;

[0121] Based on the risk types, use the Gaussian kernel function to calculate the time distribution density at the current time t.

[0122] By taking the normalized values corresponding to abnormal states as input data, the K-means clustering algorithm can automatically assign abnormal states to different clusters based on data similarity, thereby separating different types of risks. By calculating the time distribution density of abnormal states, the system can more accurately judge the time range of risk occurrence, providing a more reliable basis for subsequent early warning and intervention. When the monitored water quality abnormal state is close to the cluster center of a certain risk type, the system can identify the potential risk type and trigger different levels of early warning according to this type. This method can not only improve the accuracy of risk identification but also dynamically adjust different types of abnormal states according to the actual situation, further enhancing the flexibility and response ability of the system.

[0123] Furthermore, constructing a visual interface to display the monitoring and classification results means sorting the time distribution density by time to generate a density distribution curve;

[0124] Use the front-end framework React.js to construct a visual interface, including the main chart area and the top information bar;

[0125] Display the monitoring results and the density distribution curve in the main chart area, and display the risk type in the top information bar;

[0126] Allow users who have passed real-name verification to view.

[0127] Sorting the time distribution density by time to generate a density distribution curve can clearly show the change of water quality monitoring data over time. Using the React.js framework to construct a visual interface can not only effectively display the water quality monitoring results and the density distribution curve but also provide a smooth user interaction experience. It not only improves the readability of monitoring data but also provides an intuitive risk perception for decision-makers. By introducing a real-name verification mechanism, it is ensured that only users who have passed identity authentication can access the water quality monitoring data and risk type information, effectively guaranteeing the security of the system and the privacy of data. In the water quality monitoring and early warning system, real-name verification enhances the security management of user data and prevents criminals from tampering with or misusing water quality monitoring data.

[0128] This embodiment also provides a drinking water quality monitoring and early warning system based on an intelligent water rack, including:

[0129] A data collection and normalization module for collecting water quality data to construct a time series, performing non-linear normalization processing on the time series to obtain a normalized series;

[0130] A prediction and monitoring module for calculating predicted values for future times based on the normalized series, and using a quadratic polynomial fitting trend model for monitoring and early warning based on the predicted values for future times;

[0131] The classification visualization module is used to classify the anomaly monitoring results using K-means clustering, calculate the time distribution density, and construct a visualization interface to display the monitoring and classification results.

[0132] This embodiment also provides a computer device applicable to the case of the drinking water quality monitoring and early warning method based on the intelligent water rack, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the drinking water quality monitoring and early warning method based on the intelligent water rack proposed in the above embodiment.

[0133] This computer device can be a terminal. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of this computer device is used to provide computing and control capabilities. The memory of this computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of this computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a carrier network, NFC (Near Field Communication), or other technologies. The display screen of this computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of this computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad set on the shell of the computer device, or an external keyboard, a touchpad, or a mouse, etc.

[0134] This embodiment also provides a storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the drinking water quality monitoring and early warning method based on the intelligent water rack proposed in the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM for short), Electrically Erasable Programmable Read-Only Memory (EEPROM for short), Erasable Programmable Read Only Memory (EPROM for short), Programmable Red-Only Memory (PROM for short), Read-Only Memory (ROM for short), magnetic memory, flash memory, a magnetic disk, or an optical disc.

[0135] In summary, the present invention: collects water quality data to construct a time series, performs non-linear normalization processing on the time series to obtain a normalized series; calculates predicted values for future time based on the normalized series, and uses a quadratic polynomial fitting trend model for monitoring and early warning based on the predicted values for future time; solves the problems of inaccurate capture of dynamic changes, insufficient sensitivity of anomaly detection, and noise interference in traditional methods, enhances the prediction ability of the early warning model in different water quality change scenarios, and improves the prediction accuracy and timeliness of early warning.

[0136] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.

Claims

1. A drinking water quality monitoring and early warning method based on an intelligent water rack, Comprising, characterized in that: comprising, Collect water quality data to construct a time series, perform non-linear normalization processing on the time series to obtain a normalized series; Calculate the predicted value of future time based on the normalized series, and use a quadratic polynomial fitting trend model for monitoring and early warning based on the predicted value of future time; Use K-means clustering to classify the abnormal monitoring results, calculate the time distribution density, and construct a visualization interface to display the monitoring and classification results.

2. The drinking water quality monitoring and early warning method based on an intelligent water rack according to claim 1, characterized in that: The collection of water quality data to construct a time series means using intelligent sensors at the water intake to collect water quality data and perform preprocessing; The use of intelligent sensors includes spectral, total organic carbon, and heavy metal ion sensors; The water quality data includes turbidity, pH value, dissolved oxygen concentration, total organic carbon, and heavy metal ion concentration data; The preprocessing includes using the dynamic time warping method to align the water quality data in time, using a Kalman filter to denoise the water quality data, using the time series construction method to construct the denoised water quality data into a time series in chronological order, and using the time series segmentation algorithm to slice the time series.

3. The drinking water quality monitoring and early warning method based on an intelligent water rack according to claim 2, wherein: The non-linear normalization of the time series to obtain a normalized series means calculating the maximum distance d between the i-th and j-th data segments using the Chebyshev distance method ij ; Set the fuzzy radius r using the standard deviation estimation method, and use the fuzzy membership function to convert the maximum distance d ij into the membership value μ(d ij,r ) between the i-th and j-th data segments; Based on the membership value μ(d ij,r ), the average membership degree A of the i-th data segment is calculated using the weighted average method i ; Based on the average membership degree A i logarithmic calculation is performed to obtain the generalized fuzzy entropy FEn(X, m, r); Use the difference formula to calculate the instantaneous change rate and instantaneous acceleration of the data segment at the current time t respectively; Based on the instantaneous change rate and instantaneous acceleration at the current time t, use the dynamic characteristic quantification method to calculate the dynamic characteristic value D(X); Based on the generalized fuzzy entropy FEn(X, m, r) and the dynamic characteristic value D(X), calculate the dynamic scaling factor s(X), and the formula is: Where max(X) and min(X) are the maximum and minimum values in the time series respectively, X is the time series, m is the embedding dimension, and ∈ is a minimum constant; Use the dynamic scaling factor s(X) to perform non-linear normalization processing on the time series, and calculate the normalized value f(x), and the formula is: Where x is the water quality data of the data segment; Combine the normalized values f(x) to generate a normalized series f(X).

4. The drinking water quality monitoring and early warning method based on an intelligent water rack according to claim 3, characterized in that: The calculation of the predicted value of future time based on the normalized series means using the self-similarity analysis method to estimate the fractional order α; Construct a fractional calculus model for the normalized sequence f(X), and use the Caputp fractional derivative formula to calculate the fractional derivative D ∝f (x t ); Use the difference formula to calculate the trend change rate v of the fractional derivative at the current time t α (x t ); Based on the trend change rate v ∝ (x t ), identify local extreme points using the local extreme point identification method; Calculate the value F(x t ) of the interpolation point at the current time t using the Lagrange interpolation formula; Based on the trend change rate v ∝ (x t ) and the value of the interpolation point F(x t ), the predicted value F(x t + K) at a future time is calculated using the interpolation correction prediction method. The formula is: where K is the number of prediction time points, Δt′ is the prediction time step, and v ∝ (x t+ o -1 ) is the trend change rate at the prediction time t + o - 1, and o is the index of the time step.

5. The drinking water quality monitoring and early warning method based on an intelligent water rack according to claim 4, characterized in that: Based on the predicted value of future time, the use of a quadratic polynomial fitting trend model for monitoring and early warning means collecting historical water quality data and performing non-linear normalization processing to generate a training set; Perform least squares fitting on the training set to obtain the model coefficients; Based on the model coefficients, a quadratic polynomial is used to fit the trend model Q(x t ); Use statistical analysis methods to set a risk threshold, compare the combined trend model with the risk threshold, and when the combined trend model is greater than or equal to the risk threshold, it is judged as an abnormal state, an early warning is issued and the maintenance personnel are notified by email, and when the combined trend model is less than the risk threshold, it is judged as a normal state and the monitoring continues.

6. The drinking water quality monitoring and early warning method based on an intelligent water rack according to claim 5, characterized in that: The use of K-means clustering to classify the abnormal monitoring results and calculate the time distribution density means using the normalized values corresponding to the abnormal state as the input data for K-means clustering; Set the stop threshold using the percentile method, set the number of clusters c using the elbow method, randomly select c samples from the normalized values corresponding to the abnormal states as the initial cluster centers, calculate the DTW distances between the normalized values corresponding to the abnormal states and the cluster centers using the dynamic time warping method, assign the normalized values corresponding to the abnormal states to the nearest cluster centers to form new clusters, and stop the iteration until the cluster centers are less than the stop threshold. Define the cluster centers as the risk types; Based on the risk types, calculate the time distribution density at the current time t using the Gaussian kernel function.

7. The drinking water quality monitoring and early warning method based on an intelligent water rack according to claim 6, characterized in that: The constructing the visualization interface to display the monitoring and classification results means sorting the time distribution density by time to generate a density distribution curve; Use the front-end framework React.js to construct the visualization interface, including the main chart area and the top information bar; Display the monitoring results and the density distribution curve in the main chart area, and display the risk types in the top information bar; Allow users who have passed real-name verification to view.

8. A drinking water quality monitoring and early warning system based on an intelligent water rack, based on the drinking water quality monitoring and early warning method based on the intelligent water rack according to any one of claims 1 to 7, characterized in that: Include, A normalization collection module for collecting water quality data to construct a time series, performing non-linear normalization processing on the time series to obtain a normalized series; A prediction and monitoring module for calculating the predicted values at future times based on the normalized series, and using a quadratic polynomial fitting trend model for monitoring and early warning based on the predicted values at future times; A classification and visualization module for classifying the abnormal monitoring results using K-means clustering, calculating the time distribution density, and constructing a visualization interface to display the monitoring and classification results.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the drinking water quality monitoring and early warning method based on the intelligent water rack according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the drinking water quality monitoring and early warning method based on the intelligent water rack according to any one of claims 1 to 7.

Citation Information

Cited By

  • Urban small and micro water body intelligent monitoring and early warning method based on visible light unmanned aerial vehicle

    CN122238348A