Drought and rainy season dynamic monitoring method for pipe network external water intrusion identification

By deploying multi-dimensional sensors at key nodes of the drainage network and combining edge computing with cloud analysis, the problems of inaccurate identification of external water intrusion types and energy redundancy in existing technologies have been solved, enabling accurate dynamic monitoring of external water intrusion events and comprehensive risk perception.

CN122084849APending Publication Date: 2026-05-26YANGTZE ECOLOGY & ENVIRONMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YANGTZE ECOLOGY & ENVIRONMENT CO LTD
Filing Date
2026-01-22
Publication Date
2026-05-26

Smart Images

  • Figure CN122084849A_ABST
    Figure CN122084849A_ABST
Patent Text Reader

Abstract

The invention provides a dry and rainy season dynamic monitoring method for pipe network external water intrusion identification, and the method comprises the steps: firstly arranging a lightweight monitoring terminal integrated with a multi-dimensional sensor at a key node of a drainage pipe network, and building a cloud side communication link; in a dry season, a reference vector matrix of pipe network operation is constructed by collecting high-frequency time sequence data. When monitoring data triggers a rainfall response threshold value, the system is automatically switched to an encryption sampling mode, and dynamic response data of the whole process is captured. Then, dynamic hysteresis loop characteristics are calculated by using a phase-space reconstruction technology, and an external water intrusion fingerprint vector is constructed in combination with a first-order dynamic attenuation constant; and finally, generating a pipe network external water hot spot map for distinguishing three types of rainwater direct invasion, river water backflow and underground water jacking through a spatial interpolation algorithm, and providing a basis for precise treatment. According to the invention, accurate identification and dynamic monitoring of the external water invasion type are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of external water intrusion into pipe networks, and in particular to a dynamic monitoring method for identifying external water intrusion into pipe networks during both dry and rainy seasons. Background Technology

[0002] With the acceleration of urbanization, the operational efficiency of urban drainage pipe network systems has received increasing attention. In particular, the problem of external water intrusion (i.e., groundwater infiltration, river and lake backflow, and rainwater intrusion) has become a major cause of low influent concentrations (such as COD) and reduced treatment efficiency in sewage treatment plants. In plain river network areas such as the Taihu Lake Basin, external water intrusion exhibits strong spatiotemporal heterogeneity and dynamic randomness due to the influence of water level backflow and mountain runoff. Traditional manual single-sampling or simple online monitoring methods are insufficient to accurately capture and distinguish different types of external water intrusion events. Existing pipe network monitoring technologies mostly rely on fixed-period online monitoring equipment, but this model suffers from high deployment costs, large data transmission volumes, and high power supply pressure. Furthermore, it generates a large amount of redundant data during the non-rainy season, while during critical rainy seasons, insufficient sampling frequency may cause the instantaneous characteristics of external water intrusion to be missed.

[0003] In existing technologies, CN115853093B discloses a dynamic detection method and system for drainage pipe networks that can identify mixed stormwater and sewage connections. This technology establishes a drainage pipe network model based on population density and land use type, and deploys sensors according to the regulatory type to detect points of mixed stormwater and sewage connections. However, this existing technology mainly focuses on locating connection points through static land use attributes and sensor readings, lacking in-depth analysis of the dynamic response mechanism of external water intrusion processes, and making it difficult to distinguish between continuous groundwater backwater and short-term rainwater impacts using the temporal variation patterns of water quality and quantity. In addition, CN115544734B discloses a drought monitoring and early warning method, system, and equipment based on changes in characteristic water bodies. This technology uses random forest classification and a comprehensive threshold segmentation model to automatically extract and monitor surface water bodies. Although this existing technology has some reference value in water body feature recognition and machine learning classification, its application scenarios are mainly for macroscopic surface characteristic water bodies, and cannot be directly applied to closed and complex underground drainage pipe network environments, and it lacks analytical methods for the unique dynamic attenuation and hysteresis response characteristics of fluids within the pipe network.

[0004] Current pipeline monitoring methods often suffer from the following limitations when facing complex external water intrusion identification: First, they lack dynamic decoupling between the "dry season baseline" and "rainy season disturbances," making it impossible to accurately quantify the increase in external water intrusion. Second, they lack morphological analysis based on "phase space reconstruction," failing to utilize the hysteresis loop characteristics of COD concentration relative to conductivity changes to identify intrusion types, and relying solely on a single threshold can easily lead to false alarms. Third, data processing is mostly concentrated in the cloud, with a lack of intelligent computing environments at the edge, making it difficult to achieve high-frequency encrypted sampling and localized real-time inference based on event-driven methods, resulting in high data transmission bandwidth consumption and large response latency. Therefore, there is an urgent need for a dynamic monitoring method for both dry and rainy seasons that can integrate morphological and dynamic features and possess edge intelligence. Summary of the Invention

[0005] The main objective of this invention is to provide a dynamic monitoring method for identifying external water intrusion in pipe networks during both dry and rainy seasons. This method solves the technical problems of existing drainage pipe network monitoring technologies, which struggle to accurately distinguish between three different external water sources—direct rainwater intrusion, river backflow, and groundwater backflow—using a single indicator, as well as the coexistence of insufficient data capture capabilities and redundant energy consumption during the dry season in traditional fixed-frequency monitoring.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a dynamic monitoring method for identifying water intrusion outside the pipe network during dry and rainy seasons, the method comprising: S1. Lightweight monitoring terminals are deployed at key nodes in the topology and hydraulically weak points of the drainage network. The lightweight monitoring terminals integrate acoustic Doppler current meters, ultrasonic level meters and spectral water quality probes, and establish a communication link between the terminals and the cloud server. S2. During the dry season with consecutive rainless days, high-frequency time-series data of pipeline liquid level, flow rate, chemical oxygen demand (COD), and electrical conductivity (EC) are collected using lightweight monitoring terminals. After denoising and feature extraction, a baseline vector matrix of daily variations during the dry season is constructed. ; S3. When real-time monitoring data triggers the rainfall response threshold, the sampling frequency is automatically switched from low-frequency mode to high-frequency encrypted sampling mode to obtain the dynamic response dataset of the entire process from the start of rainfall to 72-82 hours after the rain stops. ; S4, Based on dataset The dynamic hysteresis loop characteristics of COD concentration relative to the change in conductivity EC were calculated by phase space reconstruction technology, and combined with the first-order kinetic decay constant of the post-rain recovery stage, an external water intrusion fingerprint vector containing morphological and kinetic characteristics was constructed. S5. Map the external water intrusion fingerprint vector to the pipe network topology and use spatial interpolation algorithm to generate a pipe network external water hotspot map that distinguishes between three types of external water intrusion: direct rainwater intrusion, river backflow, and groundwater backflow.

[0007] In the preferred embodiment, after deploying the lightweight monitoring terminal, step S1 also includes the containerized deployment and resource pre-allocation steps of the edge computing environment: S11. Deploy a Docker container engine in the embedded Linux operating system of the lightweight monitoring terminal, and calculate and allocate the size of the circular buffer for storing waveform data according to the terminal hardware configuration. The calculation formula is: ,in The highest sampling rate, For cache duration, For the number of channels, For bit width; S12. Instantiate the data acquisition microservice container, load the sensor driver, and configure an event-driven I / O multiplexing mechanism to concurrently handle multiple sensor interrupts. S13. Instantiate the preprocessing microservice container, preload the anomaly detection algorithm library in the container, and establish a shared memory channel with the collection container to achieve zero-copy data transmission. S14. Instantiate the edge inference microservice container, load the lightweight ONNX format fingerprint recognition model, initialize the MQTT client and subscribe to the cloud control topic to complete the closed-loop construction of the edge software environment.

[0008] In the preferred scheme, step S2 involves constructing a baseline vector matrix for daily variations during the dry season. This includes data cleaning steps based on statistics and dynamic programming: S21. For the acquired high-frequency time-series data Perform Z-score-based sliding window anomaly culling and calculate the standard score within the window. ,like It is then identified as an outlier and replaced using cubic spline interpolation, where and These are the window mean and standard deviation, respectively. S22. Diurnal variation sequence of 7 consecutive natural days Phase alignment based on dynamic time warping is performed to calculate the sequence. and Cumulative distance matrix between And adjust the sequence phase according to the optimal twist path; S23. Calculate the weighted average of the aligned sequences, generating a sequence of length [length missing]. Standard reference vector The vectors are then stored in a local time-series database to form a matrix. .

[0009] In the preferred embodiment, the steps in step S3 of triggering the rainfall response threshold and initiating the encrypted sampling mode are as follows: S31. Run a real-time streaming computation task in the data acquisition container and calculate the first derivative of the liquid level using the five-point central difference method. ; S32, Simultaneous monitoring of conductivity The change, if the condition is met If so, it is determined that a rainfall intrusion event has been triggered, in which This is the threshold for the liquid level to rise. and The mean and standard deviation of electrical conductivity during the dry season; S33. Send the SIGUSR1 signal to the acquisition container through inter-process communication to trigger the interrupt handler and adjust the timer interrupt frequency of the ADC sampling controller from 30 minutes / time to 5 minutes / time. S34. Start the data streaming write process and continue recording until the stop condition is met. Furthermore, the duration exceeds 6-8 hours, generating a dataset containing complete event waveforms. .

[0010] In the preferred embodiment, the calculation of the dynamic hysteresis loop characteristics in step S4 involves the following mathematical calculation steps: S41, Regarding the dataset COD sequence in With EC sequence Perform Min-Max normalization to obtain and ; S42, Constructing with For the horizontal axis, Using the two-dimensional phase plane with the vertical axis as the coordinate axis, the area of ​​the closed hysteresis loop formed by the response trajectory is calculated using the discrete form of Green's formula. : ; S43. Calculate the geometric centroid coordinates of the hysteresis loop. ,in , ; S44. Calculate the centroid relative to the ideal synchronous response line ( Euclidean distance ; S45, will and As a morphological characteristic component that characterizes the strength of the external water backing effect, the larger the value, the more significant the impact of groundwater retention.

[0011] In the preferred scheme, step S4 incorporates a nonlinear least squares fitting method based on the first-order kinetic decay constant during the post-rain recovery phase: S46. Locate the starting point of the post-rain recovery phase. and the end point Extract the COD concentration sequence within this time period. ; S47. Construct a first-order dynamic decay model Construct the objective function of residual sum of squares ; S48. Iteratively update parameters using the Levenberg-Marquardt algorithm. and The update step size is approximated by the Hessian matrix: ,in The damping factor, It is the residual vector; S49. When the change in the sum of squared residuals is less than Stop iteration when the optimal solution is found, and output the optimal solution. , which serves as a dynamic characteristic component characterizing the drainage capacity of the pipeline network.

[0012] In the preferred scheme, the construction of the external water intrusion fingerprint vector and the classification in step S4 are implemented based on a random forest classifier: S401, calculate the hysteresis loop area. Centroid offset distance and attenuation constant Concatenate into feature vectors ; S402. Load a pre-trained random forest model into the edge inference container. This model contains... Each decision tree is trained by splitting nodes according to the principle of maximizing the Gini index. S403, Vector Input the model and summarize the predicted categories of all decision trees. The final type of external water was determined by majority voting. ,in It is an indicator function; S404. If the determination result is "groundwater backing up", then further calculate its membership probability. ,like If this occurs, a high-level alarm will be triggered.

[0013] In the preferred embodiment, step S5, generating the external water hotspot map of the pipe network, includes a kriging interpolation step based on the variogram function: S51, the cloud server receives the fingerprint feature values ​​of each monitoring node, i.e. Attenuation constant, construct a known point set ; S52. Calculate the experimental variability function. And fit a spherical model to obtain nugget value, sill value and range; S53, For unmonitored locations Estimation is performed using the ordinary Kriging interpolation formula. The weight By solving the Kriging equations get; S54, Based on valuation results Render continuous heatmap layers in the WebGIS front-end using RGBA color space mapping. The smaller the value, the stronger the red component. The higher the value, the greater the transparency. The higher the value.

[0014] In the preferred embodiment, an auxiliary deployment step based on hydraulic model simulation is also included between steps S1 and S2: S101. Deploy the SWMM simulation engine on the server side and build a node-pipe segment topology model based on pipeline GIS data; S102. Using the one-dimensional form of Saint-Venant's equations to describe unsteady flow in a pipe, the continuity equation is: The momentum equation is ; S103. Input the designed rainfall pattern and simulate the filling ratio of each pipe section. Filter out High-load pipe sections; S104. Mark the inspection wells at both ends of the high-load pipe section as key nodes, and send the list of node coordinates to the construction handheld terminal APP via RESTful API to guide the physical installation of the monitoring terminal.

[0015] The preferred scheme also includes a model update step based on hash verification: S61. After the cloud server completes the training of the new fingerprint recognition model, it generates a binary model file and the corresponding SHA-256 hash signature. S62. Control topic publishing update notifications via MQTT, including download URL and hash signature; S63. The edge monitoring terminal suspends the inference container, downloads the model file, and calculates the SHA-256 hash value of the downloaded file locally: ; S64, Comparison If the signature matches the one issued from the cloud, the old model file will be overwritten, and the inference container will be restarted to load the new model. If there is a discrepancy, roll back to the old version and report the error log.

[0016] This invention provides a dynamic monitoring method for identifying external water intrusion in drainage networks during both dry and rainy seasons. This application utilizes lightweight monitoring terminals integrating multi-dimensional sensors deployed at key nodes of the drainage network, combined with edge computing and cloud analytics, to achieve accurate identification and dynamic monitoring of external water intrusion events. Firstly, this application innovatively introduces phase space reconstruction technology. By constructing a dynamic hysteresis loop representing the change in COD concentration relative to conductivity, and combining this with the first-order kinetic decay constant during the post-rain recovery phase, an external water intrusion fingerprint vector incorporating both morphological and kinetic features is generated. This fingerprint vector effectively distinguishes between the "rapid inflow and outflow" of rainwater, the "continuous backwatering" of groundwater, and the "backflow" characteristics of river water, significantly improving the accuracy of external water intrusion type identification.

[0017] Secondly, this application employs an event-driven dynamic sampling strategy, maintaining low-frequency sampling during the dry season to establish a robust daily variation baseline vector matrix, while automatically switching to a high-frequency encrypted sampling mode when a rainfall response threshold is triggered. This mechanism ensures the capture of dynamic response data throughout the entire process while significantly reducing power consumption and data transmission pressure during non-critical periods, thus extending the operational life of the lightweight terminal.

[0018] Furthermore, this application introduces a containerized deployment solution at the edge, isolating data acquisition, preprocessing, and inference microservices through the Docker container engine, and improving data processing efficiency by utilizing shared memory and zero-copy technology. The lightweight ONNX model loaded at the edge enables local fingerprint recognition, reducing dependence on cloud computing resources, and supports remote model updates based on hash verification via OTA technology, ensuring the continuous iteration and security of the algorithm model.

[0019] Finally, this application uses a spatial interpolation algorithm to map discrete monitoring point data into a continuous external water hotspot map of the pipe network, and uses hydraulic model simulation to assist in terminal deployment, realizing full-area risk perception from point to surface, providing an intuitive and scientific decision-making basis for the precise repair and quality improvement of drainage pipe networks. Attached Figure Description

[0020] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 This is a flowchart of the dynamic monitoring method for dry and rainy seasons of the present invention; Figure 2 This is a system architecture and workflow diagram of the dynamic monitoring method for identifying external water intrusion in pipe networks during dry and rainy seasons according to the present invention; Figure 3 This invention is a GIS visualization of external water intrusion heat maps based on spatial interpolation. Implementation Example 1 like Figure 1-3 As shown, a dynamic monitoring method for identifying water intrusion outside the pipe network during the dry and rainy seasons is proposed. The method includes: S1. Lightweight monitoring terminals are deployed at key nodes in the topology and hydraulically weak points of the drainage network. The lightweight monitoring terminals integrate acoustic Doppler current meters, ultrasonic level meters and spectral water quality probes, and establish a communication link between the terminals and the cloud server. S2. During the dry season with consecutive rainless days, high-frequency time-series data of pipeline liquid level, flow rate, chemical oxygen demand (COD), and electrical conductivity (EC) are collected using lightweight monitoring terminals. After denoising and feature extraction, a baseline vector matrix of daily variations during the dry season is constructed. ; S3. When real-time monitoring data triggers the rainfall response threshold, the sampling frequency is automatically switched from low-frequency mode to high-frequency encrypted sampling mode to obtain the dynamic response dataset of the entire process from the start of rainfall to 72-82 hours after the rain stops. ; S4, Based on dataset The dynamic hysteresis loop characteristics of COD concentration relative to the change in conductivity EC were calculated by phase space reconstruction technology, and combined with the first-order kinetic decay constant of the post-rain recovery stage, an external water intrusion fingerprint vector containing morphological and kinetic characteristics was constructed. S5. Map the external water intrusion fingerprint vector to the pipe network topology and use spatial interpolation algorithm to generate a pipe network external water hotspot map that distinguishes between three types of external water intrusion: direct rainwater intrusion, river backflow, and groundwater backflow.

[0021] This embodiment discloses a dynamic monitoring method for identifying external water intrusion in drainage networks during both dry and rainy seasons. This method achieves refined perception of the operational status of drainage networks through the collaborative work of hardware deployment and software algorithms. First, a dynamic monitoring sensor network is constructed, deploying lightweight monitoring terminals at key topological nodes and hydraulically vulnerable points in the drainage network. Key topological nodes typically refer to the junctions of main pipes or the inlets of pumping stations, while hydraulically vulnerable points refer to pipe sections historically prone to overflows or abnormal flow rates. The lightweight monitoring terminal internally integrates an acoustic Doppler current meter, an ultrasonic level gauge, and a spectral water quality probe, enabling simultaneous acquisition of flow rate, level, and water quality fingerprint data. A bidirectional communication link is established between the terminal and a cloud server via an embedded communication module, enabling real-time data upload and command distribution.

[0022] After system deployment, the system enters the stage of establishing the baseline feature space for the dry season. During the dry season, characterized by consecutive rainless days, lightweight monitoring terminals collect high-frequency time-series data on pipe network liquid level, flow rate, chemical oxygen demand (COD), and electrical conductivity (EC) according to a preset low-frequency sampling strategy. To eliminate the impact of sensor noise on baseline accuracy, the system performs denoising and feature extraction operations on the raw data. Specifically, a Z-score-based sliding window anomaly removal algorithm can be used to calculate the standard score within the window. Its calculation formula is ,in The sampled data represents the current moment. This represents the mean of the data within the sliding window. This represents the standard deviation of the data within the sliding window. When the absolute value of the calculated standard score exceeds a preset threshold, the data point is identified as an outlier and interpolation is performed. The cleaned data is then used to construct the dry season diurnal variation baseline vector matrix. This matrix accurately depicts the baseline operating pattern of the pipeline network under conditions of no external water intrusion, providing a benchmark for subsequent anomaly identification.

[0023] When abnormal fluctuations occur in real-time monitoring data, the system automatically executes the rainy season disturbance response capture procedure. The system will calculate the first derivative of the monitoring data in real time, for example, using the five-point central difference method to calculate the first derivative of the liquid level. Its approximate calculation formula is: ,in for The liquid level at that moment. The sampling time interval is specified. When the rate of change in liquid level or conductivity meets the preset rainfall response threshold, the system automatically determines that a rainfall event has occurred and switches the sampling frequency from low-frequency mode to high-frequency encrypted sampling mode. This encrypted sampling continues for 72 to 82 hours after the rain stops to ensure complete acquisition of a dynamic response dataset containing the entire process of rainfall initiation, peak, and recovery. .

[0024] Based on the acquired full-process dynamic response dataset The system runs an external water type fingerprinting algorithm. The core of this step lies in mining deep correlations between data through phase space reconstruction technology. The system uses normalized conductivity (EC) data as the horizontal axis and normalized COD data as the vertical axis to plot the response trajectory on a two-dimensional phase plane. Because different types of external water intrusions have asynchronous dilution and recovery effects on water quality and quantity, this trajectory typically forms a closed hysteresis loop. The area of ​​the closed hysteresis loop formed by this response trajectory can be calculated using the discrete form of Green's formula. Its calculation formula is ,in and The first Normalized conductivity and COD values ​​at each sampling point This represents the total number of data points. This area feature quantifies the lag between changes in water quality and changes in water quantity; a larger area usually indicates a persistent groundwater backwater effect.

[0025] In addition to morphological features, the system also incorporates the first-order kinetic decay constant during the post-rain recovery phase to construct the fingerprint vector. The system extracts the COD concentration sequence during the post-rain recovery phase and constructs a first-order kinetic decay model. ,in for COD model prediction at time 10:00 This is the baseline concentration for the dry season. The increase in concentration due to the peak of the rainy season. This marks the start of the recovery phase. Let be the first-order dynamic decay constant. The optimal decay constant is obtained by iteratively solving using the nonlinear least squares method. The constant It has a clear physical meaning and a small numerical value. The value indicates a slow recovery of pollutant concentration, corresponding to the tailing effect caused by groundwater infiltration; larger values... The value indicates a strong drainage capacity of the pipe network, corresponding to the rapid inflow and outflow characteristics of direct rainwater intrusion. The system will use the hysteresis loop area. With decay constant By combining these features, an external water intrusion fingerprint vector containing both morphological and dynamic characteristics is constructed.

[0026] Finally, the calculated external water intrusion fingerprint vectors are mapped back to the pipe network topology, and a hotspot map of external water intrusion is generated using a spatial interpolation algorithm. For areas without monitoring terminals, Kriging interpolation is used for feature estimation, and the estimation formula is as follows: ,in Location to be estimated eigenvalues, Known monitoring points eigenvalues, The corresponding weighting coefficients are determined by the variogram function. Based on the interpolation results, the system generates a continuous risk distribution layer on the map, distinguishing different external water sources through color coding. For example, a high-saturation red area represents the attenuation constant. Regions with extremely small hysteresis loops and large hysteresis loop areas are identified as groundwater backwater types; the blue area represents the attenuation constant. Areas with larger hysteresis loops and smaller lag loop areas are identified as direct rainwater intrusion types; other specific chromatograms are used to represent river backflow types. This visualized heat map can intuitively show the health status of the pipeline network, guiding subsequent pipeline repair and sewage interception and collection work.

[0027] Example 2 To further illustrate with reference to Example 1, step S1, after deploying the lightweight monitoring terminal, also includes the containerized deployment and resource pre-allocation steps of the edge computing environment: S11. Deploy a Docker container engine in the embedded Linux operating system of the lightweight monitoring terminal, and calculate and allocate the size of the circular buffer for storing waveform data according to the terminal hardware configuration. The calculation formula is: ,in The highest sampling rate, For cache duration, For the number of channels, For bit width; S12. Instantiate the data acquisition microservice container, load the sensor driver, and configure an event-driven I / O multiplexing mechanism to concurrently handle multiple sensor interrupts. S13. Instantiate the preprocessing microservice container, preload the anomaly detection algorithm library in the container, and establish a shared memory channel with the collection container to achieve zero-copy data transmission. S14. Instantiate the edge inference microservice container, load the lightweight ONNX format fingerprint recognition model, initialize the MQTT client and subscribe to the cloud control topic to complete the closed-loop construction of the edge software environment.

[0028] After completing the physical deployment of the lightweight monitoring terminals, to ensure efficient and stable data processing capabilities at the edge, the system entered the containerized deployment and resource pre-allocation phase of the edge computing environment. First, at the embedded Linux operating system layer of the lightweight monitoring terminals, a Docker container engine was deployed as the runtime platform for microservices. Considering the limitations of edge device hardware resources and the need for continuous recording of high-frequency waveform data, the system precisely calculated and allocated a dedicated memory area as a circular buffer for storing waveform data based on the terminal's hardware configuration. The size of this circular buffer... Quantitative calculations are performed based on specific physical parameters, and the calculation formula is as follows: .

[0029] In this formula, This represents the total memory capacity of the circular buffer that must be pre-allocated to prevent data overflow; its unit is usually bytes. This represents the highest sampling rate that all sensors in the monitoring terminal can achieve. For example, when the acoustic Doppler current meter has the highest sampling frequency, this value is used as the calculation benchmark to ensure that the buffer is still sufficient under extreme high-frequency sampling conditions. This represents the local data caching duration required by the system design, i.e., the maximum time span during which data can be temporarily stored when the network is down or the processor is busy. This represents the total number of sensor channels that are collected simultaneously, covering multiple dimensions such as flow rate, liquid level, COD concentration, and conductivity. This represents the bit width of a single sampled data point, such as the number of bytes corresponding to sampling using a 16-bit or 24-bit high-precision ADC. The buffer size calculated using this formula ensures lossless writing and temporary storage of multi-channel high-frequency data at the hardware level.

[0030] Next, the system instantiates the microservices. First, a data acquisition microservice container is instantiated. The main responsibility of this container is to shield the underlying hardware differences and load drivers for various sensors. To handle high-concurrency data streams triggered simultaneously by multiple sensors, the container is configured with an event-driven I / O multiplexing mechanism, such as epoll. This mechanism allows a single thread to monitor the state changes of multiple file descriptors simultaneously. Once a sensor generates an interrupt signal or data is ready, a callback function is immediately triggered for processing. This enables concurrent processing of interrupt signals from multiple sensors, such as acoustic Doppler current meters, ultrasonic level gauges, and spectral water quality probes, significantly reducing CPU context switching overhead.

[0031] Subsequently, a preprocessing microservice container is instantiated for real-time cleaning and analysis of the collected raw data. This container is pre-loaded with an anomaly detection algorithm library, capable of identifying and filtering outoutliers caused by sensor malfunctions or environmental interference in real time. To improve data transfer efficiency between the acquisition and preprocessing containers, a shared memory channel is established between them. Through memory mapping technology, the two containers can directly access the same physical memory region, achieving zero-copy data transfer. This means that massive amounts of waveform data do not need to be repeatedly copied between kernel and user modes, or between the memory spaces of different containers, significantly reducing memory bandwidth consumption and processing latency, thus meeting real-time requirements.

[0032] Finally, an edge inference microservice container, a core component of edge intelligence, is instantiated. This container loads a lightweight ONNX format fingerprinting model, a pre-trained deep learning model for identifying external water intrusion characteristics. Simultaneously, the container initializes an MQTT client and subscribes to cloud control topics. By establishing a bidirectional long-lived connection with the cloud server, the terminal can not only report inference results but also receive model update commands or control strategies from the cloud in real time. This completes the closed-loop construction of the edge software environment, enabling the monitoring terminal to possess full autonomous capabilities from data acquisition and processing to intelligent analysis.

[0033] In the preferred scheme, step S2 involves constructing a baseline vector matrix for daily variations during the dry season. This includes data cleaning steps based on statistics and dynamic programming: S21. For the acquired high-frequency time-series data Perform Z-score-based sliding window anomaly culling and calculate the standard score within the window. ,like It is then identified as an outlier and replaced using cubic spline interpolation, where and These are the window mean and standard deviation, respectively. S22. Diurnal variation sequence of 7 consecutive natural days Phase alignment based on dynamic time warping is performed to calculate the sequence. and Cumulative distance matrix between And adjust the sequence phase according to the optimal twist path; S23. Calculate the weighted average of the aligned sequences, generating a sequence of length [length missing]. Standard reference vector The vectors are then stored in a local time-series database to form a matrix. .

[0034] In step S2, a baseline vector matrix of daily variations during the dry season is constructed. This is to establish a standard operating model for the pipe network under conditions of no rain and no external water intrusion, which requires a high-precision data cleaning process based on statistics and dynamic programming. First, anomaly removal is performed on the collected high-frequency time-series data. The dataset is traversed, consisting of a series of sampling points arranged in chronological order. Until Composition. To adapt to the dynamic nature of pipeline network data over time, a sliding window algorithm is used to calculate local statistical characteristics. For each data point within the window... Calculate its standard score The calculation formula is: In this formula, This represents the arithmetic mean of all data points within the current sliding window, used to reflect the central tendency of the data during this time period; The standard deviation represents the data within the current sliding window, reflecting the dispersion or volatility of the data. If the calculated absolute value of the standard score... Greater than 3, according to the statistical standard of 3 The system determines that a data point deviates from the normal data distribution range and is an outlier caused by sensor malfunction or electromagnetic interference. Instead of simply deleting these outliers, the system uses cubic spline interpolation to construct a smooth curve based on the trend information of adjacent normal data points, calculates a reasonable replacement value, and thus removes noise while maintaining the temporal continuity of the data sequence.

[0035] After outlier removal, the system needs to address the temporal phase deviation caused by fluctuations in residents' water usage habits; that is, the peak flow or concentration on different days may have slight shifts on the timeline. To address this, the system selects a diurnal variation sequence of seven consecutive natural days. to The Dynamic Time Warping (DTW) algorithm is used to phase-align these sequences. The core of this algorithm lies in finding the optimal matching path between two time series and calculating the sequence... and Cumulative distance matrix between Its recursive calculation formula is as follows: In this formula, Represents a sequence The former Points and sequences The former The minimum cumulative distance between points; Represents corresponding points in two sequences and The Euclidean distance between two points is used to quantify the numerical difference between them. The function term indicates that in the dynamic programming grid, the current state can only be transitioned from the state to the left, below, or to the lower left. The system ensures the optimality of the global path by selecting the minimum cumulative distance in these three directions.

[0036] After calculating the optimal distortion path through the dynamic programming process described above, the system performs non-linear scaling adjustments on the time axis of each daily variation sequence based on this path, ensuring that all peaks and troughs are precisely aligned on the time axis. Subsequently, the system calculates the weighted average of the aligned sequence, thereby eliminating the influence of random daily fluctuations and generating a length of... Standard reference vector The length here This corresponds to the total number of sampling points per day, for example, for minute-level sampling data. The value is 1440. This is the standard reference vector. This represents a typical diurnal variation curve for the monitoring node under ideal conditions during the dry season. Finally, the vector is serialized and stored in a local time-series database to form a matrix. This matrix will serve as a benchmark for identifying the dynamic response to external water intrusion during the rainy season. Any data pattern that deviates significantly from this benchmark matrix will be considered a potential intrusion signal.

[0037] In the preferred embodiment, the steps in step S3 of triggering the rainfall response threshold and initiating the encrypted sampling mode are as follows: S31. Run a real-time streaming computation task in the data acquisition container and calculate the first derivative of the liquid level using the five-point central difference method. ; S32, Simultaneous monitoring of conductivity The change, if the condition is met If so, it is determined that a rainfall intrusion event has been triggered, in which This is the threshold for the liquid level to rise. and The mean and standard deviation of electrical conductivity during the dry season; S33. Send the SIGUSR1 signal to the acquisition container through inter-process communication to trigger the interrupt handler and adjust the timer interrupt frequency of the ADC sampling controller from 30 minutes / time to 5 minutes / time. S34. Start the data streaming write process and continue recording until the stop condition is met. Furthermore, the duration exceeds 6-8 hours, generating a dataset containing complete event waveforms. .

[0038] In step S3, the system enters the process of triggering the rainfall response threshold and starting the encrypted sampling mode. This process mainly relies on the real-time streaming computation task in the data acquisition container. The system uses the five-point central difference method in numerical differentiation to accurately calculate the instantaneous rate of change of the liquid level, i.e., the first derivative. Compared to the traditional two-point central difference method, the five-point central difference method uses data points from two time points before and after the current time point for weighted calculation. This effectively suppresses the interference of high-frequency noise on the derivative calculation, thus obtaining a smoother and more accurate liquid level change trend. Its calculation formula is as follows: In this formula, , , and Representing the current moment The liquid level measurements at the second and first sampling points, after and before, This represents the sampling time interval. Through this high-order difference operation, the system can sensitively capture subtle trends in liquid level rise.

[0039] At the same time, the system synchronously monitors conductivity. The system monitors real-time changes in liquid level and combines the rate of change in liquid level with the change in conductivity as dual logical conditions for determining rainfall intrusion. The system's judgment logic is as follows: In this logical expression, This represents the logical AND operation, meaning that two conditions must be met simultaneously for an event to be triggered. A preset liquid level rise threshold is used to screen out liquid level rise events with significant hydraulic impact characteristics; and These are the mean and standard deviation of the dry season conductivity constructed in step S2, respectively. This means that the current conductivity value must be lower than the dry season average minus two standard deviations. Statistically, this indicates a significant dilution effect in the water quality, most likely caused by the mixing of rainwater with low conductivity. This dual-judgment mechanism effectively eliminates false alarms caused by simple level rises due to peak domestic sewage discharge, ensuring that only sudden level changes accompanied by significant water dilution are identified as rainfall intrusion events.

[0040] Once the aforementioned triggering conditions are met, the system immediately performs a mode switch via inter-process communication. Specifically, the data acquisition container sends the SIGUSR1 signal to the underlying acquisition process. This signal, as a user-defined interrupt request, immediately triggers a preset interrupt handler. This handler directly manipulates the ADC sampling controller's registers, dynamically adjusting the timer's interrupt frequency, thus changing the analog-to-digital conversion sampling interval from once every 30 minutes in dry season mode to once every 5 minutes in encrypted mode. This millisecond-level response speed ensures that the system can begin high-resolution data recording from the start of a rainfall event, avoiding the potential loss of critical data that might occur with traditional polling mechanisms.

[0041] With the activation of the encrypted sampling mode, the system simultaneously initiates a data streaming process, continuously recording high-frequency sampled water quality and quantity data using a circular buffer technology. To ensure complete recording of the "long tail" effect of rainfall events—the slow recovery process caused by groundwater backwater—the system sets strict stopping conditions. These conditions require the conductivity value to return to within the allowable error range of the dry season baseline level, i.e., satisfying... Furthermore, the duration of this regressive state must exceed 6 to 8 hours. A 5% relative error tolerance is used to determine whether water quality has returned to background levels; the duration limit is to prevent the system from prematurely exiting encryption mode due to brief hydraulic fluctuations within the pipe network. Once all the above conditions are met, the system stops encrypting records and generates a dataset containing complete rainfall event waveforms. This provides a complete data foundation for subsequent fingerprint recognition.

[0042] In the preferred embodiment, the calculation of the dynamic hysteresis loop characteristics in step S4 involves the following mathematical calculation steps: S41, Regarding the dataset COD sequence in With EC sequence Perform Min-Max normalization to obtain and ; S42, Constructing with For the horizontal axis, Using the two-dimensional phase plane with the vertical axis as the coordinate axis, the area of ​​the closed hysteresis loop formed by the response trajectory is calculated using the discrete form of Green's formula. : ; S43. Calculate the geometric centroid coordinates of the hysteresis loop. ,in , ; S44. Calculate the centroid relative to the ideal synchronous response line ( Euclidean distance ; S45, will and As a morphological characteristic component that characterizes the strength of the external water backing effect, the larger the value, the more significant the impact of groundwater retention.

[0043] In step S4, the system performs mathematical operations to calculate the dynamic hysteresis loop characteristics. This process aims to extract the morphological fingerprint of external water intrusion by quantifying the asynchronous changes in water quality and quantity indicators. First, to eliminate the differences in physical dimensions and orders of magnitude between chemical oxygen demand (COD) and electrical conductivity (EC), they need to be mapped to the same dimensionless interval for comparison. The system then processes the dataset... COD sequence in With EC sequence Perform Min-Max normalization on each sequence. Its normalized value Through formula The calculation yielded, where and These represent the minimum and maximum values ​​of this parameter throughout the entire rainfall event. This step generates a normalized sequence with values ​​ranging from 0 to 1. and .

[0044] Subsequently, the system was constructed using normalized conductivity. The x-axis represents the normalized COD concentration. The vertical axis represents a two-dimensional phase plane. Within this plane, sampling points are connected sequentially over time to form a closed or semi-closed trajectory reflecting the rainfall response process. If the changes in COD and EC are completely synchronized, this trajectory will tend towards a straight line; however, when groundwater backwater or different transport mechanisms exist, the trajectory will separate, forming a hysteresis loop. To quantify the degree of this separation, the system uses the discrete form of Green's formula to calculate the area of ​​the polygon enclosed by the trajectory, i.e., the hysteresis loop area. The calculation formula is as follows: In the formula The total number of sampling points in the sequence. and Representing the first The formula calculates the normalized conductivity and COD values ​​at each sampling time. By summing the directed areas of the triangles formed by two adjacent points and the origin, the formula accurately obtains the geometric area enclosed by the complex trajectory curve. This area value directly reflects the degree of lag in water quality recovery relative to hydraulic recovery.

[0045] Next, in order to describe the distribution bias of the response trajectory in phase space, the system calculates the geometric centroid coordinates of the hysteresis loop. The centroid coordinates represent the average state position throughout the entire dynamic process. They are calculated by taking the arithmetic mean of the coordinates of all normalized sampling points. as well as .

[0046] In an ideal synchronous response mode, the dilution of pollutants should be linearly proportional to the decrease in conductivity, meaning the data points should move along... The centroid deviates diagonally from this diagonal distribution. Therefore, the degree to which the centroid deviates from this diagonal reveals the nonlinear characteristics of the intrusion mechanism. The system calculates the centroid. Relative to the ideal synchronous response line Euclidean distance According to the formula for the distance from a point to a line, this distance can be expressed as: This distance can quantify the systematic deviation of water quality changes relative to water quantity changes.

[0047] Finally, the system will calculate the hysteresis loop area. Distance from centroid Morphological characteristic components were extracted to characterize the strength of the external water backwater effect. Physically, the larger the values ​​of these two characteristic components, the wider the loop formed by the response trajectory on the phase plane and the farther it deviates from the diagonal. This corresponds to the slow release and continuous backwater phenomenon during the groundwater infiltration process. That is, although the flow rate of external water decreases, its dilution effect on the concentration in the pipe network still exists for a long time, indicating a significant impact of groundwater retention. Conversely, the smaller the values, the more consistent with the synchronous response characteristics of rapid inflow and outflow of rainwater direct intrusion.

[0048] In the preferred scheme, step S4 incorporates a nonlinear least squares fitting method based on the first-order kinetic decay constant during the post-rain recovery phase: S46. Locate the starting point of the post-rain recovery phase. and the end point Extract the COD concentration sequence within this time period. ; S47. Construct a first-order dynamic decay model Construct the objective function of residual sum of squares ; S48. Iteratively update parameters using the Levenberg-Marquardt algorithm. and The update step size is approximated by the Hessian matrix: ,in The damping factor, It is the residual vector; S49. When the change in the sum of squared residuals is less than Stop iteration when the optimal solution is found, and output the optimal solution. , which serves as a dynamic characteristic component characterizing the drainage capacity of the pipeline network.

[0049] In step S4, to accurately quantify the dynamic process of water quality recovery in the pipe network after rainfall, the system employs a nonlinear least squares fitting algorithm to solve for the first-order dynamic decay constant. The system first performs time window localization and extraction of data, and then automatically identifies the start time of the post-rain recovery phase using a change point detection algorithm. and the end time The start time typically corresponds to the peak of the chemical oxygen demand (COD) concentration or the inflection point where it begins a monotonous decline, while the end time corresponds to the point where the concentration returns to near the dry season baseline. The system extracts the measured COD concentration sequence for this time period. This sequence constitutes the set of observation samples for model fitting.

[0050] Subsequently, the system constructs a first-order kinetic decay model to describe the pollutant dilution and recovery process, the mathematical expression of which is: In this model, represent The model predicts the concentration value at time 10. This represents the baseline concentration during the dry season, i.e., the background value under conditions of no external water disturbance. This represents the maximum deviation of concentration caused by rainfall, i.e., the difference between the peak concentration and the baseline concentration; The core parameter to be solved is the first-order dynamic decay constant, which directly determines the decay rate of the exponential function. Let be the variable representing the current time. To find the optimal combination of model parameters that best matches the measured curve, the system constructs a residual sum-of-squares objective function. The objective function is defined as the sum of the squares of the differences between observed and predicted values ​​over the entire recovery period, and its calculation formula is as follows: Minimizing this objective function is equivalent to finding the optimal parameters. and The process.

[0051] Given the above objective function with respect to parameters Since it is nonlinear and cannot be directly solved analytically, the system employs the Levenberg-Marquardt algorithm for iterative numerical solution. This is a robust optimization algorithm that combines the advantages of the Gauss-Newton method and gradient descent. In each iteration step, the parameter vector... (Including areas for optimization) and Update step size The iterative formula is derived from the approximate Hessian matrix. In this formula, Representing the Jacobian matrix, it is a matrix containing the first-order partial derivatives of the residuals with respect to each parameter, reflecting the local gradient information of the error surface; It is the transpose of the Jacobian matrix; The residual vector is formed by the values ​​at each time point. composition; It is the identity matrix; Damping factor. It plays a key role in regulating the algorithm's behavior; when the error decreases rapidly, To reduce the error, the algorithm approximates the Gauss-Newton method to accelerate convergence; however, when the error decreases slowly or the Hessian matrix is ​​approximately singular... To improve numerical stability, the algorithm is made closer to gradient descent.

[0052] The system sets strict convergence criteria to control the iterative process, namely, when the relative change in the sum of squared residuals is less than a preset small threshold... When the algorithm reaches convergence, it stops iterating. The optimal solution is then output. This is the first-order kinetic attenuation constant we are looking for. This constant has a clear physical meaning and can serve as a kinetic characteristic component characterizing the drainage capacity of the pipeline network. Specifically, a larger... A value of [value missing] indicates that the exponential term decays rapidly, representing a short residence time of external water in the pipe network, consistent with the fluid dynamics characteristics of rainwater's rapid inflow and outflow; a smaller value... A value indicating slow decay and a significant tailing phenomenon suggests that external water is affected by groundwater level rise or soil infiltration, resulting in retention and slow release within the pipe network. This characteristic, combined with the aforementioned morphological features, constitutes a complete fingerprint of external water intrusion.

[0053] In the preferred scheme, the construction of the external water intrusion fingerprint vector and the classification in step S4 are implemented based on a random forest classifier: S401, calculate the hysteresis loop area. Centroid offset distance and attenuation constant Concatenate into feature vectors ; S402. Load a pre-trained random forest model into the edge inference container. This model contains... Each decision tree is trained by splitting nodes according to the principle of maximizing the Gini index. S403, Vector Input the model and summarize the predicted categories of all decision trees. The final type of external water was determined by majority voting. ,in It is an indicator function; S404. If the determination result is "groundwater backing up", then further calculate its membership probability. ,like If this occurs, a high-level alarm will be triggered.

[0054] In the subsequent processing stage of step S4, the system constructs multi-dimensional feature vectors and utilizes an ensemble learning model to intelligently identify the type of external water intrusion. This process is fully automated at the edge. First, the feature vectors are assembled. The system uses the hysteresis loop area, which reflects the phase space morphology, calculated in the previous steps. Centroid offset distance and the first-order kinetic decay constant reflecting the kinetic characteristics of the recovery phase. The three parameters are extracted. They provide a holographic characterization of the intrusion event from three dimensions: the degree of asynchronous response, the degree of nonlinear deviation, and the rate of exhaustion decay. The system concatenates these parameters in a predefined order to construct a three-dimensional feature vector. Its mathematical expression is Symbols in the formula This represents the matrix transpose operation, which aims to convert row vectors into column vectors to adapt to the standard input interface of subsequent machine learning models.

[0055] After the feature vectors are constructed, the edge inference microservice container loads a pre-trained lightweight random forest classification model. This model is an ensemble learning algorithm based on the Bagging strategy, which internally encapsulates... These are independent decision trees. During the training phase, samples are drawn from the historical database using a bootstrap sampling method. When splitting nodes, the Gini index maximization principle is followed, i.e., the feature and threshold that maximize the purity of the resulting subset are selected for splitting. Typically, the value is chosen to be a large odd number, such as 101 or 501, to avoid a tie and ensure the model's generalization ability. The system uses this model to classify and reason about current rainfall response events, effectively overcoming the overfitting problem of single decision trees.

[0056] The system will use feature vectors The inputs are fed in parallel to each decision tree in the model, and each tree outputs a predicted class based on its own internal rules. The system collects all The outputs of each decision tree are used to determine the final decision through a majority voting mechanism. The mathematical expression of this logic is as follows: In this formula, Represents the final determined type of external water intrusion; variable It traverses all possible intrusion categories, namely direct rainwater intrusion, river backflow, and groundwater backflow; For the characteristic function, when the first... Prediction results of trees With category The function value is 1 when the sums are the same, and 0 otherwise; summation symbol Statistics on supported categories The total number of decision trees; The operator is used to select the category with the most votes as the final output.

[0057] To further assess the confidence level of the judgment results, especially for groundwater backwater types that pose a greater hazard, the system executes membership probability calculations and hierarchical alarm logic. When the final judgment result... When the category is "groundwater backing," the system calculates the membership probability of that category. The calculation formula is: This formula calculates the proportion of decision trees that classify the current event as groundwater backwater out of the total number of trees. If the calculated probability... If the confidence level exceeds the preset high confidence threshold of 0.85, it means that more than 85% of the decision trees agree that the node has the characteristic of continuous groundwater infiltration. Based on this, the system determines that there is a serious structural damage or leakage risk in the area, immediately triggers a high-level alarm signal, and marks the event as a red emergency state and reports it to the cloud server.

[0058] In the preferred embodiment, step S5, generating the external water hotspot map of the pipe network, includes a kriging interpolation step based on the variogram function: S51, the cloud server receives the fingerprint feature values ​​of each monitoring node, i.e. Attenuation constant, construct a known point set ; S52. Calculate the experimental variability function. And fit a spherical model to obtain nugget value, sill value and range; S53, For unmonitored locations Estimation is performed using the ordinary Kriging interpolation formula. The weight By solving the Kriging equations get; S54, Based on valuation results Render continuous heatmap layers in the WebGIS front-end using RGBA color space mapping. The smaller the value, the stronger the red component. The higher the value, the greater the transparency. The higher the value.

[0059] In step S5, the system uses the Kriging interpolation algorithm from geostatistics to generate a hotspot map that intuitively reflects the distribution of external water intrusion risk across the entire network. First, the cloud server, acting as a data aggregation center, receives fingerprint feature values ​​from various distributed monitoring nodes. The key feature value focused here is the first-order kinetic decay constant extracted in the preceding kinetic analysis step. This parameter effectively characterizes the drainage and recovery capacity of the pipeline network for external water bodies. The system stores the geospatial coordinates of each monitoring node. Its corresponding eigenvalues Bind and construct a collection Discrete sample set of known monitoring points This set forms the basic data source for subsequent spatial interpolation analysis.

[0060] To quantify the spatial correlation and variability among different monitoring nodes, the system calculates the experimental variability function. This function describes the variance of eigenvalues ​​as a function of spatial distance. The law of increase and change, its calculation formula is: In this formula, Represents the spatial lag distance between two sampling points. Represents distance equal to The number of all point pairs, The squared difference in eigenvalues ​​between pairs of points represents the difference in eigenvalues. After calculating the scatter plot of the experimental variability function, a spherical model was selected as the theoretical model for fitting, thereby obtaining three key spatial structure parameters: nugget value, sill value, and range. The nugget value reflects the random error or micro-variation at extremely small distances; the sill value reflects the total variability of the system; and the range defines the maximum distance of spatial correlation, beyond which the variables no longer have spatial correlation.

[0061] Based on the fitted variogram model, the system can detect any location in the pipeline network where no monitoring terminals are deployed. Perform ordinary kriging estimation. This estimation process essentially uses a linearly weighted combination of observations from nearby known points, and the estimation formula is as follows: To ensure the unbiasedness of the estimation results and minimize the estimation variance, the weighting coefficients... It was not arbitrarily assigned, but obtained by solving the Kriging equations. The equations are... ,in Represents a known point With known points The variogram values ​​between Represents a known point And the point to be estimated The variogram values ​​between The Lagrange multiplier is used. By solving this system of linear equations, the system can assign optimal weights to each known point, thereby achieving accurate prediction of feature values ​​in unmonitored areas.

[0062] Finally, the system maps the interpolation results of the entire domain to the WebGIS front end for visualization rendering, generating a continuously distributed heatmap layer. During the rendering process, the system uses an RGBA color space mapping mechanism to intuitively distinguish risk levels. The mapping logic is set as follows: The smaller the value, the slower the dynamic decay and the higher the risk of groundwater backwater; therefore, the corresponding red component... The higher the value, the higher the opacity. The higher the value, the more prominent the high-risk area appears as a deep red on the map, with strong coverage; conversely, The higher the value, the more pronounced the rainwater characteristics. The system then reduces the red component and opacity, making it appear lighter or semi-transparent. This rendering method allows managers to easily identify key areas in the pipe network that are continuously infiltrated by groundwater, thus guiding subsequent engineering remediation measures.

[0063] In the preferred embodiment, an auxiliary deployment step based on hydraulic model simulation is also included between steps S1 and S2: S101. Deploy the SWMM simulation engine on the server side and build a node-pipe segment topology model based on pipeline GIS data; S102. Using the one-dimensional form of Saint-Venant's equations to describe unsteady flow in a pipe, the continuity equation is: The momentum equation is ; S103. Input the designed rainfall pattern and simulate the filling ratio of each pipe section. Filter out High-load pipe sections; S104. Mark the inspection wells at both ends of the high-load pipe section as key nodes, and send the list of node coordinates to the construction handheld terminal APP via RESTful API to guide the physical installation of the monitoring terminal.

[0064] To optimize the deployment of lightweight monitoring terminals and improve monitoring efficiency, the system performs an auxiliary deployment step based on hydraulic model simulation before physical deployment. First, the SWMM simulation engine is deployed on the server side. This engine can import GIS geographic information data of the drainage pipe network in the target area, analyze pipe length, diameter, slope, and connection relationships, thereby constructing a high-precision node-to-pipe segment topology model. This model, as a digital twin of the physical pipe network, provides the infrastructure for subsequent hydraulic analysis.

[0065] The system utilizes the one-dimensional form of Saint-Venant's equations to accurately describe the unsteady flow state inside the pipe. This equation set consists of the continuity equation and the momentum equation. The continuity equation describes the conservation of fluid mass, and its mathematical expression is as follows: ,in Represents the cross-sectional area of ​​the water passage. Represents a time variable. Represents traffic, This represents the distance along the direction of water flow. The momentum equation describes the force balance and motion of a fluid, and its mathematical expression is: In this formula, Represents gravitational acceleration. Represents water level elevation. The slope represents the frictional resistance, used to characterize the energy loss caused by water flow overcoming the frictional force of the pipe's inner wall. By solving this set of equations, the system can simulate complex water flow dynamics that vary over time.

[0066] Based on the constructed model and equations, the system takes the designed rainfall pattern as the boundary condition and simulates the operating status of each pipe section under a specific rainfall scenario. The system focuses on the fill ratio as a key performance indicator. Its calculation formula is ,in For the water depth inside the pipe, Where is the pipe diameter. The system automatically iterates through the simulation results of all pipe sections and filters out the fill ratio. Pipe sections with a diameter greater than 0.8 are considered high-load sections, meaning they are prone to full-pipe flow or even overflow during peak rainfall periods. These sections are high-risk areas for external water intrusion or combined sewer overflow, and therefore have extremely high monitoring value.

[0067] Finally, the system marks the manholes at both ends of the selected high-load pipe sections as key nodes and exports the latitude and longitude coordinates of these nodes into a standardized list. The server then sends this coordinate list to the handheld terminal application (APP) of the on-site construction personnel via a RESTful API interface. The on-site personnel use the map navigation and location prompts on the APP to physically install the equipment, ensuring that the monitoring terminals are accurately deployed at the weakest points in the most complex hydraulic conditions and most prone to problems, thus realizing a shift from experience-based to scientific site selection.

[0068] The preferred scheme also includes a model update step based on hash verification: S61. After the cloud server completes the training of the new fingerprint recognition model, it generates a binary model file and the corresponding SHA-256 hash signature. S62. Control topic publishing update notifications via MQTT, including download URL and hash signature; S63. The edge monitoring terminal suspends the inference container, downloads the model file, and calculates the SHA-256 hash value of the downloaded file locally: ; S64, Comparison If the signature matches the one issued from the cloud, the old model file will be overwritten, and the inference container will be restarted to load the new model. If there is a discrepancy, roll back to the old version and report the error log.

[0069] To ensure the fingerprint recognition model running on the edge monitoring terminal can continuously adapt to the evolving characteristics of external water intrusion, the system employs an OTA (Over-The-Air) model update mechanism based on hash verification. Once the cloud server has completed the training and validation of the new fingerprint recognition model using the latest accumulated rainfall event data, the system exports the trained model as a binary file, typically in the widely applicable ONNX format. To prevent the model file from being tampered with during transmission or corrupted due to network instability, the cloud server uses the SHA-256 secure hash algorithm to calculate a unique hash signature string for the binary model file. This signature, serving as the digital fingerprint of the model file, is irreversible and collision-resistant; any slight change in the file content will result in a significant change in the generated hash value.

[0070] The model deployment and notification process is implemented via the MQTT protocol. The cloud server publishes an update notification message to a specific control topic. This message payload includes the download URL for the new model file and the previously generated hash signature. Upon subscribing to and receiving this update notification, the MQTT client on the edge monitoring terminal immediately triggers the update process. To ensure the security of the file writing process and the exclusivity of memory resources, the terminal first suspends the current edge inference microservice container, pausing real-time inference tasks. Subsequently, the terminal downloads the new model file via HTTPS using the provided URL and saves it to a local temporary directory. After the download is complete, the terminal uses its local encryption algorithm library to encrypt the downloaded file. Perform hash calculations to obtain the local hash value. Its calculation process is based on the formula This formula means taking the downloaded binary file as input and using the SHA-256 algorithm to output a fixed-length hexadecimal string.

[0071] The system will calculate the local hash value The system performs a rigorous comparison and verification with the hash signature issued from the cloud. If they match perfectly, it proves that the downloaded model file is complete and has not been tampered with. The system then performs an overwrite update operation, replacing the old version of the model file with the new file, and sends a command to restart the inference container. After the container restarts, it automatically loads the new model and resumes real-time monitoring services. If the two do not match, it indicates that the file was lost or corrupted during transmission or that there is a risk of a man-in-the-middle attack. The system immediately terminates the update process, retains the old version of the model file to maintain basic system operation, and generates an error log, which is then sent back to the cloud via MQTT to prompt maintenance personnel to intervene and investigate. This mechanism effectively ensures the maintenance security and system stability of IoT devices in unattended environments.

[0072] Example 3 Further explanation in conjunction with Example 1, such as Figure 1-3 As shown in the embodiment, this method provides a dynamic monitoring method for dry and rainy seasons for identifying water intrusion outside the pipeline network. The implementation of this method covers a complete closed-loop process from early simulation deployment, edge computing environment construction, dry season baseline learning, rainy season dynamic capture, fingerprint feature recognition to global hotspot mapping and remote model maintenance.

[0073] Before the physical deployment of the monitoring system, the SWMM simulation engine is first deployed on the server side. A high-precision node-pipe segment topology model is constructed based on the pipeline network GIS data of the target area. The one-dimensional form of the Saint-Venant equations is used to describe the unsteady flow within the pipe, through the continuity equations... With momentum equation Simulate the pipeline network operation under different rainfall patterns and select the fill ratio. For high-load pipe sections with a diameter greater than 0.8, the inspection wells at both ends of these sections are marked as critical nodes. The coordinates are sent to the construction handheld terminal via a RESTful API to guide the physical installation. Lightweight monitoring terminals are deployed at the selected critical nodes and hydraulically weak points. These terminals integrate acoustic Doppler current meters, ultrasonic level gauges, and spectral water quality probes, and establish a communication link with the cloud server.

[0074] After the hardware deployment is complete, the system performs containerized deployment and resource pre-allocation of the edge computing environment. A Docker container engine is deployed in the embedded Linux operating system of the lightweight monitoring terminal, and the size of the circular buffer used to store waveform data is calculated based on the terminal hardware configuration. Its size strictly follows the formula The system is partitioned to ensure that high-frequency data does not overflow. Then, microservice containers are instantiated sequentially: the data acquisition container loads the sensor driver and configures an epoll-based I / O multiplexing mechanism to handle interrupts concurrently; the preprocessing container preloads the anomaly detection algorithm library and establishes a shared memory channel to achieve zero-copy transmission; the edge inference container loads a lightweight ONNX format fingerprint recognition model and initializes an MQTT client to subscribe to cloud control topics.

[0075] In the initial stage of system operation, the system enters the dry season baseline feature space construction phase. During the dry season period with consecutive rainless days, high-frequency time-series data of the pipeline network are collected. Perform Z-score-based sliding window anomaly culling and calculate standard scores. ,right Outliers were replaced using cubic spline interpolation. To eliminate time phase differences, the diurnal variation sequence of seven consecutive natural days was analyzed. Perform phase alignment based on Dynamic Time Warping (DTW) and calculate the cumulative distance matrix. Then, the phase is adjusted, and finally, a weighted average is calculated to generate a standard reference vector. And store it in the local time series database to form a matrix. .

[0076] After entering the real-time monitoring phase, the data acquisition container runs a real-time stream computing task, using the five-point central difference method to calculate the first derivative of the liquid level. When the conditions are met Upon detection of a rainfall intrusion event, the system immediately triggers an interrupt via the SIGUSR1 signal, adjusts the ADC sampling frequency to a high-frequency encryption mode of 5 minutes / sample, and initiates a streaming write process for continuous recording until the conductivity meets the specified threshold. And the duration exceeds 6 to 8 hours, generating a dynamic response dataset for the entire process. .

[0077] For dataset During the analysis, the COD and EC sequences were first normalized using Min-Max methods. and A two-dimensional phase plane is constructed and the area of ​​the closed hysteresis loop is calculated using the discrete Green's formula. Simultaneously calculate the Euclidean distance of the centroid relative to the ideal synchronous response line. This was used as a morphological feature. Simultaneously, the post-rain recovery phase was located, and a first-order dynamic decay model was constructed. Construct the objective function of residual sum of squares The parameters are updated iteratively using the Levenberg-Marquardt algorithm, with an iteration step size of [missing information]. Until convergence and the optimal decay constant is output. As a dynamic characteristic.

[0078] Concatenate the above features into a vector. The input is a pre-trained random forest model within the edge inference container. This model contains... A decision tree, using majority voting. Determine the type of external water. If it is determined to be "groundwater backwater," further calculate the membership probability. ,like This will trigger a high-level alarm.

[0079] The cloud server receives the feature values ​​of each node. Construct a set of known points and calculate the experimental variability function. And fit a spherical model. For unmonitored locations. Using the ordinary Kriging interpolation formula Valuation, weighting By solving the system of equations The heatmap is obtained by mapping and rendering the RGBA color space based on the interpolation results in the WebGIS front end. The smaller the value, the higher the red component, which visually indicates the risk zone of groundwater backflow.

[0080] In addition, the system supports OTA model updates based on hash verification. Once a new model and SHA-256 signature are generated in the cloud, a notification is published via MQTT. The terminal suspends the inference container, downloads the file, and calculates the local hash value. After a match is found, the old file is overwritten and the container is restarted, enabling continuous iteration and security upgrades of the algorithm model.

[0081] The above embodiments are merely preferred technical solutions of the present invention and should not be considered as limitations on the present invention. The scope of protection of the present invention should be limited to the technical solutions described in the claims, including equivalent substitutions of the technical features described in the claims. That is, equivalent substitutions and improvements within this scope are also within the scope of protection of the present invention.

Claims

1. A dynamic monitoring method for identifying external water intrusion during the dry and rainy seasons, characterized by: the method include: S1. Lightweight monitoring terminals are deployed at key nodes in the topology and hydraulically weak points of the drainage network. The lightweight monitoring terminals integrate acoustic Doppler current meters, ultrasonic level meters and spectral water quality probes, and establish a communication link between the terminals and the cloud server. S2. During the dry season with consecutive rainless days, high-frequency time-series data of pipeline liquid level, flow rate, chemical oxygen demand (COD), and electrical conductivity (EC) are collected using lightweight monitoring terminals. After denoising and feature extraction, a baseline vector matrix of daily variations during the dry season is constructed. ; S3. When real-time monitoring data triggers the rainfall response threshold, the sampling frequency is automatically switched from low-frequency mode to high-frequency encrypted sampling mode to obtain the dynamic response dataset of the entire process from the start of rainfall to 72-82 hours after the rain stops. ; S4, Based on dataset The dynamic hysteresis loop characteristics of COD concentration relative to the change in conductivity EC were calculated by phase space reconstruction technology, and combined with the first-order kinetic decay constant of the post-rain recovery stage, an external water intrusion fingerprint vector containing morphological and kinetic characteristics was constructed. S5. Map the external water intrusion fingerprint vector to the pipe network topology and use spatial interpolation algorithm to generate a pipe network external water hotspot map that distinguishes between three types of external water intrusion: direct rainwater intrusion, river backflow, and groundwater backflow.

2. The method for dynamic monitoring during dry and rainy seasons for identifying external water intrusion in pipe networks according to claim 1, characterized in that: Step S1, after deploying the lightweight monitoring terminal, also includes the containerized deployment and resource pre-allocation steps of the edge computing environment: S11. Deploy a Docker container engine in the embedded Linux operating system of the lightweight monitoring terminal, and calculate and allocate the size of the circular buffer for storing waveform data according to the terminal hardware configuration. The calculation formula is: ,in The highest sampling rate, For cache duration, For the number of channels, For bit width; S12. Instantiate the data acquisition microservice container, load the sensor driver, and configure an event-driven I / O multiplexing mechanism to concurrently handle multiple sensor interrupts. S13. Instantiate the preprocessing microservice container, preload the anomaly detection algorithm library in the container, and establish a shared memory channel with the collection container to achieve zero-copy data transmission. S14. Instantiate the edge inference microservice container, load the lightweight ONNX format fingerprint recognition model, initialize the MQTT client and subscribe to the cloud control topic to complete the closed-loop construction of the edge software environment.

3. The method for dynamic monitoring during dry and rainy seasons for identifying external water intrusion in pipe networks according to claim 1, characterized in that: In step S2, a baseline vector matrix of daily variations during the dry season is constructed. This includes data cleaning steps based on statistics and dynamic programming: S21. For the acquired high-frequency time-series data Perform Z-score-based sliding window anomaly culling and calculate the standard score within the window. ,like It is then identified as an outlier and replaced using cubic spline interpolation, where and These are the window mean and standard deviation, respectively. S22. Diurnal variation sequence of 7 consecutive natural days Phase alignment based on dynamic time warping is performed to calculate the sequence. and Cumulative distance matrix between And adjust the sequence phase according to the optimal twist path; S23. Calculate the weighted average of the aligned sequences, generating a sequence of length [length missing]. Standard reference vector The vectors are then stored in a local time-series database to form a matrix. .

4. The method for dynamic monitoring during dry and rainy seasons for identifying external water intrusion in pipe networks according to claim 1, characterized in that: The steps in step S3 to trigger the rainfall response threshold and start the encrypted sampling mode are as follows: S31. Run a real-time streaming computation task in the data acquisition container and calculate the first derivative of the liquid level using the five-point central difference method. ; S32, Simultaneous monitoring of conductivity The change, if the condition is met If so, it is determined that a rainfall intrusion event has been triggered, in which This is the threshold for the liquid level to rise. and The mean and standard deviation of electrical conductivity during the dry season; S33. Send the SIGUSR1 signal to the acquisition container through inter-process communication to trigger the interrupt handler and adjust the timer interrupt frequency of the ADC sampling controller from 30 minutes / time to 5 minutes / time. S34. Start the data streaming write process and continue recording until the stop condition is met. Furthermore, the duration exceeds 6-8 hours, generating a dataset containing complete event waveforms. .

5. The method for dynamic monitoring during dry and rainy seasons for identifying external water intrusion in pipe networks according to claim 1, characterized in that: In step S4, the calculation of the dynamic hysteresis loop characteristics involves the following mathematical calculation steps: S41, Regarding the dataset COD sequence in With EC sequence Perform Min-Max normalization to obtain and ; S42, Constructing with For the horizontal axis, Using the two-dimensional phase plane with the vertical axis as the coordinate axis, the area of ​​the closed hysteresis loop formed by the response trajectory is calculated using the discrete form of Green's formula. : ; S43. Calculate the geometric centroid coordinates of the hysteresis loop. ,in , ; S44. Calculate the centroid relative to the ideal synchronous response line ( Euclidean distance ; S45, will and As a morphological characteristic component that characterizes the strength of the external water backing effect, the larger the value, the more significant the impact of groundwater retention.

6. The method for dynamic monitoring during dry and rainy seasons for identifying external water intrusion in pipe networks according to claim 5, characterized in that: In step S4, the first-order kinetic decay constant of the post-rain recovery phase is fitted using nonlinear least squares fitting: S46. Locate the starting point of the post-rain recovery phase. and the end point Extract the COD concentration sequence within this time period. ; S47. Construct a first-order dynamic decay model Construct the objective function of residual sum of squares ; S48. Iteratively update parameters using the Levenberg-Marquardt algorithm. and The update step size is approximated by the Hessian matrix: ,in The damping factor, It is the residual vector; S49. When the change in the sum of squared residuals is less than Stop iteration and output the optimal solution. , which serves as a dynamic characteristic component characterizing the drainage capacity of the pipeline network.

7. The method for dynamic monitoring during dry and rainy seasons for identifying external water intrusion in pipe networks according to claim 6, characterized in that: In step S4, the construction of the external water intrusion fingerprint vector and the classification are implemented based on a random forest classifier: S401, calculate the hysteresis loop area. Centroid offset distance and attenuation constant Concatenate into feature vectors ; S402. Load a pre-trained random forest model into the edge inference container. This model contains... Each decision tree is trained by splitting nodes according to the principle of maximizing the Gini index. S403, Transform the vector Input the model and summarize the predicted categories of all decision trees. The final type of external water was determined by majority voting. ,in It is an indicator function; S404. If the determination result is "groundwater backing up", then further calculate its membership probability. ,like If this occurs, a high-level alarm will be triggered.

8. The method for dynamic monitoring during dry and rainy seasons for identifying external water intrusion in pipe networks according to claim 1, characterized in that: Step S5, generating the external water hotspot map, includes a kriging interpolation step based on the variogram function: S51, the cloud server receives the fingerprint feature values ​​of each monitoring node, i.e. Attenuation constant, construct a known point set ; S52. Calculate the experimental variability function. And fit a spherical model to obtain nugget value, sill value and range; S53, For unmonitored locations Estimation is performed using the ordinary Kriging interpolation formula. The weight By solving the Kriging equations get; S54, Based on valuation results Render continuous heatmap layers in the WebGIS front-end using RGBA color space mapping. The smaller the value, the stronger the red component. The higher the value, the greater the transparency. The higher the value.

9. The method for dynamic monitoring during dry and rainy seasons for identifying external water intrusion in pipe networks according to claim 1, characterized in that: in Between steps S1 and S2, there is also an auxiliary deployment step based on hydraulic model simulation: S101. Deploy the SWMM simulation engine on the server side and build a node-pipe segment topology model based on pipeline GIS data; S102. Using the one-dimensional form of Saint-Venant's equations to describe unsteady flow in a pipe, the continuity equation is: The momentum equation is ; S103. Input the designed rainfall pattern and simulate the filling ratio of each pipe section. Filter out High-load pipe sections; S104. Mark the inspection wells at both ends of the high-load pipe section as key nodes, and send the list of node coordinates to the construction handheld terminal APP via RESTful API to guide the physical installation of the monitoring terminal.

10. The method for dynamic monitoring during dry and rainy seasons for identifying external water intrusion in pipe networks according to claim 2, characterized in that: It also includes a model update step based on hash verification: S61. After the cloud server completes the training of the new fingerprint recognition model, it generates a binary model file and the corresponding SHA-256 hash signature. S62. Control topic publishing update notifications via MQTT, including download URL and hash signature; S63. The edge monitoring terminal suspends the inference container, downloads the model file, and calculates the SHA-256 hash value of the downloaded file locally: ; S64, Comparison If the signature matches the one issued from the cloud, the old model file will be overwritten, and the inference container will be restarted to load the new model. If there is a discrepancy, roll back to the old version and report the error log.