A smart water real-time monitoring and early warning method and system based on the Internet of Things
By combining real-time edge node diagnostics and cloud-based analysis with dynamic digital twin models and graph spatiotemporal fusion networks, a global risk map is generated, solving the problem of integrating anomaly detection and early warning in existing smart water systems and achieving efficient water risk monitoring and early warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUBEI JIANKE INT ENG CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-07-07
AI Technical Summary
Existing smart water systems lack deep integration and dynamic collaboration in anomaly detection and early warning, making it difficult to comprehensively utilize real-time data, physical mechanisms, and pipeline spatial characteristics, thus affecting the accuracy of early warnings and the timeliness of emergency response.
By using edge nodes to diagnose and analyze multi-parameter water quality data in real time, combined with a dynamic digital twin model and graph spatiotemporal fusion network in the cloud, a global risk map is generated, dynamically enhancing the monitoring frequency and analysis dimensions. Combined with the pipeline geographic information system, an early warning decision report is generated, realizing the entire process from anomaly perception to prediction and early warning.
It has significantly improved the real-time nature, source tracing accuracy, and intelligent response level of water risk monitoring, realizing the entire process from anomaly detection to prediction and early warning, and improving the accuracy of early warning and the timeliness of emergency response.
Smart Images

Figure CN122347486A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of smart water management, and in particular to a real-time monitoring and early warning method and system for smart water management based on the Internet of Things. Background Technology
[0002] Ensuring urban water supply security is one of the core objectives of smart water management. Real-time monitoring and timely early warning of water quality in water supply networks are crucial technological means to prevent water pollution incidents and safeguard public health. Currently, leveraging the Internet of Things (IoT) and data analytics to automatically identify and alert to water quality anomalies has become a major development direction in this field.
[0003] Current technologies generally employ an architecture that deploys sensors in the pipeline network for data collection, combined with a cloud platform for centralized processing and analysis. For anomaly detection, they largely rely on statistical analysis of historical data from single or multiple monitoring points or machine learning models for deviation identification. Additionally, some systems incorporate pipeline network topology models to aid in understanding the spatial distribution and variations of water quality parameters.
[0004] However, a major drawback of existing technical architectures is that their analysis processes are often segmented and fragmented. Anomaly identification, topology analysis, and decision support often operate independently, lacking deep integration and dynamic collaboration. This makes it difficult for the system to comprehensively utilize real-time data, physical mechanisms, and network spatial characteristics to efficiently locate anomaly sources and effectively predict their spread, thus affecting the accuracy of early warnings and the timeliness of emergency response. Summary of the Invention
[0005] In order to build a closed-loop system from anomaly perception and dynamic source tracing to intelligent decision-making through edge-cloud collaboration and mechanistic data fusion, and to achieve a leap in the ability to proactively predict water risks from passive alarms, this application provides a smart water real-time monitoring and early warning method and system based on the Internet of Things.
[0006] Firstly, this application provides a real-time monitoring and early warning method for smart water systems based on the Internet of Things, employing the following technical solution:
[0007] A smart water real-time monitoring and early warning method based on the Internet of Things includes:
[0008] By collecting multi-parameter water quality data through edge nodes deployed at key monitoring points in the water supply network, real-time diagnostic analysis of the multi-parameter water quality data is performed on the edge side to identify multi-parameter correlation feature fingerprint anomalies and generate diagnostic results including anomaly type, feature vector and timestamp.
[0009] The diagnostic results of each edge node are uploaded to the cloud, where the feature vectors are aligned and aggregated according to timestamps to form a multi-node time-series feature vector. Based on a dynamic digital twin model, the mechanism of the multi-node time-series feature vector is simulated, and the simulation results are compared with the actual feature vectors to generate a residual feature field reflecting the spatial distribution of anomalies. Then, using a graph spatiotemporal fusion network, the residual feature field and pipeline topology information are fused to generate a global risk map that identifies the location of the anomaly source and its spread trend.
[0010] Based on the global risk map, the monitoring frequency and analysis dimensions of relevant nodes on the source location and diffusion trend path are dynamically enhanced, and combined with the pipeline geographic information system, a list of key monitoring areas and a ranking of suspected sources are generated.
[0011] Based on the comprehensive anomaly type, the source location and spread trend identified by the global risk map, and the ranking of suspected sources, the system determines the hazard level of the event through preset assessment rules, generates an early warning decision report containing source tracing conclusions and handling recommendations, and generates early warning information based on the report and hazard level and pushes it to the corresponding terminals in a tiered manner.
[0012] By adopting the above technical solution, this technology constructs an intelligent closed loop of "edge diagnosis - cloud simulation - map-based source tracing - dynamic control" through edge-cloud collaboration and mechanistic data fusion, realizing the full-process connection from anomaly perception and precise positioning to prediction and early warning, and significantly improving the real-time performance, source tracing accuracy and intelligent response level of water risk monitoring.
[0013] Secondly, this application provides a smart water real-time monitoring and early warning system based on the Internet of Things, which adopts the following technical solution:
[0014] A smart water real-time monitoring and early warning system based on the Internet of Things (IoT) includes a memory, a processor, and a program stored in the memory and executable on the processor. When the program is loaded and executed by the processor, it implements the smart water real-time monitoring and early warning method based on the IoT as described in the first aspect. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating a real-time monitoring and early warning method for smart water based on the Internet of Things, according to an embodiment of this application.
[0016] Figure 2 This is a schematic diagram of another embodiment of the present application, illustrating the process of generating diagnostic results that include anomaly type, feature vector, and timestamp.
[0017] Figure 3 This is a flowchart illustrating the process of using an anomaly detection algorithm to perform preliminary analysis on feature correlation vectors and identify potential anomalies, according to another embodiment of this application.
[0018] Figure 4 This is a schematic diagram of the interface of the smart water real-time monitoring and early warning system provided in the embodiments of this application. Detailed Implementation
[0019] The present application will be further described in detail below with reference to the accompanying drawings.
[0020] Reference Figure 1 This application discloses a real-time monitoring and early warning method for smart water based on the Internet of Things, comprising:
[0021] Step S1 involves collecting multi-parameter water quality data through edge nodes deployed at key monitoring points in the water supply network. Real-time diagnostic analysis of this data is performed at the edge, identifying anomalies in the multi-parameter correlation fingerprint and generating diagnostic results including anomaly type, feature vector, and timestamp. The edge nodes are intelligent devices deployed at key monitoring points in the water supply network, integrating various water quality sensors (such as turbidity sensors, pH sensors, and residual chlorine sensors) as well as data processing and communication modules. These nodes are responsible for real-time data collection and preliminary processing and analysis locally. Multi-parameter water quality data refers to various water quality indicators collected from the edge nodes, including but not limited to turbidity, pH value, residual chlorine concentration, conductivity, and dissolved oxygen. This data reflects the overall state of water quality and is the basis for monitoring water quality changes. Feature fingerprints refer to specific correlation patterns and variation laws between parameters in the multi-parameter water quality data. Under normal circumstances, these parameters maintain a stable relationship, but this relationship is broken when water quality is abnormal, forming a unique "fingerprint." For example, chemical pollution can cause simultaneous abnormal changes in conductivity and residual chlorine; this specific combination pattern constitutes a characteristic fingerprint. Diagnostic results: These are the output information generated after real-time diagnostic analysis of edge nodes, including the anomaly type (e.g., chemical pollution, microbial pollution), feature vectors (a set of numerical values describing the anomaly characteristics), and timestamps (recording the specific time the anomaly occurred). This information is used for further analysis and decision-making. The specific process can be found in steps S11 to S16, and will not be elaborated upon here.
[0022] It should be noted that all data collected, processed and analyzed by the system in this application are physical parameter data (such as water quality, pressure and flow rate) directly related to water supply safety, as well as necessary anonymized environmental data. All data processing links are solely for the technical purpose of ensuring water supply safety, providing early warning of water quality risks, and optimizing pipeline operation, and do not involve any personal privacy information or non-technical commercial use.
[0023] Step S2 involves uploading the diagnostic results from each edge node to the cloud. The cloud then aligns and aggregates the feature vectors by timestamp, forming a multi-node time-series feature vector. Based on a dynamic digital twin model, the mechanism of the multi-node time-series feature vector is simulated, and the simulation results are compared with the actual feature vectors to generate a residual feature field reflecting the spatial distribution of anomalies. Finally, a graph-spatiotemporal fusion network is used to fuse the residual feature field with the pipeline topology information, generating a global risk map that identifies the location of the anomaly source and its spread trend. Here, the cloud refers to a server cluster based on cloud computing technology, used to store, process, and analyze data uploaded from the edge nodes. Multi-node time-series feature vector: A vector aggregated from the feature vectors of the diagnostic results uploaded by multiple edge nodes after aligning by timestamp. It reflects the changes in water quality characteristics at multiple monitoring points at different times and is the basis for analyzing the spatiotemporal distribution of water quality anomalies. Dynamic digital twin model: A model based on a combination of physical mechanisms and data-driven approaches, used to simulate the dynamic process of water quality changes in a water supply network. This model can dynamically adjust parameters based on real-time data to more accurately reflect the actual operating status of the pipeline network. Residual Feature Field: This is the difference information obtained by comparing the simulation results of the dynamic digital twin model with the actual feature vectors. It reflects the deviation between model predictions and actual observations and can reveal the spatial distribution characteristics of anomalies. Graph Spatiotemporal Fusion Network: A network model combining graph neural networks (GNNs) and spatiotemporal analysis to fuse the residual feature field with pipeline topology information. It can comprehensively consider spatial topology and time series information to generate a global risk map. Global Risk Map: A visual map that identifies the location of anomaly sources and the trend of anomaly spread. It provides monitoring personnel with intuitive information on anomaly distribution and spread, facilitating rapid anomaly location and handling.
[0024] The process of forming a multi-node time-series feature vector can be referenced as follows: After each edge node uploads its diagnostic results to the cloud, the cloud first aligns these data according to their timestamps. Since there may be slight differences in the collection times of different edge nodes, timestamp alignment can ensure the synchronization of data in the time dimension. Then, the cloud aggregates the feature vectors from each diagnostic result to form a multi-node time-series feature vector. For example, if multiple edge nodes detect an anomaly of decreasing residual chlorine concentration within a certain time period, these feature vectors will be aggregated to form a multi-node time-series feature vector reflecting the change in residual chlorine concentration of the entire pipeline network within that time period. The process of generating a residual feature field reflecting the spatial distribution of the anomaly can be referenced in steps S21 to S23. The process of generating a global risk map that identifies the location of the anomaly source and its diffusion trend can be referenced in steps S2a to S2e.
[0025] Step S3: Based on the global risk map, dynamically enhance the monitoring frequency and analysis dimensions of relevant nodes along the source location and diffusion trend path, and combine with the pipeline geographic information system to generate a list of key monitoring areas and a ranking of suspected sources. Here, monitoring frequency refers to the frequency at which edge nodes collect and upload data. Analysis dimensions refer to the number and types of parameters considered when analyzing the collected data. Enhancing analysis dimensions means increasing the number of parameters analyzed or introducing more complex analysis models to more comprehensively assess water quality. The pipeline geographic information system is an integrated geographic information system used to store, manage, and analyze spatial and attribute data of water supply networks. It can provide information such as the geographical layout of the network, node locations, and pipeline lengths to assist in monitoring and decision-making. Key monitoring area list: A list of areas requiring focused attention generated based on the global risk map and the pipeline geographic information system. These areas are typically key locations on anomaly sources or diffusion paths. Suspected source ranking: Prioritizing possible pollution sources based on anomaly characteristics and geographic information to help monitoring personnel quickly locate and address the most likely pollution sources.
[0026] The necessary process is described below:
[0027] 1. Dynamically enhance monitoring frequency and analysis dimensions:
[0028] 1.1 Monitoring Frequency Adjustment Mechanism:
[0029] Anomaly Intensity Assessment: By analyzing the residual characteristic field in the global risk map, the anomaly intensity value for each node is calculated. For example, nodes with heavy metal concentration residual values exceeding a threshold (e.g., 0.5 mg / L) are marked as having high anomaly intensity. Time Series Analysis: Time series analysis is performed on the anomaly intensity value for each node, using moving averages and exponential smoothing to smooth the data and identify dynamic changes in anomalous events. This helps determine whether the anomaly persists or gradually intensifies.
[0030] Adaptive frequency adjustment algorithm: The monitoring frequency is dynamically adjusted based on the intensity and dynamic changes of the anomaly. For example, if the anomaly intensity of a node exceeds the threshold for three consecutive time points, the monitoring frequency is increased from once every 10 minutes to once per minute. This adjustment is automatically completed by the real-time monitoring system, ensuring that more detailed data can be obtained when anomalies occur.
[0031] 1.2 Analytical Dimension Enhancement Mechanism:
[0032] Multi-parameter sensor array: Multi-parameter sensors are added at key nodes, including heavy metal sensors (lead, cadmium) and organic matter sensors (benzene, phenol). These sensors use digital signal processing (DSP) technology to preprocess the acquired signals, removing noise and interference to ensure data accuracy.
[0033] Multi-dimensional data analysis model: A Long Short-Term Memory (LSTM) network is introduced to perform real-time analysis of newly added parameters. The LSTM model can handle long-term and short-term dependencies in time-series data, thus more accurately predicting and analyzing water quality changes. Specifically, this involves feature extraction of newly added parameters, such as sliding window mean, standard deviation, and peak detection, as input features to the model.
[0034] Feature engineering involves extracting features from newly added parameters, including sliding window averages, standard deviations, and peak detection. For example, the average and standard deviation of heavy metal concentrations over the past 10 minutes can be calculated using a sliding window and used as input features for the analytical model. These features help the model better understand data trends and anomalies.
[0035] 2. Generate a list and sort it using the pipeline network geographic information system:
[0036] 2.1 Generation of a list of key monitoring areas:
[0037] Geospatial analysis algorithms: Utilizing GIS data and combining it with anomaly propagation paths in a global risk map, key nodes are identified. For example, buffer analysis is used to create a buffer zone with a certain radius (e.g., 500 meters) around the anomaly source, and nodes within the buffer zone are included in the list of key monitoring areas. This method can quickly identify areas significantly affected by anomalies, ensuring these areas receive focused attention. Buffer analysis: In the GIS system, a buffer zone is created at the location of the anomaly source. The range can be dynamically adjusted according to the anomaly type and severity. For example, for severe chemical contamination, the buffer radius can be set to 500 meters; for minor microbial contamination, the buffer radius can be set to 200 meters. All nodes within the buffer zone will be included in the list of key monitoring areas.
[0038] 2.2. Suspicion Ranking:
[0039] Anomaly Intensity Assessment: Anomaly intensity values for each node are calculated through residual characteristic field intensity analysis. For example, nodes with heavy metal concentration residual values exceeding a threshold are marked as having high anomaly intensity. Higher anomaly intensity values indicate more severe anomalies at that node. Propagation Path Analysis: Graph theory algorithms (such as Dijkstra's algorithm) are used to analyze the propagation path and time delay of anomalies from their source to each node. Nodes with shorter paths and smaller time delays are more likely to be suspected sources. This method helps identify the direction and speed of anomaly propagation, thus more accurately locating suspected sources. Geographic Distance Calculation: Geographic distances between each anomaly node and known anomaly sources are calculated using GIS data. Nodes closer to the source are more likely to be suspected sources. Geographic distances can be calculated using Euclidean distance or actual path distances based on the network topology.
[0040] Weighted scoring model: This model ranks suspected sources based on factors such as anomaly intensity, propagation path, and geographical distance. For example, anomaly intensity has a weight of 0.4, propagation path has a weight of 0.3, and geographical distance has a weight of 0.3. Using this weighted scoring model, a comprehensive score can be calculated for each suspected source, and then they are ranked from highest to lowest score. This method ensures a more scientific and reasonable ranking of suspected sources, helping monitoring personnel quickly locate and address the most likely sources of pollution.
[0041] Step S4 involves comprehensively considering the anomaly type, the source location and spread trend identified by the global risk map, and the ranking of suspected sources. Using pre-set assessment rules, the event hazard level is determined, generating an early warning decision report containing source tracing conclusions and handling recommendations. Based on this report and the hazard level, early warning information is generated and pushed to appropriate terminals in a tiered manner. The event hazard level is determined by a comprehensive assessment of the impact on water supply safety, based on factors such as anomaly type, source location, spread trend, and suspected source ranking. It is typically divided into low, medium, and high levels to guide subsequent handling measures. The early warning decision report is a formal document containing the source tracing conclusions of the abnormal event (e.g., anomaly source, pollution type), hazard level assessment results, and corresponding handling recommendations, providing decision support for water management personnel. Tiered push notifications are sent to different levels of management personnel or relevant departments based on the event hazard level. For example, low-level events are pushed to frontline maintenance personnel, while high-level events are pushed to management and emergency response departments. Steps S41 to S45 can be used as a reference for generating the early warning decision report containing source tracing conclusions and handling recommendations.
[0042] The process of tiered push notification of early warning information is as follows:
[0043] Push strategy formulation:
[0044] 1.1 Tiered Push Notification Rules: Tiered push notification rules are established based on the severity level of the event. For example, low-level events are pushed to frontline maintenance personnel, medium-level events to regional water management personnel, and high-level events to water management departments, environmental protection departments, and emergency response departments. 1.2 Push Channel Selection: Appropriate push channels are selected based on the target audience. For example, for frontline maintenance personnel, warning information is pushed via SMS and mobile applications; for management and relevant departments, warning information is pushed via email, instant messaging tools, and internal management systems.
[0045] The push notification process is as follows:
[0046] 2.1 Real-time Push Mechanism: After the early warning decision report is generated, the system automatically pushes the early warning information to the corresponding terminals in real time according to the preset push rules and channels. For example, when the system determines that it is a high-level hazard event, it immediately pushes the early warning information to the water management department, environmental protection department, and emergency response department via SMS, email, and internal management system. 2.2 Push Feedback Mechanism: A push feedback mechanism is established to ensure that the recipient can promptly confirm receipt of the early warning information. For example, after receiving the early warning information, the recipient needs to confirm it in the system. If confirmation is not made within the specified time, the system will automatically push the information a second time to ensure that the early warning information is delivered and processed in a timely manner.
[0047] Reference Figure 2 The diagnostic results generated include anomaly type, feature vector, and timestamp:
[0048] Step S11 involves continuously collecting multi-parameter water quality data through edge nodes to form multi-parameter water quality time-series data, and simultaneously acquiring associated external environmental data. Edge nodes are intelligent terminals deployed at pipeline monitoring points, integrating water quality sensors (turbidity, pH, residual chlorine, conductivity, dissolved oxygen, etc.) and communication modules. Multi-parameter water quality time-series data consists of a sequence of multi-dimensional water quality indicators sampled at fixed periods, with timestamps. External environmental data includes meteorological parameters such as temperature, humidity, air pressure, and rainfall.
[0049] The necessary processes are as follows: 1. Continuous water quality data collection: Edge nodes collect parameters such as turbidity, pH, and residual chlorine at 5-minute intervals, and then perform noise reduction using adaptive Kalman filtering. This algorithm dynamically adjusts the filtering intensity, eliminating noise in steady-state conditions and preserving signals during abrupt changes. For example, if a sudden increase in turbidity is caused by heavy rain, the algorithm will reduce the filtering after identification to prevent anomalies from being smoothed out. 2. Generation of time-series data: Data is organized in a 24-hour sliding window, including NTP calibration timestamps and quality markers, stored locally for 72 hours, and compressed with LZ4 for backup. 3. Synchronous acquisition of environmental data: Nodes subscribe to the meteorological platform via MQTT, acquiring environmental data with time window alignment (±30 seconds). In the event of rainfall, frequency compensation is triggered, increasing sampling to 1 minute for 30 minutes to ensure synchronization of environmental data.
[0050] Step S12 involves aligning the water quality time-series data with the external environmental data using a unified clock protocol to form spatiotemporally aligned multi-source input data. The unified clock protocol, NTP (Network Time Protocol), is used to synchronize the time base of edge nodes and external environmental monitoring equipment, ensuring time consistency across multiple data sources.
[0051] The necessary processes are described below: 1. Time reference synchronization: Edge nodes and external environmental monitoring equipment periodically calibrate their clocks via the NTP protocol, achieving millisecond-level synchronization accuracy and eliminating time drift between devices. 2. Timestamp alignment: A nearest neighbor interpolation algorithm is used: using the water quality data timestamp as a reference, environmental data is retrieved within a ±30-second window, and the data at the nearest time point is taken; if multiple timestamps exist, linear interpolation is performed to the corresponding time. For example, if the water quality data timestamp is 10:00:00, and the environmental data are 09:59:58 and 10:00:02, then the interpolation yields the environmental value at 10:00:00. 3. Formation of multi-source input data: The aligned water quality parameters and environmental parameters are concatenated into a fused data block, in the format {timestamp, [water quality vector], [environmental vector]}, which serves as the unified input for subsequent feature extraction and anomaly detection.
[0052] Step S13: Extract time-domain, frequency-domain, and parameter correlation features from multi-source input data, and input them into a multi-parameter correlation feature fingerprint model trained with historical normal operating condition data to calculate and generate a feature correlation vector and its confidence level of deviation from the normal benchmark.
[0053] Among them, time-domain features are statistical features directly calculated from time-series data, such as mean, standard deviation, maximum, and minimum values, used to describe the characteristics of the data in the time dimension. Frequency-domain features are frequency component features obtained by performing a Fourier transform on the time-series data, used to describe the characteristics of the data in the frequency dimension, such as dominant frequency and spectral energy. Inter-parameter correlation features describe the relationships between different parameters, such as correlation coefficient and covariance, used to capture the cooperative change patterns between parameters. Feature correlation vector is a vector representing the degree of correlation between the current data and the normal pattern, reflecting the correlation of each parameter in the current state. Confidence level of deviation from the normal baseline indicates the degree to which the current data deviates from the normal pattern, usually expressed as probability or confidence level, used to assess whether the data is abnormal.
[0054] The multi-parameter correlation feature fingerprint model constructed in this application is a hybrid model combining supervised and unsupervised learning, specifically designed to characterize the stable correlations between multiple water quality parameters under normal operating conditions of a water supply network. Model Structure: The model takes multi-source input data (water quality time-series data and external environmental data) that has undergone timestamp alignment and preprocessing as input. Its core consists of a feature encoder and a correlation estimator. The feature encoder employs a fully connected neural network, responsible for extracting high-dimensional feature representations from the input data; the correlation estimator uses a graph neural network (GNN) based on an attention mechanism, whose graph structure is dynamically constructed based on the statistical correlations between parameters in historical data, used to learn and quantify the nonlinear correlation strength between parameters. Training Data and Process: The training data comes from the multi-parameter water quality time-series dataset and corresponding environmental data collected and cleaned by each edge node during the long-term historical normal operation of the water supply network. The training process is divided into two stages: In the first stage, an unsupervised learning method (such as a variational autoencoder) is used to pre-train the feature encoder on a large amount of normal data to learn the data distribution under normal operating conditions. In the second stage, a supervised learning method is used, labeled with "normal correlation patterns," to jointly optimize the feature encoder and correlation estimator by minimizing the difference between the correlation vector output by the model and the preset baseline vector. Technical objective and implementation: This model fully serves the technical objective of real-time identification of abnormal correlations in water quality parameters.
[0055] The necessary process is as follows: First, extract time-domain, frequency-domain, and parameter correlation features from the multi-source input data. Time-domain features include statistics such as the mean, standard deviation, maximum, and minimum values of water quality parameters and external environmental parameters, used to describe the characteristics of the data in the time dimension. For example, calculate the average and standard deviation of turbidity over the past 10 minutes, and the maximum and minimum values of temperature. Frequency-domain features are obtained by performing Fourier transforms on water quality parameters and external environmental parameters, such as dominant frequency and spectral energy, used to describe the characteristics of the data in the frequency dimension. For example, analyze the pH spectrum to identify whether there are periodic changes. Parameter correlation features are obtained by calculating the correlation between different parameters, such as Pearson correlation coefficient and covariance, used to capture the cooperative change patterns between parameters. For example, calculate the correlation coefficient between turbidity and residual chlorine concentration, and the covariance between temperature and humidity.
[0056] Next, the extracted features are input into a multi-parameter correlation fingerprint model. This model, trained based on historical normal operating condition data, can identify correlation patterns between normal water quality parameters. The model generates a feature correlation vector by calculating the degree of correlation between the current data and the normal pattern. For example, the feature correlation vector might be [turbidity correlation = 0.8, pH correlation = 0.7, temperature correlation = 0.9]. Simultaneously, the model calculates the confidence level of the current data's deviation from the normal baseline, typically expressed as a probability value. For example, a confidence level of 0.9 indicates that there is a 90% probability that the current data deviates from the normal pattern, potentially indicating an anomaly.
[0057] Step S14 involves using an anomaly detection algorithm to perform preliminary analysis of the feature correlation vector and identify potential anomalies. A pre-set expert rule base is then used to logically verify these anomalies, ultimately confirming the occurrence of a multi-parameter correlation feature fingerprint anomaly. The specific process of using the anomaly detection algorithm to perform preliminary analysis of the feature correlation vector and identify potential anomalies can be found in steps S141 to S145, and will not be elaborated here. The specific process of using the pre-set expert rule base to logically verify potential anomalies and ultimately confirm the occurrence of a multi-parameter correlation feature fingerprint anomaly can be found in steps S14a to S14d.
[0058] Step S15: Based on the feature correlation vector and external environment data, match predefined anomaly types, and use the feature correlation vector as the core to analyze and generate key feature contribution, and then generate feature vectors containing key feature contribution, external environment labels and confidence.
[0059] Among them, predefined anomaly types are: a classification system based on a historical case database (such as chemical pollution, microbial pollution, turbidity shock, etc.), associated with specific parameter correlation patterns and environmental triggering conditions. Key feature contribution: an indicator quantifying the contribution of each feature to anomaly type discrimination (e.g., calculated using SHAP values), used to identify the core parameters that dominate anomaly identification. External environment labels: classification labels that discretize continuous environmental data according to preset rules (e.g., high / medium / low temperature, rainfall present / absent).
[0060] The necessary process is as follows: 1. Anomaly type matching: The feature correlation vector and external environmental data are input into a pre-set hybrid classifier (decision tree coarse classification + case reasoning fine matching). The decision tree first maps the correlation vector to a primary category (chemical / biological / physical). The splitting node threshold is determined by training with 500 historical labeled samples (e.g., turbidity-residual chlorine correlation < 0.6 and conductivity > 400 μS / cm is judged as chemical). Then, in the corresponding category case library, the most similar predefined anomaly type is matched by Euclidean distance similarity calculation. For example, if a sample correlation vector shows turbidity-residual chlorine correlation of 0.35 and a sudden increase in conductivity, and the environmental label is "high temperature, no rain", it is matched to the "chemical pollution (industrial illegal discharge)" type with a matching confidence of 0.88.
[0061] 2. Key Feature Contribution Analysis:
[0062] For each matched anomaly type, the TreeSHAP algorithm is used to calculate the marginal contribution of each feature to the classification result: using normal baseline samples as the background, the SHAP value of each parameter of the current sample (such as turbidity-residual chlorine mutual information, mean conductivity, and pH spectral entropy) is calculated for the anomaly type output. The larger the absolute value of the SHAP value, the higher the contribution, and the positive or negative sign indicates the direction of influence. For example, in the chemical pollution scenario, the SHAP value of "turbidity-residual chlorine mutual information" is -0.42 (negative contribution, indicating a break in the association), and "mean conductivity" is +0.28 (positive contribution, indicating a sudden increase in conductivity). Based on this, a Top 3 ranking of key feature contributions is generated.
[0063] 3. External environment label generation and feature vector encapsulation:
[0064] Environmental data is encoded using a pre-defined discretization rule base: temperature is categorized using the ternary method (>28℃ is "high", 20-28℃ is "medium", <20℃ is "low"); rainfall is categorized by hourly rainfall (>10mm is "heavy rain", 2-10mm is "light rain"); and atmospheric pressure change rate (>5hPa in 1 hour is "rapid change"). These thresholds are determined based on the local meteorological-water quality response relationship (e.g., high temperatures accelerate residual chlorine decay). Finally, the anomaly type, the top 3 key features contributing (feature name + SHAP value), external environmental labels, and comprehensive confidence (weighted fusion of correlation deviation confidence and type matching confidence) are integrated to form a structured feature vector, which is then encapsulated in the diagnostic results for uploading.
[0065] Step S16: Based on the location information of the edge nodes, the matched anomaly type, feature vector, and corresponding timestamp are encapsulated to form a diagnostic result. The edge node location information includes metadata identifying the spatial location of the edge node in the water supply network, including the node's unique identifier, geographic coordinates (latitude and longitude), network topology address (pipe segment number + station number), and hydraulic zoning code.
[0066] The necessary procedures are as follows:
[0067] Multi-dimensional information integration and encapsulation: The edge node integrates the anomaly type, feature vector, and local metadata generated in step S15, and encapsulates them using the Protobuf binary serialization format to compress the transmission volume. The encapsulated content includes: header information (protocol version, node ID, data length), core data (anomaly type encoding, feature vector JSON, millisecond-level UTC timestamp NTP synchronization), spatial identifiers (latitude and longitude WGS84 coordinates, pipe segment topology address, hydraulic partition code), and quality markers (data reliability level, sensor status bits).
[0068] For example, the encapsulation result of a certain node is: NodeID="GW_2025_089", anomaly type="chemical pollution_industrial illegal discharge", feature vector contains the top 3 key contributions and a comprehensive confidence level of 0.90, timestamp "2025-12-14T10:00:00.000Z", coordinates "116.4074,39.9042".
[0069] Reference Figure 3 An anomaly detection algorithm is used to perform a preliminary analysis of the feature correlation vector to identify potential anomalies, including:
[0070] Step S141: Based on a preset time window, extract the current and historical sequences from the feature correlation vector to construct a time-series feature matrix; simultaneously acquire external environmental data aligned with the preset time window and encode the external environmental data into an environmental feature vector. The preset time window is a fixed time range used to extract the historical sequence of the feature correlation vector, typically set to a 10-minute or 30-minute sliding window, determining the temporal context length for anomaly detection. The time-series feature matrix is a two-dimensional matrix composed of stacked feature correlation vectors at various time points within the window; rows represent time steps, and columns represent parameter dimensions (such as correlations for turbidity, pH, and residual chlorine), depicting the dynamic evolution of the correlation over time. The environmental feature vector is a numerical vector formed by normalizing or quantile encoding the external environmental data, used for fusion with the water quality time-series features.
[0071] The necessary processes are described as follows: 1. Construction of the time-series feature matrix: Based on a 10-minute sliding time window (5-minute step, synchronized with the sampling period), the sequence of the current and past 119 time points (120 rows in total) is extracted from the historical cache of feature correlation vectors. Each row of the matrix corresponds to an 11-dimensional correlation vector (correlation of 7-dimensional water quality parameters + 4-dimensional environmental parameters) for a timestamp, and each column represents the time series of correlation of a specific parameter. For example, the first column is the time series of turbidity correlation, the fifth column is the time series of residual chlorine correlation, and the matrix dimension is 120×11. A sliding window mechanism is adopted. For each new sampling point, the matrix moves down one row, discarding the oldest data to maintain the real-time nature of the window. 2. Synchronous acquisition and encoding of external environmental data: Synchronously acquire external environmental data (temperature, humidity, air pressure, rainfall) aligned with the window time. Min-Max normalized encoding was employed: temperature was mapped to [0,1] (based on historical extreme values of 0-40℃), humidity was directly expressed as percentage / 100, air pressure was normalized to (current value - standard atmospheric pressure) / 50hPa, and rainfall was encoded using logarithmic compression (ln(1+mm)). The encoded data formed a 4-dimensional environmental feature vector, such as [temperature 0.75, humidity 0.60, air pressure 0.02, rainfall 0.00], which was temporally aligned with the temporal feature matrix for subsequent fusion input.
[0072] Step S142: The temporal feature matrix and the environmental feature vector are concatenated to form a fused input matrix.
[0073] The necessary process is as follows: Environmental feature vectors are expanded to match the number of rows in the time-series feature matrix using feature broadcasting technology. Specifically, the environmental feature vectors (each a single 4-dimensional vector encoding temperature, humidity, air pressure, and rainfall) are broadcast in rows to generate 120 identical rows (corresponding to 120 time points within a 10-minute window). These rows are then horizontally concatenated with the time-series feature matrix (120 rows × 11-dimensional water quality correlation) along the column dimensions to form a fused input matrix (120 rows × 15 dimensions). Taking a 10-minute sliding window as an example: each row of the time-series feature matrix contains 11-dimensional water quality correlation (correlation values for parameters such as turbidity, pH, residual chlorine, conductivity, and dissolved oxygen), while each row of the broadcast environmental feature matrix contains 4-dimensional environmental codes (e.g., temperature code 0.75, humidity code 0.60, air pressure code 0.02, and rainfall code 0.00). After concatenation, each row of feature vectors has 15 dimensions, with the structure: [turbidity correlation, pH correlation, residual chlorine correlation, ..., temperature encoding, humidity encoding, air pressure encoding, rainfall encoding]. This construction ensures that the water quality state at each time point is coupled with the corresponding environmental context. For example, row 50 (corresponding to data from 5 minutes ago) includes both the turbidity-residual chlorine correlation at that time and the temperature and humidity conditions at that time.
[0074] Step S143 involves parallel analysis of the fused input matrix using at least two anomaly detection algorithms based on different detection principles, generating preliminary anomaly scores corresponding to each algorithm. The anomaly detection algorithms are computational models that identify data anomaly patterns based on different mathematical principles. This step employs two complementary methods: multivariate statistical process control and unsupervised machine learning, detecting anomalies from the perspectives of global statistical distribution deviation and local feature space outliers, respectively.
[0075] The necessary procedures are as follows:
[0076] I. Parallel Configuration of Dual Algorithms:
[0077] Configure two algorithms based on different detection principles to process the fused input matrix (120 rows × 15 dimensions) in parallel:
[0078] Algorithm A: Hotelling T 2 Control chart (Hotelling'sT) 2 (Multivariate statistical process control). Multivariate statistics are calculated based on Mahalanobis distance to detect deviations in the overall covariance structure of parameter groups. Algorithm construction: The sample mean vector and covariance matrix are calculated using historical normal operating condition data (30-day sliding window), and statistical control limits are established (99.73% confidence level, corresponding to 3σ). For each row of the fused input matrix (15-dimensional features at a single time point), T is calculated. 2 Statistic: After F-distribution transformation, the statistical outlier scores are normalized to [0,1]. This algorithm is sensitive to multi-parameter co-shifts, such as synchronous anomalies in turbidity, conductivity, and pH caused by chemical pollution. Algorithm B: Isolation Forest (Ensemble Learning). Based on a randomized splitting tree structure, it evaluates the isolation degree of samples in the feature space through path length. Algorithm construction: Configure 100 decision trees, subsample number 256, feature sampling ratio 0.8. Calculate the average path length E(h) row by row of the fused input matrix and convert it into anomaly scores: , where c(n) is the average path length normalization factor for a given number of samples. This algorithm is sensitive to local outliers, such as a sudden increase in turbidity at a single point caused by a sudden pipeline rupture.
[0079] II. Parallel Reasoning and Score Generation:
[0080] The fused input matrix undergoes parallel inference via multi-core CPUs at edge nodes (2 threads, one algorithm per thread), and the two algorithms independently output preliminary anomaly score vectors in the time series dimension.
[0081] Statistical anomaly score vector This reflects the degree of statistical deviation at each time point relative to historical normal operating conditions. For example, if the p-value of the T² statistic at a certain time is 0.008, and after Sigmoid mapping, the output is 0.92, it indicates that the data point at that time point is outside the statistical control limits and there is a significant group deviation. (Machine Learning Anomaly Score Vector) This reflects the degree of isolation at each time point in the high-dimensional feature space. For example, if the average path length in the isolated forest at a certain time is 4.2 (expected value is 6.5), and the output after normalization is 0.85, it means that the data point can be isolated with only a few segmentations and is judged as a local outlier.
[0082] The two vectors together form a preliminary set of anomaly scores, which serves as the input for dynamic weighted fusion in step S144. Parallel computation latency is <80ms, meeting the requirements for real-time edge-side diagnosis.
[0083] Step S144: Based on the environmental feature vector, multiple preliminary anomaly scores corresponding to the same edge node are dynamically weighted and fused to generate a fused anomaly score for each edge node. The dynamic weighted fusion mechanism adjusts the output weights of different anomaly detection algorithms in real time based on the environmental feature vector and a pre-defined environment-algorithm adaptation rule. The core logic is: when environmental disturbances are severe, the weights of algorithms with high requirements for statistical distribution stability are reduced, while the weights of algorithms sensitive to local anomalies are increased.
[0084] The necessary procedures are as follows:
[0085] 1. Environment-algorithm adaptation weight calculation:
[0086] Establish a mapping rule between environmental features and algorithm weights, and dynamically allocate weights based on the impact of environmental perturbations on the algorithm principle:
[0087] Steady-state environment (rainfall code less than 0.2 and stable pipeline pressure): Increase Hotling T 2 Control the weights of the control graph algorithm (e.g., 0.7), and reduce the weights of the isolation forest algorithm (0.3). Inhotlin T 2 The dependent covariance matrix is stable under steady state, ensuring reliable detection of multi-parameter cooperative migration. Disturbance environments (rainfall coding greater than or equal to 0.2 or sudden changes in pipeline pressure): reduce Hotelling T. 2 Increase the weight of the isolated forest (e.g., 0.3) to 0.7. This is because environmental noise disrupts the stability of the statistical distribution, while the isolated forest is not dependent on the global distribution and is more robust to local outliers.
[0088] Weight calculation implementation: A pre-built expert rule base or a lightweight gating network is used (input 4D environmental features, output 2D weights, which are then normalized). For example, if the environmental feature vector shows a rainstorm scene (rainfall encoding 0.8), the gating network outputs weights of type Hotelling T. 2It accounts for 0.25%, and isolated forests account for 0.75%.
[0089] 2. Temporal Fusion and Score Generation: The two 120-dimensional preliminary anomaly score vectors output from step S143 are weighted and fused point-by-time. Taking a single time point as an example: at this point, Hotelling T... 2 With a score of 0.85, an isolated forest score of 0.60, and the current environment being a rainstorm (weighted at 0.3 and 0.7), the merged anomaly score is calculated as 0.85 multiplied by 0.3 plus 0.60 multiplied by 0.7, resulting in 0.675.
[0090] 3. Output and Threshold Determination: Generate a fusion anomaly score time series (120 dimensions) and extract the global maximum value as the representative score of the edge node. If the maximum value exceeds a preset threshold (e.g., 0.8), the node is marked as potentially anomaly and proceeds to step S14a for expert rule verification. The fusion process delay is less than 10 milliseconds, meeting real-time requirements.
[0091] Step S145: Based on a predefined pipe network topology map reflecting the hydraulic connectivity between edge nodes, calculate the spatial correlation of fusion anomaly scores between different edge nodes, and perform spatial consistency verification on the fusion anomaly scores. Hydraulic connectivity refers to the physical connection relationships between nodes defined by the pipe network GIS topology, including directly connected pipe segments, flow direction, and pipe segment attributes (length, diameter). Spatial correlation refers to the statistical correlation between fusion anomaly scores of adjacent edge nodes (directly connected via pipe segments), quantified using Pearson correlation coefficient or Spearman rank correlation coefficient, reflecting the spatially coordinated occurrence pattern of anomalies. Spatial consistency verification: Based on spatial correlation, determine whether anomalies between adjacent nodes conform to the hydraulic diffusion law. If the anomaly scores of adjacent nodes are significantly correlated, it indicates that the anomaly may propagate along the pipe network topology; if they are not correlated, it may be a local independent disturbance.
[0092] The necessary procedures are as follows: 1. Neighbor node identification and correlation calculation: Based on a pre-set pipeline topology map, identify the direct hydraulic neighbors of each edge node (upstream and downstream nodes directly connected through a single pipe segment). For each pair of adjacent nodes, calculate the Pearson correlation coefficient (or Spearman rank correlation coefficient) of their fusion anomaly scores to assess the spatial correlation strength. The calculation window uses a time series of the past 30 minutes (6 sampling points), and the correlation coefficient is dynamically updated.
[0093] 2. Spatial consistency determination:
[0094] Spatial consistency is classified according to the correlation coefficient:
[0095] Spatial high consistency: The correlation coefficient is greater than 0.7, indicating that adjacent nodes appear abnormally in tandem, which is consistent with the diffusion characteristics along the pipeline network;
[0096] Spatial inconsistency: A correlation coefficient of less than 0.3 indicates that anomalies occur independently between adjacent nodes, which may be due to local sensor malfunctions or local construction interference.
[0097] Boundary region: correlation coefficient 0.3 to 0.7, marked as requiring further analysis.
[0098] 3. Anomaly Propagation Subgraph Identification and Labeling: Based on spatial consistency results, a connected subgraph search is performed on the pipeline topology graph: Node pairs with a correlation coefficient greater than 0.7 are considered strongly correlated edges, and potential anomaly propagation subgraphs are constructed. Connected components containing 3 or more nodes are identified as key propagation chains, and the positions of each node on the chain and the distribution of anomaly scores are recorded.
[0099] For isolated single-point anomalies (where the correlation coefficient between the node and all its direct neighbors is less than 0.3), they are marked as "spatially isolated - local interference" and are the focus of expert rule verification in step S14a, prioritizing the investigation of non-hydraulic factors (such as single-point sensor failure or local maintenance work). The final output is a potential anomaly propagation subgraph and a spatial consistency label matrix for subsequent steps. Example: Nodes A (0.76), B (0.72), and C (0.45) are located in the same branch pipe and are connected sequentially. The calculated correlation coefficients for AB are 0.85 and BC are 0.82, both greater than 0.7, indicating spatial consistency and forming a potential propagation chain; while node D (0.80) has correlation coefficients less than 0.3 with all its neighbors, marking it as spatially isolated and entering the subsequent local interference investigation.
[0100] Step S146: Based on the spatial consistency verification results, identify and output potential anomalies that are significantly correlated in spatial distribution or conform to the laws of hydraulic diffusion. Potential anomalies are sets of anomalous nodes selected through spatial consistency verification that exhibit spatial clustering characteristics or propagation trends. These nodes have not yet been finalized by the expert rule base but conform to the physical laws of hydraulic diffusion and possess value for further source tracing analysis.
[0101] The necessary procedures are as follows:
[0102] 1. Potential anomaly identification based on spatial consistency:
[0103] Based on the spatial consistency marker matrix generated in step S145, perform hierarchical identification:
[0104] Clustered potential anomalies: Connected subgraphs marked as "spatially highly consistent" (correlation coefficient > 0.7) and with ≥ 3 connected nodes are identified as anomalous propagation chains. The fusion anomaly score, hydraulic flow direction, and topological location of each node in the chain are extracted to form a "source-path" candidate sequence. For example, the propagation chain A→B→C is identified, where A is the upstream source (score 0.82), B is a relay node (0.78), and C is the downstream diffusion point (0.65). Isolated potential anomalies: Single high-value nodes marked as "spatially inconsistent" (fusion anomaly score > 0.8 but correlation with all neighbors < 0.3) are listed separately as local suspected anomalies and labeled "spatially isolated."
[0105] 2. Conformity judgment of hydraulic diffusion law:
[0106] For the identified propagation chains, a flow direction conformity check is performed: verify whether the anomaly scores of nodes on the chain show a gradient decrease or temporal lag along the water flow direction (high scores are upstream, low scores are downstream, conforming to the dilution diffusion law). If they conform, they are judged as potential anomalies conforming to the hydraulic diffusion law; if they are reversed or disordered, they are marked as "suspected multi-point pollution from the same source", still included in the potential anomaly list but with an additional risk warning.
[0107] 3. Structured output and subsequent integration:
[0108] The identification results are encapsulated into a list of potential anomalies, including:
[0109] Propagation chain entries: node sequence, mean spatial correlation, hydraulic flow direction conformity label; isolated point entries: node identifier, spatial isolation marker, suggested investigation direction (sensor / local interference).
[0110] The system then uses a pre-built expert rule base to perform logical checks on potential anomalies, ultimately confirming that the following anomalies occur due to multi-parameter correlation feature fingerprinting:
[0111] Step S14a: Obtain potential anomalies from the identification output and simultaneously retrieve context data corresponding to the timing and spatial location of the potential anomalies from the associated business system; the context data includes water system scheduling operation records corresponding to the timing, pipeline maintenance records of the surrounding area within a preset time window, and environmental background data corresponding to the timing and spatial location.
[0112] The contextual data includes auxiliary data corresponding to potential anomalies within a time window (±Δt) and a spatial buffer (radius R), including water system dispatch operation records, pipeline maintenance records, and environmental background data, used to exclude non-polluting interference factors. Water system dispatch operation records record dispatch operations of the water system within a specific time period, such as pump station start-up and shutdown, valve adjustment, etc., which may affect water quality. Pipeline maintenance records record maintenance activities of the pipeline network within a specific time and area, such as pipeline cleaning and repair, which may have a temporary impact on water quality. Environmental background data records environmental conditions at the time of potential anomalies, such as rainfall and temperature, which may have a natural impact on water quality.
[0113] The necessary process is described below:
[0114] I. Retrieving context data for spatiotemporal alignment:
[0115] Based on the potential anomaly list (including node ID, anomaly timestamp T, and geographic coordinates) output in step S146, three types of data are retrieved in parallel from related business systems via IoT platform API or database time-series query:
[0116] Water Dispatch Operation Records: Retrieve operation logs within the time window [T-2h, T+2h] for pump station start-up and shutdown, valve adjustment, and chemical dosage changes to identify false anomalies caused by human operation (such as turbidity fluctuations caused by pump station start-up and shutdown). Pipeline Maintenance Records: Retrieve records of pipeline flushing, valve replacement, etc., within the spatial buffer zone (within a 500-meter radius of the abnormal node) and the time window [T-24h, T] to identify temporary water quality disturbances caused by maintenance activities. Environmental Background Data: Retrieve meteorological data such as rainfall and temperature within the time window [T-1h, T+1h] to identify background fluctuations caused by natural factors such as rainstorm runoff and sudden temperature changes.
[0117] II. Heterogeneous Data Standardization and Integration: Data standardization middleware is used to uniformly convert heterogeneous system data (SCADA real-time database, GIS spatial database, and JSON returned by meteorological API) into structured context feature packages. Example format: Includes event ID, spatiotemporal label, scheduling operation list (operation type / time / impact level), maintenance record list (job type / time / distance), and environmental background (rainfall / temperature / air pressure).
[0118] III. Data Integrity Verification and Output: The retrieved results are verified for integrity. If any type of data is missing (e.g., the maintenance system is offline), it is marked as "data missing," and the corresponding dimension weight is reduced in subsequent rule verifications. Finally, a context-enhanced potential anomaly dataset is generated as input for the expert rule base logical reasoning in step S14b.
[0119] Step S14b involves inputting potential anomalies and their corresponding contextual data into a pre-set expert rule base for multi-dimensional logical reasoning verification. The logical reasoning verification includes: first verification, based on hydraulic model rules, analyzing whether the spatial distribution of potential anomalies supports the physical laws of diffusion from a certain source through the pipeline topology; second verification, based on environmental logic rules, determining whether the characteristic patterns of potential anomalies contradict the normal changes indicated by the environmental background data; and third verification, based on operational interference elimination rules, determining whether the occurrence of potential anomalies can be explained by planned activities in the scheduling operation records or pipeline maintenance records.
[0120] The expert rule base is a knowledge system built on production rules (IF-THEN), comprising a hydraulic model rule set, an environmental logic rule set, and an operational interference exclusion rule set. It uses an inference engine to perform multi-dimensional logical verification of potential anomalies. The first verification (hydraulic model rules) verifies whether the spatial distribution of anomalies conforms to the source-diffusion physical laws, based on the matching of the hydraulic residence time of the pipe section with the anomaly propagation delay. The second verification (environmental logic rules) verifies the compatibility of anomaly characteristic patterns with environmental background data, using historical prior probabilities to determine whether the anomaly belongs to environmentally induced natural fluctuations. The third verification (operational interference exclusion rules) verifies whether the anomaly can be explained by planned maintenance activities, using spatiotemporal buffer matching to exclude human operational interference.
[0121] The necessary process is described below:
[0122] I. Loading and Inputting Expert Rule Base: Input the potential anomalies (including spatial distribution, feature patterns, and time series data) and context data obtained in step S14a into the expert rule base. The rule base adopts a production rule structure, with each rule defining a condition-conclusion pair. For example, the hydraulic model rule: "If the anomaly intensity of the downstream node is less than that of the upstream node multiplied by the hydraulic attenuation coefficient of 0.8, and the propagation time delay deviates from the hydraulic residence time of the pipe section by less than 15%, then it is determined that source diffusion is supported."
[0123] II. Hydraulic Model Rule Validation:
[0124] Based on the rules of the hydraulic model, analyze whether the spatial distribution of potential anomalies supports diffusion from a certain source through the pipe network topology:
[0125] Technical means: Compare the attenuation curve of the actual anomaly score along the pipeline network with the theoretical diffusion curve based on hydraulic residence time to calculate the propagation time delay error. Judgment criteria: If the anomaly intensity of the downstream node decreases gradient along the water flow direction (consistent with the dilution law), and the propagation time delay error is less than a preset threshold (e.g., 15%), it is judged as "supporting source diffusion"; if there is a reverse distribution such as low upstream score and high downstream score, it is judged as "not conforming to hydraulic law".
[0126] III. Environmental Logic Rule Validation:
[0127] Based on environmental logic rules, determine whether the characteristic patterns of potential anomalies contradict the environmental background data:
[0128] Technical means: Query the environment-anomaly pattern association database (records the prior occurrence probability of various anomalies under different environmental conditions). Judgment criteria: If the historical co-occurrence probability of the current anomaly type (such as chemical pollution) under the current environmental background (such as heavy rain) is lower than the threshold (such as 5%), it is judged as "environmental contradiction" (indicating real pollution); if it is higher than the threshold (such as 50%), it is judged as "environmental consistency" (indicating natural disturbance, such as heavy rain causing an increase in turbidity).
[0129] IV. Verification of Operational Interference Elimination Rules:
[0130] Based on the operational interference elimination rules, determine whether the occurrence of potential anomalies can be explained by planned activities:
[0131] Technical means: Spatiotemporal buffer matching is used to retrieve dispatch operation records (pump station start / stop, valve adjustment) or pipeline maintenance records (pipeline flushing) within a preset influence radius (e.g., 500 meters) and time window (e.g., ±30 minutes) around the abnormal node. Judgment criteria: If there is an explainable operation event, and the operation influence pattern matches the abnormal characteristics (e.g., turbidity fluctuation of ±20% within 30 minutes after pump station start / stop is a normal response), it is judged as "explainable by operation"; if there is no such record or the influence pattern does not match, it is judged as "operation-irrelevant".
[0132] V. Structured output of verification results:
[0133] Generate a three-dimensional verification result vector, clearly recording the judgment conclusions (compliance / contradiction / irrelevance) and confidence scores of the first verification (hydraulic compliance), the second verification (environmental inconsistency), and the third verification (operational interpretability), as the decision basis for generating the comprehensive verification conclusion in step S14c.
[0134] Step S14c: Based on the results of logical reasoning verification, a comprehensive verification conclusion is generated for each potential anomaly. This conclusion determines whether the potential anomaly is a true feature fingerprint anomaly requiring confirmation. The comprehensive verification conclusion is based on a weighted quantitative score (0-1) and a binary judgment label (true anomaly / interference pseudo-anomaly / pending verification) derived from the three-dimensional logical reasoning verification results. This is used to ultimately screen anomalies that need to enter the early warning process. True feature fingerprint anomalies: Anomalies with a comprehensive verification score ≥ 0.7 and meeting the condition of "hydraulic compliance + (environmental contradiction or operational irrelevance)" are confirmed as non-interference water pollution events.
[0135] Necessary process description:
[0136] I. 3D verification result quantization scoring:
[0137] Receive the 3D verification result output by step S14b and convert it into a quantization value (0 - 1) using a weighted scoring mechanism:
[0138] Hydraulic model verification: If it conforms, get 1 point (weight 0.5); if it does not conform, get 0 points. The weight is the highest because hydraulic diffusion is the core physical feature of pipe network pollution. Environmental logic verification: If there is a contradiction, get 1 point (weight 0.3); if it is consistent, get 0 points. "Contradiction" means it can be explained by non - environmental background, supporting the determination of real pollution. Operation interference verification: If it is irrelevant, get 1 point (weight 0.2); if it can be explained, get 0 points. "Irrelevant" means it is not caused by operation and maintenance activities.
[0139] II. Comprehensive score calculation and grading determination:
[0140] Calculate the comprehensive score: .
[0141] Determination threshold:
[0142] Abnormal real feature fingerprint (Score≥0.7): Meet the hydraulic diffusion law (0.5 points), and at least one of the following holds: environmental contradiction (0.3 points) or operation irrelevance (0.2 points). Typical scenarios: Hydraulic compliance + environmental contradiction + operation irrelevance (0.5 + 0.3 + 0.2 = 1.0), or hydraulic compliance + environmental consistency but operation irrelevance (0.5 + 0 + 0.2 = 0.7, need to be combined with intensity for judgment).
[0143] Interference pseudo - anomaly (Score≤0.4): Hydraulic non - compliance (0 points) or operation can be explained (0 points) and environmental consistency (0 points). Typical scenarios: Hydraulic non - compliance + environmental consistency + operation can be explained (0 + 0 + 0 = 0), or hydraulic compliance but environmental consistency and operation can be explained (0.5 + 0 + 0 = 0.5).
[0144] Pending manual review (0.4 < Score < 0.7): Borderline cases, such as only hydraulic compliance but both environment and operation cannot be excluded (0.5 + 0 + 0 = 0.5), or hydraulic non - compliance but environmental contradiction (0 + 0.3 + 0.2 = 0.5).
[0145] III. Conclusion generation and structured output:
[0146] Generate a comprehensive verification conclusion package for each potential anomaly, including:
[0147] Comprehensive score (0 - 1 numerical value);
[0148] Determination label (real anomaly / interference pseudo - anomaly / pending review);
[0149] Judgment criteria (specific results of 3D verification, such as "hydraulic propagation time delay error 8%, consistent; environmental background heavy rain but anomaly type is chemical pollution, contradictory; no scheduling operation record, irrelevant"). Confidence level (high: Score ≥ 0.8; medium: 0.6-0.8; low: < 0.6). Only events marked as "true feature fingerprint anomalies" are output to step S14d; the rest are filtered as interference pseudo-anomalies or transferred to the manual review queue.
[0150] Step S14d outputs the potential anomalies that are determined to be true feature fingerprint anomalies by the comprehensive verification conclusion, as the final confirmed multi-parameter associated feature fingerprint anomalies.
[0151] Based on a dynamic digital twin model, a mechanism simulation is performed on multi-node time-series feature vectors, and the simulation results are compared with the actual feature vectors to generate a residual feature field reflecting the spatial distribution of anomalies, including:
[0152] Step S21: Based on historical normal operating condition data, initialize the dynamic digital twin model and drive it to perform forward time extrapolation to obtain the theoretical feature vectors at each node at the current moment. This serves as the result of the mechanism simulation. The dynamic digital twin model is a mechanism simulation model that incorporates network topology, pipe segment hydraulic properties, and water quality reaction kinetic parameters. Historical normal operating condition data: Water quality and hydraulic data collected under normal operating conditions are used to initialize and calibrate the dynamic digital twin model, ensuring that the model can accurately simulate the network operation under normal conditions. Theoretical feature vectors: The expected feature vectors of each node at the current moment calculated by the dynamic digital twin model based on its built-in physical mechanisms and parameters, including water quality parameters (such as turbidity, pH value, residual chlorine concentration, etc.) and hydraulic parameters (such as flow rate, pressure, etc.).
[0153] The necessary processes are described as follows: I. Model Initialization and Dynamic Calibration: The dynamic digital twin model is initialized using historical normal operating condition data, including the topology of the pipe network, the hydraulic properties of pipe sections (pipe length, diameter, roughness, etc.), and the kinetic parameters of water quality reactions (chemical reaction rate, biological reaction rate, etc.). After initialization, the model uses the measured feature vectors of each edge node at the most recent time (T-1) as the initial state. Time-varying parameters such as the pipe wall reaction coefficient are corrected online through rolling time-domain estimation to ensure that the model prediction error is less than a preset threshold (e.g., 10%), thus achieving dynamic model updates. II. Forward Time Extrapolation and Boundary Condition Input: Using the measured water quality value of the water source at time T, real-time water demand, and pump station scheduling instructions as boundary conditions, the initialized dynamic digital twin model is driven to perform forward time extrapolation, calculating the theoretical feature vectors at each node one time step later (e.g., 5 minutes). The model, based on its built-in physical mechanisms (hydraulic-water quality coupled solution, such as the EPANET-MSX engine), simulates the propagation and changes of water quality and hydraulic parameters in the pipeline network, generating the expected feature vectors for each node. The timestamps of the simulation results are strictly aligned with the sampling timestamps of the multi-node time-series feature vectors (millisecond precision, NTP synchronization). III. Generating Mechanism Simulation Results: The theoretical feature vectors output by the model serve as the mechanism simulation results, forming a theoretical reference field spatiotemporally aligned with the measured data, used for subsequent comparative analysis with actual feature vectors.
[0154] Step S22: Compare the theoretical feature vectors of each node in the mechanism simulation results with the corresponding actual feature vectors in the multi-node time-series feature vectors, and calculate the feature difference degree of each node.
[0155] The specific process is as follows: 1. Data Alignment: Ensure that the theoretical feature vectors and multi-node temporal feature vectors in the mechanism simulation results are aligned in time and space. This step ensures that the theoretical feature vector of each node can be directly compared with the corresponding actual feature vector. 2. Calculate Feature Difference: For each node, calculate the difference between the theoretical feature vector and the actual feature vector. Commonly used methods for calculating the difference include Euclidean distance, Manhattan distance, or cosine similarity. For example, using Euclidean distance to calculate the difference between two vectors: Difference = Among them, x i and y i These are the i-th eigenvalues in the theoretical and actual eigenvectors, respectively, where n is the dimension of the eigenvector. 3. Generate a difference matrix: Record the feature difference of each node to form a difference matrix. This matrix reflects the distribution of feature differences among nodes in the entire pipeline network and can be used for subsequent anomaly detection and analysis.
[0156] Step S23: Based on the pipeline network topology, a spatial interpolation algorithm is used to reconstruct the feature differences of each node into a continuous spatial distribution field covering the entire pipeline network, which serves as the residual feature field. The pipeline network topology describes the connection relationships between nodes and pipes in the water supply network, including information such as node locations, pipe lengths, and directions. The pipeline network topology is the foundation for spatial interpolation and anomaly propagation analysis. Spatial interpolation algorithms are used to estimate data at unknown locations based on data from known nodes. Common spatial interpolation methods include nearest neighbor interpolation, linear interpolation, and Kriging interpolation. These algorithms can generate a continuous spatial distribution field covering the entire pipeline network based on the feature differences of known nodes.
[0157] The necessary processes are as follows: 1. Pipeline topology analysis and gridding: Extract the topology from the pipeline database, including node coordinates and pipeline connection relationships. Divide the pipe segments into one-dimensional linear grids along the centerline (spacing 50-100 meters), or perform non-uniform discretization based on the pipe segment length to ensure that the interpolation points are located on the actual pipeline path, avoiding invalid interpolation in areas without a pipeline network. Coordinates are obtained from node coordinates through linear interpolation. 2. Selection and application of spatial interpolation algorithm: Select the Kriging interpolation algorithm based on the pipeline layout and data characteristics. Establish a semivariance model based on the hydraulic path length of the pipe segment (rather than Euclidean distance): Using the water flow path length along the pipeline as the lag distance, fit the experimental semivariance function to determine the range (influence radius) and sill value, characterizing the spatial autocorrelation of pollutant propagation along the pipeline network. Calculate the Kriging weight of each known node to the grid points, and use the weights and the characteristic variability of the known nodes to calculate the characteristic variability of the unknown grid points and its estimated variance (quantifying interpolation uncertainty). 3. Residual Feature Field Generation and Visualization: The estimated characteristic difference and variance of all grid points are combined to form a continuous spatial distribution field covering the entire pipeline network, which serves as the residual feature field. Visualization is achieved through color coding: red indicates high difference (abnormal core area), blue indicates low difference (normal area), and transparency or grid line density represents the estimated variance (high variance areas correspond to monitoring blind spots, indicating low data reliability). This visually displays the spatial distribution and confidence level of anomalies.
[0158] Then, by utilizing a graph-spatiotemporal fusion network, the residual feature field and pipeline topology information are integrated to generate a global risk map that identifies the location of anomaly sources and their spread trends, including:
[0159] Step S2a: Based on the pipeline network topology information, construct a pipeline network topology graph with edge nodes as vertices and pipe segments connecting edge nodes as edges.
[0160] The necessary process is as follows: 1. Extract pipeline topology information: Extract topology information from the pipeline GIS database, including the coordinates of edge nodes and interpolation points inside the pipe segments generated by S23 gridding, pipeline connection relationships, pipe segment length, diameter, material roughness coefficient and flow direction, etc.
[0161] 2. Construct a weighted directed graph with enhanced physical information:
[0162] Vertex Definition: All computational points (including original edge nodes and interpolated grid points within the pipe segment) in the S23 residual feature field are used as graph vertices. Each vertex is attached with an initial feature vector (containing the residual feature variance and estimated variance of that point). Edge Definition: Directed edges are constructed according to the water flow direction, connecting adjacent vertices (adjacent grid points within the same pipe segment or pipe segment endpoint nodes). Edge weights are calculated from the physical properties of the pipe segment: weight = 1 / (pipe segment length × hydraulic residence time) or an admittance coefficient based on pipe diameter and roughness coefficient, characterizing the hydraulic connectivity and contaminant transport resistance. Graph Construction: A physically enhanced weighted directed graph is constructed using vertices and weighted edges, stored in the form of an adjacency matrix, ensuring that edge weights encode the hydraulic transmission characteristics of the pipe network.
[0163] 3. Connectivity verification and weight normalization:
[0164] Connectivity verification: Check graph connectivity to ensure there are no isolated subgraphs (except for monitoring blind spots). If a break exists, backtrack to the S23 interpolation point generation logic for correction. Weight normalization: Normalize the weight of each edge (e.g., Softmax or linear normalization to [0,1]) to ensure the stability of subsequent graph convolution operations.
[0165] Step S2b: Extract the spatial features corresponding to each edge node from the residual feature field, and fuse them with the historical feature sequence of the corresponding node in the multi-node temporal feature vector to form a spatiotemporal fusion feature attached to each vertex of the pipeline topology map.
[0166] The specific process is as follows: 1. Spatial feature extraction: For each vertex in the pipeline topology diagram constructed in step S2a, the residual feature difference degree and Kriging estimation variance at the current time T are extracted from the residual feature field (S23) to form a spatial feature vector (e.g., [current difference degree, estimated variance], 2-dimensional), which characterizes the current anomaly intensity and data reliability of the node. 2. Temporal feature alignment and encoding: From the multi-node temporal feature vector (aggregation result of step S2), the historical feature sequence of each vertex corresponding node within the [T-Δt, T] time window is extracted (e.g., the correlation vector of the past 30 minutes, 6 time steps). A lightweight temporal encoder (e.g., 1D convolutional layer or bidirectional GRU, 32-dimensional hidden layer) is used to compress the variable-length historical sequence into a fixed-length temporal embedding vector (32-dimensional) to capture the anomaly evolution trend (e.g., gradual increase, sudden decrease, periodicity). 3. Spatiotemporal Feature Fusion and Attachment: The spatial feature vector (current residual) and the temporal embedding vector (historical evolution) are concatenated along the feature dimension to form a spatiotemporal fusion feature vector (e.g., 2+32=34 dimensions). This vector is attached as an attribute to the corresponding vertex of the pipeline network topology graph, containing both spatial information of "where the anomaly is at this moment" and temporal information of "how it evolved," providing complete input for the deep reasoning of the spatiotemporal fusion network in step S2c.
[0167] Step S2c involves inputting the spatiotemporal fusion features of the pipeline network topology and its vertices into a graph spatiotemporal fusion network. The network then performs spatial graph convolution and temporal series evolution analysis to form a deep feature representation of the anomalous spatiotemporal propagation pattern. The specific process can be found in steps S2c1 to S2c3.
[0168] Step S2d, based on deep feature representation, decodes and generates the probability distribution of each node as a pollution source, and the probability distribution of the intensity and direction of anomaly propagation along each pipe segment through the output layer of the graph spatiotemporal fusion network. Specifically, the pollution source probability distribution is the posterior probability distribution of each node as an anomaly injection source generated by the output layer of the graph spatiotemporal fusion network. Softmax normalization is used to ensure that the sum of the probabilities of all nodes is 1, and the node corresponding to the maximum probability is determined as the location of the anomaly source. The propagation intensity and direction probability distribution is the propagation activation probability (0-1) and direction determination (downstream / upstream) generated by the graph spatiotemporal fusion network for each pipe segment (edge). Sigmoid activation is used to characterize the possibility and trend direction of anomaly propagation along that pipe segment.
[0169] The necessary process is as follows: 1. Decoding input based on deep feature representation: Receive the deep node feature representation (the high-dimensional feature vector corresponding to each node, which encodes the abnormal pattern information of the node in the spatiotemporal dimension) generated by the graph spatiotemporal fusion network in step S2c, as the input basis for the decoding of the output layer.
[0170] 2. Decoding via dual tasks at the output layer:
[0171] The output layer of the graph-temporal fusion network contains two parallel decoding branches, corresponding to source identification and diffusion prediction, respectively:
[0172] Node decoding branches: Deep feature representations of each node are used to extract source-related patterns through a fully connected mapping layer. Softmax normalization is then applied to generate the probability distribution of each node as a pollution source. The network automatically learns to identify source characteristics (such as high anomaly intensity, location at a branch point, etc.) from the features, with the output dimension consistent with the number of nodes.
[0173] Edge decoding branch: For each pipe segment (edge), the deep feature representations of the two end nodes are spliced and fused and then input into the fully connected layer. After Sigmoid activation, the intensity probability of the anomaly propagating along the pipe segment is generated. At the same time, combined with the preset water flow direction attribute of the pipe segment, the direction probability component (probability of propagation with the water flow vs. probability of propagation against the water flow) is output to determine the diffusion trend.
[0174] 3. Generate probability distribution and structured output:
[0175] Source location: Select the node with the highest probability from the probability distribution output by Softmax as the main source position, and extract the Top-K candidates (such as the top 3) and their corresponding probability values.
[0176] Propagation path determination: Based on the propagation intensity probability output by Sigmoid, pipe segments with a probability higher than the threshold (e.g., 0.7) are selected as high-probability propagation paths; combined with the direction probability determination, the propagation direction of the anomaly along each pipe segment is determined (e.g., "propagation probability in the direction of water flow 0.90").
[0177] Step S2e: Identify the node or region with the highest probability as the source of the anomaly based on the probability distribution, and deduce the diffusion path and trend of the anomaly along the pipeline topology based on the intensity and direction probability distribution.
[0178] The necessary procedures are as follows:
[0179] 1. Identification of the source of the anomaly:
[0180] Based on the probability distribution of pollution sources (the sum of the probabilities of each node is 1), deterministic identification is performed:
[0181] Single-source identification: Select the node with the highest probability as the main source (e.g., node A with a probability of 0.85); Multi-source expansion: If there is a node with a second-highest probability (probability > 0.3 and spatial distance from the main source > 500 meters), use DBSCAN density clustering to identify independent source regions; Region localization: Spatially aggregate high-probability nodes and their first-order neighbors, and calculate the geometric center as the coordinates of the source region.
[0182] 2. Diffusion path deduction:
[0183] Based on the probability distribution of propagation strength and direction, perform a directed graph path search:
[0184] Threshold filtering: Set a propagation probability threshold (e.g., 0.7) and filter pipe segments with intensity higher than the threshold as candidate paths;
[0185] Direction determination: Based on the direction probability (probability of downstream flow vs. probability of upstream flow), determine the direction of the anomaly's propagation along each pipe segment (select the direction with the dominant probability).
[0186] Path generation: Starting from the source, expand the path in a breadth-first manner along pipe segments that meet the threshold and are in the same direction to generate the main diffusion path (node sequence + pipe segment list), and estimate the propagation time delay (based on pipe segment length and hydraulic residence time).
[0187] Step S2f integrates the location of the anomaly source, the diffusion path and trend to generate a global risk map that covers the geographic space of the pipeline network in a visual form and is used to characterize the comprehensive risks.
[0188] The necessary procedures are as follows:
[0189] 1. Data Fusion and Risk Quantification: Integrate the anomaly source location (coordinates + probability value), propagation path (node sequence + pipe segment list), and trend prediction (enhancement / decay / stability) identified in step S2e to construct an anomaly propagation topology model. Risk level quantification is performed based on the following rules:
[0190] High risk: Nodes with a source probability greater than 0.8, or pipe sections with a transmission intensity greater than 0.9; Medium risk: Nodes with a source probability of 0.5 to 0.8, or pipe sections with a transmission intensity of 0.7 to 0.9; Low risk: Other affected areas.
[0191] 2. Geospatial mapping and map construction:
[0192] Based on the pipeline network GIS database (node latitude and longitude, pipeline segment geographical path), the anomaly propagation topology model is mapped to geospatial data:
[0193] Layer overlay: On the basic pipeline network geographic base map, overlay the source location layer (red highlighted dots, radius positively correlated with probability), the diffusion path layer (gradient color line segments, red indicates high intensity, yellow indicates medium intensity), and the risk heat map layer (continuous risk field generated based on Kriging interpolation).
[0194] Color coding: A four-color system of red, orange, yellow and green is used to intuitively identify the spatial distribution of risks (red: core source area; orange: high probability transmission path; yellow: medium risk impact area; green: safe area).
[0195] 3. Structured Output: Generate a global risk map data package (including source coordinates, path GeoJSON, risk level matrix, and estimated arrival time), which serves as the spatial decision-making basis for dynamic enhanced monitoring in step S3. The map is presented on the monitoring terminal in the form of a visual rendering.
[0196] By extracting and fusing spatial correlation features and temporal evolution features between nodes through a graph spatiotemporal fusion network, a deep feature representation reflecting the spatiotemporal propagation pattern of anomalies is formed, including:
[0197] Step S2c1 involves retrieving the physical attributes of each pipe segment and the topological attributes of each node from a pre-set asset database, based on the pipeline network topology diagram. The physical attributes include at least the pipe segment's flow direction, pipe diameter, material, and roughness coefficient. The topological attributes include at least the node's degree centrality and betweenness centrality in the graph. The pre-set asset database is a structured database storing the pipeline network's static attributes and historical hydraulic parameters, including the pipe segment's physical attributes (pipe diameter, material, roughness coefficient, design flow direction) and node topological coordinates, providing prior physical constraint knowledge for the graph neural network.
[0198] Based on the pipeline topology map (node ID and pipe segment ID) constructed in step S2a, the pre-set asset database (derived from pipeline GIS design drawings and historical hydraulic model calibration data) is queried to extract two types of attributes: pipe segment physical attributes: flow direction (unidirectional / bidirectional markings determined based on historical hydraulic simulations or flow direction sensors), pipe diameter (affecting flow velocity and dilution), and material and roughness coefficient (affecting hydraulic resistance and wall reaction rate). These attributes directly determine the transport efficiency of pollutants in the pipe segment and serve as the core basis for edge weight calculation in step S2c2. Node topology attributes: degree centrality (number of connected edges) and betweenness centrality (frequency of shortest path traversal) are calculated using graph algorithms. Nodes with high degree centrality (such as tees and crosses) are high-risk points for abnormal convergence; nodes with high betweenness centrality (such as pipeline bridge joints) are key hubs for controlling abnormal diffusion.
[0199] Step S2c2: Based on physical and topological attributes, assign weights to the edges and nodes in the pipeline network topology graph to construct a weighted graph structure with enhanced physical information.
[0200] 1. Edge weight assignment based on physical attributes: Based on the physical attributes of the pipe segments obtained in step S2c1, weights are assigned to each edge in the pipe network topology diagram to characterize the propagation capability of anomalies along that pipe segment. The edge weights are calculated using the hydraulic transmission coefficient. Among them, D ij n is the pipe diameter. ij L is the roughness coefficient. ij δ represents the pipe segment length, reflecting the impact of the pipe segment's physical characteristics on abnormal transmission; ij Let δ be the flow direction indicator function. If the flow direction is i→j, then δij =1, then δ in the reverse flow direction ij =0. This leads to the construction of weighted directed edges based on physical properties.
[0201] 2. Node assignment based on topological attributes: Based on the node topological attributes (degree centrality, betweenness centrality) obtained in step S2c1, feature enhancement is performed on each vertex in the graph. The spatiotemporal fusion feature s generated in step S2b is then applied... i Concatenate with normalized topological properties: .
[0202] in, and These are the degree centrality and betweenness centrality values after Min-Max normalization to [0,1]. This assignment method allows the topological hub nodes to obtain higher feature representation weights in subsequent graph attention mechanisms.
[0203] 3. Weighted Graph Structure Construction: Integrating the edge weights and node features described above, a weighted graph structure with enhanced physical information is constructed. Softmax normalization (or linear normalization) is applied to the edge weights originating from the same source node to ensure numerical stability. The final result is a weighted directed graph represented by a normalized adjacency matrix (asymmetric) or a weighted edge list, fully encoding the network's physical constraints and topological characteristics, and input into the spatiotemporal fusion graph network in step S2c3.
[0204] Step S2c3 involves inputting the weighted graph structure enhanced with physical information and the spatiotemporal fusion features into a graph spatiotemporal fusion network for hierarchical learning: In the spatial dimension, a graph attention network is used to aggregate the features of neighboring nodes, where the attention weights are modulated by the physical attribute weights of the corresponding edges and the topological attributes of the nodes to extract spatial correlation features under physical constraints; in the temporal dimension, a temporal convolutional network is used to process the temporal features of each node to extract multi-scale temporal evolution features; finally, a feature fusion module adaptively fuses the spatial correlation features and temporal evolution features to generate a deep feature representation that simultaneously encodes the physical constraints, spatiotemporal correlations, and anomaly dynamics of the pipeline network.
[0205] In step S2c2, a physically-enhanced spatiotemporal graph structure has been constructed, and the spatiotemporal features of each node have been obtained. Next, in step S2c3, these data are input into a cascaded graph spatiotemporal fusion network for hierarchical feature learning to generate deep feature representations.
[0206] 1. Spatial dimension feature learning:
[0207] Graph Attention Network (GAT): This network aggregates features from neighboring nodes using GAT. The attention mechanism is modulated by edge weights and node attributes. Specifically, for each node, attention coefficients between it and its neighbors are calculated. These coefficients are determined by edge weights and node attributes (such as degree centrality and betweenness centrality). The features of neighboring nodes are aggregated through a weighted summation to extract spatial correlation features under physical constraints. For example, for node v, its aggregated features are represented as follows:
[0208] ,in, It is the set of neighboring nodes of node v. It is the attention coefficient between node v and node u. Let σ be the feature vector of node u, and σ be the activation function.
[0209] 2. Time-dimensional feature learning:
[0210] Temporal Convolutional Networks (TCNs): TCNs process the temporal features of each node to extract multi-scale temporal evolution features. TCNs capture local dependencies in temporal data through causal convolution and dilated convolution, enabling them to handle feature changes at different time scales. Specifically, for the temporal features of node v... TCN extracts temporal features through multiple convolutional layers: ,in, It is the extracted time feature, which can reflect the feature changes of node v at time t.
[0211] 3. Spatiotemporal feature fusion:
[0212] Spatiotemporal Feature Fusion Module: Adaptively weighted fusion of spatial correlation features and temporal evolution features. Through a fusion module, weights are dynamically adjusted based on feature importance and relevance to generate a comprehensive deep feature representation. For example, for node v, its final deep feature representation is: ,in, It is a spatial correlation feature. These are temporal evolution features, and Fusion is the fusion function, typically a weighted summation based on learned weights. These deep feature representations simultaneously encode the physical constraints, spatiotemporal context, and anomaly evolution patterns of the pipeline network, providing rich information for subsequent anomaly detection and risk assessment.
[0213] The Graph Spatiotemporal Fusion Network (GSTFN) described in this application is not a general spatiotemporal prediction model, but is specifically designed to couple the physical laws of hydraulic transmission in pipeline networks with the spatiotemporal propagation patterns of anomalies.
[0214] A deep fusion mechanism of physical information: When constructing the spatiotemporal graph structure, not only are the pipe network topology connections considered, but the hydraulic properties of pipe segments (such as pipe diameter, roughness coefficient, and design flow velocity) and real-time hydraulic states (such as current flow rate and direction obtained through digital twin models) are also encoded as edge weights and features. In addition to residual feature field data, node features also incorporate their topological importance (such as betweenness centrality) and geographical environmental attributes (such as node elevation). This deep fusion allows the graph structure itself to carry rich physical constraint information.
[0215] Domain Adaptation of the Network Architecture: The Graph Attention Network (GAT) module in GSTFN is designed to calculate attention weights by simultaneously considering node feature similarity, the strength of physical connections represented by edges, and the direction of water flow. The kernel size and dilation rate of the Temporal Convolutional Network (TCN) module are designed with reference to the timescale of pollutant transport in typical pipe sections. This design ensures that the features extracted by the network can effectively reflect anomalous diffusion behavior under physical constraints.
[0216] Technical Effects: Through the aforementioned deep fusion, GSTFN can more accurately identify abnormal propagation paths from the residual feature field that conform to the hydraulic diffusion laws such as "flow direction, attenuation with distance, and influence by pipe diameter," thereby improving the accuracy of source location and trend prediction. This network is a key technological bridge connecting "digital twin mechanism simulation results" and "pipeline network geospatial risk maps."
[0217] Based on the comprehensive anomaly type, the source location and spread trend identified by the global risk map, and the ranking of suspected sources, the severity level of the event is determined through pre-set assessment rules, generating an early warning decision report that includes source tracing conclusions and handling recommendations.
[0218] Step S41 involves constructing an event feature vector based on the anomaly type, the source location and diffusion trend identified by the global risk map, and the ranking of suspected sources. In step S41, the anomaly type is first encoded; for example, chemical pollution is encoded as [1,0,0], microbial pollution as [0,1,0], and physical pollution as [0,0,1]. Then, the location coordinates of the anomaly source and key nodes of the diffusion path are extracted from the global risk map, such as the source location (10,20) and the diffusion path [A,B,C]. Simultaneously, the ranking of suspected sources is converted into weight values, such as [0.9,0.7,0.5]. This information is then integrated into a single vector to form the event feature vector, for example, [1,0,0,10,20,A,B,C,0.9,0.7,0.5], providing foundational data for subsequent hazard assessment and decision support.
[0219] Step S42: Input the event feature vector into a pre-set hazard assessment matrix, and output a quantitative hazard index through dimensional mapping and weighted aggregation. The weight configuration of the hazard assessment matrix is dynamically adjusted in conjunction with the pollutant toxicity database, the affected area sensitivity layer, and the historical event statistics database. Specifically, the hazard assessment matrix is a pre-set matrix model used to map the event feature vector into a quantitative hazard index. This matrix contains weights for multiple dimensions to assess the contribution of different features to the degree of hazard. The pollutant toxicity database stores toxicity information for various pollutants, used to assess the degree of hazard from different pollutants. The affected area sensitivity layer is a map describing the sensitivity of different areas to pollutants, used to assess the impact of abnormal events on different areas. The historical event statistics database records data and statistical information of similar past events, used to dynamically adjust the weights of the hazard assessment matrix.
[0220] The necessary process is described below:
[0221] 1. Dimensional mapping and quantization:
[0222] Map heterogeneous data segments in the event feature vector to standardized evaluation dimensions:
[0223] Toxicity Dimension (T): Based on the anomaly type code, query the pollutant toxicity database (e.g., chemical toxicity level, microbial pathogenicity) and map it to a normalized toxicity score (0-1). Sensitivity Dimension (S): Based on the source coordinates and diffusion path, spatial interpolation is performed in the affected area sensitivity layer (GIS raster, including sensitive targets such as water source protection areas and hospitals) to obtain the regional sensitivity score (0-1). Impact Range Dimension (I): Based on the number of nodes covered by the diffusion path, pipe segment length, and number of downstream users, calculate the impact range score (0-1). Confidence Dimension (C): Take the average of the top-3 suspected sources by ranking weight as the event confidence score (0-1).
[0224] 2. Dynamic weight adjustment:
[0225] The weighting of the hazard assessment matrix is dynamically adjusted in conjunction with three types of data sources:
[0226] By integrating a pollutant toxicity database: The toxicity dimension weight is automatically increased for highly toxic pollutants (such as heavy metals) (e.g., from 0.3 to 0.4). By integrating an affected area sensitivity layer: If the source is located in the core area of a water source protection zone, the sensitivity dimension weight is increased. By integrating a historical event statistics database: Similar cases (same anomaly type, topological similarity > 0.8) are retrieved; if a high-hazard historical event exists, the overall hazard weight is increased; if it matches a common false alarm scenario (such as turbidity fluctuations during heavy rain), the overall weight is reduced or it is forcibly marked as low-risk.
[0227] 3. Weighted aggregation and hazard index generation:
[0228] After normalizing and calibrating the scores of each dimension, a weighted summation is used to generate a quantitative hazard index:
[0229] Where w1-w4 are the dynamically adjusted dimension weights (satisfying the normalization condition). The output H value (e.g., 0.85) serves as the direct basis for determining the event hazard level in step S43: ≥0.8 indicates high risk, 0.5-0.8 indicates medium risk, and <0.5 indicates low risk.
[0230] Step S43: Match the quantitative hazard index with a predefined threshold range to determine the hazard level of the event. In step S43, the quantitative hazard index is matched with a predefined threshold range to determine the hazard level of the event. For example, if the quantitative hazard index is 0.85, according to the set threshold range (low hazard: 0-0.3, medium hazard: 0.3-0.7, high hazard: 0.7-1.0), the index falls into the high hazard range, therefore the event is judged to be of a high hazard level.
[0231] Step S44: Based on the event hazard level and source location, one or more candidate disposal strategies are matched through the contingency plan inference engine. The contingency plan inference engine uses a dynamic digital twin model to simulate and extrapolate the pollutant diffusion and control process under the candidate disposal strategies. Based on the simulation results, the control effect, impact range and duration of different strategies are quantitatively compared to generate strategy comparison results. Based on the comparison results, the adjustable parameters in the candidate disposal strategies are optimized and adjusted to generate optimized disposal suggestions containing specific operation instructions, expected impact range and duration.
[0232] The necessary process is described below:
[0233] 1. Matching of candidate disposal strategies:
[0234] The contingency planning inference engine generates an initial set of candidate strategies based on the severity level of the event and its source location through hybrid reasoning.
[0235] Case-Based Reasoning (CBR): Calculates the similarity with historical cases using a weighted comprehensive similarity formula. .in, This represents the shortest path distance between the current event and historical cases in the pipeline topology (calculated using Dijkstra's algorithm to measure the cumulative length of the pipe segment, not Euclidean straight-line distance). For the degree of matching of exception types, For hazard level matching, retrieve the top-3 similar cases and their corresponding handling strategies.
[0236] Rule-based reasoning (RBR): Matching pre-set expert rules based on hazard level (e.g., IF hazard level = high THEN close source valve + activate emergency water source).
[0237] Fusion and Deduplication: Perform a union operation on the case strategy and the rule strategy to remove duplicates and form an initial candidate strategy set. (Usually n≤5).
[0238] 2. Simulation and Quantitative Comparison:
[0239] The contingency planning inference engine invokes a dynamic digital twin model (integrating the EPANET hydraulic-water quality coupling solver) to analyze each candidate strategy θ. i Perform forward time series extrapolation (the extrapolation window is usually set to 4-6 hours) and calculate three-dimensional quantification indicators:
[0240] Control effect (cutoff rate): The reduction ratio of the total downstream pollutants at the end of the projected period relative to the scenario without treatment, using the cutoff rate formula: .
[0241] Scope of impact: R, the number of nodes where water quality exceeded standards during the simulation. i And the corresponding number of downstream users.
[0242] Duration: The time required from the start of treatment to the point where water quality recovers to a safe threshold (e.g., residual chlorine ≥ 0.3 mg / L) D i (Hour).
[0243] Generate strategy comparison results: Construct an evaluation matrix And perform Pareto non-dominated ranking to identify the frontier solution set. (That is, there is no other strategy that is better in all three dimensions).
[0244] 3. Adjustable parameter optimization and adjustment:
[0245] right The strategy in the middle is to optimize adjustable parameters (such as valve closing timing t). k Emergency water source flow rate Q, dosage C dose The NSGA-II multi-objective evolutionary algorithm is used.
[0246] Chromosome encoding: Encoding adjustable parameters into a real number vector, such as... Where t1 and t2 are the closing times (in minutes) of different valves, and Q is the emergency flow rate (m³ / s). 3 / h).
[0247] Fitness function: Minimize three objective functions. ,in The comprehensive operating cost is calculated as follows: (number of valve operations × unit price + emergency water source operation cost).
[0248] Evolutionary parameters: Population size is set to 50, number of generations to 30, crossover probability to 0.9, and mutation probability to 0.1. Fitness of individuals in each generation is rapidly assessed using a dynamic digital twin model, and optimized strategy parameters are output after non-dominated ranking and crowding selection. .
[0249] 4. Optimization and handling suggestions generated:
[0250] Decoding optimized parameters Generate structured processing suggestions:
[0251] Specific operation instruction sequence: Executable actions arranged in sequence, such as:
[0252] t=0min: Close source valve V1; t=30min: Start emergency water supply, with flow rate set to the optimized value. (e.g., 500m) 3 / h); t=90min: Open the standby valve V3 to restore downstream water supply.
[0253] Expected impact range: based on List of controlled pollution area nodes, their geographical coordinates, and the number of affected users (e.g., "12 nodes affected, covering approximately 2,000 households").
[0254] Duration: Total processing time (e.g., "Water quality is expected to recover to a safe level within 4 hours") and water quality recovery time curves for key nodes. This optimized treatment recommendation serves as the core content of step S45 for generating the early warning decision report.
[0255] Step S45: Automatically integrate the event hazard level, source location, optimized treatment suggestions and key judgment basis to generate a structured early warning decision report. The key judgment basis includes at least the quantitative hazard index, the probability distribution of each node as a pollution source, and the strategy comparison results.
[0256] The necessary procedures are as follows:
[0257] 1. Multi-source information integration:
[0258] Automatic aggregation of key data output from previous steps:
[0259] Incident hazard level (from step S43, such as "high hazard");
[0260] Source location and diffusion trend (from steps S2e / S2d, such as "Node A, probability 0.85, diffusion path A→B→C");
[0261] Optimized handling recommendations (from step S44, such as "Close valve V12, start backup water supply, expected to affect 2000 households, lasting 4 hours").
[0262] Key assessment criteria (from steps S42 and S2d): quantitative hazard index (e.g., 0.85), probability distribution of each node as a pollution source (e.g., [node A: 0.85, node B: 0.10, others: 0.05]), and strategy comparison results (e.g., "scheme A control time 3 hours vs. scheme B control time 5 hours").
[0263] 2. Structured report generation:
[0264] Using a pre-built report template (JSON structured data or standard chapter document), organized according to the following modules:
[0265] Event Overview: Anomaly type, occurrence time, source coordinates; Risk Quantification: Hazard level, quantitative hazard index, list of affected sensitive areas; Source Tracing Conclusion: Main source location (highest probability node), Top-3 suspected sources; Disposal Plan: Optimized disposal suggestions (operation instructions + scope of impact + duration); Analysis Appendix: Strategy Comparison Results (Quantitative comparison table of control effects, costs, and time of each alternative plan), pollution source probability distribution map.
[0266] 3. Output and Subsequent Integration: Generate a standardized early warning decision report data package, with key judgment criteria embedded as attachments or metadata to ensure that managers can review the decision-making logic (e.g., why the high-cost option A was chosen instead of option B, because simulation showed it had a shorter control time). This report serves as the direct input for step S4, "Generate early warning information based on this report and hazard level and push it out in a tiered manner." The hazard level field determines the push terminal level (e.g., high-risk information is pushed to the emergency management department, medium-risk information is pushed to the regional water affairs center).
[0267] Based on the same inventive concept, embodiments of the present invention provide an IoT-based smart water real-time monitoring and early warning system, including a memory and a processor. The memory stores data that can run on the processor to implement... Figures 1 to 3 The procedure for the method shown.
[0268] Reference Figure 4 This is a schematic diagram of the interface of the smart water real-time monitoring and early warning system provided in the embodiments of this application. Figure 4 The list of active anomalies, the status of monitoring nodes, and key water quality indicators are displayed in a visual format. The list of anomalies uses different color labels to distinguish the types of anomalies (such as chemical pollution and physical pollution).
[0269] The embodiments described in this specific implementation are preferred embodiments of this application and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A real-time monitoring and early warning method for smart water systems based on the Internet of Things, characterized in that, include: By collecting multi-parameter water quality data through edge nodes deployed at key monitoring points in the water supply network, real-time diagnostic analysis of the multi-parameter water quality data is performed on the edge side to identify multi-parameter correlation feature fingerprint anomalies and generate diagnostic results including anomaly type, feature vector and timestamp. The diagnostic results of each edge node are uploaded to the cloud, where the feature vectors are aligned and aggregated according to timestamps to form a multi-node time-series feature vector. Based on a dynamic digital twin model, the mechanism of the multi-node time-series feature vector is simulated, and the simulation results are compared with the actual feature vectors to generate a residual feature field reflecting the spatial distribution of anomalies. Then, using a graph spatiotemporal fusion network, the residual feature field and pipeline topology information are fused to generate a global risk map that identifies the location of the anomaly source and its spread trend. Based on the global risk map, the monitoring frequency and analysis dimensions of relevant nodes on the source location and diffusion trend path are dynamically enhanced, and combined with the pipeline geographic information system, a list of key monitoring areas and a ranking of suspected sources are generated. Based on the comprehensive anomaly type, the source location and spread trend identified by the global risk map, and the ranking of suspected sources, the system determines the hazard level of the event through preset assessment rules, generates an early warning decision report containing source tracing conclusions and handling recommendations, and generates early warning information based on the report and hazard level and pushes it to the corresponding terminals in a tiered manner.
2. The method for real-time monitoring and early warning of smart water based on the Internet of Things according to claim 1, characterized in that, The diagnostic results generated include anomaly type, feature vector, and timestamp: Multi-parameter water quality data is continuously collected through edge nodes to form multi-parameter water quality time series data, and related external environmental data is acquired simultaneously. Water quality time series data and external environmental data are timestamp aligned using a unified clock protocol to form spatiotemporally aligned multi-source input data. From multi-source input data, extract time-domain, frequency-domain and parameter correlation features, and input them into a multi-parameter correlation feature fingerprint model trained with historical normal operating condition data to calculate and generate feature correlation vector and its confidence level of deviation from normal benchmark. An anomaly detection algorithm is used to perform preliminary analysis on the feature correlation vector to identify potential anomalies; and a pre-built expert rule base is used to perform logical verification on potential anomalies, ultimately confirming the occurrence of multi-parameter correlation feature fingerprint anomalies. Based on feature correlation vectors and external environment data, predefined anomaly types are matched, and key feature contribution is generated by analyzing the feature correlation vector as the core. Then, feature vectors containing key feature contribution, external environment labels and confidence are generated. Based on the location information of edge nodes, the matched anomaly type, feature vector and corresponding timestamp are encapsulated to form a diagnostic result.
3. The method for real-time monitoring and early warning of smart water systems based on the Internet of Things according to claim 2, characterized in that, An anomaly detection algorithm is used to perform a preliminary analysis of the feature correlation vector to identify potential anomalies, including: Based on a preset time window, the current and historical sequences are extracted from the feature correlation vector to construct a time-series feature matrix; external environmental data aligned with the preset time window is acquired synchronously and encoded into an environmental feature vector. The temporal feature matrix and the environmental feature vector are concatenated to form a fused input matrix; At least two anomaly detection algorithms based on different detection principles are used to perform parallel analysis on the fused input matrix, and preliminary anomaly scores corresponding to each algorithm are generated respectively. Based on environmental feature vectors, multiple preliminary anomaly scores corresponding to the same edge node are dynamically weighted and fused to generate a fused anomaly score for each edge node. Based on a predefined network topology map reflecting the hydraulic connectivity between edge nodes, the spatial correlation of fusion anomaly scores between different edge nodes is calculated, and the spatial consistency of the fusion anomaly scores is verified. Based on the results of spatial consistency verification, potential anomalies that are significantly correlated in spatial distribution or conform to the laws of hydraulic diffusion are identified and output.
4. The method for real-time monitoring and early warning of smart water based on the Internet of Things according to claim 3, characterized in that, The system then uses a pre-built expert rule base to perform logical checks on potential anomalies, ultimately confirming that the following anomalies occur due to multi-parameter correlation feature fingerprinting: The system acquires potential anomalies from the identification output and simultaneously retrieves context data corresponding to the timing and spatial location of the potential anomalies from related business systems. The context data includes water system scheduling operation records corresponding to the timing, pipeline maintenance records of the surrounding area within a preset time window, and environmental background data corresponding to the timing and spatial location. Potential anomalies and their corresponding contextual data are input into a pre-set expert rule base for multi-dimensional logical reasoning verification. The logical reasoning verification includes: First verification, based on hydraulic model rules, analyzing whether the spatial distribution of potential anomalies supports the physical laws of diffusion from a certain source through the pipeline topology; Second verification, based on environmental logic rules, determining whether the characteristic patterns of potential anomalies contradict the normal changes indicated by environmental background data; Third verification, based on operational interference elimination rules, determining whether the occurrence of potential anomalies can be explained by planned activities in dispatch operation records or pipeline maintenance records. Based on the results of logical reasoning verification, a comprehensive verification conclusion is generated for each potential anomaly. The comprehensive verification conclusion is used to determine whether the potential anomaly is a real feature fingerprint anomaly that needs to be confirmed. The output is a potential anomaly determined by the comprehensive verification conclusion to be a true feature fingerprint anomaly, which is then used as the final confirmed multi-parameter associated feature fingerprint anomaly.
5. The method for real-time monitoring and early warning of smart water based on the Internet of Things according to claim 1, characterized in that, Based on a dynamic digital twin model, a mechanism simulation is performed on multi-node time-series feature vectors, and the simulation results are compared with the actual feature vectors to generate a residual feature field reflecting the spatial distribution of anomalies, including: Based on historical normal operating data, a dynamic digital twin model is initialized and driven to perform forward time extrapolation to obtain the theoretical feature vectors at each node at the current moment, which serve as the mechanism simulation results. The dynamic digital twin model is a mechanism simulation model that incorporates network topology, hydraulic properties of pipe segments, and water quality reaction dynamics parameters. The theoretical feature vectors of each node in the mechanism simulation results are compared with the corresponding actual feature vectors in the multi-node time series feature vectors to calculate the feature difference degree of each node. Based on the pipeline network topology, the feature differences of each node are reconstructed into a continuous spatial distribution field covering the entire pipeline network through a spatial interpolation algorithm, which serves as the residual feature field.
6. The method for real-time monitoring and early warning of smart water based on the Internet of Things according to claim 5, characterized in that, Then, by utilizing a graph-spatiotemporal fusion network, the residual feature field and pipeline topology information are integrated to generate a global risk map that identifies the location of anomaly sources and their spread trends, including: Based on the pipeline network topology information, a pipeline network topology graph is constructed with edge nodes as vertices and pipe segments connecting edge nodes as edges. The spatial features corresponding to each edge node are extracted from the residual feature field and fused with the historical feature sequence of the corresponding node in the multi-node temporal feature vector to form a spatiotemporal fusion feature attached to each vertex of the pipeline topology map. The spatiotemporal fusion features of the pipeline network topology and its vertices are input into the graph spatiotemporal fusion network. Spatial graph convolution and time series evolution analysis are performed through the graph spatiotemporal fusion network to form a deep feature representation of the abnormal spatiotemporal propagation pattern. Based on deep feature representation, the output layer of the graph spatiotemporal fusion network is used to decode and generate the probability distribution of each node as a pollution source, as well as the probability distribution of the intensity and direction of the anomaly propagation along each pipe segment. Based on the probability distribution, the node or region with the highest probability is identified as the source of the anomaly. Based on the probability distribution of intensity and direction, the diffusion path and trend of the anomaly along the pipeline topology are deduced. By integrating the location of the anomaly source, the spread path and trend, a global risk map is generated in a visual form covering the geographic space of the pipeline network to characterize comprehensive risks.
7. The method for real-time monitoring and early warning of smart water based on the Internet of Things according to claim 6, characterized in that, By performing spatial graph convolution and temporal series evolution analysis through a graph spatiotemporal fusion network, a deep feature representation characterizing the spatiotemporal propagation pattern of anomalies is formed, including: Based on the pipeline network topology map, the physical attributes of each pipe segment and the topological attributes of each node are obtained from the pre-set asset database. The physical attributes include at least the pipe segment flow direction, pipe diameter, material and roughness coefficient, and the topological attributes include at least the degree centrality and betweenness centrality of the node in the graph. Based on physical and topological attributes, weights are assigned to edges and nodes in the pipeline network topology diagram to construct a weighted graph structure with enhanced physical information. The weighted graph structure enhanced with physical information and spatiotemporal fusion features are input into a graph spatiotemporal fusion network for hierarchical learning: In the spatial dimension, a graph attention network is used to aggregate the features of neighboring nodes, where the attention weights are modulated by the physical attribute weights of the corresponding edges and the topological attributes of the nodes to extract spatial correlation features under physical constraints; in the temporal dimension, a temporal convolutional network is used to process the temporal features of each node to extract multi-scale temporal evolution features; finally, a feature fusion module adaptively fuses the spatial correlation features and temporal evolution features to generate a deep feature representation that simultaneously encodes the physical constraints, spatiotemporal correlations, and anomaly dynamics of the pipeline network.
8. A real-time monitoring and early warning method for smart water systems based on the Internet of Things, as described in claim 6, is characterized in that... The generated early warning decision report, which includes source tracing conclusions and handling recommendations, includes: Based on anomaly type, source location and spread trend identified by global risk map, and ranking of suspected sources, an event feature vector is constructed; The event feature vector is input into a preset hazard assessment matrix, and a quantitative hazard index is output through dimensional mapping and weighted aggregation. The quantitative hazard index is matched with a predefined threshold range to determine the hazard level of the event; Based on the hazard level and source location of the event, one or more candidate disposal strategies are matched through the contingency plan inference engine. The contingency plan inference engine uses a dynamic digital twin model to simulate and extrapolate the pollutant diffusion and control process under the candidate disposal strategies. Based on the simulation results, the control effect, impact range and duration of different strategies are quantitatively compared to generate strategy comparison results. Based on the comparison results, the adjustable parameters in the candidate disposal strategies are optimized and adjusted to generate optimized disposal suggestions containing specific operation instructions, expected impact range and duration. The system automatically integrates the event hazard level, source location, optimized treatment suggestions, and key judgment criteria to generate a structured early warning decision report. The key judgment criteria include at least a quantitative hazard index, the probability distribution of each node as a pollution source, and the results of strategy comparison.
9. A smart water real-time monitoring and early warning system based on the Internet of Things, characterized in that, It includes a memory, a processor, and a program stored in the memory and executable on the processor, which, when loaded and executed by the processor, implements a smart water real-time monitoring and early warning method based on the Internet of Things as described in any one of claims 1 to 8.