Method and system for monitoring pressure anomaly of water supply network based on physical constraint and attention

By combining a two-stage prediction mechanism of lightweight prediction and high-precision heavy prediction, along with an adaptive inference switching mechanism and hydraulic laws, the physical consistency and power consumption problems in water supply network pressure anomaly monitoring are solved, achieving high-precision and low-power anomaly detection.

CN122241309APending Publication Date: 2026-06-19TIANJIN JYJC TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIANJIN JYJC TECH CO LTD
Filing Date
2026-03-19
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies for monitoring abnormal pressure in water supply networks suffer from problems such as lack of physical consistency, insufficient accuracy in anomaly detection, and excessive power consumption of edge devices.

Method used

A two-level prediction mechanism based on physical constraints and attention is adopted, including a lightweight prediction module and a high-precision re-prediction module. Combined with an adaptive inference switching mechanism, the lightweight prediction is used for initial screening, and the high-precision re-prediction is used for verification. Hydraulic laws are embedded to ensure the physical rationality of the prediction, and the high-precision module is activated to reduce power consumption when an anomaly is suspected.

Benefits of technology

It achieves high detection rate and low false alarm rate for anomaly detection, significantly reduces the power consumption of edge devices, is suitable for battery-powered scenarios, and has high-precision and low-power water supply network pressure anomaly monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122241309A_ABST
    Figure CN122241309A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for monitoring pressure anomalies in water supply networks based on physical constraints and attention. The system includes: a lightweight prediction module that performs low-power prediction of pressure ranges under normal operating conditions based on preprocessed data; the output pressure prediction value is used for judgment by an adaptive inference switch module; the adaptive inference switch module receives the pressure prediction value, calculates the deviation between the current actual pressure and the predicted value, and if the deviation exceeds the system's automatically set dynamic residual threshold twice consecutively, a high-precision re-prediction module is triggered to execute the next step; otherwise, the next round of data acquisition and lightweight prediction continues; the high-precision re-prediction module includes a lightweight spatiotemporal attention mechanism to re-predict the preprocessed data, and the prediction result is output to an anomaly detection module; the anomaly detection module performs secondary verification, comparing the current actual pressure value with the re-predicted value. If the deviation still exceeds the system's dynamically set normal fluctuation threshold, it is confirmed as a real anomaly event, triggering a local early warning and uploading the warning and event data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the intersection of smart water management and edge artificial intelligence, and in particular to a method and system for monitoring anomalies in water supply networks that integrates physical constraints and adaptive attention. Background Technology

[0002] Urban water supply pipeline networks are critical infrastructure for ensuring residents' daily lives, industrial production, and public safety. Their stable operation directly affects the daily water security of millions of people and the city's emergency response capabilities. However, water supply networks have long faced severe challenges due to complex hydraulic conditions. The system is affected by multiple factors such as water load fluctuations and pump station scheduling, resulting in drastic dynamic changes in the pressure field. Furthermore, sudden pipe bursts not only waste water resources but can also trigger secondary disasters such as road collapses and power outages. Since water supply pipelines are mostly buried underground, leaks or bursts are difficult to detect manually in their early stages.

[0003] With the acceleration of urbanization and the advancement of smart water management and smart city construction in my country, water supply systems are developing towards "high coverage, high reliability, and high intelligence." Real-time and accurate pressure monitoring and anomaly early warning at key nodes of the pipeline network have become one of the core tasks of smart water management construction. In recent years, deep learning time series models based on LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit), and Transformer (a neural network model based on self-attention mechanism) have been widely applied to pressure prediction. For example, Deng Bangwu et al. proposed a water supply network pressure prediction method based on residual dense neural networks; Wang Wenliang et al. proposed a flow monitoring system based on quantum heuristic AI algorithms; and Xu Zhe et al. disclosed a pressure prediction method based on parallel LSTM cascaded DNN (deep neural network).

[0004] However, a single algorithm lacks physical consistency constraints and may output results that violate the basic laws of hydraulics. At the same time, the high complexity of deep learning models increases the power consumption of edge devices. Summary of the Invention

[0005] This invention provides a method and system for monitoring pressure anomalies in water supply networks based on physical constraints and attention. This invention solves the problems of lack of physical consistency, insufficient anomaly detection accuracy, and excessive power consumption of edge devices in existing technologies, as detailed below:

[0006] A first aspect: a method for monitoring pressure anomalies in water supply networks based on physical constraints and attention, the method comprising:

[0007] The lightweight prediction module performs low-power prediction of the pressure range under normal operating conditions based on preprocessed data; the output pressure prediction value is used for the judgment of the adaptive inference switch module.

[0008] The adaptive inference switch module receives the pressure prediction value, calculates the deviation between the current actual pressure and the prediction value. If the deviation exceeds the dynamic residual threshold automatically set by the system twice in a row, the high-precision re-prediction module is triggered to execute the next step; otherwise, the next round of data acquisition and lightweight prediction continues.

[0009] The high-precision re-prediction module includes a lightweight spatiotemporal attention mechanism to re-predict the preprocessed data, and the prediction results are output to the anomaly detection module.

[0010] The anomaly detection module performs secondary verification by comparing the actual pressure value at the current moment with the reviewed predicted value. If the deviation between the two still exceeds the normal fluctuation threshold dynamically set by the system, it is confirmed as a real abnormal event, triggering a local early warning, uploading the early warning and event data, and the process ends.

[0011] The preprocessed data consists of: receiving and collecting pressure and water flow data, performing data cleaning and conversion preprocessing operations, and using the preprocessed data as input to the lightweight prediction module and the heavy prediction module.

[0012] The method further includes: if the deviation between the two does not exceed the normal fluctuation threshold dynamically set by the system, it is considered a preliminary screening misjudgment, no warning is triggered, and only a local record is made.

[0013] The data cleaning process includes:

[0014] Calculate the sliding window Median internal pressure N represents the number of sampling points that the sliding window extends to the past and future in the time dimension, expressed in "number of sampling points". The median absolute deviation is used as a measure of robust dispersion.

[0015] ;

[0016] If satisfied Then Those marked as anomalies are replaced with linear interpolation of valid points in the neighboring region; where, Where W is the threshold coefficient, and W is the set of time indices within the sliding window. This is the function for taking the median. For any sampling time in the sliding window W, This represents the median absolute deviation of the pressure data within this window relative to the median.

[0017] The data is converted into: normalizing the pressure value using the global minimum value obtained from historical operational data statistics during the cloud training phase. With the maximum value Perform linear normalization to ,Should and The model metadata, along with the network weights, is embedded into the edge device;

[0018] According to the Hazen-Williams formula Exponential transformation of flow rate values Preprocessed bivariate sequences This constitutes the model input tensor. For the real number field, .

[0019] The secondary verification performed by the anomaly detection module is as follows:

[0020] The secondary verification decision logic reuses the dynamic threshold maintained by the adaptive inference switch. Reconstruct the residual at the current time from the output of the high-precision reprediction module. ;

[0021] like If the anomaly is confirmed, the alarm and communication process will begin; otherwise, it will be determined as a normal water usage fluctuation, the local warning will be suppressed, and the event will not be uploaded.

[0022] Quantifying the severity of anomalies based on the degree of residual deviation:

[0023] Level 1: Suspected pipe burst;

[0024] Level 2: Possible leak;

[0025] Level 3: Multiple consecutive minor exceedances but not reaching Level 2, indicating pipeline aging warning.

[0026] A second aspect is a water supply network pressure anomaly monitoring system based on physical constraints and attention, the system comprising: a processor and a memory, the memory storing program instructions, the processor calling the program instructions stored in the memory to cause the device to perform the method described in any of the first aspects.

[0027] Third aspect, a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described in any one of the first aspects.

[0028] The beneficial effects of the technical solution provided by this invention are:

[0029] 1. High detection rate and low false alarm rate: Through a two-level mechanism of lightweight initial screening and high-precision verification, combined with dynamic thresholds and physical constraints, it effectively identifies anomalies such as pipe bursts and leaks, and suppresses false alarms caused by routine disturbances such as valve operation.

[0030] 2. Ultra-low power consumption: Under normal operating conditions, only a lightweight model is run, and the high-precision module is activated only when an anomaly is suspected, which significantly reduces the power consumption of edge devices and is suitable for battery-powered scenarios; 3. Physically reliable: Hydraulic model laws are embedded in the preprocessing and loss function to avoid anti-physics prediction and improve the generalization ability of the model. Attached Figure Description

[0031] Figure 1 A flowchart of a method for monitoring pressure anomalies in water supply networks based on physical constraints and attention;

[0032] Figure 2 Flowchart for training and prediction;

[0033] Figure 3 This is a schematic diagram of an experiment for leak early warning. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below.

[0035] Example 1

[0036] This invention provides a method for monitoring abnormal pressure in water supply networks based on physical constraints and attention. (See also...) Figure 1 and Figure 2 This method integrates hydraulic priors, quantile regression, lightweight spatiotemporal attention, and adaptive inference scheduling mechanisms to achieve a balance between high detection rate, low false alarm rate, and ultra-low power consumption while ensuring physical rationality. The steps of this monitoring method are as follows:

[0037] 101: The data acquisition module acquires pressure and water flow data of the target monitoring node and its associated equipment (adjacent nodes within the same hydraulic zone) in real time at fixed time intervals (e.g., 15 minutes);

[0038] The collected results serve as the input source for subsequent preprocessing steps, the adaptive switching module, and the anomaly detection module.

[0039] 102: Receive the pressure and water flow data collected in step 101, perform preprocessing operations such as data cleaning and data conversion, and use the preprocessed data as input for the lightweight prediction module and the heavy prediction module.

[0040] 103: The lightweight prediction module performs low-power prediction of the pressure range under normal operating conditions based on the preprocessed data in step 102; the output pressure prediction value is used for the judgment of the adaptive inference switch module.

[0041] During most periods when pipeline pressure is normal, only the lightweight prediction module is run.

[0042] 104: The adaptive inference switch module receives the pressure prediction value (from step 103), calculates the deviation between the current actual pressure (from step 101) and the prediction value. If the deviation exceeds the dynamic residual threshold automatically set by the system twice in a row, the high-precision re-prediction module is triggered and step 105 is executed; otherwise, step 101 is executed to continue the next round of data acquisition and lightweight prediction.

[0043] 105: The high-precision re-prediction module includes a lightweight spatiotemporal attention mechanism to re-predict the preprocessed data in step 102. The prediction result is output to the anomaly detection module, and step 106 is executed.

[0044] 106: Perform secondary verification through the anomaly detection module, compare the actual pressure value at the current moment with the reviewed predicted value. If the deviation between the two still exceeds the normal fluctuation threshold dynamically set by the system, it is confirmed as a real abnormal event, triggers a local warning, uploads the warning and event data, and the process ends; if it does not exceed the threshold, it is considered a false initial screening, no warning is triggered, and only a local record is made.

[0045] Operational Logic: The data acquisition module first obtains the raw pressure and flow data for the current time period and outputs it to the preprocessing unit. The preprocessed data is then sent to the lightweight prediction module, which outputs the predicted pressure value. The adaptive inference switch module compares the predicted value with the current actual pressure value to determine whether to activate the high-precision re-prediction module. If not activated, the system returns to the data acquisition module to wait for the next acquisition. If activated, the high-precision re-prediction module performs context-enhanced verification based on the same preprocessed data and outputs the reconstructed predicted value. The anomaly detection module compares the reconstructed predicted value with the current actual pressure and decides whether to trigger an alarm. Regardless of whether an alarm is triggered, the system automatically performs the next round of acquisition and prediction.

[0046] Example 2

[0047] The following is combined Figures 1-3 The calculation formula for the scheme in Example 1 is further described below:

[0048] In this embodiment of the invention, pressure data is first collected in real time by monitoring terminals deployed at key nodes of the water supply network. and traffic data The length is a fixed sampling duration. The time window sequence, where L is the number of sampling points contained within the time window. This is the time interval between adjacent sampling points (i.e., the reciprocal of the sampling rate of the acquisition terminal).

[0049] The following preprocessing steps are performed on the raw data to improve model robustness and physical consistency:

[0050] 1. Outlier Filtering: In field practice, edge devices often experience data loss or abnormal data collection due to issues with their own equipment and network connectivity. To address this problem, a sliding window is calculated. Median internal pressure N represents the number of sampling points (i.e., half-window width) that the sliding window expands into the past and future along the time dimension, with the unit being "number of sampling points". The median absolute deviation (MAD) is used as a measure of robust dispersion. If satisfied Then Marked as an anomaly, it is replaced with a linear interpolation of valid points in the neighboring region. Wherein, This is the threshold coefficient, usually This balances sensitivity and noise resistance; W is the set of time indices within the sliding window, i.e., the set of all sampling times involved in the calculation. This is the function for taking the median. For any sampling time (time point) in the sliding window W. This represents the median absolute deviation of the pressure data within this window relative to the median.

[0051] 2. Data Transformation: The stress value is normalized using the global minimum value obtained from historical operational data statistics during the cloud training phase. With the maximum value Perform linear normalization to ,Should and The model metadata, along with the network weights, is embedded into the edge device;

[0052] Should and As model metadata, it is embedded along with network weights into the edge device and remains unchanged during the inference phase. According to the Hazen-Williams formula... This means that, given constants such as pipe length, diameter, and material properties, the pressure loss along a pipe section is directly proportional to the 1.852nd power of the flow rate. An exponential transformation is then performed on the flow rate value. This is done to enhance its linear correlation with the pressure gradient, facilitating subsequent physical constraint modeling. The preprocessed bivariate sequence described above... , constitute the model input tensor For the real number domain. This embodiment of the invention introduces a cloud-based high-performance computing platform to complete the training of the adopted neural network model (including a lightweight prediction module and a high-precision re-prediction module). Historical operational data from the target water supply network are collected, with a time span of no less than 6 months, covering typical operating conditions such as different seasons, weekdays / holidays, and extreme weather. Regarding the original pressure... With traffic Perform the preprocessing procedure described above, and construct a length of 1 with a step size of 1. sequence samples, To predict future steps (e.g., H=4, corresponding to one hour), a training set is formed. .

[0053] To balance the low-power, persistent operation of edge devices with the need for high-precision anomaly verification, this invention employs two collaborative neural network models: a lightweight prediction module and a high-precision re-prediction module. Both are trained uniformly in the cloud, share a common composite loss function, and have different structural complexities and deployment strategies.

[0054] In the model training phase, this invention employs a composite loss function. Its core idea is to embed prior hydraulic knowledge of the water supply network while ensuring statistical prediction performance, thereby guiding the neural network to learn a mapping relationship that is both "data-driven" and "physically reliable".

[0055] The loss function consists of two parts: quantile regression loss and hydraulic trend consistency regularization term. These two are weighted and summed to jointly optimize the model parameters. Let the input be a historical window. The goal is to predict the pressure quantile for future H-steps. Its overall form is:

[0056]

[0057] in, This is the total loss function; Pinball loss function; For the first The actual measured pressure of the step; The first output of the model Step 1 Quantile predictions; The regularization coefficient is dimensionless. This indicates the amount of change in the predicted median pressure; This is a learnable scaling factor; The rate of change of water flow. ,in Representing the The actual measured water flow rate of the step.

[0058] The first part concerns the quantile regression loss. For any quantile level... , Defined as:

[0059]

[0060] in, It represents the residual.

[0061] When q=0.5, it degenerates into mean absolute error; when q=0.9, it imposes a greater penalty on underestimating predicted values ​​that are less than the true values; and when q=0.1, it imposes a greater penalty on overestimating predicted values ​​that are greater than the true values. This quantile regression loss not only predicts the most likely stress value but also quantifies prediction uncertainty, providing a theoretical basis for subsequent dynamic threshold anomaly detection.

[0062] In the second part, the hydraulic trend consistency regularization term... and This is the corresponding adjustable hyperparameter. In this regularization term, the median prediction with q=0.5 is used, and hydraulic model constraints are applied to multiple future steps (i.e., when water usage changes are relatively gradual, the pressure change and the water flow change are approximately linearly related), and a learnable coefficient k is introduced to adapt to the comprehensive resistance characteristics of different pipe sections.

[0063] When the LSTM model outputs anti-physical predictions such as "flow rate decreases but pressure increases", the loss function increases dramatically. Gradient backpropagation forces the model to correct itself, which can filter out non-physical results caused by sudden changes in water usage, sensor noise, etc.

[0064] The lightweight prediction module of this invention serves as the backbone model for persistent edge devices and is mainly composed of two layers of long short-term time series prediction models (LSTM).

[0065] In this layer, LSTM Layer 1 acts as the encoding layer, capturing short-term dynamic patterns and preprocessing the data. As input, For monitoring signals. Determine the input event span and the number of hidden layers (e.g., hidden layer dimensions) based on empirical values ​​or preliminary parameter tuning results. To balance the complexity of the LSTM model with its feature extraction and learning capabilities, the LSTM model output returns the complete sequence of hidden layers. .

[0066] The Dropout mechanism is added to randomly discard a certain proportion (e.g., 0.2) of hidden layer nodes while keeping the weights unchanged, thereby enhancing the model's generalization ability. The selection of this proportion balances the effects of overfitting and underfitting.

[0067] Add an early stopping mechanism to terminate training early when validation performance no longer improves or even begins to deteriorate (e.g., validation set loss does not decrease for 10 consecutive rounds) to prevent the model from overfitting on the training set.

[0068] LSTM Layer 2 is used as a compression layer to compress the hidden layer sequence output by the coding layer. By performing time-series compression and information condensation, the output dimensionality is reduced to... Extract more representative high-level dynamic features, retaining only the hidden state of the last time step. , as a representation of the global context.

[0069] The output layer is a fully connected layer, Mapping to the future Quantile prediction of the step: Each row corresponds to a future time point, and the three columns are as follows: Quantiles and These represent the weight matrix and bias vector during training, respectively. The training output of this lightweight prediction module is a converged complete weight set. .

[0070] This invention introduces a high-precision re-prediction module, a high-precision model specifically designed for anomaly verification. It incorporates a temporal attention mechanism and reuses all the LSTM backbone network weights of the lightweight prediction module, as described above. The encoder portion only requires an enhancement module at the decoding end.

[0071] The original second-layer LSTM now outputs the complete hidden layer sequence: L is the length of the input sequence, and d is the dimension of the LSTM hidden layer. It is the context representation of time step t.

[0072] To address the strong periodicity of water supply systems, the high-precision re-prediction module introduces sparse dual-window time attention:

[0073] Recent window: Water usage trends over the past 2 hours.

[0074] Periodic pattern: Water usage patterns within two hours before and after the same period yesterday .

[0075] Calculate the attention weight score for each time step in this sparse window: ,in In time step The transpose of the generated query vector is used to represent "what we want to focus on" at the current moment. These are key vectors generated at each time step, representing "what retrieveable information is contained at that historical moment," and they are derived from the aforementioned hidden states. Generates weights based on learning, with the following dimensions: .

[0076] Raw score After local softmax normalization, it will be transformed into a weight distribution with a sum of 1:

[0077] , The window size for sparse windows. For time indexes of all moments, For the aforementioned recent window, This is the window for the aforementioned periodic pattern.

[0078] Weighted aggregate value vector This will yield the final feature vector containing historical context. , Is with The value vector generated together. This feature vector. This will be fed into a fully connected layer to generate stress quantile predictions for the next H steps. The final training result of this module is converged. . The parameter set of the training results The learnable parameters for the sparse dual-window attention mechanism include the query matrix, key matrix, and value matrix. These are fully connected prediction head parameters specifically for the high-precision re-prediction module, used to map contextual features to multi-step quantile outputs.

[0079] Furthermore, in addition to introducing a temporal attention mechanism, the high-precision re-prediction module can also optionally incorporate spatial proximity attention. When multiple terminals are deployed within the monitoring area, the system can enable spatial collaboration.

[0080] A hydraulic adjacency graph is constructed based on historical pressure correlation (e.g., Pearson coefficient > 0.7); the LSTM hidden states of first-order neighbor nodes are aggregated and fused using learnable attention weighting; thereby identifying typical leakage characteristics of "sudden drop in local pressure while neighboring points remain normal," improving localization capabilities. This function is controlled by compilation options and is disabled by default to adapt to single-point scenarios.

[0081] This invention introduces an adaptive inference switch. After training is completed using high-performance computing in the cloud, the corresponding results are... , and global normalization parameters , It is distributed to edge devices via the communication network.

[0082] To achieve highly reliable anomaly detection on resource-constrained edge devices, this invention proposes an on-demand, two-stage inference mechanism, whose core consists of an adaptive inference switch module and a high-precision re-prediction module working together. This mechanism ensures ultra-low power consumption most of the time while performing secondary verification of suspected anomalies, significantly reducing the false alarm rate.

[0083] Under normal circumstances, the lightweight prediction module runs continuously, calculating the residual at each step. It also maintains a sliding window of residuals from the past 7 days (672 steps). The mean residuals are updated hourly. , And set a dynamic threshold based on it. This threshold can adapt to seasonal changes in the pipeline network, avoiding sensitivity imbalances caused by a fixed threshold. Among other things, For the first The pressure value at any moment, For the first Median stress forecast at time 10:00 To find the average value function, The average value of the residuals. The standard deviation of the residuals. To find the standard deviation function.

[0084] To prevent false activations caused by transient noise, when two consecutive steps of the lightweight prediction residual satisfy... and If so, it is judged as "suspected abnormality". For the aforementioned dynamic threshold, the weights of the high-precision re-prediction module are loaded from the computer's flash memory, and inference is initiated. By calculating the residual between the predicted value and the measured pressure, and comparing it with the dynamic threshold, secondary verification of suspected abnormal events is achieved. This predicted value simultaneously references recent trends and historical trends at the same time, resulting in smaller residuals and more accurate results than a single lightweight LSTM prediction.

[0085] This invention introduces an anomaly detection module, which is responsible for making the final decision on the review results of the high-precision re-prediction module and executing differentiated response strategies according to the severity of the anomalies. Specifically, it includes:

[0086] 1. The secondary verification and judgment logic reuses the dynamic threshold maintained by the adaptive inference switch. Reconstruct the residual at the current time from the output of the high-precision reprediction module. . like If the anomaly is confirmed, the alarm and communication process will begin; otherwise, it will be determined as a normal water usage fluctuation (e.g., fire water intake, start-up and shutdown of large equipment), local warnings will be suppressed, and the event will not be uploaded.

[0087] 2. Anomaly Classification: Further quantify the severity of anomalies based on the degree of residual deviation.

[0088] Level 1 (Emergency): Suspected pipe burst;

[0089] Level 2 (Important): Possible leak;

[0090] Level 3 (Note): Multiple consecutive minor exceedances but not reaching Level 2, indicating pipeline aging warning.

[0091] Example 3

[0092] See Figure 3 This experiment uses real pressure monitoring data from a typical section of a city's water supply network as an example to conduct a month-long continuous anomaly detection verification. The experiment aims to verify the effectiveness of the anomaly detection method integrating physical constraints and adaptive reasoning proposed in this embodiment of the invention in real-world scenarios.

[0093] After preprocessing such as outlier filtering and pressure normalization, the raw data is used to construct the model input sequence. The system employs a lightweight prediction module to output the median pressure prediction for the next three steps in real time and calculates the prediction residual at the current moment. Simultaneously, a 7-day residual sliding window is maintained, and the threshold is dynamically updated to adapt to the fluctuation characteristics of different operating periods. During normal water usage fluctuations, the residual never exceeds the threshold, the high-precision re-prediction module remains dormant, and the system maintains low-power operation.

[0094] When a simulated pipe burst occurs, the residual output by the lightweight module exceeds the dynamic threshold for two consecutive steps. The adaptive inference switch determines this as a "suspected anomaly" and immediately activates the high-precision re-prediction module. This module reconstructs the context-aware prediction value through a sparse dual-window attention mechanism. The calculated reconstructed residual significantly exceeds the threshold, reaching the pipe burst warning level. The system then triggers a local alarm and uploads the event data packet.

[0095] For both simulated leakage events, the lightweight module also triggered a review process due to persistent small deviations. After review by the high-precision module, it was confirmed that the residual deviation was consistent with leakage characteristics, and the system triggered a leakage level warning and completed data reporting accordingly.

[0096] Throughout the rest of the month, the predicted curves closely matched the measured data, with no false alarms. Experimental results demonstrate that the method of this invention can effectively distinguish between sudden pipe bursts and gradual leaks, exhibiting strong robustness while maintaining high sensitivity, making it suitable for edge intelligent monitoring under real-world complex operating conditions.

[0097] Example 4

[0098] A water supply network pressure anomaly monitoring system integrating physical constraints and adaptive attention is disclosed. The system includes a processor and a memory. The processor calls program instructions stored in the memory to cause the device to execute the following method steps in Embodiment 1:

[0099] The lightweight prediction module performs low-power prediction of the pressure range under normal operating conditions based on preprocessed data; the output pressure prediction value is used for the judgment of the adaptive inference switch module.

[0100] The adaptive inference switch module receives the pressure prediction value, calculates the deviation between the current actual pressure and the prediction value. If the deviation exceeds the dynamic residual threshold automatically set by the system twice in a row, the high-precision re-prediction module is triggered to execute the next step; otherwise, the next round of data acquisition and lightweight prediction continues.

[0101] The high-precision re-prediction module includes a lightweight spatiotemporal attention mechanism to re-predict the preprocessed data, and the prediction results are output to the anomaly detection module.

[0102] The anomaly detection module performs secondary verification by comparing the actual pressure value at the current moment with the reviewed predicted value. If the deviation between the two still exceeds the normal fluctuation threshold dynamically set by the system, it is confirmed as a real abnormal event, triggering a local early warning, uploading the early warning and event data, and the process ends.

[0103] The preprocessed data consists of: receiving and collecting pressure and water flow data, performing data cleaning and conversion preprocessing operations, and using the preprocessed data as input for the lightweight prediction module and the heavy prediction module.

[0104] This also includes: if the deviation between the two does not exceed the normal fluctuation threshold dynamically set by the system, it is considered a false initial screening, no warning is triggered, and it is only recorded locally.

[0105] Data cleaning includes:

[0106] Calculate the sliding window Median internal pressure N represents the number of sampling points that the sliding window extends to the past and future in the time dimension, expressed in "number of sampling points". The median absolute deviation is used as a measure of robust dispersion.

[0107] If satisfied Then Those marked as anomalies are replaced with linear interpolation of valid points in the neighboring region; where, Where W is the threshold coefficient, and W is the set of time indices within the sliding window. This is the function for taking the median. For any sampling time in the sliding window W, This represents the median absolute deviation of the pressure data within this window relative to the median.

[0108] The data transformation involves normalizing the stress values ​​using the global minimum value obtained from historical operational data statistics during the cloud training phase. With the maximum value Perform linear normalization to ,Should and The model metadata, along with the network weights, is embedded into the edge device;

[0109] According to the Hazen-Williams formula Exponential transformation of flow rate values Preprocessed bivariate sequences This constitutes the model input tensor. For the real number field, .

[0110] The secondary verification performed through the anomaly detection module is as follows:

[0111] The secondary verification decision logic reuses the dynamic threshold maintained by the adaptive inference switch. Reconstruct the residual at the current time from the output of the high-precision reprediction module. ;

[0112] like If the anomaly is confirmed, the alarm and communication process will begin; otherwise, it will be determined as a normal water usage fluctuation, the local warning will be suppressed, and the event will not be uploaded.

[0113] Quantifying the severity of anomalies based on the degree of residual deviation:

[0114] Level 1: Suspected pipe burst;

[0115] Level 2: Possible leak;

[0116] Level 3: Multiple consecutive minor exceedances but not reaching Level 2, indicating pipeline aging warning.

[0117] It should be noted that the device descriptions in the above embodiments correspond to the method descriptions in the embodiments, and the embodiments of the present invention will not be repeated here.

[0118] The execution entities of the aforementioned processor and memory can be devices with computing functions such as computers, microcontrollers, and single-chip microcomputers. In specific implementations, the embodiments of the present invention do not limit the execution entities and can select them according to the needs of actual applications.

[0119] Data signals are transmitted between the memory and the processor via a bus, which will not be elaborated upon in this embodiment of the invention.

[0120] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium, the storage medium including a stored program, which, when the program is running, controls the device where the storage medium is located to execute the method steps in the above embodiments.

[0121] The computer-readable storage medium includes, but is not limited to, flash memory, hard disk, solid-state drive, etc.

[0122] It should be noted that the description of the readable storage medium in the above embodiments corresponds to the description of the method in the embodiments, and the embodiments of the present invention will not be repeated here.

[0123] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of the present invention is generated.

[0124] A computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in or transmitted through a computer-readable storage medium. A computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic or semiconductor, etc.

[0125] Unless otherwise specified, the model numbers of the various devices in this embodiment of the invention are not limited, and any device that can perform the above functions is acceptable.

[0126] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for monitoring anomalies in water supply network pressure based on physical constraints and attention, characterized in that, The method includes: The lightweight prediction module performs low-power prediction of the pressure range under normal operating conditions based on preprocessed data; the output pressure prediction value is used for the judgment of the adaptive inference switch module. The adaptive inference switch module receives the pressure prediction value, calculates the deviation between the current actual pressure and the prediction value. If the deviation exceeds the dynamic residual threshold automatically set by the system twice in a row, the high-precision re-prediction module is triggered to execute the next step; otherwise, the next round of data acquisition and lightweight prediction continues. The high-precision re-prediction module includes a lightweight spatiotemporal attention mechanism to re-predict the preprocessed data, and the prediction results are output to the anomaly detection module. The anomaly detection module performs secondary verification by comparing the actual pressure value at the current moment with the reviewed predicted value. If the deviation between the two still exceeds the normal fluctuation threshold dynamically set by the system, it is confirmed as a real abnormal event, triggering a local early warning, uploading the early warning and event data, and the process ends.

2. The method for monitoring abnormal pressure in a water supply network based on physical constraints and attention, as described in claim 1, is characterized in that... The preprocessed data consists of: receiving collected pressure and water flow data, performing data cleaning and conversion preprocessing operations, and using the preprocessed data as input to the lightweight prediction module and the heavy prediction module.

3. The method for monitoring abnormal pressure in a water supply network based on physical constraints and attention, as described in claim 1, is characterized in that... The method further includes: if the deviation between the two does not exceed the normal fluctuation threshold dynamically set by the system, it is regarded as a preliminary screening misjudgment, no warning is triggered, and only a local record is made.

4. The method for monitoring abnormal pressure in a water supply network based on physical constraints and attention, as described in claim 2, is characterized in that... The data cleaning process is as follows: Calculate the sliding window Median internal pressure N represents the number of sampling points that the sliding window extends to the past and future in the time dimension, expressed in "number of sampling points". The median absolute deviation is used as a measure of robust dispersion. ; If satisfied Then Those marked as anomalies are replaced with linear interpolation of valid points in the neighboring region; where, Where W is the threshold coefficient, and W is the set of time indices within the sliding window. This is the function for taking the median. For any sampling time in the sliding window W, This represents the median absolute deviation of the pressure data within this window relative to the median.

5. The method for monitoring abnormal pressure in a water supply network based on physical constraints and attention, as described in claim 2, is characterized in that... The data is converted to: normalize the pressure values ​​using the global minimum value obtained from historical operational data statistics during the cloud training phase. With the maximum value Perform linear normalization to ,Should and The model metadata, along with the network weights, is embedded into the edge device; According to the Hazen-Williams formula Exponential transformation of flow rate values Preprocessed bivariate sequences This constitutes the model input tensor. For the real number field, ; in, For the real number field, For the pressure loss along the pipeline, the first The original flow measurement value at that moment, For the first The pressure value at any moment, For the first The flow rate value after exponential transformation at any given time, where L is the length of the historical time step.

6. The method for monitoring abnormal pressure in a water supply network based on physical constraints and attention, as described in claim 1, is characterized in that... The secondary verification performed by the anomaly detection module is as follows: The secondary verification decision logic reuses the dynamic threshold maintained by the adaptive inference switch. Reconstruct the residual at the current time from the output of the high-precision reprediction module. ; like If confirmed as a genuine anomaly, the alarm and communication process will begin. Otherwise, it is judged as a normal water usage fluctuation, local early warning is suppressed, and the event is not uploaded; Quantifying the severity of anomalies based on the degree of residual deviation: Level 1: Suspected pipe burst; Level 2: Possible leak; Level 3: Multiple consecutive minor exceedances, but not reaching Level 2, indicating pipeline aging warning. is the standard deviation of the residual sequence.

7. A water supply network pressure anomaly monitoring system based on physical constraints and attention, characterized in that, The system includes a processor and a memory, the memory storing program instructions, the processor invoking the program instructions stored in the memory to cause the device to perform the method according to any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described in any one of claims 1-6.