A water supply and drainage water quality anomaly detection method and system

By periodically acquiring water quality parameter values ​​in the water supply and drainage network and reconstructing the difference calculation, the problem of not being able to identify hidden anomalies in the existing technology is solved, and in-depth analysis of the correlation of water quality parameters is realized, thereby improving the sensitivity and early warning capability of water quality monitoring.

CN120741808BActive Publication Date: 2026-01-09GUANGZHOU ZHONGYUE MUNICIPAL GARDEN DESIGN ENG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511252589.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2026-01-09
Estimated Expiration
2045-09-03

AI Technical Summary

Technical Problem

The existing urban water supply and drainage network water quality monitoring system cannot effectively identify hidden abnormalities caused by unknown pollutants, resulting in the failure to detect potential water quality risks in a timely manner.

Method used

By periodically acquiring water quality parameter values ​​of key nodes in the water supply and drainage network, reconstructing and calculating differences, and using the total reconstructed difference value and time decay factor to calculate the cumulative abnormal value, an alarm is generated when the cumulative value reaches the threshold. Combined with the initialization and calibration of the reconstructed mapping function, the inherent correlation between water quality parameters is identified.

Benefits of technology

It improves the sensitivity and accuracy of water quality anomaly detection, timely identifies potential water quality risks, avoids the masking of systemic normalities, and significantly enhances the sensitivity and early warning capabilities of monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120741808B_ABST
    Figure CN120741808B_ABST
Patent Text Reader

Abstract

The application discloses a kind of water supply and drainage water quality anomaly detection method and system, it is related to water supply and drainage water quality detection technical field;Method: according to the periodicity of preset time acquisition multiple water quality parameter values;For each acquisition value, the following operations are carried out: each water quality parameter value is respectively reconstructed, and the water quality parameter reconstruction value corresponding to each water quality parameter value is obtained;According to each water quality parameter value and corresponding water quality parameter reconstruction value, calculate the current reconstruction difference total value of water quality, according to current reconstruction difference total value, and preset time attenuation factor, calculate the current abnormal accumulation value of water quality;If reach sustained anomaly threshold, generate and send the alarm information that water quality exists latent anomaly.The water supply and drainage water quality anomaly detection method and system provided in the present application, by reconstructing water quality parameters and calculating reconstruction difference, and then accumulating abnormal value, effectively identify the latent water quality anomaly caused by the small correlation change of multiple water quality parameters, improve the sensitivity and accuracy of water quality detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of water quality testing technology for water supply and drainage, and more specifically, to a method and system for detecting abnormal water quality in water supply and drainage. Background Technology

[0002] Currently, in the field of water quality monitoring for urban water supply and drainage networks, a multi-index analysis system based on online monitoring equipment is widely used. This system typically relies on the independent monitoring of key physicochemical indicators in the water body (such as pH, turbidity, residual chlorine, and conductivity), and uses a preset single threshold for anomaly detection. When the real-time measurement value of any indicator exceeds its set normal range, the system will issue an alarm, prompting maintenance personnel to intervene. This mechanism demonstrates good responsiveness in identifying sudden events caused by specific pollutants that lead to drastic changes in a single indicator.

[0003] However, with the increasing complexity of industrial production and domestic emissions, some new pollutants not included in routine monitoring lists have emerged in water bodies. These pollutants may possess unique properties, meaning that at low concentrations they themselves do not directly cause any single monitoring indicator to exceed the existing independent alarm threshold. However, they may undergo slow physicochemical reactions with existing substances in the water, thereby simultaneously causing small, continuous, and intrinsically linked fluctuations in at least two or more monitoring indicators.

[0004] Because the existing monitoring logic is parallel and independent, it lacks the ability to analyze the deep correlations between indicators, thus failing to effectively identify this "hidden anomaly" state caused by unknown pollutants. The monitoring center's data analysis system independently reviews the data streams from each sensor. When the residual chlorine, conductivity, pH, and turbidity channels all show "normal," the system's final comprehensive assessment also shows "normal water quality." This masking of "systemic normality" prevents potential water quality risks from being detected in a timely manner. For example, biofilms may grow in the terminal areas of the pipe network due to weakened residual chlorine disinfection efficiency, but the existing monitoring system cannot directly detect biofilm formation, nor can it understand that the seemingly unrelated events of a slight decrease in residual chlorine readings and a slight increase in conductivity readings, both within normal ranges, actually originate from the same unknown physicochemical process. The entire water quality assurance system is trapped in a "hidden anomaly" state caused by unknown pollutants that cannot be detected by the existing detection logic.

[0005] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention

[0006] This application discloses a method and system for detecting abnormal water quality in water supply and drainage, which aims to solve the problem that the existing urban water supply and drainage network water quality monitoring system cannot effectively identify the "hidden abnormal" state caused by unknown pollutants. That is, when a new pollutant appears in the water body, it causes multiple monitoring indicators to fluctuate slightly, continuously and with intrinsic physical correlation, but when a single indicator does not exceed the independent alarm threshold, the system cannot detect potential water quality risks in a timely manner.

[0007] The technical solution of this application is as follows:

[0008] Firstly, this application discloses a method for detecting abnormal water quality in water supply and drainage, including:

[0009] Multiple water quality parameter values ​​at key nodes of the water supply and drainage network are acquired periodically according to a preset time period.

[0010] For each set of multiple water quality parameter values ​​acquired, the following operations should be performed:

[0011] Each water quality parameter value is reconstructed separately to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value;

[0012] Based on each water quality parameter value and the corresponding reconstructed water quality parameter value, calculate the current total reconstructed difference value of the water quality. Based on the current total reconstructed difference value and the preset time decay factor, calculate the current cumulative anomaly value of the water quality.

[0013] If the current cumulative abnormal value reaches the preset continuous abnormal threshold, an alarm message indicating that there is a hidden abnormality in the water quality will be generated and issued.

[0014] This technical solution enables the reconstruction of water quality parameters and the calculation of reconstruction differences, thereby accumulating outliers. It effectively identifies hidden water quality anomalies caused by subtle correlations in multiple water quality parameters, which are difficult to detect by traditional monitoring methods. This overcomes the limitations of relying on a single indicator for independent judgment in existing technologies and improves the sensitivity and accuracy of water quality anomaly detection.

[0015] Furthermore, this application also discloses a method for detecting abnormal water quality in water supply and drainage, including:

[0016] Under normal water quality conditions within the water supply and drainage network, multiple sets of first water quality parameter values ​​are obtained in chronological order.

[0017] Establish normal relationships between water quality parameters based on multiple sets of primary water quality parameter values;

[0018] The weight coefficients within the preset reconstruction mapping function are initialized based on the normal relationship.

[0019] The specific steps for reconstructing each water quality parameter value to obtain the reconstructed water quality parameter value for each value include:

[0020] Input each obtained water quality parameter value into the reconstruction mapping function;

[0021] The reconstruction mapping function is called to compress each water quality parameter value into a low-dimensional data value according to the preset mathematical operation rules;

[0022] Based on the weighting coefficients and the preset reverse mathematical operation rules, each low-dimensional data value is reconstructed to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value.

[0023] This technical solution enables the establishment of normal relationships between water quality parameters using normal water quality data, and the initialization of the weight coefficients of the reconstruction mapping function accordingly. This allows the reconstruction process to accurately capture the intrinsic correlation of water quality parameters, thereby providing a more accurate benchmark for subsequent anomaly detection and effectively improving the reliability of anomaly detection.

[0024] Based on this, this application further proposes a method for detecting abnormal water quality in water supply and drainage, which also includes:

[0025] The following operations will be performed periodically according to the preset time:

[0026] Under normal water quality conditions within the water supply and drainage network, multiple sets of secondary water quality parameter values ​​were obtained.

[0027] Based on multiple sets of secondary water quality parameter values, establish the first normal relationship between water quality parameters;

[0028] The weight coefficients within the reconstructed mapping function are calibrated based on the first normal relation.

[0029] This technical solution enables the model to adapt to long-term changes in the water quality environment by periodically acquiring normal water quality data and calibrating the weight coefficients of the reconstructed mapping function. This maintains the model's ability to accurately identify the correlation between normal water quality parameters, effectively avoiding false alarms or missed alarms caused by environmental changes, and further improving the robustness of the detection system.

[0030] In some preferred embodiments, this application discloses a method for detecting water quality anomalies in water supply and drainage. The steps of calculating the current total reconstructed difference of water quality based on each water quality parameter value and its corresponding reconstructed value, and calculating the current cumulative anomaly value of water quality based on the current total reconstructed difference and a preset time decay factor, specifically include:

[0031] For each water quality parameter value, calculate the corresponding reconstructed difference value: Reconstructed difference value = (Water quality parameter value - Reconstructed water quality parameter value) 2 The reconstructed difference values ​​corresponding to each water quality parameter value are summed to calculate the current total reconstructed difference value of the water quality.

[0032] Based on the current total reconstructed difference value and the preset time decay factor, calculate the current cumulative abnormal value of water quality. Current cumulative abnormal value = (previous cumulative abnormal value × time decay factor) + current total reconstructed difference value; the previous cumulative abnormal value is the current cumulative abnormal value calculated in the previous calculation; where the time decay factor is less than 1.

[0033] This technical solution enables the reconstruction and accumulation of difference values ​​through squared difference calculation, and then the calculation of abnormal cumulative values ​​by combining the time decay factor. This allows the system to effectively capture and accumulate small, continuous abnormal signals. At the same time, by giving higher weight to recent data through the decay factor, the system improves the early warning capability for latent anomalies and avoids misjudgments caused by instantaneous fluctuations.

[0034] As a technical improvement, this application also discloses a method for detecting abnormal water quality in water supply and drainage, wherein, after the step of reconstructing each water quality parameter value to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value, the method further includes:

[0035] Record the reconstructed difference value corresponding to each water quality parameter value, as well as the timestamp for calculating the reconstructed difference value;

[0036] The steps following the generation and issuance of an alert regarding a latent water quality anomaly also include:

[0037] Based on the magnitude of the reconstructed difference value corresponding to each recorded water quality parameter value and the corresponding timestamp, the combination of water quality parameters that leads to the hidden anomaly in water quality is determined.

[0038] This technical solution can accurately pinpoint the specific combination of water quality parameters causing hidden anomalies by recording and reconstructing difference values ​​and timestamps, and further analyzing this data when an alarm is triggered. This provides maintenance personnel with a clear direction for troubleshooting and significantly improves the efficiency and accuracy of anomaly location.

[0039] In one embodiment, this application discloses a method for detecting abnormal water quality in water supply and drainage systems. Before the step of periodically acquiring multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time period, when there is a periodic network operation in the water supply and drainage network system that causes a regular deviation in the correlation of water quality parameters, the method further includes:

[0040] Under normal water quality conditions within the water supply and drainage network, the following operations shall be performed within at least one network operation cycle:

[0041] During a specific time period of pipeline operation, multiple third water quality parameter values ​​at key nodes of the water supply and drainage pipeline are acquired according to a preset time period.

[0042] For each acquired third water quality parameter value, the following operations are performed: each third water quality parameter value is reconstructed to obtain the corresponding first water quality parameter reconstruction value; the current first reconstruction difference value of water quality is calculated based on each third water quality parameter value and the corresponding first water quality parameter reconstruction value, and the first timestamp of the calculation of the current first reconstruction difference value is recorded.

[0043] Based on the total value of all reconstruction differences calculated within at least one pipeline operation cycle, and the corresponding first timestamp, a standardized periodic disturbance profile is generated.

[0044] The steps of calculating the current total reconstructed difference of water quality based on each water quality parameter value and its corresponding reconstructed value, and calculating the current cumulative anomaly value of water quality based on the current total reconstructed difference and a preset time decay factor, specifically include:

[0045] The current total reconstructed difference of water quality is calculated based on each water quality parameter value and the corresponding reconstructed water quality parameter value, and the second timestamp for calculating the current total reconstructed difference is recorded.

[0046] Based on the second timestamp, find the first reconstruction difference value corresponding to the first timestamp that is aligned with it from the periodic interference profile;

[0047] Subtract the found first reconstruction difference value from the current total reconstruction difference value to obtain the residual difference value;

[0048] The current cumulative value of water quality anomalies is calculated based on the residual difference value and the preset time decay factor.

[0049] One pipeline operation cycle refers to the time interval between the start times of two adjacent pipeline operations.

[0050] This technical solution can identify and quantify the regular interference of periodic pipeline operations on the correlation of water quality parameters, and deduct it from the real-time reconstruction differences. This effectively isolates the fluctuations caused by normal operations, making anomaly detection more focused on unexpected events, significantly reducing the false alarm rate, and improving the accuracy of the system in complex operating environments.

[0051] To improve the solution, this application also discloses a method for detecting abnormal water quality in water supply and drainage. Following the step of generating a standardized periodic disturbance profile based on the total value of all reconstructed differences calculated within at least one pipeline operation cycle and the corresponding first timestamp, the method further includes:

[0052] The following operations are performed periodically according to a preset second time period:

[0053] During a specific time period of pipeline operation, multiple fourth water quality parameter values ​​at key nodes of the water supply and drainage pipeline are acquired according to a preset time period.

[0054] For each acquired fourth water quality parameter value, the following operations are performed: each fourth water quality parameter value is reconstructed to obtain the corresponding second water quality parameter reconstruction value; based on each fourth water quality parameter value and the corresponding second water quality parameter reconstruction value, the current second reconstruction difference value of the water quality is calculated, and the third timestamp for calculating the current second reconstruction difference value is recorded.

[0055] The periodic disturbance profile is calibrated based on the total value of all second reconstruction differences calculated within a specific time period and the corresponding third timestamp.

[0056] This technical solution enables the system to adapt to minor changes or long-term drifts in pipeline operation modes by periodically acquiring new data and calibrating periodic disturbance profiles. This allows for continuous and accurate identification and compensation of the impact of normal operation, further improving the adaptability and accuracy of anomaly detection.

[0057] In another embodiment, this application discloses a method for detecting abnormal water quality in water supply and drainage. Specifically, when the water supply source for water supply and drainage is a mixture of two or more water sources with different water quality characteristics, the step of periodically acquiring multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time period includes:

[0058] The system periodically acquires multiple water quality parameter values ​​at key nodes of the water supply and drainage network, as well as the mixing ratio of the current mixed water sources within the water supply and drainage network, based on a preset time period.

[0059] Following the step of periodically acquiring multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time period, the process also includes:

[0060] Based on multiple water quality parameter values ​​and mixing ratio values, the estimated water quality parameter values ​​of each pure water source in the current mixed water source are calculated in reverse;

[0061] Based on the preset correlation of water quality parameters of each normal pure water source and the estimated value of each water quality parameter of each pure water source, determine whether there is any abnormality in the mixed water source;

[0062] If an anomaly is detected, an alarm message will be generated and issued specifying the type of pure water source that caused the anomaly.

[0063] To improve the solution, this application also discloses a method for detecting abnormal water quality in water supply and drainage. The step of determining whether an abnormality exists in the mixed water source based on the preset correlation between water quality parameters of various normal pure water sources and the estimated value of each water quality parameter of each pure water source specifically includes:

[0064] For each type of purified water source, determine whether the estimated values ​​of each water quality parameter in the corresponding purified water source conform to the preset correlation relationship of water quality parameters of normal purified water source;

[0065] If it does not meet the requirements, the estimated values ​​of each water quality parameter of the corresponding pure water source are reconstructed to obtain the reconstructed estimated values ​​of each water quality parameter.

[0066] Based on the estimated value and the reconstructed value of each water quality parameter, calculate the degree of self-coordination deviation of the corresponding pure water source;

[0067] If the degree of deviation of its own coordination reaches or exceeds the preset limit value, it is determined that there is an abnormality in the mixed water source.

[0068] This technical solution enables the reverse calculation of water quality parameters of pure water sources in complex scenarios involving multiple water sources. Based on the normal correlation between pure water sources, it reconstructs and judges anomalies, thereby effectively identifying anomalies in specific pure water sources within mixed water sources. This solves the problem of tracing the source of water quality anomalies in mixed water sources and improves the refined management capabilities of anomaly detection.

[0069] This application also discloses a water quality anomaly detection system for water supply and drainage, including:

[0070] The acquisition module is used to periodically acquire multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time.

[0071] The calling module is used to sequentially call the following modules to perform relevant operations for each set of multiple water quality parameter values ​​obtained;

[0072] The reconstruction module is used to reconstruct each water quality parameter value separately to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value.

[0073] The calculation module is used to calculate the current total value of water quality reconstruction difference based on each water quality parameter value and the corresponding reconstructed water quality parameter value, and to calculate the current cumulative value of water quality anomalies based on the current total value of reconstruction difference and the preset time decay factor.

[0074] The alarm module is used to generate and issue an alarm message indicating that there is a hidden abnormality in the water quality if the current cumulative abnormal value reaches a preset continuous abnormality threshold.

[0075] This technical solution provides a system that integrates data acquisition, reconstruction, anomaly calculation, and alarm functions, enabling automated and intelligent detection of hidden anomalies in water quality for water supply and drainage. It provides a reliable hardware or software platform for practical applications, improving the overall efficiency and response speed of water quality management.

[0076] Beneficial effects

[0077] The water quality anomaly detection method disclosed in this application periodically acquires water quality parameter values ​​at key nodes of the water supply and drainage network and reconstructs these parameters to obtain reconstructed values. Based on this, the total current reconstructed difference value of the water quality is calculated, and the current cumulative anomaly value is calculated by combining a time decay factor. When this cumulative anomaly value reaches a preset continuous anomaly threshold, the system generates and issues an alarm message indicating a latent anomaly in the water quality. The core of this method is that it no longer relies solely on whether a single water quality indicator exceeds an independent threshold for judgment, but rather analyzes the inherent correlation between multiple water quality parameters, i.e., assesses the coordination between parameters through reconstruction. When a latent anomaly occurs in the water quality, even if the change in a single indicator is small, its inherent correlation with other related indicators will deviate, leading to the accumulation of reconstructed differences, which is then detected by the system. This mechanism based on multi-indicator correlation analysis and anomaly accumulation effectively solves the problem in existing technologies of failing to identify "latent anomalies" caused by new pollutants that result in small but continuous fluctuations in the correlation of multiple indicators. This method enables the timely detection of potential water quality risks, avoids the masking effect of "systemic normality," significantly improves the sensitivity and early warning capabilities of urban water supply and drainage network water quality monitoring, and ensures water supply security. Attached Figure Description

[0078] Figure 1 This is a flowchart illustrating a method for detecting abnormal water quality in water supply and drainage provided in this application.

[0079] Figure 2 This is a schematic diagram of a water quality anomaly detection system for water supply and drainage provided in this application.

[0080] Figure 2 In the diagram: 1 is the acquisition module, 2 is the calling module, 3 is the reconstruction module, 4 is the calculation module, and 5 is the alarm module. Detailed Implementation

[0081] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. The components of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0082] This application proposes a method for detecting abnormal water quality in water supply and drainage systems, comprising: periodically acquiring multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time interval. See also... Figure 1 For each set of multiple water quality parameter values ​​obtained, the following operations are performed:

[0083] S10. Reconstruct each water quality parameter value separately to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value;

[0084] S20. Calculate the current total value of water quality reconstruction difference based on each water quality parameter value and the corresponding reconstructed water quality parameter value. Calculate the current cumulative value of water quality anomalies based on the current total value of reconstruction difference and the preset time decay factor.

[0085] S30. If the current cumulative abnormal value reaches the preset continuous abnormal threshold, an alarm message indicating that there is a hidden abnormality in the water quality will be generated and issued.

[0086] This application aims to improve the accuracy and timeliness of water quality monitoring by analyzing the intrinsic correlation between water quality parameters to identify hidden water quality anomalies that are difficult to detect by traditional methods.

[0087] The "water quality parameter values" mentioned in this application refer to the quantitative data of physical, chemical, or biological indicators of water bodies acquired in real time or periodically by various sensors or detection devices in water supply and drainage networks. These parameters may include, but are not limited to, pH value, turbidity, residual chlorine, conductivity, dissolved oxygen, oxidation-reduction potential, ammonia nitrogen, and total organic carbon. Each water quality parameter value represents the measurement result of that indicator at a specific time point and a specific node in the network.

[0088] "Reconstructed water quality parameter value" refers to the value obtained by recalculating or predicting a water quality parameter based on its current value and its inherent correlation with other water quality parameters using a mathematical model or algorithm. This reconstruction process aims to simulate the expected performance of the water quality parameter under normal water quality conditions.

[0089] "Total Reconstruction Difference" is a quantitative representation of the degree of difference between the actual water quality parameter values ​​and the corresponding reconstructed water quality parameter values. This value reflects the degree of deviation between the current combination of water quality parameters and the normal water quality parameter correlation pattern.

[0090] The "time decay factor" is a value between 0 and 1 used to assign different weights to the total historical reconstructed differences when calculating the cumulative anomaly value. Earlier differences are decayed by the time decay factor, making more recent differences have a greater impact on the current cumulative anomaly value, thus making the system more sensitive to the latest water quality changes.

[0091] The "cumulative anomaly value" is an indicator that measures the persistence and severity of water quality anomalies. It comprehensively considers the current total reconstructed difference value and the historical total reconstructed difference value, and introduces a time decay factor. This value can reflect the cumulative effect of water quality anomalies; even if each deviation is very small, if it continues to occur, the cumulative anomaly value will gradually increase.

[0092] The "continuous anomaly threshold" is a preset critical value. When the accumulated anomaly value reaches or exceeds this threshold, the system determines that there is a hidden anomaly in the water quality and triggers an alarm.

[0093] The implementation environment of this application is typically an urban water supply and drainage network system, including water supply networks and drainage networks. At key nodes of the network, such as water plant outlets, pumping stations, important user interfaces, and network ends, various online water quality monitoring devices are deployed. These devices can periodically collect the aforementioned water quality parameter values ​​and transmit the data to a central data processing platform for analysis.

[0094] The core of the water quality anomaly detection method for water supply and drainage in this application lies in identifying hidden water quality anomalies that are difficult to detect by traditional methods through the reconstruction and differential accumulation analysis of water quality parameters.

[0095] Specifically, after obtaining multiple water quality parameter values ​​at key nodes of the water supply and drainage network, the system reconstructs each water quality parameter value. For example, statistical models (such as multiple linear regression models, principal component analysis models) or machine learning models (such as neural networks, support vector machines) trained based on historical data can be used to establish normal correlations between water quality parameters. When a new set of water quality parameter values ​​is obtained, one of the water quality parameters can be used as input to predict its reconstructed value under normal conditions, or other water quality parameters can be used as input to predict the reconstructed value of the current water quality parameter. For example, a normal correlation model between residual chlorine and turbidity and pH value can be established based on historical data. When new residual chlorine, turbidity, and pH values ​​are obtained, the reconstructed value of residual chlorine can be predicted using turbidity and pH value.

[0096] After obtaining the reconstructed water quality parameter value for each water quality parameter, the system calculates the total current reconstructed difference. One calculation method is to calculate the squared difference between each water quality parameter value and its corresponding reconstructed value, and then sum the squared differences of all water quality parameters to obtain the total current reconstructed difference. For example, if there are parameters A, B, and C, with reconstructed values ​​A', B', and C' respectively, then the total current reconstructed difference can be calculated as (A-A'). 2 +(B-B') 2 +(C-C') 2 .

[0097] Subsequently, based on the current total reconstructed difference value and the preset time decay factor, the current cumulative anomaly value of the water quality is calculated. For example, an exponentially weighted moving average (EWMA) method can be used for calculation. Assume the previously calculated cumulative anomaly value is "cumulative anomaly value". 上一次 Then the current cumulative anomaly value can be calculated as: (cumulative anomaly value) 上一次 × Time decay factor) + Current total reconstructed difference. The time decay factor is a positive number less than 1, such as 0.9. This calculation method makes recent reconstructed differences have a greater impact on the cumulative anomaly value, while the impact of earlier differences gradually decreases, thus reflecting the latest trends in water quality changes in a timely manner.

[0098] Finally, the system compares the calculated current cumulative anomaly value with a preset persistent anomaly threshold. If the current cumulative anomaly value reaches or exceeds the threshold, it indicates a persistent, cumulative, latent anomaly in the water quality, and the system will generate and issue an alarm message. For example, the alarm message may include the time and location of the anomaly, the magnitude of the cumulative anomaly value, and prompt maintenance personnel to conduct further investigation and handling.

[0099] This application's method for detecting water quality anomalies in water supply and drainage periodically acquires water quality parameter values ​​and reconstructs each parameter to obtain its expected value under normal conditions. By comparing the difference between the actual value and the reconstructed value, the degree of deviation in the correlation between water quality parameters can be quantified. Such differences, even when a single parameter does not exceed a traditional threshold, may indicate latent changes in water quality. By accumulating these differences and introducing a time decay factor, this application can effectively capture subtle but continuous water quality anomaly signals. When the accumulated anomalies reach a preset threshold, the system can issue an alarm in a timely manner, thereby intervening before the water quality problem evolves into a serious event.

[0100] Compared to existing methods that rely on independent thresholds for single indicators, this application's advantage lies in its ability to identify subtle deviations in the intrinsic correlation between water quality parameters. By introducing the concepts of water quality parameter reconstruction, total reconstruction difference, and cumulative anomaly value, this application can effectively capture these weak but persistent anomalous signals. Even if a single water quality parameter value remains within the normal range, changes in its correlation with other parameters can still be identified by the system. This method can detect potential water quality risks earlier and more accurately, avoiding the masking effect of "systemic normality," thereby improving the early warning capability and reliability of water quality monitoring for water supply and drainage.

[0101] This application further proposes a method for detecting abnormal water quality in water supply and drainage, which also includes:

[0102] Under normal water quality conditions within the water supply and drainage network, multiple sets of first water quality parameter values ​​are obtained in chronological order.

[0103] Based on the multiple sets of first water quality parameter values, establish the normal relationship between the water quality parameters;

[0104] The weight coefficients within the preset reconstruction mapping function are initialized based on the normal relationship.

[0105] The steps described above for reconstructing each water quality parameter value to obtain the reconstructed water quality parameter value for each value specifically include:

[0106] Each obtained water quality parameter value is input into the reconstruction mapping function;

[0107] The reconstruction mapping function is invoked to compress each water quality parameter value into a low-dimensional data value according to preset mathematical operation rules;

[0108] Based on the weighting coefficients and the preset reverse mathematical operation rules, each low-dimensional data value is reconstructed to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value.

[0109] The phrase "under normal water quality conditions within the water supply and drainage network, acquiring multiple sets of first water quality parameter values ​​in chronological order" refers to continuously collecting a series of water quality parameter data during the initial stage of system operation or a verified period of stable water quality. These data are considered to represent the water quality characteristics under normal operating conditions. For example, monitoring data of multiple water quality parameters such as pH value, turbidity, residual chlorine, and conductivity can be collected over several consecutive days or weeks.

[0110] The phrase "establishing normal relationships between water quality parameters based on the multiple sets of first water quality parameter values" refers to using these normal water quality data, through data analysis or machine learning methods, to learn and quantify the intrinsic correlations, variation patterns, and normal fluctuation ranges among different water quality parameters. For example, models such as principal component analysis (PCA), independent component analysis (ICA), or autoencoders can be used to capture the statistical or nonlinear relationships of these multidimensional water quality parameters under normal conditions.

[0111] The "reconstruction mapping function" can be understood as a mathematical model or algorithm that can compress and reconstruct input data. Its purpose is to preserve the main features of the data during compression and to restore the original data as much as possible during reconstruction. For example, this function can be a neural network model, such as an autoencoder, which includes an encoder and a decoder.

[0112] The "weight coefficients" refer to the parameters used within the reconstruction mapping function to adjust the data transformation and mapping relationships. These parameters are determined during model training or initialization. For example, in a neural network, weight coefficients are the parameters connecting different neurons, which determine how the input data is processed and transformed.

[0113] The "preset mathematical operation rules" refer to the algorithmic logic followed by the reconstruction mapping function when compressing water quality parameter values ​​into low-dimensional data values. For example, for autoencoders, this may involve matrix multiplication and the application of activation functions (such as ReLU and Sigmoid) to map high-dimensional input data to a low-dimensional latent space.

[0114] The "low-dimensional data values" refer to the data representation with lower dimensionality obtained after the original water quality parameter values ​​have been compressed using a reconstruction mapping function. These low-dimensional data values ​​typically contain the most critical and representative information from the original data, while removing redundancy and noise.

[0115] The "preset reverse mathematical operation rules" refer to the algorithmic logic followed by the reconstruction mapping function when reconstructing low-dimensional data values ​​into reconstructed water quality parameter values. For example, for an autoencoder, this may involve matrix multiplication and activation function application, which are the reverse of the compression process, to map the low-dimensional latent representation back to the dimensional space of the original data, thereby obtaining the reconstructed value.

[0116] The phrase "initializing the weight coefficients within the preset reconstruction mapping function" refers to pre-configuring or training the model's internal parameters using established normal relationships before the reconstruction mapping function is formally used for anomaly detection. This allows the model to better learn and represent the characteristics of normal water quality data. This helps the model more accurately identify anomalies deviating from the normal pattern in subsequent real-time detection.

[0117] This application's solution obtains multiple sets of first water quality parameter values ​​under normal water quality conditions and establishes normal relationships between these parameters based on these data, thus providing meaningful initialization settings for the weight coefficients within the reconstruction mapping function. Therefore, when subsequent water quality parameter values ​​are input into the reconstruction mapping function, the function can compress them into low-dimensional data values ​​according to preset mathematical operation rules, and reconstruct these low-dimensional data values ​​based on the initialized weight coefficients and preset reverse mathematical operation rules. This method of initialization and reconstruction based on normal relationships allows the reconstruction mapping function to learn and capture the inherent correlations and data distribution characteristics of water quality parameters under normal conditions. When actual water quality data deviates from these normal patterns, the reconstruction mapping function will struggle to accurately reconstruct the data, leading to a greater difference between the actual water quality parameter values ​​and their corresponding reconstructed values, thereby more effectively indicating abnormal water quality conditions.

[0118] Through the above technical solution, this application ensures that the reconstruction mapping function is based on a deep understanding and learning of normal water quality patterns when reconstructing water quality parameters. This significantly improves the accuracy and reliability of water quality parameter reconstruction, enabling the subsequently calculated total reconstruction difference value to more accurately reflect the true degree of water quality anomaly. Furthermore, by initializing the weight coefficients, the model avoids learning from a random state, accelerating its convergence speed and enhancing its ability to identify latent water quality anomalies, thereby improving the robustness and effectiveness of the entire water quality anomaly detection method for water supply and drainage.

[0119] In some preferred embodiments, the reconstruction mapping function can be implemented as an autoencoder. Specifically, under normal water quality conditions within the water supply and drainage network, a large amount of historical water quality data can be collected as a training set. This data is input into the encoder part of the autoencoder, where high-dimensional water quality parameter values ​​are compressed into low-dimensional latent representations (i.e., low-dimensional data values) through a multi-layer neural network and a nonlinear activation function. Subsequently, these low-dimensional data values ​​are input into the decoder part of the autoencoder, where they are reconstructed back to the original water quality parameter dimensions through a reverse neural network structure and activation function, yielding reconstructed water quality parameter values. During this process, the weight coefficients of the autoencoder are trained and initialized by minimizing the difference (e.g., mean squared error) between the original input and the reconstructed output. Once the autoencoder is trained and its weight coefficients are initialized, it can effectively capture the inherent patterns in normal water quality data. When new water quality parameter values ​​are input, if they deviate from the normal patterns learned during training, the autoencoder will struggle to accurately reconstruct them, resulting in significant reconstruction discrepancies, which in turn indicate potential water quality anomalies. For example, if there is a linear or non-linear correlation between pH and turbidity in normal water quality data, the autoencoder will learn this correlation during training. When a situation occurs in actual monitoring where the pH is normal but the turbidity is abnormally high, the autoencoder will be unable to accurately reconstruct the turbidity value based on the normal correlation it has learned, resulting in a large reconstruction discrepancy and prompting an alarm.

[0120] This application further proposes a method for calibrating the weight coefficients within the reconstructed mapping function, specifically including:

[0121] The following operations will be performed periodically according to the preset time:

[0122] Under normal water quality conditions within the water supply and drainage network, multiple sets of secondary water quality parameter values ​​were obtained.

[0123] Based on the multiple sets of second water quality parameter values, a first normal relationship is established between the water quality parameters;

[0124] The weight coefficients within the reconstructed mapping function are calibrated based on the first normal relationship.

[0125] Specifically, the aforementioned preset first time refers to the time interval used to trigger the weight coefficient calibration operation. This time interval can be flexibly set according to the needs of the actual application scenario; for example, it can be set to perform calibration once a day, week, month, or quarter. Its purpose is to ensure that the reconstructed mapping function can continuously adapt to the long-term changing trend of water quality in the water supply and drainage network, thereby maintaining the accuracy of anomaly detection. When performing the calibration operation, multiple sets of second water quality parameter values ​​need to be obtained under normal water quality conditions within the water supply and drainage network. Here, "normal water quality conditions" refers to a state where no known abnormal events have occurred in the network, and the water quality parameters are within their typical fluctuation range. These second water quality parameter values ​​are the basic data used to update or relearn the normal relationships between water quality parameters. For example, it can be determined whether the current water quality is in a normal state through manual confirmation, historical data analysis, or by combining other auxiliary monitoring methods. Furthermore, based on the obtained multiple sets of second water quality parameter values, a first normal relationship between water quality parameters is established. This first normal relationship can be understood as the inherent correlation pattern presented between water quality parameters at the current point in time or within a period. The method for establishing this relationship can be similar to that used when initializing the weight coefficients. For example, statistical analysis and machine learning algorithms (such as principal component analysis and autoencoders) can be used to capture the correlation between water quality parameters. Finally, the weight coefficients within the reconstructed mapping function are calibrated based on the established first normal relationship. The calibration process aims to adjust the parameters within the reconstructed mapping function to better fit the current normal water quality relationship. For example, if the reconstructed mapping function is based on a neural network, the calibration process can be achieved by using a backpropagation algorithm to fine-tune the network weights using new normal water quality data to minimize the reconstruction error. In this way, the reconstructed mapping function can dynamically adapt to the normal fluctuation range of water quality parameters, avoiding misjudgments caused by outdated models.

[0126] This application's solution effectively addresses the issue of potentially invalidating weight coefficients in the reconstructed mapping function over time by introducing a periodic calibration mechanism. Specifically, new normal water quality data is periodically acquired at a predetermined time interval, and a new normal relationship between water quality parameters is re-established based on this data, enabling the model to learn the latest normal water quality pattern. Subsequently, this new normal relationship is used to calibrate the weight coefficients within the reconstructed mapping function, ensuring that the reconstructed model can always accurately capture the intrinsic correlation between water quality parameters. Therefore, when actual water quality parameter values ​​are input into the reconstructed mapping function, the reconstructed value can more accurately reflect the expected value under the current normal state, thus allowing the calculated reconstructed difference value to more realistically reflect the degree of water quality anomaly and avoiding false alarms or missed alarms caused by model drift.

[0127] In some preferred embodiments, a specific example is given below. Suppose that during the initial deployment of a water supply and drainage network system, the initial weights of the reconstruction mapping function were established using historical data. However, with seasonal changes and network aging, the normal fluctuation range and interrelationships of water quality parameters may undergo subtle changes. For example, in summer, due to rising temperatures, the normal range of some water quality parameters (such as dissolved oxygen) may decrease, while in winter it may increase. If the model is not adjusted, the normal dissolved oxygen value in summer may be misjudged as abnormal. To solve this problem, a preset first normality period can be set to once a month. At the beginning of each month, the system automatically collects multiple sets of second water quality parameter values ​​for a consecutive week under normal network water quality conditions. Based on these newly collected normal data, the system recalculates the first normality relationships between these parameters. Subsequently, this new first normality relationship is used to calibrate the weight coefficients within the existing reconstruction mapping function. Through this periodic calibration, even if the normal baseline of water quality drifts slowly, the reconstruction model can adapt in a timely manner, ensuring that it can always accurately distinguish between normal fluctuations and true anomalies.

[0128] Specifically, the steps described above—calculating the current total reconstructed difference of water quality based on each water quality parameter value and the corresponding reconstructed water quality parameter value, and calculating the current cumulative abnormal value of water quality based on the current total reconstructed difference and a preset time decay factor—can be implemented in the following manner.

[0129] For each water quality parameter value, a corresponding reconstructed difference value is calculated. The reconstructed difference value is defined as (water quality parameter value - reconstructed water quality parameter value). 2 Subsequently, the reconstructed difference values ​​corresponding to each water quality parameter value are summed to calculate the current total reconstructed difference value of the water quality. Based on this, the current cumulative anomaly value of the water quality is calculated according to the current total reconstructed difference value and the preset time decay factor. The calculation formula is: Current cumulative anomaly value = (Cumulative anomaly value) / (Cumulative anomaly value) 上一次 × Time decay factor) + Current total reconstruction difference. Where, the cumulative anomaly value... 上一次 This refers to the current cumulative abnormal value obtained from the previous calculation, with the time decay factor set to a value less than 1.

[0130] Specifically, the reconstructed difference value is obtained by squaring the difference between the original water quality parameter value and its corresponding reconstructed value. This squaring operation aims to quantify the deviation between the original water quality parameter value and its reconstructed value, ensuring that the calculated difference value is positive and amplifying the impact of larger deviations on the total difference. By summing the reconstructed difference values ​​of all water quality parameters, a comprehensive index is obtained: the current total reconstructed difference value of water quality. This value reflects the overall deviation of all water quality parameters at the current moment.

[0131] Furthermore, a time decay factor is introduced into the calculation of the current cumulative anomaly value. This time decay factor is a value between 0 and 1, and its function is to assign different weights to historical cumulative anomaly values, so that more recent cumulative anomaly values ​​have a greater impact on the current cumulative anomaly value, while the impact of older cumulative anomaly values ​​gradually decreases. Through this accumulation method, even if the total reconstruction difference at a single moment is insufficient to trigger an alarm, if small deviations persist, these deviations will accumulate over time and may eventually reach a preset persistent anomaly threshold.

[0132] This application's solution, by introducing the calculation of reconstructed difference values ​​and anomaly accumulation values, can effectively capture subtle changes and long-term trends in water quality parameters. The calculation of the square of the reconstructed difference value ensures sensitivity to deviations in water quality parameters, quantifying even minute deviations. The calculation of the anomaly accumulation value, particularly by introducing a time decay factor, allows the system to "memorize" and accumulate historical deviation information. Therefore, even if the instantaneous value of a water quality parameter does not exceed a conventional threshold, if its intrinsic correlation continues to deviate, this cumulative effect will cause the anomaly accumulation value to gradually increase, thereby identifying latent anomalies that are difficult to detect using traditional methods.

[0133] The above technical solution enables early and sensitive detection of latent anomalies in water quality for water supply and drainage. This method not only identifies sudden, large fluctuations in water quality parameters, but more importantly, it effectively detects latent anomalies caused by subtle, continuous deviations in the intrinsic correlation between water quality parameters through the continuous accumulation and time decay of reconstructed differences. This accumulation mechanism avoids missed detections due to inconspicuous instantaneous fluctuations, significantly improving the accuracy and timeliness of water quality anomaly detection and providing a more reliable guarantee for the safe operation of water supply and drainage networks.

[0134] This application further proposes an optimization scheme that aims to provide information on the specific combination of water quality parameters that cause the anomaly when an anomaly is detected.

[0135] The steps described above, which reconstruct each water quality parameter value to obtain the reconstructed water quality parameter value for each value, also include:

[0136] Record the reconstructed difference value corresponding to each water quality parameter value, as well as the timestamp for calculating the reconstructed difference value;

[0137] The steps described above, including generating and issuing an alert about hidden water quality anomalies, also include:

[0138] Based on the magnitude of the reconstructed difference value corresponding to each recorded water quality parameter value and the corresponding timestamp, the combination of water quality parameters that leads to the hidden anomaly in water quality is determined.

[0139] Specifically, each water quality parameter value is reconstructed and its reconstruction difference value is calculated (e.g., reconstruction difference value = (water quality parameter value - reconstructed water quality parameter value)). 2 Afterward, the system records and stores these individual reconstructed difference values ​​along with their calculated timestamps. These records form a historical database for subsequent queries and analysis. The timestamp recording ensures that each reconstructed difference value is associated with a specific point in time, enabling the tracking of the time series of anomalies. When the current cumulative anomaly value of the water quality reaches a preset continuous anomaly threshold, triggering the generation and issuance of an alarm message indicating a latent anomaly in water quality, the system further utilizes the reconstructed difference values ​​and their timestamps corresponding to each previously recorded water quality parameter value. By analyzing this historical data, especially those parameters that exhibited significant reconstructed difference values ​​before and after the anomaly occurred, it is possible to determine which water quality parameters or combinations thereof caused the latent anomaly in the overall water quality. For example, a threshold can be set; when the reconstructed difference value of a certain water quality parameter continuously or suddenly exceeds this threshold, it is considered that the parameter may be abnormal.

[0140] This application's solution, during the water quality anomaly detection process, not only calculates the overall cumulative anomaly value but also meticulously records the individual reconstruction difference value and its timestamp for each water quality parameter. This fine-grained recording provides crucial data support for subsequent anomaly diagnosis. When the overall cumulative anomaly value triggers an alarm, the system can retrospectively analyze these individual reconstruction difference values ​​to identify the water quality parameters that deviate most significantly from their normal correlations. This is because the reconstruction difference value directly reflects the degree of deviation between a single water quality parameter and its expected value based on other parameters. By comparing the magnitude of the reconstruction difference values ​​of different parameters and combining them with the time of their occurrence, the key parameters or parameter combinations causing the overall anomaly can be effectively identified.

[0141] The aforementioned technical solution not only detects hidden water quality anomalies and issues alarms, but also provides the specific combination of water quality parameters leading to the anomaly. This significantly improves the efficiency and accuracy of anomaly location, enabling managers and maintenance personnel to quickly pinpoint the source of the problem and take targeted measures for investigation and handling. This avoids blind investigation, reduces fault response time, and enhances the precision of water quality management and emergency response capabilities in water supply and drainage networks.

[0142] This application further proposes a method for detecting abnormal water quality in water supply and drainage that takes into account the impact of periodic pipeline network operations, aiming to eliminate or mitigate the impact of periodic interference on the abnormal detection results and improve the accuracy of detection.

[0143] When there is a periodic operation in the water supply and drainage network system that causes a regular deviation in the correlation of water quality parameters, the steps before obtaining multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time period also include:

[0144] Under normal water quality conditions within the water supply and drainage network, the following operations shall be performed within at least one network operation cycle:

[0145] During a specific time period of pipeline operation, multiple third water quality parameter values ​​at key nodes of the water supply and drainage pipeline are periodically acquired according to the preset time.

[0146] For each acquired third water quality parameter value, the following operations are performed: each third water quality parameter value is reconstructed to obtain the corresponding first water quality parameter reconstruction value; the current first reconstruction difference value of water quality is calculated based on each third water quality parameter value and the corresponding first water quality parameter reconstruction value, and the first timestamp of the calculation of the current first reconstruction difference value is recorded.

[0147] Based on the total value of all reconstruction differences calculated within the at least one pipeline operation cycle, and the corresponding first timestamp, a standardized periodic disturbance profile is generated.

[0148] The steps described above, which involve calculating the current total reconstructed difference of water quality based on each water quality parameter value and its corresponding reconstructed value, and then calculating the current cumulative anomaly value of water quality based on the current total reconstructed difference and a preset time decay factor, specifically include:

[0149] The current total reconstructed difference of water quality is calculated based on each water quality parameter value and the corresponding reconstructed water quality parameter value, and the second timestamp for calculating the current total reconstructed difference is recorded.

[0150] Based on the second timestamp, find the first total reconstruction difference value corresponding to the first timestamp that is aligned with the periodic interference profile;

[0151] Subtract the found first reconstruction difference value from the current total reconstruction difference value to obtain the residual difference value;

[0152] The current cumulative value of water quality abnormalities is calculated based on the residual difference value and the preset time decay factor.

[0153] One pipeline operation cycle refers to the time interval between the start times of two adjacent pipeline operations.

[0154] Specifically, when there are periodic network operations in the water supply and drainage network system, such as regular valve switching, pump station start-up and shutdown, or network flushing, these operations will regularly affect the measured values ​​of water quality parameters, causing them to deviate from the normal correlation. To eliminate the impact of this periodic interference, a baseline for periodic interference needs to be established before routine water quality parameter acquisition. The process of establishing this baseline includes: under normal water quality conditions within the water supply and drainage network, periodically acquiring multiple third water quality parameter values ​​at key nodes of the water supply and drainage network within at least one complete network operation cycle. For example, if the network operation cycle is 24 hours, water quality parameters need to be acquired continuously for at least 24 hours. For each acquired third water quality parameter value, it will be reconstructed to obtain a first water quality parameter reconstruction value corresponding to each third water quality parameter value. Subsequently, based on each third water quality parameter value and its corresponding first water quality parameter reconstruction value, the current first reconstruction difference value of the water quality is calculated, and the first timestamp when the difference value is calculated is recorded. By repeating this process over at least one network operation cycle, a series of total remodeling differences generated under normal periodic operation and their corresponding timestamps can be collected. Based on this collected data, a standardized periodic disturbance profile can be generated. This profile essentially describes the typical impact pattern of periodic operation on water quality parameter remodeling differences at different time points (relative to the start of the network operation cycle). For example, it could be a time series curve representing the expected total remodeling difference at different stages of the network operation cycle.

[0155] In actual anomaly detection, when real-time water quality parameter values ​​are acquired and the current total reconstructed difference value of the water quality is calculated, a second timestamp for calculating this total difference value is recorded. Subsequently, using this second timestamp, the first total reconstructed difference value corresponding to the first timestamp aligned with its time is found from a pre-generated periodic disturbance profile. This found first total reconstructed difference value represents the expected reconstructed difference caused by normal periodic pipeline operations at the current time point. Next, the first total reconstructed difference value found in the periodic disturbance profile is subtracted from the real-time calculated current total reconstructed difference value to obtain a residual difference value. This residual difference value reflects the actual degree of water quality deviation after excluding the influence of periodic disturbances. Finally, based on this residual difference value and a preset time decay factor, the current cumulative anomaly value of the water quality is calculated. Here, a pipeline operation cycle can be understood as the time interval between the start times of two adjacent identical pipeline operations (e.g., two valve openings or closings).

[0156] This application's solution effectively addresses the false alarm problem that may arise in basic solutions during periodic pipeline operations by introducing a periodic disturbance profile. Specifically, under normal pipeline water quality and periodic operation conditions, the reconstructed differences in water quality parameters exhibit a regular fluctuation pattern. By collecting and analyzing these reconstructed differences over at least one pipeline operation cycle, a "periodic disturbance profile" representing this regular fluctuation can be constructed. This profile captures the expected deviations caused by normal operation, rather than actual water quality anomalies. In subsequent real-time monitoring, when the total reconstructed difference of the current water quality parameters is calculated, it is no longer directly used for calculating the anomaly accumulation value. Instead, the reconstructed difference expected to occur at the current time point, as indicated by the periodic disturbance profile, is first subtracted from this total value. The resulting residual difference value eliminates the influence of periodic operation and more accurately reflects the true degree of anomaly in the water quality parameters. This approach ensures that only deviations of water quality parameters exceeding the normal fluctuation range caused by periodic operation are included in the anomaly accumulation value, thereby avoiding false alarms caused by normal operation.

[0157] This application further proposes that, after generating a standardized periodic disturbance profile based on the total value of all reconfiguration differences calculated within at least one pipeline operation cycle and the corresponding first timestamp, the following steps are also included:

[0158] The following operations are performed periodically according to a preset second time period:

[0159] During a specific time period of pipeline operation, multiple fourth water quality parameter values ​​at key nodes of the water supply and drainage pipeline are periodically acquired according to the preset time.

[0160] For each acquired fourth water quality parameter value, the following operations are performed: each fourth water quality parameter value is reconstructed to obtain the corresponding second water quality parameter reconstruction value; based on each fourth water quality parameter value and the corresponding second water quality parameter reconstruction value, the current second reconstruction difference value of the water quality is calculated, and the third timestamp for calculating the current second reconstruction difference value is recorded.

[0161] The periodic disturbance profile is calibrated based on the total value of all second reconstruction differences calculated within the specific time period and the corresponding third timestamp.

[0162] Specifically, the preset second time periodicity refers to the time interval used to calibrate the periodic interference profile. This interval can be set according to the stability of the actual pipeline network operation, the frequency of water quality changes, and the requirements for detection accuracy. For example, it can be monthly, quarterly, or semi-annually. Its purpose is to ensure that the periodic interference profile can reflect the latest status of the pipeline network operation in a timely manner, avoiding the accumulation of deviations caused by environmental or operational changes. The process of obtaining the fourth water quality parameter value, reconstructing it to obtain the second water quality parameter reconstruction value, calculating the current total second reconstruction difference value, and recording the third timestamp is similar to the process of obtaining the third water quality parameter value, reconstructing it, calculating the first total reconstruction difference value, and recording the first timestamp when generating the initial periodic interference profile. Its purpose is to obtain the latest data for calibration. In practical applications, calibrating the periodic interference profile can be understood as updating or adjusting the original periodic interference profile based on the newly obtained second total reconstruction difference value and the third timestamp.

[0163] The proposed solution effectively addresses the problem that the periodic disturbance profile in the basic scheme may become inaccurate over time by introducing a periodic calibration mechanism.

[0164] Through the above technical solution, this application can significantly improve the accuracy and robustness of water quality anomaly detection in water supply and drainage systems. Because the periodic disturbance profile can be calibrated and updated regularly, its matching degree with the actual pipeline network operation is continuously maintained, effectively avoiding false alarms or missed alarms caused by profile inaccuracies. This enables the system to more accurately identify true latent water quality anomalies, improving the reliability of early warnings, which is of great significance for ensuring the safe and stable operation of water supply and drainage systems.

[0165] This application further proposes a method for detecting water quality anomalies in water supply and drainage in mixed water source scenarios. By reverse-calculating the estimated values ​​of water quality parameters of pure water sources and judging their own coordination, water quality anomalies can be identified more accurately.

[0166] When the water supply source for water supply and drainage is a mixture of two or more water sources with different water quality characteristics, the steps described above for periodically obtaining multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time period specifically include:

[0167] The system periodically acquires multiple water quality parameter values ​​at key nodes of the water supply and drainage network, as well as the mixing ratio of the current mixed water sources within the water supply and drainage network, based on a preset time period.

[0168] The mixing ratio value of the mixed water source refers to the volume or flow percentage of each pure water source in the mixed water. These mixing ratio values ​​can be obtained in various ways. For example, by installing flow meters or proportional valves at the confluence of the pure water sources to monitor and record the water supply flow of each source in real time, and then calculating the mixing ratio; or, they can be estimated using a preset scheduling plan or historical data. The purpose of obtaining the mixing ratio value is to provide the necessary data foundation for subsequent reverse calculation of the estimated water quality parameters of each pure water source.

[0169] The step of obtaining multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time period also includes:

[0170] Based on the multiple water quality parameter values ​​and the mixing ratio value, the estimated value of each water quality parameter of each pure water source in the current mixed water source is calculated in reverse.

[0171] Specifically, reverse engineering can be understood as using the total water quality parameters of the mixed water and the known mixing ratio, combined with the principle of mass conservation or a linear superposition model, to calculate the water quality parameters that each pure water source constituting the mixed water might have in its unmixed state. The estimated water quality parameters are the virtual water quality parameter values ​​of each pure water source obtained through this reverse engineering. The purpose is to decompose the complexity of the mixed water quality into the relatively independent characteristics of each pure water source, so as to facilitate subsequent anomaly detection.

[0172] Based on the pre-defined correlation between water quality parameters of each normal pure water source and the estimated value of each water quality parameter of each pure water source, it is determined whether there is any abnormality in the mixed water source.

[0173] If an anomaly is detected, an alarm message will be generated and issued specifying the type of pure water source that caused the anomaly.

[0174] The specific steps for determining whether the mixed water source is abnormal, based on the preset correlation between water quality parameters of various normal pure water sources and the estimated value of each water quality parameter of each pure water source, include:

[0175] For each type of purified water source, determine whether the estimated values ​​of each water quality parameter in the corresponding purified water source conform to the preset correlation relationship of water quality parameters of normal purified water source;

[0176] If it does not meet the requirements, the estimated values ​​of each water quality parameter of the corresponding pure water source are reconstructed to obtain the reconstructed estimated values ​​of each water quality parameter.

[0177] Based on the estimated value and the reconstructed value of each water quality parameter, calculate the degree of self-coordination deviation of the corresponding pure water source;

[0178] If the degree of deviation of its own coordination reaches or exceeds the preset limit value, it is determined that there is an abnormality in the mixed water source.

[0179] The pre-defined correlation between water quality parameters of various normal purified water sources refers to the inherent and stable statistical or physicochemical correlation patterns between different water quality parameters within a purified water source under normal conditions. This correlation can be obtained through historical data analysis and training machine learning models (such as autoencoders and principal component analysis) to describe the "normal" state of the purified water source. To determine whether the correlation is met, the estimated values ​​of the purified water source's water quality parameters can be input into the pre-trained model, and the reconstruction error or degree of deviation can be observed.

[0180] If it does not meet the requirements, it indicates that there is an abnormal deviation in the coordination of the internal water quality parameters of the pure water source.

[0181] At this point, the estimated values ​​of each water quality parameter of the corresponding pure water source are reconstructed to obtain the reconstructed value of the water quality parameter estimate for each water quality parameter estimate. The principle is similar to that of reconstructing the mixed water quality parameters mentioned above, aiming to capture the inherent correlation of the internal parameters of the pure water source.

[0182] The degree of deviation of self-coordination is an indicator that measures the difference between the actual estimated value and the reconstructed value of a pure water source. For example, it can be calculated by the sum of squared differences or Euclidean distance. The larger the value, the greater the degree of deviation of the internal water quality parameters of the pure water source from the normal state.

[0183] The preset threshold value is a threshold used to judge abnormalities. When the degree of deviation of the self-coordination reaches or exceeds the threshold value, it is considered that the pure water source is abnormal, and thus the entire mixed water source system is judged to be abnormal. This threshold value can be set based on historical data, expert experience, or statistical methods.

[0184] This application's solution decomposes the complex water quality characteristics of a mixed water source into the independent characteristics of each pure water source by introducing a mixing ratio value and performing reverse calculation. Since the water quality parameters of the mixed water source are a linear combination of the water quality parameters of its constituent pure water sources, by obtaining the mixing ratio value, it is possible to effectively reverse calculate the estimated water quality parameters of each pure water source under the current mixing state. This decomposition allows the judgment of water quality anomalies to no longer be limited by the dynamic changes in the mixing ratio, but rather focuses on the intrinsic quality of each pure water source itself.

[0185] Subsequently, by determining whether the estimated water quality parameters of each pure water source conform to its preset normal correlation and calculating its own degree of coordination deviation, this application is able to identify which pure water source has an abnormal internal water quality characteristic.

[0186] This method can effectively distinguish between normal fluctuations caused by changes in the mixing ratio of water sources and water quality problems caused by pollution or abnormalities in a pure water source itself. This avoids the false alarms or missed alarms that may occur in mixed water source scenarios using traditional methods, and improves the accuracy and targeting of anomaly detection.

[0187] Through the above technical solution, this application effectively addresses the problem that traditional methods struggle to accurately distinguish between normal mixing fluctuations and genuine water quality anomalies when the water supply and drainage sources consist of a mixture of various water sources with different water quality characteristics. This solution decouples the mixed water sources, reverse-calculates and evaluates the inherent coordination of each pure water source, making the detection of water quality anomalies more refined and accurate. This not only improves the sensitivity and specificity of water quality anomaly detection and reduces false alarms, but also, once an anomaly is detected, it can further pinpoint which pure water source is causing the problem. This provides crucial information for quickly locating the pollution source and implementing targeted measures, significantly improving the efficiency and reliability of water quality management in water supply and drainage networks.

[0188] In the embodiments of this application, the understanding and specific implementation of the concepts such as "water quality parameter value", "reconstructed water quality parameter value", "total reconstruction difference value", "time decay factor", "abnormal cumulative value" and "continuous abnormal threshold" can refer to the content already recorded in the above embodiments, and will not be repeated here.

[0189] Specifically, when a water supply and drainage system contains two or more pure water sources with different water quality characteristics (e.g., surface water, groundwater, reclaimed water, etc.), traditional water quality anomaly detection methods may be unable to accurately determine the source of the anomaly or identify hidden anomalies after mixing.

[0190] Therefore, this application, while periodically acquiring multiple water quality parameter values ​​at key nodes of the water supply and drainage network, also acquires the mixing ratio value of the current mixed water sources within the water supply and drainage network. This mixing ratio value can be obtained in various ways, such as by real-time calculation through monitoring flow meter data of different water sources entering the mixing point; or by estimation through a preset scheduling plan or historical operating data; or by indirect calculation by setting specific sensors (such as conductivity sensors, if the conductivity of different water sources differs significantly) at the mixing point.

[0191] After obtaining the mixed water quality parameter values ​​and mixing ratio values, this application uses this information to reverse-engineer the estimated values ​​of each water quality parameter of each pure water source in the current mixed water source. This reverse-engineering can be achieved using various mathematical methods such as linear regression, least squares method, or models based on physicochemical equilibrium equations. Its purpose is to decompose the complexity of the mixed water quality into an analysis of its constituent pure water sources, thereby enabling targeted assessment of potential anomalies in each pure water source.

[0192] Subsequently, this application will determine whether there is any abnormality in the mixed water source based on the preset correlation of water quality parameters of each normal pure water source and the estimated value of each water quality parameter of each pure water source.

[0193] If the judgment result shows a discrepancy, meaning that there are deviations between the estimated water quality parameters of a certain pure water source and their normal correlation, the system will reconstruct the estimated value of each water quality parameter for the corresponding pure water source, obtaining a reconstructed estimated value for each water quality parameter. This reconstruction is similar to the reconstruction of actual measured values ​​in the above implementation, but its input is the estimated pure water source parameters.

[0194] After obtaining the estimated and reconstructed values ​​of each water quality parameter, the system calculates the degree of deviation of the corresponding pure water source's self-coordination. This value quantifies the degree of deviation between the estimated parameters of the pure water source and its normal correlation pattern.

[0195] When the degree of deviation from its own coordination reaches or exceeds a preset threshold, the system determines that there is an anomaly in the mixed water source. This threshold is set based on historical data and expert experience to distinguish between normal fluctuations and potential anomalies. If an anomaly is found, the system will generate and issue an alarm message indicating the type of pure water source causing the anomaly.

[0196] This application further proposes a system for detecting abnormal water quality in water supply and drainage, see [link to relevant documentation]. Figure 2 It includes: an acquisition module 1, a calling module 2, a reconstruction module 3, a calculation module 4, and an alarm module 5. The acquisition module 1 is used to periodically acquire multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time. The calling module 2 is used to sequentially call the following modules to perform relevant operations for each acquired water quality parameter value. The reconstruction module 3 is used to reconstruct each water quality parameter value to obtain the corresponding reconstructed water quality parameter value. The calculation module 4 is used to calculate the current total reconstructed difference of the water quality based on each water quality parameter value and its corresponding reconstructed value, and to calculate the current cumulative anomaly value of the water quality based on the current total reconstructed difference value and a preset time decay factor. The alarm module 5 is used to generate and issue an alarm message indicating a hidden water quality anomaly if the current cumulative anomaly value reaches a preset continuous anomaly threshold.

[0197] The water quality anomaly detection system proposed in this application is the same system as the water quality anomaly detection method provided above. The operation process of each module is the same as the operation process of the corresponding steps of the above water quality anomaly detection method, and the beneficial technical effects are the same. Therefore, each module will not be described in detail here.

[0198] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for detecting abnormal water quality in water supply and drainage, characterized in that, include: Multiple water quality parameter values ​​at key nodes of the water supply and drainage network are acquired periodically according to a preset time period. For each set of multiple water quality parameter values ​​acquired, the following operations should be performed: Each water quality parameter value is reconstructed separately to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value; Based on each water quality parameter value and the corresponding reconstructed water quality parameter value, calculate the current total reconstructed difference value of the water quality. Based on the current total reconstructed difference value and the preset time decay factor, calculate the current cumulative anomaly value of the water quality. If the current cumulative abnormal value reaches the preset continuous abnormal threshold, an alarm message indicating that there is a hidden abnormality in the water quality will be generated and issued. The method for detecting abnormal water quality in water supply and drainage also includes: Under normal water quality conditions within the water supply and drainage network, multiple sets of first water quality parameter values ​​are obtained in chronological order. Based on the multiple sets of first water quality parameter values, establish the normal relationship between the water quality parameters; The weight coefficients within the preset reconstruction mapping function are initialized based on the normal relationship. The step of reconstructing each water quality parameter value to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value specifically includes: Each obtained water quality parameter value is input into the reconstruction mapping function; The reconstruction mapping function is invoked to compress each water quality parameter value into a low-dimensional data value according to preset mathematical operation rules; Based on the weighting coefficients and the preset reverse mathematical operation rules, each low-dimensional data value is reconstructed to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value. The steps of calculating the current total reconstructed difference of water quality based on each water quality parameter value and the corresponding reconstructed water quality parameter value, and calculating the current cumulative anomaly value of water quality based on the current total reconstructed difference value and a preset time decay factor, specifically include: For each water quality parameter value, calculate the corresponding reconstructed difference value: Reconstructed difference value = (Water quality parameter value - Reconstructed water quality parameter value) 2 The reconstructed difference values ​​corresponding to each water quality parameter value are summed to calculate the current total reconstructed difference value of the water quality. Based on the current total reconstructed difference value and the preset time decay factor, calculate the current cumulative anomaly value of the water quality. Current cumulative anomaly value = (cumulative anomaly value) 上一次 ×Time decay factor) + Current total reconstruction difference; Abnormal cumulative value 上一次 This is the current cumulative abnormal value obtained from the previous calculation.

2. The method for detecting abnormal water quality in water supply and drainage according to claim 1, characterized in that, Also includes: The following operations will be performed periodically according to the preset time: Under normal water quality conditions within the water supply and drainage network, multiple sets of secondary water quality parameter values ​​were obtained. Based on the multiple sets of second water quality parameter values, a first normal relationship is established between the water quality parameters; The weight coefficients within the reconstructed mapping function are calibrated based on the first normal relationship.

3. The method for detecting abnormal water quality in water supply and drainage according to claim 1 or 2, characterized in that, After the step of reconstructing each water quality parameter value to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value, the method further includes: Record the reconstructed difference value corresponding to each water quality parameter value, as well as the timestamp for calculating the reconstructed difference value; The step of generating and issuing an alarm message indicating a hidden water quality anomaly also includes: Based on the magnitude of the reconstructed difference value corresponding to each recorded water quality parameter value and the corresponding timestamp, the combination of water quality parameters that leads to the hidden anomaly in water quality is determined.

4. The method for detecting abnormal water quality in water supply and drainage according to claim 1, characterized in that, When there is a periodic operation in the water supply and drainage network system that causes a regular deviation in the correlation of water quality parameters, the step of periodically obtaining multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time period also includes: Under normal water quality conditions within the water supply and drainage network, the following operations shall be performed within at least one network operation cycle: Within a preset time period for pipeline operation, multiple third water quality parameter values ​​at key nodes of the water supply and drainage pipeline are periodically acquired according to the preset time. For each acquired third water quality parameter value, the following operations are performed: each third water quality parameter value is reconstructed to obtain the corresponding first water quality parameter reconstruction value; the current first reconstruction difference value of water quality is calculated based on each third water quality parameter value and the corresponding first water quality parameter reconstruction value, and the first timestamp of the calculation of the current first reconstruction difference value is recorded. Based on the total value of all reconstruction differences calculated within at least one pipeline operation cycle, and the corresponding first timestamp, a standardized periodic interference profile is generated. The steps of calculating the current total reconstructed difference of water quality based on each water quality parameter value and the corresponding reconstructed water quality parameter value, and calculating the current cumulative anomaly value of water quality based on the current total reconstructed difference value and a preset time decay factor, specifically include: The current total reconstructed difference of water quality is calculated based on each water quality parameter value and the corresponding reconstructed water quality parameter value, and the second timestamp for calculating the current total reconstructed difference is recorded. Based on the second timestamp, find the first total reconstruction difference value corresponding to the first timestamp aligned with the periodic interference profile; Subtract the found first reconstruction difference value from the current total reconstruction difference value to obtain the residual difference value; The current cumulative value of water quality abnormalities is calculated based on the residual difference value and the preset time decay factor.

5. The method for detecting abnormal water quality in water supply and drainage according to claim 4, characterized in that, After generating a standardized periodic disturbance profile based on the total value of all reconstruction differences calculated within the at least one pipeline operation cycle and the corresponding first timestamp, the method further includes: The following operations are performed periodically according to a preset second time period: Within a preset time period for pipeline operation, multiple fourth water quality parameter values ​​at key nodes of the water supply and drainage pipeline are periodically acquired according to the preset time. For each acquired fourth water quality parameter value, the following operations are performed: each fourth water quality parameter value is reconstructed to obtain the corresponding second water quality parameter reconstruction value; based on each fourth water quality parameter value and the corresponding second water quality parameter reconstruction value, the current second reconstruction difference value of the water quality is calculated, and the third timestamp for calculating the current second reconstruction difference value is recorded. The periodic interference profile is calibrated based on the total value of all second reconstruction differences calculated within the preset time period and the corresponding third timestamp.

6. The method for detecting abnormal water quality in water supply and drainage according to claim 1, characterized in that, When the water supply source for water supply and drainage is a mixture of two or more water sources with different water quality characteristics, the step of periodically obtaining multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time period specifically includes: The system periodically acquires multiple water quality parameter values ​​at key nodes of the water supply and drainage network, as well as the mixing ratio of the current mixed water sources within the water supply and drainage network, based on a preset time period. The step of obtaining multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time period also includes: Based on the multiple water quality parameter values ​​and the mixing ratio value, the estimated water quality parameter value of each water quality parameter of each pure water source in the current mixed water source is calculated in reverse; Based on the preset correlation of water quality parameters of each normal pure water source and the estimated value of each water quality parameter of each pure water source, determine whether there is any abnormality in the mixed water source; If an anomaly is detected, an alarm message will be generated and issued specifying the type of pure water source that caused the anomaly.

7. The method for detecting abnormal water quality in water supply and drainage according to claim 6, characterized in that, Based on the pre-defined correlation between water quality parameters of various normal pure water sources and the estimated values ​​of each water quality parameter of each pure water source, the specific steps for determining whether there is an anomaly in the mixed water source include: For each type of purified water source, determine whether the estimated values ​​of each water quality parameter in the corresponding purified water source conform to the preset correlation relationship of water quality parameters of normal purified water source; If it does not meet the requirements, the estimated values ​​of each water quality parameter of the corresponding pure water source are reconstructed to obtain the reconstructed estimated values ​​of each water quality parameter. Based on the estimated value and the reconstructed value of each water quality parameter, calculate the degree of self-coordination deviation of the corresponding pure water source; If the degree of deviation of its own coordination reaches or exceeds the preset limit value, it is determined that there is an abnormality in the mixed water source.

8. A water quality anomaly detection system for water supply and drainage, used in the water quality anomaly detection method for water supply and drainage as described in any one of claims 1 to 7, characterized in that, include: The acquisition module is used to periodically acquire multiple water quality parameter values ​​at key nodes of the water supply and drainage network according to a preset time. The calling module is used to sequentially call the following modules to perform relevant operations for each set of multiple water quality parameter values ​​obtained; The reconstruction module is used to reconstruct each water quality parameter value separately to obtain the reconstructed water quality parameter value corresponding to each water quality parameter value. The calculation module is used to calculate the current total value of water quality reconstruction difference based on each water quality parameter value and the corresponding reconstructed water quality parameter value, and to calculate the current cumulative value of water quality anomalies based on the current total value of reconstruction difference and the preset time decay factor. The alarm module is used to generate and issue an alarm message indicating that there is a hidden abnormality in the water quality if the current cumulative abnormal value reaches a preset continuous abnormality threshold.

Citation Information

Patent Citations

  • Water quality abnormal event identification and early warning method based on pipe network water quality spatio-temporal data

    CN115470850A

  • Pollution traceability system and method based on water quality and water quantity monitoring and analysis of drainage system

    CN119959494A