Water supply and drainage water quality anomaly detection method and system
By periodically obtaining water quality parameter values in the water supply and drainage network and performing reconstruction difference calculations, the intrinsic correlation changes of water quality parameters are identified, which solves the problem of the inability to identify hidden anomalies in existing technologies and achieves timely discovery and effective early warning of potential water quality risks.
Patent Information
- Application Number
- CN202511252589.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-09-03
AI Technical Summary
The existing water quality monitoring system of urban water supply and drainage networks cannot effectively identify hidden abnormal conditions caused by unknown pollutants, resulting in the failure to timely discover potential water quality risks.
By periodically obtaining the water quality parameter values of key nodes in the water supply and drainage network, reconstructing and calculating the differences, and using the total reconstructed difference value and the accumulated abnormal value to identify the inherent correlation changes of multiple water quality parameters, implicit abnormality alarms are generated.
It improves the sensitivity and accuracy of water quality anomaly detection, timely discovers potential water quality risks, avoids the cover-up of "systemic normality", and enhances the early warning capability of water quality monitoring for water supply and drainage.
Smart Images

Figure CN120741808A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of water quality detection for water supply and drainage, and in particular to a method and system for detecting abnormal water quality for water supply and drainage. Background Art
[0002] Currently, a multi-indicator analysis system based on online monitoring equipment is widely used in water quality monitoring of urban water supply and drainage networks. This system typically relies on independent monitoring of key physical and chemical indicators in the water (such as pH, turbidity, residual chlorine, and conductivity), and uses preset single thresholds to identify anomalies. If the real-time measurement value of any indicator exceeds its set normal range, the system will issue an alarm, prompting operations and maintenance personnel to intervene. This mechanism has demonstrated excellent responsiveness in identifying sudden events caused by specific pollutants that result in drastic changes in a single indicator.
[0003] However, with the increasing complexity of industrial production and domestic emissions, new pollutants have emerged in water bodies that are not included in routine monitoring lists. These pollutants may have unique properties: at low concentrations, they will not directly cause the readings of any single monitoring indicator to exceed existing independent alarm thresholds. However, they may undergo slow physical and chemical reactions with existing substances in the water, thereby causing small, persistent, and inherently physically correlated fluctuations in at least two or more monitoring indicators.
[0004] Because the existing monitoring logic operates in parallel and independently, lacking the ability to analyze deep correlations between indicators, it is unable to effectively identify these "hidden anomalies" caused by unknown contaminants. 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 display "normal," the system's final comprehensive assessment also indicates "normal water quality." This masking of "systemic normality" prevents potential water quality risks from being detected promptly. For example, biofilm formation may develop in terminal areas of the pipe network due to reduced residual chlorine disinfection effectiveness. However, the existing monitoring system cannot directly detect biofilm formation, nor can it understand that a slight decrease in residual chlorine readings and a slight increase in conductivity readings, two seemingly unrelated events within normal ranges, are actually caused by the same unknown physical and chemical process. The entire water quality assurance system is trapped in a "hidden anomaly" caused by unknown contaminants, undetectable by existing detection logic.
[0005] In view of the above problems, the existing technology is in urgent need of improvement. Summary of the Invention
[0006] This application discloses a method and system for detecting water quality anomalies in water supply and drainage, which aims to solve the problem that the existing urban water supply and drainage network water quality monitoring system is unable to effectively identify the "hidden anomaly" state caused by unknown pollutants, that is, when new pollutants appear in the water body, causing multiple monitoring indicators to produce small, continuous and inherently physically correlated fluctuations, but a single indicator does not exceed the independent alarm threshold, the system is unable to timely detect potential water quality risks.
[0007] The technical solution of this application is as follows: In a first aspect, the present application discloses a method for detecting abnormal water quality in water supply and drainage, comprising: Periodically obtain multiple water quality parameter values at key nodes of the water supply and drainage network according to preset time; For each of the multiple water quality parameter values obtained, perform the following operations: Reconstruct each water quality parameter value separately to obtain a water quality parameter reconstruction value corresponding to each water quality parameter value; Calculate the total value of the current reconstruction difference of the water quality based on each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculate the current abnormal cumulative value of the water quality based on the current reconstruction difference total value and the preset time decay factor; If the current abnormal accumulation value reaches the preset continuous abnormality threshold, an alarm message indicating that there is a hidden abnormality in the water quality will be generated and issued.
[0008] Through this technical solution, water quality parameters can be reconstructed and the reconstruction differences can be calculated, thereby accumulating outliers, effectively identifying hidden water quality anomalies that are difficult to detect with traditional monitoring methods and are caused by slight correlation changes in multiple water quality parameters. This overcomes the limitations of independent judgment of a single indicator in existing technologies and improves the sensitivity and accuracy of water quality anomaly detection.
[0009] Furthermore, the present application also discloses a method for detecting abnormal water quality in water supply and drainage, comprising: Under normal water quality conditions in the water supply and drainage network, multiple sets of first water quality parameter values are obtained in chronological order; establishing a normal relationship between the water quality parameters based on the plurality of sets of first water quality parameter values; Initializing the weight coefficients in the preset reconstruction mapping function according to the normal relationship; The steps of reconstructing each water quality parameter value to obtain the water quality parameter reconstructed value corresponding to each water quality parameter value specifically include: Input each acquired water quality parameter value into the reconstruction mapping function; Call the reconstruction mapping function to compress each water quality parameter value into a low-dimensional data value according to the preset mathematical operation rules; According to the weight coefficient and the preset reverse mathematical operation rules, each low-dimensional data value is reconstructed and calculated to obtain the water quality parameter reconstruction value corresponding to each water quality parameter value.
[0010] Through this technical solution, normal water quality data can be used to establish a normal relationship between water quality parameters, and the weight coefficients of the reconstruction mapping function can be initialized accordingly, so that the reconstruction process can 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.
[0011] On this basis, this application further proposes a method for detecting abnormal water quality in water supply and drainage, which also includes: The following operations are performed periodically according to the preset first time: Under normal water quality conditions in the water supply and drainage network, multiple sets of second water quality parameter values are obtained; establishing a first normal relationship between the water quality parameters based on the plurality of sets of second water quality parameter values; The weight coefficients in the reconstruction mapping function are calibrated according to the first normal relationship.
[0012] Through this technical solution, normal water quality data can be periodically obtained and the weight coefficients of the reconstructed mapping function can be calibrated, ensuring that the model can adapt to long-term changes in the water quality environment and maintain its accurate identification ability of the correlation between normal water quality parameters, thereby effectively avoiding false alarms or missed alarms due to environmental changes and further improving the robustness of the detection system.
[0013] In some preferred embodiments, the present application discloses a method for detecting abnormal water quality in water supply and drainage, wherein the steps of calculating the total value of the current reconstruction difference of the water quality based on each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculating the current abnormal cumulative value of the water quality based on the current reconstruction difference total value and a preset time decay factor specifically include: Calculate the corresponding reconstruction difference value for each water quality parameter value. Reconstruction difference value = (water quality parameter value - water quality parameter reconstruction value) 2 , accumulate the reconstruction difference values corresponding to each water quality parameter value to calculate the total reconstruction difference value of the water quality; Based on the current reconstructed difference total value and the preset time decay factor, the current abnormal cumulative value of water quality is calculated: the current abnormal cumulative value = (the last abnormal cumulative value × the time decay factor) + the current reconstructed difference total value; the last abnormal cumulative value is the current abnormal cumulative value obtained by the last calculation; wherein the time decay factor is less than 1.
[0014] Through this technical solution, the difference value can be reconstructed and accumulated through square difference calculation, and then the abnormal cumulative value can be calculated in combination with the time attenuation factor, so that the system can effectively capture and accumulate small, continuous abnormal signals. At the same time, the attenuation factor is used to give higher weight to recent data, thereby improving the early warning capability of hidden anomalies and avoiding misjudgment caused by instantaneous fluctuations.
[0015] As a technical improvement, the present application also discloses a method for detecting abnormal water quality in water supply and drainage, wherein each water quality parameter value is reconstructed separately, and after the step of obtaining the water quality parameter reconstructed value corresponding to each water quality parameter value, the method further includes: Record the reconstructed difference value corresponding to each water quality parameter value and the timestamp of calculating the reconstructed difference value; The step of generating and issuing an alarm message indicating that water quality has hidden anomalies also includes: According to the size of the reconstructed difference value corresponding to each recorded water quality parameter value and the corresponding timestamp, the water quality parameter combination that causes the hidden abnormality in water quality is determined.
[0016] This technical solution enables the precise location of the specific combination of water quality parameters that causes hidden anomalies by recording and reconstructing difference values and timestamps, and further analyzing these data when an alarm is triggered. This provides clear troubleshooting directions for operation and maintenance personnel, significantly improving the efficiency and accuracy of anomaly location.
[0017] In one embodiment, the present application discloses a method for detecting abnormal water quality in water supply and drainage, wherein, when a water supply and drainage network system has a periodic network operation that causes a deviation in the regular correlation of water quality parameters, the method further includes, before 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: When the water quality in the water supply and drainage network is normal, perform the following operations within at least one network operation cycle: During a specific time period of pipe network operation, multiple third water quality parameter values at key nodes of the water supply and drainage pipe network are periodically obtained according to preset time periods; For each acquired third water quality parameter value, the following operations are performed: reconstructing each third water quality parameter value to obtain a first water quality parameter reconstructed value corresponding to each third water quality parameter value; calculating a current first reconstructed total difference value of water quality based on each third water quality parameter value and the corresponding first water quality parameter reconstructed value, and recording a first timestamp of calculating the current first reconstructed total difference value; generating a standardized periodic interference profile according to all total values of reconstruction differences calculated in at least one pipe network operation cycle and corresponding first timestamps; The steps of calculating the total value of the current reconstruction difference of the water quality according to each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculating the current abnormal cumulative value of the water quality according to the current reconstruction difference total value and a preset time decay factor specifically include: Calculating a current reconstruction difference total value of the water quality according to each water quality parameter value and the corresponding water quality parameter reconstruction value, and recording a second timestamp of calculating the current reconstruction difference total value; Searching, according to the second timestamp, from the periodic interference profile for a first reconstructed difference total value corresponding to the first timestamp aligned therewith; Subtract the first found total reconstruction difference value from the current total reconstruction difference value to obtain a residual difference value; Calculate the current abnormal accumulation value of water quality based on the residual difference value and the preset time decay factor; Among them, a pipeline network operation cycle refers to the interval between two adjacent pipeline network operation start time points.
[0018] This technical solution can identify and quantify the regular interference of periodic operations of the pipeline network on the correlation of water quality parameters, and deduct it from the real-time reconstruction difference, thereby effectively removing 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.
[0019] To improve the solution, the present application further discloses a method for detecting water quality anomalies in water supply and drainage, wherein, after the step of generating a standardized periodic interference profile based on all reconstructed difference sums calculated within at least one pipe network operation cycle and corresponding first timestamps, the method further includes: The following operations are performed periodically according to the preset second time: During a specific time period of pipe network operation, periodically obtaining a plurality of fourth water quality parameter values at key nodes of the water supply and drainage pipe network according to a preset time; For each acquired fourth water quality parameter value, the following operations are performed: reconstructing each fourth water quality parameter value to obtain a second water quality parameter reconstructed value corresponding to each fourth water quality parameter value; calculating a current second reconstructed total difference value of the water quality based on each fourth water quality parameter value and the corresponding second water quality parameter reconstructed value, and recording a third timestamp for calculating the current second reconstructed total difference value; The periodic interference profile is calibrated according to all second reconstruction difference total values calculated within a specific time period and the corresponding third timestamps.
[0020] This technical solution enables the system to adapt to slight changes or long-term drifts in the network’s operating mode by periodically acquiring new data and calibrating the periodic interference profile, thereby continuously and accurately identifying and compensating for the impact of normal operations, further improving the adaptability and accuracy of anomaly detection.
[0021] In another embodiment, the present application discloses a method for detecting abnormal water quality in water supply and drainage, wherein, when the water supply source for water supply and drainage is a mixed water source of two or more types with different water quality characteristics, the steps of periodically obtaining multiple water quality parameter values at key nodes of the water supply and drainage network according to a preset time specifically include: Periodically obtain multiple water quality parameter values at key nodes of the water supply and drainage network according to preset time periods, and obtain the mixing ratio value of the current mixed water source in the water supply and drainage network; After 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, the following steps are further included: Reversely calculate the estimated water quality parameter value of each water quality parameter of each pure water source in the current mixed water source based on multiple water quality parameter values and mixing ratio values; Determine whether the mixed water source has an abnormality based on the preset correlation between the water quality parameters of each normal pure water source and the estimated value of each water quality parameter of each pure water source; If an abnormality exists, an alarm message indicating the type of pure water source causing the abnormality is generated and issued.
[0022] To improve the solution, the present application also discloses a method for detecting abnormal water quality in water supply and drainage, wherein the steps of determining whether a mixed water source has an abnormality based on a preset correlation between water quality parameters of each normal pure water source and an estimated value of each water quality parameter of each pure water source specifically include: For each pure water source, determine whether the estimated values of each water quality parameter in the corresponding pure water source conform to the preset water quality parameter correlation relationship of a normal pure water source; If not, each water quality parameter estimation value of the corresponding pure water source is reconstructed to obtain a water quality parameter estimation reconstructed value of each water quality parameter estimation value; According to each water quality parameter estimation value and the water quality parameter estimation reconstruction value, the corresponding self-coordination deviation value of the pure water source is calculated; When the self-coordination deviation value reaches or exceeds the preset limit value, it is determined that there is an abnormality in the mixed water source.
[0023] Through this technical solution, it is possible to target complex scenarios with multiple water sources by reversely inferring the estimated water quality parameters of pure water sources, and reconstructing and judging anomalies based on the normal correlation between pure water sources, thereby effectively identifying anomalies of specific pure water sources in mixed water sources. This solves the problem of difficulty in tracing water quality anomalies in mixed water sources and improves the refined management capabilities of anomaly detection.
[0024] This application also discloses a water quality anomaly detection system for water supply and drainage, comprising: An acquisition module is used to periodically obtain 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 call the following modules in sequence to perform related operations for multiple water quality parameter values obtained each time; A reconstruction module is used to reconstruct each water quality parameter value respectively to obtain a water quality parameter reconstruction value corresponding to each water quality parameter value; a calculation module for calculating a total value of the current reconstruction difference of the water quality based on each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculating a current abnormal cumulative value of the water quality based on the current total value of the reconstruction difference and a preset time decay factor; The alarm module is used to generate and issue an alarm message indicating that there is a hidden abnormality in water quality if the current abnormal accumulation value reaches a preset continuous abnormality threshold.
[0025] Through this technical solution, a system integrating data acquisition, reconstruction, anomaly calculation and alarm functions can be provided, realizing the automated and intelligent detection of hidden anomalies in water quality of water supply and drainage, providing a reliable hardware or software carrier for practical applications, and improving the overall efficiency and response speed of water quality management.
[0026] Beneficial effects The water quality anomaly detection method disclosed in this application periodically acquires water quality parameter values at key nodes in the water supply and drainage network and reconstructs these parameters to obtain reconstructed values. Based on this, the total value of the current reconstructed water quality difference is calculated, and the current cumulative water quality anomaly value is calculated in combination with a time decay factor. When this cumulative anomaly value reaches a preset sustained anomaly threshold, the system generates and issues an alert indicating a hidden water quality anomaly. The core of this method lies in its ability to no longer rely solely on whether a single water quality indicator exceeds an independent threshold. Instead, it analyzes the inherent correlations between multiple water quality parameters, assessing the coordination between parameters through reconstruction. When a hidden water quality anomaly occurs, even if a single indicator changes slightly, its inherent correlation with other related indicators will deviate, resulting in the accumulation of reconstructed differences, which are then captured by the system. This mechanism, based on multi-indicator correlation analysis and anomaly accumulation, effectively solves the problem of existing technologies being unable to identify "hidden anomalies" caused by new pollutants, which lead to small but persistent fluctuations in the correlations between multiple indicators. Through this method, potential water quality risks can be discovered in a timely manner, avoiding the cover-up of "systemic normality", significantly improving the sensitivity and early warning capabilities of water quality monitoring in urban water supply and drainage networks, and ensuring water supply safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A flow chart of a method for detecting abnormal water quality in water supply and drainage provided in this application.
[0028] Figure 2 This is a schematic diagram of the structure of a water quality anomaly detection system for water supply and drainage provided in this application.
[0029] Figure 2 In the figure: 1 is the acquisition module, 2 is the call module, 3 is the reconstruction module, 4 is the calculation module, and 5 is the alarm module. DETAILED DESCRIPTION
[0030] The technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. The components of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for which protection is claimed, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.
[0031] This application proposes a method for detecting abnormal water quality in water supply and drainage, which includes: periodically obtaining multiple water quality parameter values at key nodes of the water supply and drainage network according to a preset time. Figure 1, perform the following operations for each of the multiple water quality parameter values obtained: S10, reconstructing each water quality parameter value to obtain a water quality parameter reconstructed value corresponding to each water quality parameter value; S20, calculating a total value of the current reconstruction difference of the water quality based on each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculating a current abnormal cumulative value of the water quality based on the current total value of the reconstruction difference and a preset time decay factor; S30: If the current abnormal accumulation value reaches the preset continuous abnormality threshold, an alarm message indicating that there is a hidden abnormality in the water quality is generated and issued.
[0032] This application aims to improve the accuracy and timeliness of water quality monitoring for water supply and drainage by analyzing the inherent correlations between water quality parameters and identifying hidden water quality anomalies that are difficult to detect with traditional methods.
[0033] The "water quality parameter values" mentioned in this application refer to quantitative data on physical, chemical, or biological indicators of water bodies, acquired in real time or periodically by various sensors or detection equipment in the water supply and drainage network. These parameters may include, but are not limited to, pH, turbidity, residual chlorine, conductivity, dissolved oxygen, redox potential, ammonia nitrogen, and total organic carbon. Each water quality parameter value represents the measurement result of that indicator at a specific point in time and at a specific network node.
[0034] A "reconstructed water quality parameter value" is a recalculated or predicted value of 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 is intended to simulate how the water quality parameter would behave under normal water quality conditions.
[0035] The "Total Reconstructed Difference" is a quantitative representation of the degree of difference between the actual water quality parameter value and the corresponding reconstructed water quality parameter value. This value reflects the degree of deviation of the current water quality parameter combination from the normal water quality parameter association pattern.
[0036] The "time decay factor" is a value between 0 and 1 that assigns different weights to the sum of historical reconstructed differences when calculating the anomaly accumulation value. Older differences are attenuated by the time decay factor, making more recent differences have a greater impact on the current anomaly accumulation value, making the system more sensitive to recent water quality changes.
[0037] The "Abnormal Cumulative Value" measures the persistence and severity of water quality anomalies. It takes into account the current total reconstructed difference value and the historical total reconstructed difference value, and incorporates a time decay factor. This value reflects the cumulative effect of water quality anomalies. Even if each deviation is small, if it continues, the abnormal cumulative value will gradually increase.
[0038] The "continuous abnormality threshold" is a preset critical value. When the accumulated abnormality value reaches or exceeds this threshold, the system will determine that there is a hidden abnormality in the water quality and trigger an alarm.
[0039] The application is typically implemented in an urban water supply and drainage network, encompassing both water supply and drainage. Various online water quality monitoring devices are deployed at key points in the network, such as water plant outlets, pumping stations, important user interfaces, and network terminals. These devices periodically collect the aforementioned water quality parameters and transmit the data to a central data processing platform for analysis.
[0040] The core of the water quality anomaly detection method for water supply and drainage in this application is to identify hidden water quality anomalies that are difficult to detect with traditional methods through reconstruction of water quality parameters and cumulative analysis of differences.
[0041] Specifically, after obtaining multiple water quality parameter values at key nodes of the water supply and drainage network, the system will reconstruct each water quality parameter value. For example, a statistical model (such as a multivariate linear regression model, a principal component analysis model) or a machine learning model (such as a neural network, a support vector machine) trained based on historical data can be used to establish a normal correlation 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 using the model, or other water quality parameters can be used as input to predict the reconstructed value of the current water quality parameter. For example, based on historical data, a normal correlation model between residual chlorine and turbidity and pH value can be established. When new residual chlorine, turbidity, and pH values are obtained, turbidity and pH values can be used to predict the reconstructed value of residual chlorine.
[0042] After obtaining the water quality parameter reconstruction value corresponding to each water quality parameter value, the system will calculate the total value of the current reconstruction difference of the water quality. One calculation method is to calculate the square difference between each water quality parameter value and the corresponding water quality parameter reconstruction value, and then add up the square differences of all water quality parameters to obtain the total value of the current reconstruction difference. For example, if there are parameters A, B, and C, and their reconstruction values are A', B', and C' respectively, then the total value of the current reconstruction difference can be calculated as (A-A') 2 +(B-B') 2 +(C-C') 2 .
[0043] Then, the current abnormal accumulation value of water quality is calculated based on the total value of the current reconstruction difference and the preset time decay factor. For example, the calculation can be performed using the exponential weighted moving average (EWMA). Assuming that the abnormal accumulation value obtained in the last calculation is "abnormal accumulation value 上一次 ", then the current abnormal cumulative value can be calculated as: (abnormal cumulative value 上一次× time decay factor) + the total value of the current reconstruction difference. The time decay factor is a positive number less than 1, such as 0.9. This calculation method makes the most recent reconstruction differences have a greater impact on the cumulative anomaly value, while the influence of older differences gradually decreases, thereby promptly reflecting the latest changes in water quality.
[0044] Finally, the system compares the calculated current cumulative abnormality value with a preset persistent abnormality threshold. If the current cumulative abnormality value reaches or exceeds the threshold, it indicates a persistent, cumulative, hidden abnormality in the water quality, and the system generates and issues an alarm. For example, the alarm message may include the time and location of the abnormality, the magnitude of the cumulative abnormality value, and prompt operations and maintenance personnel to conduct further investigation and resolution.
[0045] The water quality anomaly detection method for water supply and drainage of the present application obtains the expected value under normal circumstances by periodically obtaining the water quality parameter values and reconstructing each parameter. 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. This difference may indicate a hidden change in water quality even when a single parameter does not exceed the traditional threshold. By accumulating these differences and introducing a time decay factor, the present application can effectively capture small but continuous water quality anomaly signals. When the accumulated anomaly reaches the preset threshold, the system can issue an alarm in time, thereby intervening before the water quality problem evolves into a serious incident.
[0046] Compared with the existing method that relies on independent threshold judgment of a single indicator, the advantage of this application is that it can identify small deviations from the inherent correlation between water quality parameters. By introducing the concepts of water quality parameter reconstruction, total reconstruction difference value and cumulative abnormality value, this application can effectively capture these weak but persistent abnormal signals. Even if the value of a single water quality parameter is still within the normal range, it can be identified by the system when its correlation with other parameters changes. This method can detect potential water quality risks earlier and more accurately, avoid the cover-up of "systematic normality", and thus improve the early warning capability and reliability of water quality monitoring for water supply and drainage.
[0047] This application further proposes a method for detecting abnormal water quality in water supply and drainage, which also includes: Under normal water quality conditions in the water supply and drainage network, multiple sets of first water quality parameter values are obtained in chronological order; establishing a normal relationship between water quality parameters based on the multiple sets of first water quality parameter values; Initializing the weight coefficients in the preset reconstruction mapping function according to the normal relationship; The above steps of reconstructing each water quality parameter value to obtain the water quality parameter reconstructed value corresponding to each water quality parameter value specifically include: Inputting each acquired water quality parameter value into the reconstruction mapping function; Calling the reconstruction mapping function to compress each water quality parameter value into a low-dimensional data value according to a preset mathematical operation rule; According to the weight coefficient and the preset reverse mathematical operation rules, each low-dimensional data value is reconstructed and calculated to obtain a water quality parameter reconstructed value corresponding to each water quality parameter value.
[0048] The phrase "acquiring multiple sets of first water quality parameter values in chronological order when the water quality in the water supply and drainage network is normal" refers to continuously collecting a series of water quality parameter data during the initial operation of the system or during a verified period of water quality stabilization. This data is considered to represent the water quality characteristics under normal operating conditions. For example, monitoring data for multiple water quality parameters such as pH, turbidity, residual chlorine, and conductivity can be collected over several consecutive days or weeks.
[0049] The phrase "establishing normal relationships between water quality parameters based on the multiple sets of first water quality parameter values" refers to utilizing these normal water quality data to learn and quantify the inherent correlations, patterns of variation, and normal fluctuation ranges between different water quality parameters through data analysis or machine learning methods. 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 between these multidimensional water quality parameters under normal conditions.
[0050] The "reconstruction mapping function" can be understood as a mathematical model or algorithm that compresses and reconstructs input data. Its goal is to preserve the key features of the data during compression and restore the original data as closely as possible during reconstruction. For example, this function can be a neural network model, such as an autoencoder, which consists of an encoder and a decoder.
[0051] The term "weight coefficients" refers to the parameters used within the reconstruction mapping function to adjust data conversion and mapping relationships. These parameters are determined during model training or initialization. For example, in a neural network, weight coefficients are the parameters that connect different neurons and determine how input data is processed and transformed.
[0052] The "predefined mathematical operation rules" mentioned here 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 an autoencoder, this may involve matrix multiplication and the application of activation functions (such as ReLU and Sigmoid) to map high-dimensional input data into a low-dimensional latent space.
[0053] The "low-dimensional data values" mentioned above refer to the original water quality parameter values that are compressed by the reconstruction mapping function, resulting in a lower-dimensional data representation. These low-dimensional data values typically contain the most critical and representative information in the original data while removing redundancy and noise.
[0054] The "predetermined reverse mathematical operation rules" refer to the algorithmic logic followed by the reconstruction mapping function when reconstructing low-dimensional data values into reconstructed values of water quality parameters. For example, for an autoencoder, this may involve matrix multiplication and application of activation functions in the reverse order of the compression process, mapping the low-dimensional latent representation back to the dimensional space of the original data to obtain the reconstructed value.
[0055] Initializing the weight coefficients within the pre-set reconstruction mapping function refers to pre-configuring or training the model's internal parameters using the established normal relationships before the reconstruction mapping function is officially 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 that deviate from the normal pattern during subsequent real-time detection.
[0056] The solution of the present application obtains multiple groups of first water quality parameter values under normal water quality conditions, and establishes a normal relationship between water quality parameters based on these data, thereby providing a meaningful initialization setting for the weight coefficients in the reconstruction mapping function. Thus, 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 the low-dimensional data values according to the initialized weight coefficients and the preset reverse mathematical operation rules. This method of initialization and reconstruction based on normal relationships enables the reconstruction mapping function to learn and capture the intrinsic correlation and data distribution characteristics of water quality parameters under normal conditions. When the actual water quality data deviates from these normal patterns, the reconstruction mapping function will be difficult to accurately reconstruct, resulting in an increase in the difference between the water quality parameter values and the corresponding water quality parameter reconstruction values, thereby more effectively indicating abnormal water quality.
[0057] Through the above technical solution, this application can ensure 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, allowing the subsequent calculated total reconstruction difference value to more accurately reflect the true degree of water quality anomaly. In addition, by initializing the weight coefficients, the model is prevented from starting learning from a random state, accelerating the model's convergence speed and enhancing its ability to identify hidden water quality anomalies, thereby improving the robustness and effectiveness of the entire water quality anomaly detection method for water supply and drainage.
[0058] 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 portion of the autoencoder, where a multi-layer neural network and nonlinear activation function compress the high-dimensional water quality parameter values into low-dimensional latent representations (i.e., low-dimensional data values). These low-dimensional data values are then input into the decoder portion of the autoencoder, where a reverse neural network structure and activation function are used to reconstruct them back to the dimensions of the original water quality parameters, resulting in reconstructed water quality parameter values. During this process, the autoencoder's weight coefficients 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 and deviate from the normal patterns learned during training, the autoencoder will struggle to accurately reconstruct them, resulting in large reconstruction discrepancies, indicating possible water quality anomalies. For example, if there is a linear or nonlinear correlation between pH and turbidity in normal water quality data, the autoencoder will learn this correlation during training. However, if the pH value is normal but the turbidity is abnormally elevated during actual monitoring, the autoencoder will not be able to accurately reconstruct the turbidity value based on the learned normal correlation, resulting in a large reconstruction discrepancy and prompting an alarm.
[0059] This application further proposes a method for calibrating the weight coefficients in the reconstruction mapping function, specifically including: The following operations are performed periodically according to the preset first time: Under normal water quality conditions in the water supply and drainage network, multiple sets of second water quality parameter values are obtained; establishing a first normal relationship between water quality parameters based on the multiple sets of second water quality parameter values; The weight coefficients in the reconstruction mapping function are calibrated according to the first normal relationship.
[0060] 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 based on the needs of the actual application scenario; for example, calibration can be performed daily, weekly, monthly, or quarterly. Its purpose is to ensure that the reconstructed mapping function can continuously adapt to the long-term changes in water quality in the water supply and drainage network, thereby maintaining the accuracy of anomaly detection. During the calibration operation, multiple sets of second water quality parameter values are obtained when the water quality in the water supply and drainage network is normal. "Normal water quality" here means that there are no known abnormal events in the network and the water quality parameters are within their typical fluctuation range. These second water quality parameter values serve as the basis for updating or relearning the normal relationship between water quality parameters. For example, determining whether the current water quality is normal can be achieved through manual confirmation, historical data analysis, or other auxiliary monitoring methods. Furthermore, based on the multiple sets of second water quality parameter values obtained, a first normal relationship between the water quality parameters is established. This first normal relationship can be understood as the inherent correlation pattern between the water quality parameters at the current time point or period. The method for establishing this relationship can be similar to the method 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 reconstruction mapping function are calibrated based on the established first normal relationship. The calibration process aims to adjust the parameters within the reconstruction mapping function so that it can better fit the current normal relationship of water quality. For example, if the reconstruction mapping function is implemented based on a neural network, the calibration process can be to use the backpropagation algorithm to fine-tune the network weights using new normal water quality data to minimize the reconstruction error. In this way, the reconstruction mapping function can dynamically adapt to the normal fluctuation range of water quality parameters and avoid misjudgments due to outdated models.
[0061] The solution of the present application effectively solves the problem that the weight coefficients of the reconstruction mapping function may become invalid over time by introducing a periodic calibration mechanism. Specifically, new normal water quality data are periodically acquired at a preset first time, and the first normal relationship between water quality parameters is re-established based on these data, so that the model can learn the latest normal water quality pattern. Subsequently, the weight coefficients within the reconstruction mapping function are calibrated using this new normal relationship, ensuring that the reconstruction model can always accurately capture the inherent correlation between water quality parameters. Thus, when the actual water quality parameter value is input into the reconstruction mapping function, its reconstructed value can more accurately reflect the expected value under the current normal state, so that the calculated reconstruction difference value can more realistically reflect the degree of abnormality of the water quality, avoiding false alarms or omissions due to model drift.
[0062] In some preferred embodiments, a specific example is provided below. Suppose that during the initial deployment of a water supply and drainage network system, the initial weights for the reconstruction mapping function are established using historical data. However, with the changing seasons and aging of the network, the normal fluctuation ranges and interrelationships of water quality parameters may undergo subtle changes. For example, in the summer, due to rising temperatures, the normal ranges of certain water quality parameters (such as dissolved oxygen) may decrease, while in the winter, they may increase. If the model is not adjusted, normal summer dissolved oxygen values may be mistakenly interpreted as abnormal. To address this issue, a preset first interval can be set to occur monthly. At the beginning of each month, the system automatically collects multiple sets of second water quality parameter values for a consecutive week, assuming normal water quality in the network. Based on this newly collected normal data, the system recalculates the first normal relationship between these parameters. This new first normal relationship is then used to calibrate the weight coefficients within the existing reconstruction mapping function. This periodic calibration allows the reconstruction model to adapt promptly even if the normal baseline for water quality drifts slowly, ensuring that it can always accurately distinguish normal fluctuations from true anomalies.
[0063] Specifically, the above steps of calculating the current reconstruction difference total value of water quality based on each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculating the current abnormal cumulative value of water quality based on the current reconstruction difference total value and the preset time attenuation factor can be implemented in detail as follows.
[0064] For each water quality parameter value, the corresponding reconstruction difference value is calculated. The reconstruction difference value is defined as (water quality parameter value - water quality parameter reconstruction value) 2 Then, the reconstruction difference values corresponding to each water quality parameter value are accumulated to calculate the current reconstruction difference value of the water quality. On this basis, according to the current reconstruction difference value and the preset time decay factor, the current abnormal cumulative value of the water quality is calculated. The calculation formula is: Current abnormal cumulative value = (abnormal cumulative value 上一次 × time decay factor) + total value of current reconstruction difference. Among them, the abnormal cumulative value 上一次 It refers to the current anomaly accumulation value obtained from the last calculation, and the time decay factor is set to a value less than 1.
[0065] Specifically, the reconstructed difference value is obtained by squaring the difference between the original water quality parameter value and its corresponding reconstructed water quality parameter value. The purpose of this squaring operation is to quantify the degree of deviation between the original water quality parameter value and its reconstructed value, ensure that the calculated difference value is a positive number, and amplify the impact of large deviations on the total difference. By summing the reconstructed difference values of all water quality parameters, a comprehensive indicator, namely the current reconstructed difference value of water quality, can be obtained. This value reflects the overall deviation of all water quality parameters at the current moment.
[0066] Furthermore, the calculation of the current anomaly accumulation value incorporates a time decay factor. This time decay factor, a value between 0 and 1, assigns different weights to historical anomaly accumulation values, so that more recent anomaly accumulation values have a greater impact on the current anomaly accumulation value, while older anomaly accumulation values have a gradually decreasing influence. This accumulation method ensures that even if the total reconstructed difference value at a single moment is insufficient to trigger an alarm, persistent small deviations will accumulate over time and may eventually reach the preset persistent anomaly threshold.
[0067] The solution of this application can effectively capture subtle changes and long-term trends in water quality parameters by introducing the calculation of reconstruction difference values and abnormal cumulative values. The square calculation of the reconstruction difference value ensures sensitivity to deviations in water quality parameters, and even small deviations can be quantified. The calculation of the abnormal cumulative value, especially the introduction of the time decay factor, enables the system to "memorize" and accumulate historical deviation information. Therefore, even if the instantaneous value of the water quality parameter does not exceed the conventional threshold, if its internal correlation continues to deviate, this cumulative effect will cause the abnormal cumulative value to gradually increase, thereby identifying hidden anomalies that are difficult to detect with traditional methods.
[0068] The above technical solution enables early and sensitive detection of hidden anomalies in water quality for water supply and drainage. This method not only identifies large, instantaneous fluctuations in water quality parameters, but more importantly, through the continuous accumulation and time-attenuation of reconstructed differences, it effectively detects hidden anomalies caused by subtle, persistent deviations from the inherent correlations between water quality parameters. This accumulation mechanism avoids underreporting due to subtle instantaneous fluctuations, significantly improving the accuracy and timeliness of water quality anomaly detection and providing more reliable assurance for the safe operation of water supply and drainage networks.
[0069] This application further proposes an optimization scheme, which aims to provide specific water quality parameter combination information that causes the anomaly when water quality anomaly is detected.
[0070] After the above step of reconstructing each water quality parameter value to obtain the water quality parameter reconstructed value corresponding to each water quality parameter value, the following steps are further included: Record the reconstructed difference value corresponding to each water quality parameter value and the timestamp of calculating the reconstructed difference value; After the above step of generating and issuing an alarm message indicating that there is a hidden abnormality in water quality, the following steps may also be performed: According to the size of the reconstructed difference value corresponding to each recorded water quality parameter value and the corresponding timestamp, the water quality parameter combination that causes the hidden abnormality in water quality is determined.
[0071] Specifically, each water quality parameter value is reconstructed and its reconstructed difference value is calculated (for example, reconstructed difference value = (water quality parameter value - water quality parameter reconstructed value) 2 ), the system will record and store these individual reconstructed difference values and the timestamps at which they were calculated. These records can form a historical database for subsequent query and analysis. The recording of timestamps ensures that each reconstructed difference value is associated with a specific time point, so that the time series of anomalies can be tracked. When the current abnormal cumulative value of water quality reaches the preset continuous abnormality threshold, triggering the generation and issuance of an alarm message indicating that there is a hidden abnormality in water quality, the system will further utilize the reconstructed difference value and its timestamp corresponding to each previously recorded water quality parameter value. By analyzing these historical data, especially those parameters that show large reconstructed difference values before and after the abnormality occurs, it can be determined which water quality parameters or their combination cause the hidden abnormality of the overall water quality. For example, a threshold can be set. When the reconstructed difference value of a water quality parameter continuously or suddenly exceeds the threshold, it is considered that the parameter may be abnormal.
[0072] The solution of the present application not only calculates the overall abnormal accumulation value during the water quality anomaly detection process, but also records the individual reconstruction difference value and its timestamp for each water quality parameter. This fine-grained record provides key data support for subsequent abnormality diagnosis. When the overall abnormal accumulation value triggers an alarm, the system can trace back and analyze these individual reconstruction difference values to identify those water quality parameters that deviate most significantly from the normal correlation relationship. 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 size of the reconstruction difference values of different parameters and combining them with the time of their occurrence, the key parameters or parameter combinations that cause the overall anomaly can be effectively locked.
[0073] The above technical solution not only detects hidden water quality anomalies and issues an alarm, but also provides the specific combination of water quality parameters that caused the anomaly. This greatly improves the efficiency and accuracy of anomaly location, allowing managers and maintenance personnel to quickly identify the source of the problem and take targeted measures to investigate and address it. This avoids blind investigations, reduces fault response time, and enhances the refinement of water quality management and emergency response capabilities within the water supply and drainage network.
[0074] This application further proposes a method for detecting water quality anomalies in water supply and drainage that takes into account the influence of periodic pipe network operations, aiming to eliminate or reduce the impact of periodic interference on anomaly detection results and improve detection accuracy.
[0075] When the water supply and drainage network system has a periodic network operation that causes a deviation in the regular 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 further includes: Under normal water quality conditions in the water supply and drainage network, perform the following operations within at least one network operation cycle: During a specific time period of pipe network operation, periodically obtaining a plurality of third water quality parameter values at key nodes of the water supply and drainage pipe network according to the preset time period; For each acquired third water quality parameter value, the following operations are performed: reconstructing each third water quality parameter value to obtain a first water quality parameter reconstructed value corresponding to each third water quality parameter value; calculating a current first reconstructed total difference value of water quality based on each third water quality parameter value and the corresponding first water quality parameter reconstructed value, and recording a first timestamp of calculating the current first reconstructed total difference value; A standardized periodic interference profile is generated according to all total values of the reconstruction differences calculated during the at least one pipe network operation cycle and the corresponding first timestamps.
[0076] The above steps of calculating the total value of the current reconstruction difference of the water quality based on each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculating the current abnormal cumulative value of the water quality based on the current reconstruction difference total value and the preset time decay factor specifically include: Calculating a current reconstruction difference total value of the water quality according to each water quality parameter value and the corresponding water quality parameter reconstruction value, and recording a second timestamp of calculating the current reconstruction difference total value; searching, according to the second timestamp, from the periodic interference profile for a first total reconstruction difference value corresponding to a first timestamp aligned therewith; Subtracting the first total reconstruction difference value found from the current total reconstruction difference value to obtain a residual difference value; The current abnormal accumulation value of the water quality is calculated according to the residual difference value and a preset time decay factor.
[0077] Among them, a pipeline network operation cycle refers to the interval between two adjacent pipeline network operation start time points.
[0078] Specifically, when the water supply and drainage network system undergoes periodic network operations, such as regular valve switching, pump station startup and shutdown, or network flushing, these operations can 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 regular 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. Each acquired third water quality parameter value is reconstructed to obtain the first water quality parameter reconstruction value corresponding to each third water quality parameter value. Subsequently, based on each third water quality parameter value and the corresponding first water quality parameter reconstruction value, a total difference value of the current first reconstruction of the water quality is calculated, and the first timestamp when the total difference value is calculated is recorded. By repeating this process over at least one network operation cycle, a series of total reconstruction differences generated under normal periodic operation and their corresponding timestamps can be collected. Based on this collected data, a standardized periodic interference profile can be generated. This profile essentially describes the typical pattern of the impact of periodic operation on the reconstruction differences of water quality parameters at different time points (relative to the start of the network operation cycle). For example, it can be a time series curve showing the expected total reconstruction differences at different stages of the network operation cycle.
[0079] During the actual anomaly detection process, when real-time water quality parameter values are acquired and the current total reconstruction difference value of water quality is calculated, a second timestamp is recorded for the calculation of this total difference value. This second timestamp is then used to search for the first total reconstruction difference value corresponding to the first timestamp aligned with it from a pre-generated periodic interference profile. This first total reconstruction difference value represents the expected reconstruction difference caused by normal periodic pipe network operation at the current time point. Next, the first total reconstruction difference value found from the periodic interference profile is subtracted from the current total reconstruction difference value calculated in real time to obtain a residual difference value. This residual difference value reflects the actual degree of water quality deviation after eliminating the influence of periodic interference. Finally, based on this residual difference value and a preset time decay factor, the current cumulative water quality anomaly value is calculated. A pipe network operation cycle can be understood as the time interval between the start times of two consecutive identical pipe network operations (e.g., two valve openings or closings).
[0080] The solution of this application effectively addresses the false alarm issues that can arise from the basic solution when periodic pipe network operations are present by introducing a periodic interference profile. Specifically, when pipe network water quality is normal and periodic operations are present, the reconstructed differences in water quality parameters exhibit a regular fluctuation pattern. By collecting and analyzing these reconstructed differences over at least one pipe network operation cycle, a "periodic interference 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 differences of the current water quality parameters are calculated, they are no longer directly used to calculate the cumulative anomaly value. Instead, the expected reconstructed differences at the current time, as indicated by the periodic interference profile, are first subtracted from this total value. The resulting residual difference value eliminates the influence of periodic operations and more accurately reflects the true degree of anomaly in the water quality parameters. This processing ensures that only deviations in water quality parameters that exceed the normal fluctuation range caused by periodic operations are counted towards the cumulative anomaly value, thus avoiding false alarms caused by normal operation.
[0081] The present application further proposes that, after the step of generating a standardized periodic interference profile based on all total values of reconstruction differences calculated in at least one pipe network operation cycle and the corresponding first timestamps, the following steps are further included: The following operations are performed periodically according to the preset second time: During a specific time period of pipe network operation, periodically obtaining a plurality of fourth water quality parameter values at key nodes of the water supply and drainage pipe network according to the preset time period; For each acquired fourth water quality parameter value, the following operations are performed: reconstructing each fourth water quality parameter value to obtain a second water quality parameter reconstructed value corresponding to each fourth water quality parameter value; calculating a current second reconstructed total difference value of the water quality based on each fourth water quality parameter value and the corresponding second water quality parameter reconstructed value, and recording a third timestamp for calculating the current second reconstructed total difference value; The periodic interference profile is calibrated according to all second reconstruction difference total values calculated within the specific time period and the corresponding third timestamps.
[0082] Specifically, the preset second time periodicity refers to the time interval used to calibrate the periodic interference profile. The interval can be set according to the stability of the actual pipe network operation, the frequency of water quality changes, and the requirements for detection accuracy. For example, it can be one month, one quarter, or half a year. Its purpose is to ensure that the periodic interference profile can timely reflect the latest status of the pipe network operation and avoid the accumulation of deviations due to environmental or operational changes. Among them, the process of obtaining the fourth water quality parameter value, reconstructing it to obtain the second water quality parameter reconstruction value, calculating the current second reconstruction difference total value, and recording the third timestamp is similar to the process of obtaining the third water quality parameter value, reconstructing it, calculating the first reconstruction difference total 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 reconstruction difference total value and the third timestamp.
[0083] The solution of the present application effectively solves the problem in the basic solution that the periodic interference profile may become inaccurate over time by introducing a periodic calibration mechanism.
[0084] Through the above technical solution, this application can significantly improve the accuracy and robustness of water quality anomaly detection for water supply and drainage. Because the periodic interference profile can be regularly calibrated and updated, its matching degree with the actual pipe network operation can be continuously maintained, thus effectively avoiding false alarms or missed alarms caused by profile inaccuracy. This enables the system to more accurately identify true hidden water quality anomalies, improves the reliability of early warning, and is of great significance for ensuring the safe and stable operation of the water supply and drainage system.
[0085] This application further proposes a method for detecting water quality anomalies in water supply and drainage for mixed water source scenarios, which reversely calculates the estimated values of water quality parameters of pure water sources and judges their own coordination to more accurately identify water quality anomalies.
[0086] When the water supply source for water supply and drainage is a mixed water source of two or more types 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 specifically includes: The system periodically obtains multiple water quality parameter values at key nodes of the water supply and drainage network according to preset time periods, and obtains the mixing ratio value of the current mixed water source in the water supply and drainage network.
[0087] The mixing ratio value of the mixed water source refers to the volume or flow rate percentage of each pure water source in the mixed water. These mixing ratio values can be obtained in a variety of ways. For example, by installing a flow meter or proportional valve at the confluence point of each pure water source, monitoring and recording the water supply flow of each water source in real time, and then calculating its mixing ratio; or, it can be estimated based on a preset scheduling plan or historical data. The purpose of obtaining the mixing ratio value is to provide the necessary data foundation for the subsequent reverse calculation of the estimated values of the water quality parameters of each pure water source.
[0088] After 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, the following step is further included: The water quality parameter estimation value of each water quality parameter of each pure water source in the current mixed water source is reversely calculated based on the multiple water quality parameter values and the mixing ratio value.
[0089] Specifically, reverse extrapolation can be understood as using the total water quality parameter values of the mixed water and the known mixing ratio, combined with the principle of conservation of mass or a linear superposition model, to reversely calculate the water quality parameter values that the individual pure water sources that make up the mixed water would have in their unmixed state. The water quality parameter estimates are the virtual water quality parameter values for each pure water source obtained through this reverse extrapolation. Its purpose is to decompose the complexity of mixed water quality into the relatively independent characteristics of each pure water source, facilitating subsequent anomaly detection.
[0090] Based on the preset correlation between the 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 the mixed water source has an abnormality.
[0091] If an abnormality exists, an alarm message indicating the type of pure water source causing the abnormality is generated and issued.
[0092] The specific steps of determining whether the mixed water source has an abnormality based on the preset correlation between the water quality parameters of each normal pure water source and the estimated value of each water quality parameter of each pure water source include: For each pure water source, determine whether the estimated values of each water quality parameter in the corresponding pure water source conform to the preset water quality parameter correlation relationship of a normal pure water source; If not, each water quality parameter estimation value of the corresponding pure water source is reconstructed to obtain a water quality parameter estimation reconstructed value of each water quality parameter estimation value; According to each water quality parameter estimation value and the water quality parameter estimation reconstruction value, the corresponding self-coordination deviation value of the pure water source is calculated; When the self-coordination deviation value reaches or exceeds the preset limit value, it is determined that there is an abnormality in the mixed water source.
[0093] The pre-set correlations between water quality parameters for each normal purified water source refer to the inherent, stable statistical or physicochemical correlation patterns between different water quality parameters within the purified water source under normal conditions. This correlation can be obtained through historical data analysis and machine learning models (such as autoencoders and principal component analysis) to describe the "normal" state of the purified water source. Conformance to this correlation can be determined by inputting the estimated water quality parameters of the purified water source into a pre-trained model and observing the reconstruction error or deviation.
[0094] If it does not meet the requirements, it indicates that there is an abnormal coordination deviation between the internal water quality parameters of the pure water source.
[0095] At this time, each water quality parameter estimation value of the corresponding pure water source is reconstructed separately to obtain the water quality parameter estimation reconstructed value of each water quality parameter estimation value. The principle is similar to the above-mentioned reconstruction of the mixed water quality parameters, which aims to capture the intrinsic correlation of the internal parameters of the pure water source.
[0096] The self-coordination deviation degree value is an indicator to measure the difference between the actual estimated value of the pure water source and its reconstructed value. For example, it can be calculated using the sum of square differences or Euclidean distance. The larger the value, the greater the degree to which the correlation of the internal water quality parameters of the pure water source deviates from the normal state.
[0097] The preset threshold is used to determine anomalies. When the degree of deviation from the self-coordination reaches or exceeds this threshold, the pure water source is considered abnormal, and the entire mixed water source system is considered abnormal. This threshold can be set based on historical data, expert experience, or statistical methods.
[0098] The solution of this application 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. Because the water quality parameters of a 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 reversely calculate the estimated water quality parameters corresponding to each pure water source under the current mixing state. This decomposition means that the judgment of water quality anomalies is no longer limited to the dynamic changes in the mixing ratio, but instead focuses on the intrinsic quality of each pure water source itself.
[0099] Subsequently, by determining whether the estimated water quality parameters of each pure water source conform to its preset normal correlation relationship and calculating its own coordination deviation value, the present application can identify which pure water source has abnormal internal water quality characteristics.
[0100] This method can effectively distinguish normal fluctuations caused by changes in the mixing ratio of water sources from water quality problems caused by contamination or abnormalities in a pure water source itself, thereby avoiding the false alarms or missed alarms that may occur in traditional methods in mixed water source scenarios, and improving the accuracy and pertinence of anomaly detection.
[0101] Through the above technical solution, the present application can effectively solve the problem that when the water source for water supply and drainage is a mixed water source with multiple different water quality characteristics, it is difficult for traditional methods to accurately distinguish between normal mixed fluctuations and real water quality anomalies. This solution decouples the mixed water source, reversely calculates and evaluates the self-coordination of each pure water source, making the detection of water quality anomalies more refined and accurate. As a result, it can not only improve the sensitivity and specificity of water quality anomaly detection and reduce false alarms, but also, once an anomaly is detected, it can further indicate which pure water source has a problem, providing an important basis for quickly locating the source of pollution and taking targeted measures, significantly improving the efficiency and reliability of water quality management of the water supply and drainage network.
[0102] In the implementation manner of the present application, the understanding and specific implementation methods of the above-mentioned concepts such as "water quality parameter value", "water quality parameter reconstruction value", "reconstruction difference total value", "time attenuation factor", "abnormal accumulation value" and "continuous abnormality threshold" can refer to the contents recorded in the above-mentioned implementation manner and will not be repeated here.
[0103] Specifically, when the water supply and drainage system contains two or more pure water sources with different water quality characteristics (for example, surface water, groundwater, recycled water, etc.), traditional water quality anomaly detection methods may find it difficult to accurately determine the source of the anomaly or identify hidden anomalies after mixing.
[0104] To this end, this application periodically acquires multiple water quality parameter values at key nodes in the water supply and drainage network, and also obtains the mixing ratio of the current mixed water sources within the network. This mixing ratio can be obtained in a variety of ways, such as real-time calculation by monitoring flow meter data from different water sources entering the mixing point; estimation based on preset scheduling plans or historical operating data; or indirect inference by placing specific sensors at the mixing point (such as conductivity sensors, if the conductivity of different water sources varies significantly).
[0105] After obtaining the mixed water quality parameter values and mixing ratio values, this application will reversely calculate the water quality parameter estimates of each water quality parameter of each pure water source in the current mixed water source based on this information. This reverse calculation can be achieved using a variety of mathematical methods such as linear regression, least squares method, or models based on physical and chemical equilibrium equations. Its purpose is to decompose the complexity of mixed water quality into an analysis of its constituent pure water sources, so that the potential abnormalities of each pure water source can be evaluated in a targeted manner.
[0106] Subsequently, this application will determine whether there is any abnormality in the mixed water source based on the preset correlation between the water quality parameters of each normal pure water source and the estimated value of each water quality parameter of each pure water source.
[0107] If the judgment result indicates a mismatch, that is, the estimated water quality parameters of a particular pure water source deviate from their normal correlation, the system reconstructs each estimated water quality parameter value of the corresponding pure water source to obtain a reconstructed water quality parameter estimate for each water quality parameter estimate. This reconstruction is similar to the reconstruction of the actual measured values in the above embodiment, but its input is the estimated pure water source parameters.
[0108] After obtaining the estimated and reconstructed values of each water quality parameter, the system calculates the corresponding pure water source's self-coordination deviation value. This value quantifies the degree of deviation of the estimated parameters of the pure water source from its normal correlation pattern.
[0109] When the degree of deviation from its own coordination reaches or exceeds a preset threshold, the system determines that the mixed water source is abnormal. This threshold is set based on historical data and expert experience to distinguish between normal fluctuations and potential anomalies. If an anomaly is present, the system generates and issues an alarm indicating the type of pure water source causing the anomaly.
[0110] This application further proposes a water quality anomaly detection system for water supply and drainage, see Figure 2 , which includes: an acquisition module 1, a call module 2, a reconstruction module 3, a calculation module 4, and an alarm module 5. Among them, the acquisition module 1 is used to periodically obtain multiple water quality parameter values at key nodes of the water supply and drainage network according to a preset time; the call module 2 is used to sequentially call the following modules to perform related operations for the multiple water quality parameter values obtained each time; the reconstruction module 3 is used to reconstruct each water quality parameter value separately to obtain the water quality parameter reconstruction value corresponding to each water quality parameter value; the calculation module 4 is used to calculate the current reconstruction difference total value of the water quality based on each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculate the current abnormal accumulation value of the water quality based on the current reconstruction difference total value and a preset time attenuation factor; the alarm module 5 is used to generate and issue an alarm message indicating that there is a hidden abnormality in the water quality if the current abnormal accumulation value reaches a preset continuous abnormality threshold.
[0111] The water quality anomaly detection system for water supply and drainage proposed in this application is a system corresponding to the water quality anomaly detection method for water supply and drainage provided above in this application. The operation process performed by each module is the same as the operation process of the corresponding steps of the above-mentioned water quality anomaly detection method for water supply and drainage, and the beneficial technical effects achieved are the same. Each module will not be described in detail here.
[0112] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, various modifications and variations of the present application are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for detecting abnormal water quality in water supply and drainage, characterized in that: include: Periodically obtain multiple water quality parameter values at key nodes of the water supply and drainage network according to preset time; For each of the multiple water quality parameter values obtained, perform the following operations: Reconstruct each water quality parameter value separately to obtain a water quality parameter reconstruction value corresponding to each water quality parameter value; Calculate the total value of the current reconstruction difference of the water quality based on each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculate the current abnormal cumulative value of the water quality based on the current reconstruction difference total value and the preset time decay factor; If the current abnormal accumulation value reaches the preset continuous abnormality threshold, an alarm message indicating that there is a hidden abnormality in the water quality will be generated and issued.
2. The method for detecting abnormal water quality of water supply and drainage according to claim 1, characterized in that: Also includes: Under normal water quality conditions in the water supply and drainage network, multiple sets of first water quality parameter values are obtained in chronological order; establishing a normal relationship between water quality parameters based on the multiple sets of first water quality parameter values; Initializing the weight coefficients in the preset reconstruction mapping function according to the normal relationship; The step of reconstructing each water quality parameter value to obtain a water quality parameter reconstructed value corresponding to each water quality parameter value specifically includes: Inputting each acquired water quality parameter value into the reconstruction mapping function; Calling the reconstruction mapping function to compress each water quality parameter value into a low-dimensional data value according to a preset mathematical operation rule; According to the weight coefficient and the preset reverse mathematical operation rules, each low-dimensional data value is reconstructed and calculated to obtain a water quality parameter reconstructed value corresponding to each water quality parameter value.
3. The method for detecting abnormal water quality of water supply and drainage according to claim 2, characterized in that: Also includes: The following operations are performed periodically according to the preset first time: Under normal water quality conditions in the water supply and drainage network, multiple sets of second water quality parameter values are obtained; establishing a first normal relationship between water quality parameters based on the multiple sets of second water quality parameter values; The weight coefficients in the reconstruction mapping function are calibrated according to the first normal relationship.
4. The method for detecting abnormal water quality of water supply and drainage according to claim 1, characterized in that: The steps of calculating the total value of the current reconstruction difference of the water quality according to each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculating the current abnormal cumulative value of the water quality according to the current reconstruction difference total value and a preset time decay factor specifically include: Calculate the corresponding reconstruction difference value for each water quality parameter value. Reconstruction difference value = (water quality parameter value - water quality parameter reconstruction value) 2 , accumulate the reconstruction difference values corresponding to each water quality parameter value to calculate the current reconstruction difference total value of water quality; According to the current reconstruction difference total value and the preset time decay factor, the current abnormal cumulative value of water quality is calculated. The current abnormal cumulative value = (abnormal cumulative value 上一次 × time decay factor) + total value of current reconstruction difference; abnormal accumulation value 上一次 The current abnormal accumulation value obtained from the last calculation.
5. The method for detecting abnormal water quality of water supply and drainage according to any one of claims 1 to 4, characterized in that: After the step of reconstructing each water quality parameter value to obtain a water quality parameter reconstructed value corresponding to each water quality parameter value, the following steps are further included: Record the reconstructed difference value corresponding to each water quality parameter value and the timestamp of calculating the reconstructed difference value; After the step of generating and issuing an alarm message indicating that water quality is not properly regulated, the method further includes: According to the size of the reconstructed difference value corresponding to each recorded water quality parameter value and the corresponding timestamp, the water quality parameter combination that causes the hidden abnormality in water quality is determined.
6. The method for detecting abnormal water quality of water supply and drainage according to claim 1, characterized in that: When the water supply and drainage network system has a periodic network operation that causes a deviation in the regular 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 further includes: Under normal water quality conditions in the water supply and drainage network, perform the following operations within at least one network operation cycle: During a specific time period of pipe network operation, periodically obtaining a plurality of third water quality parameter values at key nodes of the water supply and drainage pipe network according to the preset time period; For each acquired third water quality parameter value, the following operations are performed: reconstructing each third water quality parameter value to obtain a first water quality parameter reconstructed value corresponding to each third water quality parameter value; calculating a current first reconstructed total difference value of water quality based on each third water quality parameter value and the corresponding first water quality parameter reconstructed value, and recording a first timestamp of calculating the current first reconstructed total difference value; generating a standardized periodic interference profile according to all total values of the reconstructed differences calculated during the at least one pipe network operation cycle and the corresponding first timestamps; The steps of calculating the total value of the current reconstruction difference of the water quality according to each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculating the current abnormal cumulative value of the water quality according to the current reconstruction difference total value and a preset time decay factor specifically include: Calculating a current reconstruction difference total value of the water quality according to each water quality parameter value and the corresponding water quality parameter reconstruction value, and recording a second timestamp of calculating the current reconstruction difference total value; searching, according to the second timestamp, from the periodic interference profile for a first total reconstruction difference value corresponding to a first timestamp aligned therewith; Subtracting the first total reconstruction difference value found from the current total reconstruction difference value to obtain a residual difference value; The current abnormal accumulation value of the water quality is calculated according to the residual difference value and a preset time decay factor.
7. The method for detecting abnormal water quality of water supply and drainage according to claim 6, characterized in that: After the step of generating a standardized periodic interference profile based on all the total values of the reconstructed differences calculated in the at least one pipe network operation cycle and the corresponding first timestamps, the method further includes: The following operations are performed periodically according to the preset second time: During a specific time period of pipe network operation, periodically obtaining a plurality of fourth water quality parameter values at key nodes of the water supply and drainage pipe network according to the preset time period; For each acquired fourth water quality parameter value, the following operations are performed: reconstructing each fourth water quality parameter value to obtain a second water quality parameter reconstructed value corresponding to each fourth water quality parameter value; calculating a current second reconstructed total difference value of the water quality based on each fourth water quality parameter value and the corresponding second water quality parameter reconstructed value, and recording a third timestamp for calculating the current second reconstructed total difference value; The periodic interference profile is calibrated according to all second reconstruction difference total values calculated within the specific time period and the corresponding third timestamps.
8. The method for detecting abnormal water quality of water supply and drainage according to claim 1, characterized in that: When the water supply source for water supply and drainage is a mixed water source of two or more types 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 specifically includes: Periodically obtain multiple water quality parameter values at key nodes of the water supply and drainage network according to preset time periods, and obtain the mixing ratio value of the current mixed water source in the water supply and drainage network; After 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, the following step is further included: Reversely calculating a water quality parameter estimation value of each water quality parameter of each pure water source in the current mixed water source based on the multiple water quality parameter values and the mixing ratio value; Determine whether the mixed water source has an abnormality based on the preset correlation between the water quality parameters of each normal pure water source and the estimated value of each water quality parameter of each pure water source; If an abnormality exists, an alarm message indicating the type of pure water source causing the abnormality is generated and issued.
9. The method for detecting abnormal water quality of water supply and drainage according to claim 8, characterized in that: Based on the preset correlation between the water quality parameters of each normal pure water source and the estimated value of each water quality parameter of each pure water source, the steps of determining whether the mixed water source has an abnormality specifically include: For each pure water source, determine whether the estimated values of each water quality parameter in the corresponding pure water source conform to the preset water quality parameter correlation relationship of a normal pure water source; If not, each water quality parameter estimation value of the corresponding pure water source is reconstructed to obtain a water quality parameter estimation reconstructed value of each water quality parameter estimation value; According to each water quality parameter estimation value and the water quality parameter estimation reconstruction value, the corresponding self-coordination deviation value of the pure water source is calculated; When the self-coordination deviation value reaches or exceeds the preset limit value, it is determined that there is an abnormality in the mixed water source.
10. A water quality abnormality detection system for water supply and drainage, characterized in that: include: An acquisition module is used to periodically obtain 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 call the following modules in sequence to perform related operations for multiple water quality parameter values obtained each time; A reconstruction module is used to reconstruct each water quality parameter value respectively to obtain a water quality parameter reconstruction value corresponding to each water quality parameter value; a calculation module for calculating a total value of the current reconstruction difference of the water quality based on each water quality parameter value and the corresponding water quality parameter reconstruction value, and calculating a current abnormal cumulative value of the water quality based on the current total value of the reconstruction difference and a preset time decay factor; The alarm module is used to generate and issue an alarm message indicating that there is a hidden abnormality in water quality if the current abnormal accumulation 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
Water quality multi-parameter real-time monitoring system
CN120446416A
Water quality monitoring data analysis method and apparatus, device, and storage medium
WO2022160682A1
Cited By
Water quality data anomaly detection method and device, electronic equipment and readable storage medium
CN121881212A