Secondary water supply pollution early warning method based on Internet of Things
By constructing a water supply topology map through IoT monitoring nodes and combining it with water quality data to identify pollution sources and predict their paths, the problem of untimely and inaccurate pollution early warning in secondary water supply systems has been solved, enabling precise monitoring and early warning of water quality safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies cannot achieve real-time prediction and accurate tracking of water pollution in secondary water supply systems, resulting in difficulties in identifying pollution sources and inaccurate early warning ranges, making it impossible to prevent water safety risks in a timely manner.
By acquiring real-time water pressure data through IoT monitoring nodes, a water supply topology map is constructed, the instantaneous water flow direction is identified, and pollution nodes are determined and pollution paths are predicted based on abnormal water quality data. Early warning levels are assigned and early warning instructions are sent to user terminals.
It enables accurate identification and path prediction of pollution sources in complex water flow environments, improves the timeliness and accuracy of secondary water supply water quality safety monitoring, and ensures early and tiered warnings for user areas.
Smart Images

Figure CN121789421A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to data processing technology, and more particularly to a method for early warning of secondary water supply pollution based on the Internet of Things. Background Technology
[0002] Secondary water supply systems are primarily established to compensate for insufficient pressure in municipal water supply pipelines and ensure water supply for people living in high-rise buildings. Compared to raw water supply, secondary water supply is more susceptible to contamination. However, due to the complex structure of secondary water supply networks, the direction and pressure of water flow change frequently under different operating conditions. This makes it difficult for traditional fixed network topology diagrams to accurately reflect the actual water flow status. Consequently, when water pollution occurs, it is difficult to accurately identify the source of pollution and predict the path of pollution transmission, posing a potential threat to the safety of residents' drinking water.
[0003] Currently, monitoring and early warning of secondary water supply quality safety mainly rely on deploying water quality sensors at key nodes in the pipeline network. Existing technologies typically employ threshold alarm mechanisms, which trigger an alarm when water quality parameters such as turbidity and residual chlorine at a certain node exceed preset ranges. However, this technology has significant drawbacks: First, this mechanism is a reactive alarm, only issuing warnings after pollution reaches the monitoring point, failing to achieve pre-emptive prediction and early intervention. Second, it lacks the ability to track the pollution propagation path. Due to the inability to perceive the real-time hydraulic status of the pipeline network, it is difficult to determine the true location of the pollution source and which areas the pollution will spread to with the water flow when pollution occurs, resulting in inaccurate warning ranges and potential false alarms or missed alarms.
[0004] Therefore, how to combine real-time hydraulic data to accurately predict the propagation path of water pollution, thereby improving the timeliness and accuracy of secondary water supply safety monitoring and early warning, has become an urgent problem to be solved. Summary of the Invention
[0005] This invention provides an Internet of Things-based method for early warning of pollution in secondary water supply, which can combine real-time hydraulic data to accurately predict the propagation path of water pollution, thereby improving the timeliness and accuracy of monitoring and early warning of water quality safety in secondary water supply.
[0006] A first aspect of the present invention provides a method for early warning of secondary water supply pollution based on the Internet of Things, comprising: The instantaneous water flow direction between adjacent IoT monitoring nodes is determined based on the real-time water pressure data at the IoT monitoring nodes, and a water supply topology map is constructed based on the instantaneous water flow direction. The IoT monitoring node with abnormal water quality data is identified as a pollution node, and all risky water supply paths originating from the pollution node are obtained based on the water supply topology map. Obtain the pipeline parameters and hydraulic characteristic parameters of the water supply pipelines on each of the risk water supply paths, and determine the hydraulic propagation time required for the polluted water source to reach each downstream monitoring node based on the pipeline parameters and hydraulic characteristic parameters; Based on the degree of pollution of the polluted water source and the hydraulic propagation time, an early warning level is assigned to each downstream monitoring node. According to the early warning level, an early warning instruction matching the early warning level is sent to the user terminal corresponding to the early warning impact area located between the polluted node and each downstream monitoring node on the risky water supply path.
[0007] Optionally, in one possible implementation of the first aspect, determining the instantaneous water flow direction between adjacent IoT monitoring nodes based on real-time water pressure data at the IoT monitoring nodes includes: Obtain real-time water pressure data of each IoT monitoring node at the current sampling time, and determine adjacent IoT monitoring node pairs based on the installation location of each IoT monitoring node in the secondary water supply network; Determine the water pressure difference for each pair of adjacent IoT nodes at the current sampling time, and determine the preliminary judgment direction based on the positive or negative attribute of the water pressure difference; When the absolute value of the water pressure difference is greater than the preset water pressure resolution threshold, the preliminary judgment direction is determined to be the effective water flow direction at the current sampling time; otherwise, the water flow state at the current sampling time is marked as a non-flowing state. If the effective water flow direction at the current sampling time is consistent with the effective water flow direction at the previous sampling time, the cumulative count is incremented by one. When the cumulative count reaches the preset number of stable confirmations, the effective water flow direction is determined as the instantaneous water flow direction. If the effective water flow direction at the current sampling time is inconsistent with the effective water flow direction at the previous sampling time, the cumulative count will be reset.
[0008] Optionally, in one possible implementation of the first aspect, constructing a water supply topology map based on the instantaneous water flow direction includes: Based on the installation location of each IoT monitoring node in the secondary water supply network, a topology node corresponding to each IoT monitoring node is constructed, and a connection edge is generated for each pair of adjacent IoT monitoring nodes based on the topology node. Based on the instantaneous water flow direction of each adjacent IoT monitoring node pair, the corresponding connection edges are converted into directed connection edges; If the water flow between adjacent IoT monitoring node pairs is in a state of no flow and the duration exceeds the preset dead water judgment time, then the water supply pipe section between adjacent IoT monitoring node pairs will be marked as a dead water risk zone. If, within the preset disturbance determination time period, the number of times the effective water flow direction changes between adjacent IoT monitoring node pairs exceeds the preset disturbance frequency threshold, then the water supply pipe section between adjacent IoT monitoring node pairs will be marked as a flow disturbance zone. Mark the connection status of the connecting edge corresponding to the dead water risk zone as a bidirectional isolation state, and add a disturbance identifier to the directed connecting edge corresponding to the flow disturbance zone. The graph structure consisting of the topological nodes, directed connecting edges, and additional bidirectional isolation states or disturbance identifiers is defined as the water supply topology graph.
[0009] Optionally, in one possible implementation of the first aspect, determining the IoT monitoring node with abnormal water quality data as a pollution node includes: Water quality data at each IoT monitoring node is acquired based on the IoT monitoring devices at the IoT monitoring nodes, wherein the water quality data includes multiple water quality parameters; An IoT monitoring node whose water quality parameter exceeds a preset threshold is identified as an abnormal node. Based on the directed connection edges pointing to the abnormal node in the water supply topology diagram, obtain all upstream monitoring nodes of the abnormal node; If the abnormal node has no upstream monitoring node, or if the water quality parameters of all upstream monitoring nodes do not exceed the preset threshold, then the abnormal node is identified as a pollution node.
[0010] Optionally, in one possible implementation of the first aspect, obtaining all risky water supply paths originating from the contaminated node based on the water supply topology map includes: Based on the water supply topology, starting from the pollution node, each of the IoT monitoring nodes is traversed step by step along the instantaneous water flow direction, and the directed paths that satisfy the continuity of the water flow direction are recorded to obtain a set of water supply paths. By removing water supply paths that contain bidirectional isolated connection edges from the set of water supply paths, a set of feasible water supply paths is obtained. The sampling time when the water quality parameters at the pollution node first exceed the preset threshold is determined as the baseline warning time; Obtain the water quality data of the IoT monitoring nodes in each of the feasible water supply paths set at the most recent sampling time before the baseline warning time; The path in which the water quality parameters in the water quality data do not exceed the preset threshold is identified as a risky water supply path.
[0011] Optionally, in one possible implementation of the first aspect, obtaining the pipeline parameters and hydraulic characteristic parameters of the water supply pipelines along each of the risky water supply paths, and determining the hydraulic propagation time required for the polluted water source to reach each downstream monitoring node based on the pipeline parameters and hydraulic characteristic parameters, includes: Obtain the pipe parameters and hydraulic characteristic parameters of each segment of the water supply pipeline on each of the aforementioned risk water supply paths, wherein the pipe parameters include pipe length and pipe diameter, and the hydraulic characteristic parameters include real-time water flow rate obtained at the baseline warning time; Based on the pipeline parameters and the hydraulic characteristic parameters, the water flow velocity of each connecting edge corresponding to the risk water supply path is calculated, and the basic propagation time of each connecting edge is determined according to the water flow velocity and the pipeline length. If the disturbance marker exists on the connecting edge, the time delay is determined based on the disturbance duration and flow velocity fluctuation amplitude corresponding to the disturbance marker, and the time delay is added to the base propagation time to obtain the corrected propagation time; If the disturbance identifier is not present on the connecting edge, the corrected propagation time is the base propagation time. The corrected propagation times of each connecting edge in the risky water supply path are summed to obtain the hydraulic propagation time from the polluted node to the corresponding downstream monitoring node.
[0012] Optionally, in one possible implementation of the first aspect, if the connection edge has the disturbance identifier, the time delay is determined based on the disturbance duration and flow velocity fluctuation amplitude corresponding to the disturbance identifier, including: The number of sampling moments in which the connecting edge is continuously marked as flowing towards the disturbance region is determined, and the number of sampling moments is multiplied by a preset sampling period to obtain the disturbance duration; The maximum and minimum values of the real-time water flow corresponding to the connection edge are obtained during all sampling times covered by the duration of the disturbance. The maximum and minimum water flow velocities are calculated based on the maximum and minimum values, and the difference between the maximum and minimum water flow velocities is determined as the flow velocity fluctuation amplitude. Multiply the duration of the disturbance by the amplitude of the flow velocity fluctuation to obtain the cumulative disturbance value, and divide the cumulative disturbance value by the preset flow velocity reference value to obtain the time delay.
[0013] Optionally, in one possible implementation of the first aspect, an early warning level is assigned to each downstream monitoring node based on the degree of pollution of the polluted water source and the hydraulic propagation time. According to the early warning level, an early warning instruction matching the early warning level is sent to the user terminal corresponding to the early warning impact area located between the polluted node and each downstream monitoring node along the risky water supply path. This includes: The pollution type and pollution severity level are determined based on the water quality parameters at the pollution nodes, wherein the water quality parameters include changes in residual chlorine concentration, turbidity, and conductivity. Based on the pollution type, pollution severity level, and water propagation time, a preset warning level mapping table is consulted to determine the warning level corresponding to the downstream monitoring node; Based on the direction of the connecting edge in the risk water supply path, the user area located between the pollution node and the downstream monitoring node on the risk water supply path is determined as the early warning impact area; A warning command matching the warning level of the downstream monitoring node is generated and sent to all user terminals within the warning impact area.
[0014] Optionally, in one possible implementation of the first aspect, determining the pollution type and pollution severity level based on water quality parameters at the pollution node includes: The residual chlorine concentration, turbidity, and conductivity changes at the pollution node are obtained, wherein the conductivity change is the absolute value of the difference between the conductivity at the current sampling time and the conductivity at the previous sampling time. If the residual chlorine concentration is lower than a preset residual chlorine threshold and the turbidity is higher than a preset turbidity threshold, then the pollution type with a change in conductivity not exceeding a preset conductivity threshold is determined to be microbial pollution, and the pollution type with a change in conductivity exceeding a preset conductivity threshold is determined to be pipeline corrosion pollution. The absolute value of the difference between the residual chlorine concentration and the preset residual chlorine threshold, and the absolute value of the difference between the turbidity and the preset turbidity threshold are combined and calculated to obtain a comprehensive exceedance index; The severity level of pollution is determined based on the range of values for the comprehensive exceedance index.
[0015] Optionally, in one possible implementation of the first aspect, it also includes: Obtain user type data corresponding to the user area served by each downstream monitoring node, and determine the importance value corresponding to the user type data based on a preset mapping relationship; Send a warning command matching the warning level to user terminals within the warning impact area, and record the time when the warning command is sent; During a preset response monitoring period after the sending time, water usage behavior feedback data of user terminals within the warning impact area is acquired; If it is determined from the water usage behavior feedback data that the user has not performed the protective operation in the warning instruction, and the importance value is greater than the preset importance threshold, then the warning level will be raised by one level. If it is determined from the water usage behavior feedback data that the user has not performed any protective actions, and the importance value is less than or equal to a preset importance threshold, then the warning level remains unchanged, and the unresponsive event is recorded.
[0016] A second aspect of the present invention provides an electronic device comprising: a memory, a processor, and a computer program, the computer program being stored in the memory, and the processor executing the computer program to perform the methods described in the first aspect of the present invention and various possible methods related to the first aspect.
[0017] The beneficial effects of this invention are as follows: 1. This invention can effectively improve the water quality safety of secondary water supply by constructing a water supply topology map that reflects the hydraulic state in complex situations where the water flow direction of secondary water supply changes dynamically and there are dead water zones and disturbance zones. Based on the water supply topology map, the source of pollution can be accurately identified, the possible propagation path of polluted water source can be predicted, and combined with the degree of pollution and the propagation time, the pollution warning can be provided in advance, in a graded and accurate manner for the user areas that will be affected.
[0018] 2. When constructing the water supply topology map, this invention deploys sensors with water pressure sensing capabilities at IoT monitoring nodes to collect water pressure data from each node in real time. Based on the water pressure difference between adjacent nodes, the instantaneous water flow direction is determined. By comparing the water pressure differences between adjacent node pairs and setting a water pressure resolution threshold to filter out minor fluctuations, the effectiveness of the water flow direction judgment is ensured. By requiring the effective water flow direction to remain consistent over multiple consecutive sampling periods before confirming it as the instantaneous water flow direction, the invention can effectively eliminate transient flow direction disturbances caused by users' instantaneous switching of faucets, ensuring the stability and accuracy of the water supply topology map and ensuring that the water supply topology map can reflect the real water flow conditions.
[0019] 3. By combining abnormal water quality data with water supply topology maps, this invention can accurately identify pollution sources, precisely determine pollution nodes, and predict the propagation path of polluted water sources. This ensures accurate coverage of all truly polluted areas, even in complex scenarios where the water flow direction is reversed. This improves the accuracy of pollution early warning. When determining pollution nodes, by tracing the water quality status of all upstream monitoring nodes in the water supply topology map, it is possible to fundamentally avoid misjudging polluted nodes as sources, thus ensuring the accuracy of pollution source location.
[0020] 4. This invention assigns early warning levels to each downstream monitoring node by combining the degree of pollution and the water propagation time, and accurately sends early warning instructions to guide users to take response measures of different intensities. By calculating the water propagation time and considering water flow disturbance factors, it ensures that early warning instructions are sent in time before the pollution arrives, providing users with effective response time. After sending early warning instructions to the affected area, this invention can also obtain user type data of the area to determine its importance value, and monitor user water use behavior feedback data. If it is found that users in areas with high importance values, such as hospitals with high water safety requirements, have not performed protective operations, the early warning level will be automatically upgraded to ensure that users with high water safety requirements can respond to pollution early warnings in a timely manner. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating a secondary water supply pollution early warning method based on the Internet of Things provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of a water supply topology provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a risk-prone water supply path provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0024] See Figure 1 This is a flowchart illustrating a secondary water supply pollution early warning method based on the Internet of Things, provided in an embodiment of the present invention. Figure 1 The execution entity of the method shown can be a software and / or hardware device. The execution entity of this application can include, but is not limited to, at least one of the following: user equipment, network equipment, etc. User equipment can include, but is not limited to, computers, smartphones, personal digital assistants (PDAs), and the aforementioned electronic devices. Network equipment can include, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of computers or network servers. Cloud computing is a type of distributed computing, consisting of a super virtual computer composed of a group of loosely coupled computers. This embodiment does not limit this. Steps S1 to S4 are detailed as follows: S1, determine the instantaneous water flow direction between adjacent IoT monitoring nodes based on the real-time water pressure data at the IoT monitoring nodes, and construct a water supply topology map based on the instantaneous water flow direction.
[0025] Among them, IoT monitoring nodes refer to fixed locations in high-rise buildings that are hydraulically representative during secondary water supply, such as water tank outlets, branch points of floor risers, and main outlet pipes of pump rooms. Sensors that can monitor water quality can be installed at IoT monitoring nodes to obtain the water quality status at each IoT monitoring node. Real-time water pressure data refers to the data reflecting the instantaneous fluid pressure at that point, which is collected in real time by sensors installed on IoT monitoring nodes, such as pressure sensors. Instantaneous water flow direction refers to the direction of water flow from one IoT monitoring node to its downstream adjacent IoT monitoring node, determined by the water pressure difference between adjacent IoT monitoring nodes. It should be noted that the instantaneous water flow direction does not refer to the direction at a single isolated moment, but rather to a continuous and stable flow direction state identified by analyzing water pressure data at multiple consecutive moments. The water supply topology map is a network graph with IoT monitoring nodes as vertices and instantaneous water flow directions as directed edges, which can represent the flow path and connection relationship of water in the actual pipe network within a certain period of time.
[0026] In practical applications, during peak water usage periods or equipment malfunctions, local water pressure fluctuations in the secondary water supply process may cause instantaneous changes in water flow direction, or even lead to the backflow of contaminated water into the originally clean high-level pipe network, posing a potential threat to residents' drinking water safety. This solution can accurately identify pollution sources and predict possible propagation paths of contaminated water sources by constructing a water supply topology map that reflects the hydraulic state in complex situations where the water flow direction of the secondary water supply is dynamically changing and there are dead water zones and disturbance zones. Combined with the degree of pollution and the propagation time, it can provide early, graded, and accurate pollution warnings for user areas that will be affected, thereby effectively improving the water quality safety of the secondary water supply.
[0027] Since the water flow direction in the secondary water supply network is not constant, the water pressure in the network will fluctuate drastically during peak water usage periods, pump start-up and shutdown, or local valve operation. This may cause the water flow direction to reverse momentarily, forming dead water zones or causing polluted water to flow back into clean areas. If a fixed, designed network topology map is used, it will be impossible to accurately track the actual propagation path of pollution in this dynamic environment. Therefore, a dynamic water supply topology map that reflects the current real water flow conditions can be constructed using real-time data.
[0028] Specifically, sensors with water pressure sensing capabilities can be deployed at key locations with hydraulic representativeness, namely IoT monitoring nodes, to continuously collect the water pressure at these locations, i.e., real-time water flow data. Then, by comparing the water pressure values of any two adjacent nodes within the same time period, based on the basic hydraulic principle that water flows from high-pressure areas to low-pressure areas, the actual dominant direction of water flow in that adjacent section can be determined. This direction is not the direction at a single moment, but a stable flow direction that remains consistent over multiple consecutive sampling periods, i.e., the instantaneous water flow direction. Then, using all IoT monitoring nodes as vertices and the determined instantaneous water flow direction as directed edges, a directed graph that can truly reflect the current hydraulic connectivity of the pipe network can be constructed, i.e., a water supply topology graph. This graph can be updated in real time with water pressure data, providing an accurate basis for subsequent pollution path identification.
[0029] In some embodiments, step S1, "determining the instantaneous water flow direction between adjacent IoT monitoring nodes based on real-time water pressure data at the IoT monitoring nodes," includes the following steps: S11, obtain the real-time water pressure data of each IoT monitoring node at the current sampling time, and determine the adjacent IoT monitoring node pairs according to the installation location of each IoT monitoring node in the secondary water supply network.
[0030] In the secondary water supply network of high-rise buildings, IoT monitoring nodes are deployed in key hydraulically representative locations such as water tank outlets, floor riser branch points, and pump room main outlet pipes. Their spatial layout determines the possible connectivity of water flow. To determine the direction of water flow, it is first necessary to synchronously acquire real-time water pressure data of all IoT monitoring nodes under a unified time reference, i.e., the current sampling time. For example, water pressure values can be used to ensure that water pressure comparisons are based on the same conditions. Subsequently, based on the physical installation location of each node in the network, the node combinations that are directly connected to each other through pipes are identified, i.e., adjacent IoT monitoring node pairs. This provides a structural basis for subsequent water pressure difference calculations, ensuring that directional judgment is only performed on nodes with actual hydraulic connections, and avoiding cross-regional misjudgments.
[0031] Among them, the current sampling time refers to the time point at which water pressure data is collected from the IoT monitoring node; the secondary water supply network refers to the network system formed in the water supply system of high-rise buildings, which is formed by water being supplied from the municipal water supply pipeline, pressurized or stored again by equipment such as water tanks and pumps, and then delivered to various water points in the building; the installation location refers to the key hydraulically representative location of the IoT monitoring node in the secondary water supply network of the high-rise building, such as the water tank outlet, the branch point of the floor riser, the main outlet of the pump room, etc.; and the IoT monitoring node pair refers to two IoT monitoring nodes directly connected by the same pipe section in the secondary water supply network.
[0032] S12, determine the water pressure difference of each pair of adjacent IoT nodes at the current sampling time, and determine the preliminary judgment direction based on the positive or negative attribute of the water pressure difference.
[0033] After identifying adjacent IoT monitoring node pairs, the water pressure difference at the current sampling time can be obtained based on the difference between their real-time water pressure data. For example, the adjacent IoT monitoring node pair can be node A and node B. Based on the difference between the water pressure data of node A and node B, the corresponding water pressure difference can be obtained. According to the basic principles of fluid mechanics, water always flows from high-pressure areas to low-pressure areas. Therefore, if the water pressure difference is positive, the water flow direction is initially determined to be from A to B, that is, the initial determination is that the direction is from node A to node B. If the water pressure difference is negative, the initial determination is that the water flow is from B to A, that is, the initial determination is that the direction is from node B to node A.
[0034] Among them, water pressure difference refers to the difference in water pressure values between two nodes in the same adjacent node pair at the same sampling time, positive and negative attributes refer to the description of the properties of the water pressure difference value, and preliminary judgment direction refers to the direction of water flow inferred based on the positive and negative values of a single water pressure difference.
[0035] S13, when the absolute value of the water pressure difference is greater than the preset water pressure resolution threshold, the preliminary judgment direction is determined to be the effective water flow direction at the current sampling time; otherwise, the water flow state at the current sampling time is marked as a non-flowing state.
[0036] Because water pressure sensors may have measurement errors, and the pipe network may experience slight pressure fluctuations without actual flow under low load, such as static pressure changes caused by thermal expansion and contraction, directly taking the slight water pressure difference as the basis for water flow will lead to misjudgment of direction. Therefore, a water pressure resolution threshold can be set. When the absolute value of the water pressure difference exceeds the water pressure resolution threshold, it can be considered that there is a water pressure difference sufficient to drive water flow. At this time, the preliminary judgment direction can be confirmed as the effective water flow direction at the current sampling time. If the absolute value of the water pressure difference is less than or equal to the threshold, it is determined that there is no effective flow in the current pipe section, and the water flow state at the current sampling time can be marked as no flow state.
[0037] Among them, the water pressure resolution threshold refers to the preset pressure difference threshold used to distinguish the actual water flow drive; the effective water flow direction refers to the flow direction that has passed the water pressure resolution threshold test and is considered to have actual hydraulic significance at the current sampling time; the water flow state refers to a description of the water flow movement in the pipe section, which can reflect whether there is effective water flow in the pipe section at the current sampling time; the no-flow state refers to the state where the water pressure difference between adjacent IoT monitoring nodes is too small and can be considered as a relatively static state of water flow.
[0038] S14. If the effective water flow direction at the current sampling time is consistent with the effective water flow direction at the previous sampling time, the cumulative count is incremented by one. When the cumulative count reaches the preset number of stable confirmations, the effective water flow direction is determined as the instantaneous water flow direction.
[0039] In practical applications, even with a clear water pressure difference, the direction of the flow may change briefly due to factors such as a user turning the tap on and off instantaneously. The flow direction used to construct the topology map should be continuous and stable. The effective flow direction of a single instance may still be affected by brief operational disturbances and is insufficient to represent a stable flow direction. To improve the reliability of the judgment, a direction stability verification mechanism can be introduced: a counter can be set up. Whenever the effective flow direction at the current sampling moment is consistent with the previous moment, the counter is incremented by one. The cumulative count is incremented by one. When the counter reaches a preset number of stable confirmations, such as 3 times, corresponding to 3 consecutive sampling cycles, such as once every 10 seconds, it takes 30 seconds to stabilize. Then it is considered that the effective flow direction corresponding to the consecutive sampling cycles has formed a stable trend and can be determined as the instantaneous flow direction. This ensures that the identified flow direction is a continuous hydraulic behavior rather than an instantaneous fluctuation.
[0040] The cumulative count refers to the record of the number of times the effective water flow direction remains consistent. Whenever the effective water flow direction at the current sampling time is consistent with the effective water flow direction at the previous sampling time, the cumulative count will increase by 1. The number of stable confirmations refers to the preset integer number of times that a water flow direction needs to be maintained for a certain number of sampling periods before it can be finally recognized as a stable and reliable flow direction.
[0041] S15, if the effective water flow direction at the current sampling time is inconsistent with the effective water flow direction at the previous sampling time, then reset the cumulative count.
[0042] At each sampling moment, once the valid water flow direction is determined, it can be immediately compared with the valid water flow direction at the previous sampling moment. If the two are found to be inconsistent, for example, A points to B at the previous moment and B points to A at the current moment, the cumulative count of that node pair will be immediately cleared to zero. The cumulative count reset operation can ensure that a new direction can only be finally adopted when it can continuously maintain the number of cycles required for stable confirmation. This can effectively prevent the topology map from being updated incorrectly due to accidental and brief direction reversals, and ensure that the final determined instantaneous water flow direction has high stability and reliability.
[0043] In some embodiments, step S1, "constructing a water supply topology map based on the instantaneous water flow direction," includes the following steps: S16. Based on the installation location of each IoT monitoring node in the secondary water supply network, construct the topology node corresponding to each IoT monitoring node, and generate a connection edge for each pair of adjacent IoT monitoring nodes based on the topology node.
[0044] Understandably, before constructing a dynamic topology map that reflects the hydraulic state, it is first necessary to establish a static framework that reflects the physical connections of the pipeline network. This framework serves as the basis for judging all subsequent dynamic information, such as water flow direction and risk status. Specifically, the installation coordinates and IDs of all IoT monitoring nodes can be read from the geographic information system or design drawings of the pipeline network. A corresponding topology node can be created for each physical node in the system. Then, based on the physical connections of the pipelines in the network, a connection edge can be drawn between the corresponding topology nodes for each pair of IoT monitoring nodes directly connected by the same pipeline segment. For example, if a physical pipeline connects node A and node B, a connection edge can be created between topology node A and topology node B.
[0045] In this context, a topology node refers to a vertex that represents each IoT monitoring node, and a connecting edge refers to a logical connection that represents a water supply pipe connecting two adjacent IoT monitoring nodes in the physical network. In the initial stage, this connection does not have directionality.
[0046] S17. Based on the instantaneous water flow direction of each adjacent IoT monitoring node pair, the corresponding connection edge is converted into a directed connection edge.
[0047] In this context, a directed connection edge refers to a connection edge in a graph structure that has a clear directional indication, usually represented by an arrow. Its direction represents the current stable direction of water flow.
[0048] During water supply, the diffusion path of polluted water sources follows the direction of water flow. However, a graph structure without directional information cannot be used for tracking and predicting pollution paths. Therefore, the determined instantaneous water flow direction information can be assigned to the connecting edges of the basic undirected graph, transforming it from a static connection framework into a dynamic flow direction graph structure. Specifically, all generated connecting edges can be traversed. For each connecting edge, its corresponding two IoT monitoring node pairs can be located. Then, the instantaneous water flow direction between the IoT monitoring node pairs can be queried. For example, if the direction is from node A to node B, then the undirected connecting edge can be updated to a directed connecting edge from node A to node B. By performing this operation on all connecting edges in the graph, a dynamic hydraulic topology graph that accurately reflects the current water flow path can be initially formed.
[0049] S18. If the water flow state between adjacent IoT monitoring node pairs is stagnant and the duration exceeds the preset dead water judgment time, then the water supply pipe section between adjacent IoT monitoring node pairs will be marked as a dead water risk zone.
[0050] Among them, the preset dead water judgment time refers to the pre-configured time threshold used to determine whether the pipe section has entered a stagnant state. The dead water risk zone refers to the water supply pipe section in the secondary water supply network that has a long water flow stagnation or extremely low flow rate, resulting in an excessively long water renewal cycle and easy deterioration of water quality, which may become an internal pollution source.
[0051] In water supply networks, water quality risks exist not only in flowing water bodies, but also in stagnant areas, which are significant sources of risk. Stagnant water provides conditions for microbial growth and chemical deposition, and can itself be considered a potential pollution point. Therefore, simply identifying the direction of water flow is insufficient to comprehensively assess network risks; these static risk areas must also be identified. These static pipe segments with potential pollution risks can be marked on the topology map. Specifically, the water flow status between each pair of adjacent nodes can be continuously monitored. When a node pair is marked as stagnant, a timer for that pipe segment can be started, with a preset dead water determination duration. Once the cumulative duration of the timer exceeds this threshold, it can be determined that the water in that pipe segment is stagnant and has the conditions for water quality deterioration. This physical pipe segment can then be marked as a dead water risk zone. This marking is used to set isolation status in the subsequent topology map to prevent dead water zones from being mistakenly identified as paths for pollutant propagation, thereby avoiding unnecessary warnings to users within the dead water zone. It also supports localized warnings of pollution within the dead water zone.
[0052] S19. If, within the preset disturbance determination time period, the number of times the effective water flow direction changes between adjacent IoT monitoring node pairs exceeds the preset disturbance frequency threshold, then the water supply pipe section between adjacent IoT monitoring node pairs will be marked as a flow disturbance zone.
[0053] Under conditions such as frequent pump start-stop or zoned water supply switching, certain pipe sections may experience repeated changes in water flow direction, i.e., flow direction disturbance. To identify such areas, the number of effective water flow direction changes can be counted within a preset disturbance judgment time period. If the number exceeds the preset disturbance frequency threshold, the pipe section can be marked as a flow direction disturbance area. This marking can be used to introduce a time delay in subsequent propagation time calculations to compensate for the extended propagation time caused by flow velocity fluctuations and improve the accuracy of early warning timing.
[0054] Among them, the disturbance judgment time period refers to the pre-set time period used to count the frequency of directional changes, the disturbance frequency threshold refers to the upper limit of the preset number of directional changes, used to distinguish between normal water use fluctuations and abnormal disturbances, and the flow direction disturbance zone refers to the water supply pipe section in the secondary water supply network where the water flow direction frequently reverses or changes in a short period of time due to factors such as drastic fluctuations in water consumption and frequent start-stop of water pumps.
[0055] S110, mark the connection status of the connection edge corresponding to the dead water risk zone as a bidirectional isolation state, and add a disturbance identifier to the directed connection edge corresponding to the flow disturbance zone.
[0056] Specifically, after completing the area marking, the corresponding marked areas can be synchronously updated to the corresponding topology graph structure. For the connecting edges corresponding to the dead water risk area, their connection status can be set to bidirectional isolation, indicating that the edge is not passable in the path search and pollutants cannot spread through this edge. For the directed connecting edges corresponding to the flow disturbance area, a disturbance marker is added to them as a trigger marker for adding delay amount when calculating the subsequent propagation time. This operation allows the water supply topology graph to not only contain geometric and directional information, but also integrate the hydraulic flow state. The resulting topology graph can not only represent the water flow direction, but also identify the risk status information of the pipe segment.
[0057] Among them, connection state refers to a definition of the connection edge attribute, which is used to describe the characteristics of the pipe segment represented by the connection edge in terms of hydraulic conduction. Bidirectional isolation state refers to a definition of the connection edge attribute in the topology graph, which indicates that the water flow in the pipe segment represented by the edge is stagnant, and its two end nodes are temporarily isolated in terms of hydraulic conduction function. Disturbance label refers to an attribute label attached to the directed connection edge in the topology graph, which is used to indicate that the water flow direction of the pipe segment represented by the edge is unstable.
[0058] S111, the graph structure consisting of the topological nodes, directed connecting edges, and additional bidirectional isolation states or disturbance identifiers is determined to be a water supply topology graph.
[0059] Specifically, a complete graph structure containing topological nodes, directed connecting edges, bidirectional isolation states, and disturbance indicators can be constructed. This graph structure is designated as the water supply topology graph and serves as the basis for subsequent pollution path deduction, propagation time calculation, and early warning area delineation. This graph structure can accurately reflect the real-time hydraulic state of the secondary water supply system under complex operating conditions, providing a reliable basis for achieving accurate, early, and tiered early warnings.
[0060] See Figure 2 This is a schematic diagram of a water supply topology provided in an embodiment of the present invention. Each topology node corresponds to an IoT monitoring node. Figure 2As can be seen, there is a disturbance indicator between topology node A and topology node B, which reflects that the water flow direction in the water supply pipe section between the IoT monitoring nodes corresponding to topology node A and topology node B is unstable. The corresponding water supply pipe section is a flow disturbance zone, and a delay needs to be added when calculating the propagation time. The connection status between topology node D and topology node E is a bidirectional isolation state, which reflects that the water in the water supply pipe section between the IoT monitoring nodes corresponding to topology node D and topology node E is stagnant. The corresponding water supply pipe section is a dead water risk zone, and paths containing this pipe section can be removed when searching for risk paths.
[0061] S2, determine the IoT monitoring node with abnormal water quality data as a pollution node, and obtain all risky water supply paths starting from the pollution node based on the water supply topology map.
[0062] Among them, water quality data refers to a series of indicator data collected by various water quality sensors installed on IoT monitoring nodes, which can reflect the health and safety status of water supply bodies in real time. Pollution nodes refer to IoT monitoring nodes that identify abnormal water quality data. Risk water supply paths refer to each complete path formed by starting from the pollution node and following all possible downstream nodes that can be reached along the instantaneous water flow direction in the water supply topology map.
[0063] After establishing a dynamic pipeline topology, since pollution spreads with the water flow, it is necessary to quickly locate pollution events and predict their impact range. Specifically, water quality data reported by sensors at each IoT monitoring node, such as changes in turbidity, residual chlorine concentration, and conductivity, can be continuously monitored. When the water quality indicators of one or more nodes continuously exceed the normal threshold range, they may be pollution nodes and can be marked as pollution nodes. Since pollution can only spread along the actual water flow direction and cannot flow backward, pollution nodes can be used as the starting point of the path. By traversing and analyzing the generated dynamic water supply topology, all downstream paths starting from the pollution node and following the instantaneous water flow direction indicated in the figure can be listed, thereby generating a set of all possible propagation paths starting from the pollution source and conforming to the current hydraulic flow direction, i.e., risk water supply paths. This ensures that even in complex scenarios where the water flow direction reverses due to changes in operating conditions, such as water flowing back from the high zone to the middle zone, all truly affected areas can be accurately covered, avoiding omission of reverse flow pollution paths.
[0064] In some embodiments, step S2, "determining the IoT monitoring node with abnormal water quality data as a pollution node," includes the following steps: S21, Based on the IoT monitoring equipment at the IoT monitoring node, water quality data at each IoT monitoring node is obtained, wherein the water quality data includes multiple water quality parameters.
[0065] Specifically, IoT monitoring devices at IoT monitoring nodes can acquire water quality data at each node using multi-parameter water quality sensors. This data is a collection of multiple water quality parameters, such as turbidity, residual chlorine, and conductivity, which can comprehensively reflect the water quality status from different dimensions. Here, IoT monitoring devices refer to terminal devices that integrate water quality sensors and communication modules, installed at IoT monitoring nodes, and possessing real-time data acquisition, local storage, and remote transmission capabilities. Water quality parameters refer to key parameters that reflect water quality safety, such as turbidity, residual chlorine, and conductivity.
[0066] S22, determine any IoT monitoring node whose water quality parameter exceeds the preset threshold as an abnormal node.
[0067] After acquiring water quality data from each IoT monitoring node, the data can be initially screened by setting threshold rules to identify all nodes showing potential pollution signs, thereby narrowing down the scope for subsequent precise source tracing. Specifically, a safety threshold can be set for each water quality parameter, such as an upper limit threshold of 1 NTU for turbidity and a lower limit threshold of 0.05 mg / L for residual chlorine. After receiving water quality data reported by each IoT monitoring node, each parameter value in the data can be compared with its corresponding threshold. Once any parameter value is found to exceed the preset threshold range, the IoT monitoring node can be marked as an abnormal node.
[0068] Among them, the preset threshold refers to the safety threshold set in advance for each water quality parameter, and the abnormal node refers to the IoT monitoring node whose water quality parameter exceeds the preset threshold.
[0069] S23. Based on the directed connection edges pointing to the abnormal node in the water supply topology diagram, obtain all upstream monitoring nodes of the abnormal node.
[0070] In practical applications, identifying a single anomalous node is insufficient to determine it as a pollution source, as it may simply be a node through which contaminated water flows, with the true source of pollution being a node upstream. Therefore, a constructed water supply topology map reflecting the actual flow direction can be used to trace the potential pollution sources of anomalous nodes. Specifically, the identified anomalous node can be used as the query target. A reverse graph traversal can be performed on the water supply topology map to find all other topology nodes reachable from the anomalous node via directed edges, whether directly connected or via multi-level paths. The set of these found nodes represents all upstream monitoring nodes of the anomalous node. For example, if there is a path A→B→C in the graph, and C is an anomalous node, then both A and B are its upstream monitoring nodes.
[0071] In this context, upstream monitoring nodes refer to all direct or indirect topological nodes in the water supply topology diagram that have directed edges pointing to the abnormal node.
[0072] S24. If the abnormal node does not have an upstream monitoring node, or if the water quality parameters of all upstream monitoring nodes do not exceed the preset threshold, then the abnormal node is identified as a pollution node.
[0073] Pollution spreads downstream along the water flow direction in the water supply system. Therefore, the true source of pollution must be the node where the first anomaly occurs and there are no anomalies upstream. If a downstream node that has already been polluted is mistakenly identified as the source, it will lead to an incorrect warning path, such as issuing a warning from the 5th floor to the 8th floor, while the true source is the 3rd floor, causing resource misallocation and missed risk assessment. Specifically, all upstream monitoring nodes can be obtained for judgment. There are two situations that will ultimately confirm the abnormal node as the pollution node: The first situation is that the abnormal node is the source node in the water supply topology diagram, that is, there are no directed edges pointing to it, such as the water tank outlet node. If it is abnormal, then it must be the source. The second situation is that although there are upstream monitoring nodes, after checking the water quality data of all these upstream nodes at the same time, it is found that all are normal and no parameters exceed the threshold. This indicates that the pollution does not come from upstream, but is introduced by the node itself or its nearby pipes. Through this rigorous logical judgment, the true pollution starting point, i.e., the pollution node, can be accurately identified from many abnormal nodes.
[0074] In some embodiments, step S2, "obtaining all risky water supply paths originating from the pollution node based on the water supply topology map," includes the following steps: S25. Based on the water supply topology map, starting from the pollution node, traverse each of the IoT monitoring nodes step by step along the instantaneous water flow direction, and record the directed paths that satisfy the continuity of the water flow direction to obtain a set of water supply paths.
[0075] After identifying the pollution source, i.e. the pollution node, the water supply topology map can be used to predict the spread range of the pollution and initially find all possible paths through which the polluted water body may flow, forming a candidate path list. Specifically, the identified pollution node can be used as the starting point for traversal. On the water supply topology map, each IoT monitoring node is traversed once along the instantaneous water flow direction, i.e., from the pollution node to its directly downstream node, and then from the downstream node to the node further downstream, until all reachable end IoT monitoring nodes are reached. Each complete path consisting of continuous directed edges starting from the pollution node will be recorded, ultimately forming a set of water supply paths containing all possible spread paths.
[0076] The water supply path set refers to the set of all possible downstream paths that conform to the direction of water flow, starting from the pollution node.
[0077] S26, Remove water supply paths that contain bidirectional isolated connection edges from the water supply path set to obtain a feasible water supply path set.
[0078] Specifically, since the obtained set of water supply paths is based on theoretical paths of connectivity, but in reality some paths may be unable to spread pollution due to stagnant water flow, physical feasibility screening can be performed on each path in the set to remove invalid paths containing stagnant water risk areas, making subsequent analysis more accurate. Specifically, each path in the set can be traversed, and for each path, the properties of all its connecting edges can be checked. If any edge is marked as bidirectionally isolated, it means that polluted water cannot flow through that pipe segment, therefore the entire path is invalid and can be removed from the set. All paths that pass this screening are recombined to form a set of feasible water supply paths. The set of feasible water supply paths refers to the set of paths that truly pose a risk of pollution spread after removing paths from the set that cannot actually spread pollution due to physical conditions.
[0079] S27, the sampling time when the water quality parameters at the pollution node first exceed the preset threshold is determined as the baseline warning time.
[0080] To establish a unified time baseline, the starting point of this pollution event needs to be clearly defined. Otherwise, it's impossible to determine whether other nodes were already in an abnormal state before the pollution occurred. A vague time baseline will make it impossible to distinguish between newly affected users and those previously affected by pollution. Specifically, the sampling time when a polluted node is first identified as abnormal can be recorded and set as the baseline warning time. This time can be used to compare historical water quality data from other nodes, ensuring clear and traceable temporal logic. This is a prerequisite for issuing warnings only for new risks rather than repeatedly warning about old problems. The sampling time refers to the moment when water quality data is collected, and the baseline warning time refers to the sampling time when water quality parameters first exceed a preset threshold.
[0081] S28, Obtain the water quality data of the IoT monitoring node in each path of the feasible water supply path set at the most recent sampling time before the baseline warning time.
[0082] It should be noted that the core target of the early warning should be users who are about to be exposed but have not yet been exposed, rather than users who have already been exposed. If the end-point IoT monitoring node was abnormal before the pollution occurred, it means that it was part of the historical pollution, and the current pollution event did not add any new risks. Issuing an early warning for it would be a redundant operation. Therefore, the historical status of the end-point IoT monitoring node can be verified by obtaining the most recent water quality data of the end-point IoT monitoring node before the baseline early warning time, providing a basis for accurately screening risk paths. Specifically, for each path in the set of feasible water supply paths, the IoT monitoring nodes included can be identified first. Then, the most recent valid sampling time before the baseline early warning time can be located in the historical water quality data of the IoT monitoring nodes, and the complete water quality data at that time can be extracted. This data is used to determine whether the IoT monitoring node was already in an abnormal state before the current pollution occurred, ensuring that the early warning scope is strictly limited to the newly affected area of this event.
[0083] S29, determine the path in which the water quality parameters in the water quality data do not exceed the preset threshold as the risky water supply path.
[0084] If the water quality at the IoT monitoring nodes along the path was normal before the pollution occurred, it indicates that the path represents a newly spreading area of the pollution event, and its users are about to face risks and should be included in the early warning system. Conversely, if the water quality at the IoT monitoring nodes along the path was abnormal before the pollution occurred, it belongs to historical pollution and does not require this early warning. This verification mechanism can ensure that early warning resources are accurately directed to real high-risk users and avoid invalid early warnings. Specifically, the water quality data at the IoT monitoring nodes along the path can be checked: if all parameters do not exceed the preset threshold, the path is identified as a risky water supply path; otherwise, it is removed. The final set of risky water supply paths represents the true impact range of this pollution event and will be used for subsequent propagation time calculation and graded early warning, thereby enabling early and accurate pollution early warning.
[0085] S3, obtain the pipeline parameters and hydraulic characteristic parameters of the water supply pipelines on each of the risk water supply paths, and determine the hydraulic propagation time required for the polluted water source to reach each downstream monitoring node based on the pipeline parameters and hydraulic characteristic parameters.
[0086] Among them, pipeline parameters refer to static parameters describing the physical structure of water supply pipelines, such as pipeline length and diameter; hydraulic characteristic parameters refer to dynamic parameters reflecting the current dynamic state of water flow, such as water flow rate; polluted water source refers to polluted water source; downstream monitoring node refers to IoT monitoring node located downstream of the polluted node on the risky water supply path for monitoring water quality; and hydraulic propagation time refers to the time required for polluted water source to flow from the polluted node along the risky water supply path to the downstream monitoring node.
[0087] To achieve accurate early warning, it is not enough to simply know which areas the pollution may reach; it is also necessary to predict when the contaminated water source will arrive. Specifically, for each risky water supply path, pipe parameters such as pipe length and inner diameter, as well as current hydraulic characteristic parameters such as water flow rate, can be extracted for each section along the path. This data can come from the pipeline network GIS system. Subsequently, by combining the water supply topology map with the current water flow status, the time required for the pollution to spread from the pollution node to each downstream monitoring node on the risky water supply path can be estimated, i.e., the hydraulic propagation time. This time reflects the urgency of the pollution's arrival and is a key dimension for distinguishing early warning levels. For example, the main riser has a fast flow velocity and a short propagation time, requiring an emergency response, while the terminal branch pipe has a slow flow velocity and stagnation, resulting in a long propagation time, allowing for delayed treatment.
[0088] Based on the above embodiments, step S3 can be implemented in the following ways: S31, obtain the pipeline parameters and hydraulic characteristic parameters of each section of the water supply pipeline on each of the risk water supply paths, wherein the pipeline parameters include the pipeline length and pipe diameter, and the hydraulic characteristic parameters include the real-time water flow rate obtained at the baseline warning time.
[0089] When calculating the hydraulic propagation time of polluted water sources, it is first necessary to understand the physical structure of the water supply pipeline and the current dynamic state of the water flow. Pipe parameters such as pipe length and diameter can describe the physical structure of the water supply pipeline, while hydraulic characteristic parameters such as real-time water flow can reflect the current dynamic state of the water flow. These data are the basis for subsequent calculations.
[0090] Specifically, the pipeline parameters of each segment of the water supply pipeline along each risky water supply path are obtained, including the length and diameter of the pipeline. At the same time, the real-time water flow of these pipelines is obtained as hydraulic characteristic parameters at the baseline warning time. For example, for a certain risky water supply path, the GIS system can be used to locate each pipeline segment along the route, record the length and diameter of each pipeline segment, and measure the real-time water flow in the pipeline segment at the baseline warning time.
[0091] Among them, pipe length refers to the actual distance from one end of the water supply pipe to the other, pipe diameter refers to the inner diameter of the water supply pipe, and real-time water flow rate refers to the actual amount of water passing through a certain cross section of the pipe per unit time at the baseline warning time.
[0092] S32, based on the pipeline parameters and the hydraulic characteristic parameters, calculate the water flow velocity of each connecting edge corresponding to the risk water supply path, and determine the basic propagation time of each connecting edge according to the water flow velocity and the pipeline length.
[0093] Specifically, based on the obtained pipe parameters and hydraulic characteristic parameters, the water flow velocity at each connecting edge of the risky water supply path can be calculated using relevant fluid mechanics formulas. For example, the water flow velocity can be calculated based on the relationship between the water flow rate and the pipe cross-sectional area calculated from the pipe diameter. Assuming the water flow rate of a certain pipe section is 10 cubic meters per hour and the pipe diameter is 200 millimeters, first calculate the pipe cross-sectional area based on the pipe diameter, then divide the water flow rate by the cross-sectional area to obtain the water flow velocity. Then, based on the calculated water flow velocity and the length of the pipe section, determine the basic propagation time of each connecting edge. The basic propagation time is equal to the pipe length divided by the water flow velocity. For example, if the pipe length is 100 meters and the water flow velocity is 1 meter per second, then the basic propagation time is 100 seconds.
[0094] Among them, water flow velocity refers to the average speed at which water flows in the water supply pipeline, and basic propagation time refers to the time required for polluted water to flow from the pollution node to the corresponding logistics monitoring node in a certain section of the water supply pipeline.
[0095] S33, if the disturbance identifier exists on the connecting edge, the time delay is determined based on the disturbance duration and flow velocity fluctuation amplitude corresponding to the disturbance identifier, and the time delay is added to the basic propagation time to obtain the corrected propagation time.
[0096] In actual water supply systems, water flow may be disturbed by various factors. These disturbances affect the propagation time of contaminated water. For example, during pump start-up and shutdown, or sudden water usage by users, the flow velocity within the pipe section fluctuates drastically, and the migration of contaminants proceeds intermittently. The actual propagation time is significantly longer than the steady-state calculation value. Ignoring this effect will lead to premature warnings, as users may lower their guard before the contaminants actually arrive, posing a health risk. Therefore, a time delay can be introduced to correct the baseline propagation time, compensating for the migration delay caused by disturbances, making the prediction closer to reality. If a disturbance indicator is present at the connection edge, it indicates that the water flow in that section is unstable, and the impact of the disturbance on the propagation time needs to be considered. To mitigate the impact of disturbances, the base propagation time is corrected by determining the time delay. Specifically, this can be done by checking if there are disturbance indicators on the connecting edges. If so, the time delay can be determined based on the disturbance duration and flow velocity fluctuation amplitude corresponding to the disturbance indicator. For example, if the disturbance indicator shows that the disturbance duration of a certain connecting edge is 10 seconds and the flow velocity fluctuation amplitude is 20%, and the originally calculated base propagation time is 100 seconds, then according to a specific calculation method, the time delay corresponding to the connecting edge is calculated to be 20 seconds based on the disturbance duration and flow velocity fluctuation amplitude. This time delay of 20 seconds is then added to the base propagation time of 100 seconds, resulting in a corrected propagation time of 120 seconds for the connecting edge.
[0097] Among them, the duration of disturbance refers to the length of time that the water flow in the water supply pipeline is disturbed by external factors, causing its flow direction to deviate from the steady state and remain in an unstable state. The velocity fluctuation amplitude refers to the range of change of water flow velocity relative to steady-state velocity during the disturbance process, which can reflect the severity of the change in water flow velocity during the disturbance. The time delay refers to the amount by which the actual propagation time of the polluted water source is increased compared with the basic propagation time due to the water flow disturbance. The corrected propagation time refers to the actual propagation time of the polluted water source at the connection edge of the water supply pipeline after considering the water flow disturbance factor based on the basic propagation time.
[0098] In some embodiments, step S33, "if the disturbance identifier exists on the connection edge, determine the time delay based on the disturbance duration and flow velocity fluctuation amplitude corresponding to the disturbance identifier," includes the following steps: S331, determine the number of sampling times when the connecting edge is continuously marked as flowing to the disturbance area, and multiply the number of sampling times by the preset sampling period to obtain the disturbance duration.
[0099] Understandably, the impact of a disturbance on propagation time depends not only on its intensity but also on its duration. Short-term disturbances have limited impacts, while continuous disturbances can cause pollutants to remain for extended periods, significantly prolonging arrival time. Therefore, to assess the impact of a disturbance on propagation time, it is first necessary to quantify how long the disturbance process lasts. A disturbance lasting several minutes and a disturbance lasting several seconds have completely different effects on hindering pollutant migration. Specifically, this can be achieved by tracing back the historical state records of the connection edge and counting the number of sampling times that were consecutively marked as flowing towards the disturbance area. For example, if five consecutive sampling periods are marked, then multiplying this number by a preset sampling period, such as 30 seconds, yields a disturbance duration of 150 seconds. This value reflects the cumulative length of the disturbance on the time axis and is a key parameter for measuring its interference with the pollutant migration process, ensuring that the time delay is proportional to the actual duration of the disturbance. Among them, the number of sampling moments refers to the number of sampling points that are continuously marked as flowing into the disturbance zone when the historical state record of the connection edge is traced back; the sampling period refers to the preset time interval for sampling the water flow state of the water supply pipeline connection edge; and the disturbance duration refers to the total duration for which the connection edge is in the flow into the disturbance zone.
[0100] S332, obtain the maximum and minimum values of the real-time water flow corresponding to the connection edge during all sampling times covered by the duration of the disturbance, calculate the maximum and minimum water flow velocities based on the maximum and minimum values respectively, and determine the difference between the maximum and minimum water flow velocities as the flow velocity fluctuation amplitude.
[0101] Knowing only how long a disturbance lasts is insufficient; its intensity is also crucial. A disturbance with a long duration but minimal velocity variation has a different impact on contaminant transport than a short-duration disturbance with violent velocity fluctuations. The severity of velocity fluctuations directly affects the reduction in contaminant migration efficiency within the pipe section. Specifically, the duration of the disturbance can be determined. Then, real-time water flow data corresponding to the connecting edge at all sampling times within that time period can be obtained. From this flow data, the maximum and minimum values can be identified. These extreme values are then divided by the cross-sectional area of the pipe to calculate the corresponding maximum and minimum water flow velocities. Finally, the maximum and minimum water flow velocities are subtracted, and the difference is determined as the velocity fluctuation amplitude of the disturbance event. This amplitude directly reflects the severity of the velocity change during the disturbance. The larger the velocity fluctuation amplitude, the more unstable the water flow state and the stronger the hindrance to contaminant migration.
[0102] The maximum flow velocity refers to the maximum value of the flow velocity of the connecting edge within the time period covered by the duration of the disturbance, and the minimum flow velocity refers to the minimum value of the flow velocity of the connecting edge within the time period covered by the duration of the disturbance.
[0103] S333, multiply the duration of the disturbance by the amplitude of the flow velocity fluctuation to obtain the cumulative disturbance value, and divide the cumulative disturbance value by the preset flow velocity reference value to obtain the time delay.
[0104] Specifically, the disturbance duration is multiplied by the velocity fluctuation amplitude to obtain the disturbance cumulative value. The disturbance cumulative value combines the impact of the disturbance duration and velocity fluctuation amplitude on pollution migration. Dividing this value by the preset velocity baseline value can convert this combined impact into a specific time delay, thereby achieving a reasonable correction to the baseline propagation time and making the prediction results more consistent with the actual situation.
[0105] Among them, the cumulative disturbance value is the value obtained by multiplying the duration of the disturbance by the amplitude of the flow velocity fluctuation. It can reflect the overall degree of interference of the disturbance on the pollution migration process. The preset flow velocity reference value is a pre-set reference value that represents the water flow velocity under normal conditions.
[0106] S34, if the disturbance identifier does not exist on the connecting edge, the corrected propagation time is the basic propagation time. The corrected propagation times of each connecting edge in the risk water supply path are added together to obtain the hydraulic propagation time of the polluted water source from the polluted node to the corresponding downstream monitoring node.
[0107] For connection edges without disturbances, the water flow is relatively stable, and the basic propagation time can accurately reflect the propagation time of the polluted water source in that section of the pipeline without correction. However, by summing up the corrected propagation times of each connection edge in the risk water supply path, the complete hydraulic propagation time of the polluted water source from the pollution node to the corresponding downstream monitoring node can be obtained. This time, taking into account the actual conditions of each section of the pipeline, can provide an accurate basis for early warning decisions.
[0108] Specifically, if there is no disturbance indicator on the connecting edge, the base propagation time is directly used as the corrected propagation time. Then, the corrected propagation times of each connecting edge in the risky water supply path are accumulated sequentially. For example, see... Figure 3 This is a schematic diagram of a risky water supply path provided by an embodiment of the present invention, as shown below. Figure 3 As shown, the risky water supply path has three connecting edges, corresponding to three downstream monitoring nodes. Specifically, connecting edge 1 between the pollution node and topology node 1 corresponds to downstream monitoring node 1, connecting edge 2 between topology node 1 and topology node 2 corresponds to downstream monitoring node 2, and connecting edge 3 between topology node 2 and topology node 3 corresponds to downstream monitoring node 3. When the corrected propagation time of the first connecting edge 1 is 100 seconds, the corrected propagation time of the second connecting edge 2 is 120 seconds, and the corrected propagation time of the third connecting edge 3 is 80 seconds, then it can be determined that the hydraulic propagation time corresponding to downstream monitoring node 1 is the corrected propagation time of the first connecting edge (100 seconds), the hydraulic propagation time corresponding to downstream monitoring node 2 is the sum of the corrected propagation times of the first and second connecting edges (220 seconds), and the hydraulic propagation time corresponding to downstream monitoring node 2 is the sum of the corrected propagation times of the three connecting edges (300 seconds).
[0109] S4. Based on the pollution level of the polluted water source and the hydraulic propagation time, an early warning level is assigned to each downstream monitoring node. According to the early warning level, an early warning instruction matching the early warning level is sent to the user terminal corresponding to the early warning impact area located between the polluted node and each downstream monitoring node on the risky water supply path.
[0110] Among them, the degree of pollution refers to the severity of water quality abnormalities at the pollution node, which is usually quantified by indicators such as the turbidity exceeding the standard multiple and the residual chlorine deficiency rate, reflecting the potential threat to users' health. The warning level refers to the risk response level divided after comprehensively considering the degree of pollution and the hydraulic propagation time, which is used to guide users to take response measures of different intensities. The warning impact area refers to the set of all user water points located between the pollution node and a specific downstream monitoring node on a certain risk water supply path. The user terminal refers to the various devices used by users to receive warning instructions. The warning instruction refers to the specific information generated according to the warning level, which is used to guide users to take corresponding response measures.
[0111] The purpose of early warning is not simply to know where pollution might occur, but to enable users to take the right action at the right time. If users are only informed that their local water source is at risk of pollution without specifying the level and urgency of the risk, they may be confused. However, if a uniform water outage order is issued to all areas, it may result in unnecessary cost waste and user resistance. This solution can comprehensively utilize two dimensions: the severity of pollution (the degree of pollution) and the urgency of pollution (the water propagation time), to generate early warning information of different levels and accurately deliver it to users who are truly at risk. This ensures the effectiveness of the early warning while minimizing interference with unaffected users.
[0112] After identifying each risky water supply path and its corresponding hydraulic propagation time, this solution can further combine the severity of water quality anomalies at the pollution node (i.e., the degree of pollution) with the remaining time for the pollution to reach each downstream monitoring node (i.e., the hydraulic propagation time) to assign differentiated warning levels to each downstream node. Specifically, the degree of pollution reflects the severity of water quality hazards, while the hydraulic propagation time reflects the urgency of risk exposure. Together, they constitute the basis for comprehensive risk assessment. High pollution levels combined with short propagation times correspond to the highest risk, requiring an emergency response. Low pollution levels combined with long propagation times indicate lower risk, and warnings can be issued through information prompts. Therefore, warning levels can be divided into multiple levels. For example, a Level 1 warning requires users to immediately stop using tap water and wait for flushing instructions; a Level 2 warning advises caution and attention to subsequent instructions; and a Level 3 warning only provides a water quality fluctuation alert. Subsequently, for each downstream monitoring node, all user water points between it and the pollution node are designated as the warning impact area. Instructions strictly matching the warning level are pushed to the associated user terminals within this area to ensure that the response measures are consistent with the actual risk level, protecting the safety of users in high-risk areas while avoiding unnecessary interference to low-risk areas.
[0113] Based on the above embodiments, step S4 can be implemented in the following ways: S41, determine the pollution type and pollution severity level based on the water quality parameters at the pollution node, wherein the water quality parameters include residual chlorine concentration, turbidity and conductivity changes.
[0114] Understandably, not all pollution incidents are the same; their nature and severity vary greatly. A simple water quality anomaly alert cannot guide users and maintenance personnel to take the correct response measures. Therefore, it is necessary to conduct preliminary qualitative and quantitative analysis of pollution incidents, that is, to determine the type of pollution and the severity level of pollution. This is also the basis for subsequent differentiated early warning. Specifically, multiple water quality parameters of the pollution node at the baseline early warning time and several consecutive sampling times thereafter can be analyzed. For example, if the residual chlorine concentration is detected to be significantly lower than the threshold, while the turbidity increases significantly, it may be identified as a type of microbial pollution. If the conductivity shows an abnormal jump while other parameters do not change much, it may be identified as a type of pipeline corrosion pollution. At the same time, the corresponding severity level of pollution can be determined based on the multiple by which the parameters exceed the standard.
[0115] Among them, pollution type refers to a classification of the nature of pollution events, such as microbial pollution, pipeline corrosion pollution, etc. Different pollution types correspond to different health risks and treatment methods. Pollution severity level refers to the quantitative rating of the degree of harm of pollution events, usually a numerical value or level, used to characterize the severity of pollution. Residual chlorine concentration refers to the content of residual chlorine in water. Turbidity is an indicator that measures the content of suspended particulate matter in water and can reflect the clarity of water. Conductivity change refers to the difference between the current detected conductivity and the normal reference value. When conductivity shows an abnormal jump, it may indicate that new substances have dissolved in the water, such as metal ions produced by pipeline corrosion.
[0116] In some embodiments, step S41 may be implemented as follows: S411, obtain the changes in residual chlorine concentration, turbidity, and conductivity at the pollution node, wherein the change in conductivity is the absolute value of the difference between the conductivity at the current sampling time and the conductivity at the previous sampling time.
[0117] Different water quality parameters can reflect water quality conditions from different perspectives, which is crucial for accurately determining the type and severity of pollution. For example, residual chlorine concentration is related to the disinfection effect in water and can reflect the presence of microbial contamination risk; turbidity reflects the content of suspended solids in water and can help determine the degree of pollution; and changes in conductivity can reflect changes in ion concentration in water, which helps identify abnormal water quality conditions such as pipe corrosion. By obtaining these parameters, basic data can be provided for subsequent pollution analysis. At the same time, defining the change in conductivity as the absolute value of the difference between the conductivity at the current sampling time and the previous sampling time is to intuitively reflect the change range of conductivity at adjacent sampling times, which is convenient for subsequent determination of the pollution type based on the changes.
[0118] S412, if the residual chlorine concentration is lower than a preset residual chlorine threshold and the turbidity is higher than a preset turbidity threshold, then the pollution type with a change in conductivity not exceeding a preset conductivity threshold is determined to be microbial pollution, and the pollution type with a change in conductivity exceeding a preset conductivity threshold is determined to be pipeline corrosion pollution.
[0119] Different types of pollution will exhibit different characteristics in water quality parameters. When the residual chlorine concentration is lower than the preset threshold and the turbidity is higher than the preset threshold, it indicates that the disinfection effect in the water is insufficient and the suspended solids are increasing. This may be due to pollution caused by microbial growth. The change in conductivity can further distinguish the specific type of pollution. If the change in conductivity is small, it means that the ion concentration in the water has not changed much, which may be due to microbial pollution. If the change in conductivity exceeds the preset threshold, it means that the ion concentration in the water has changed significantly. Combined with the residual chlorine and turbidity, it is more likely that the pollution is caused by metal ions entering the water due to pipeline corrosion. By judging these conditions, the type of pollution can be preliminarily determined relatively accurately.
[0120] Specifically, the residual chlorine concentration is compared with a preset residual chlorine threshold, and the turbidity is compared with a preset turbidity threshold. If the residual chlorine concentration is lower than the preset residual chlorine threshold and the turbidity is higher than the preset turbidity threshold, the relationship between the change in conductivity and the preset conductivity threshold is further determined. If the change in conductivity does not exceed the preset conductivity threshold, the pollution type can be marked as microbial pollution. If the change in conductivity exceeds the preset conductivity threshold, the pollution type is marked as pipeline corrosion pollution.
[0121] Among them, the preset residual chlorine threshold refers to the lower limit of residual chlorine concentration set in advance according to water supply standards and water quality requirements. When the actual detected residual chlorine concentration is lower than this threshold, it indicates that the disinfection effect in the water may be insufficient and there is a risk of microbial growth. The preset turbidity threshold refers to the upper limit of turbidity set in advance according to water quality specifications and health requirements. When the actual detected turbidity is higher than this threshold, it indicates that the content of suspended solids in the water is too high and there may be pollution. The preset conductivity threshold refers to a limit value set in advance based on the range of conductivity variation under normal water quality. When the change in conductivity exceeds this threshold, it means that the ion concentration in the water has changed significantly, and there may be abnormal water quality due to pipe corrosion, etc. Microbial pollution refers to pollution caused by the large-scale reproduction of microorganisms such as bacteria and viruses in the water. Pipe corrosion pollution refers to water pollution caused by the corrosion of the inner wall of the pipe, which leads to the dissolution of metal ions into the water.
[0122] S413, the absolute value of the difference between the residual chlorine concentration and the preset residual chlorine threshold and the absolute value of the difference between the turbidity and the preset turbidity threshold are fused and calculated to obtain the comprehensive exceedance index.
[0123] Determining the severity of pollution requires comprehensive consideration of the exceedance of multiple water quality parameters, and cannot be based on a single parameter alone. Residual chlorine concentration and turbidity are both important parameters reflecting water quality anomalies. By calculating the absolute value of the difference between these parameters and their respective preset thresholds, the degree of exceedance of each parameter can be quantified. By combining these two absolute values, a comprehensive exceedance index can be obtained, which can more comprehensively and holistically reflect the severity of water pollution and provide a more accurate basis for subsequently determining the severity level of pollution.
[0124] Specifically, after obtaining the values of residual chlorine concentration and turbidity, as well as the preset residual chlorine threshold and turbidity threshold, the absolute value of the difference between the residual chlorine concentration and the preset residual chlorine threshold, and the absolute value of the difference between the turbidity and the preset turbidity threshold, can be calculated respectively. Then, according to a pre-set fusion calculation method, such as weighting and summing these two differences according to certain weights, a comprehensive exceedance index is obtained. The comprehensive exceedance index refers to a comprehensive index value obtained by integrating the absolute value of the difference between residual chlorine concentration and turbidity and their respective preset thresholds through a specific fusion calculation method.
[0125] S414. Determine the severity level of pollution based on the numerical range of the comprehensive exceedance index.
[0126] The comprehensive exceedance index is a quantitative indicator. Different numerical ranges correspond to different levels of pollution severity. By dividing different numerical ranges and assigning them to different pollution severity levels, the comprehensive exceedance index can be transformed into an intuitive, easy-to-understand, and easy-to-operate level classification. This facilitates subsequent implementation of corresponding countermeasures based on different pollution severity levels, such as issuing different levels of early warning information.
[0127] Specifically, a pre-defined correspondence between the comprehensive exceedance index and the pollution severity level is established. Then, based on the pre-defined correspondence, the numerical range of the comprehensive exceedance index is determined, thereby determining the corresponding pollution severity level. For example, when the comprehensive exceedance index is between 0 and 5, the pollution severity level is determined to be mild; when the comprehensive exceedance index is between 5 and 10, the pollution severity level is determined to be moderate; and when the comprehensive exceedance index is greater than 10, the pollution severity level is determined to be severe.
[0128] S42, based on the pollution type, pollution severity level and water propagation time, query the preset warning level mapping table to determine the warning level corresponding to the downstream monitoring node.
[0129] After clarifying the nature and severity of the pollution and understanding the urgency of its arrival, this information needs to be integrated into a final, actionable warning level. This can be achieved through a pre-defined mapping relationship, transforming multi-source risk assessment into a single warning level and ensuring consistency in warning decisions. Specifically, the determined pollution type, pollution severity level, and calculated water propagation time to a downstream monitoring node can be used as three query conditions to retrieve a pre-defined warning level mapping table. This mapping table encapsulates expert knowledge and historical data. For example, it might be set as follows: when the pollution type is microbial, the pollution severity level is severe, and the propagation time is less than 30 minutes, the warning level is Level 1 Emergency; when the severity level is moderate and the propagation time is between 30 and 120 minutes, the warning level is Level 2 Warning. Through this table lookup method, a warning level matching the comprehensive risk faced by each downstream monitoring node can be quickly and accurately assigned.
[0130] The warning level mapping table refers to a pre-set decision rule table that includes multi-dimensional input conditions and corresponding warning level outputs.
[0131] S43, based on the direction of the connecting edge in the risky water supply path, the user area located between the pollution node and the downstream monitoring node on the risky water supply path is determined as the early warning impact area.
[0132] The accuracy of early warnings is not only reflected in time but also in space. It is essential to ensure that early warning information is pushed to areas that are truly at risk, rather than entire buildings or communities, to avoid causing unnecessary panic. This can be achieved by utilizing existing water supply topology maps and risk paths to precisely define the geographical area that needs to receive early warnings. Specifically, for each risky water supply path and each downstream monitoring node along it, a complete directed path from the contamination node to that downstream monitoring node can be extracted from the water supply topology map. Then, the database linking the pipeline GIS system and the user information system can be queried to identify the specific user units served by all water supply pipe segments constituting this path. The set of these identified user units can be defined as the early warning impact area corresponding to that downstream monitoring node.
[0133] The warning impact area refers to the set of all user water points served by a specific water supply pipeline section, located between the pollution source and the monitoring point that is about to be polluted.
[0134] S44, generate an early warning command that matches the early warning level of the downstream monitoring node, and send the early warning command to all user terminals within the early warning impact area.
[0135] After determining the warning level and the area affected by the warning, the warning level can be converted into specific instructions that users can understand and act upon, i.e., warning instructions, and accurately delivered to the area affected by the warning. Specifically, firstly, based on the determined warning level, a corresponding warning instruction can be called or generated from a preset instruction library. For example, the instruction for a level one warning might be an emergency alarm: "The water supply in your area has been severely contaminated. Please stop using it immediately and wait for repair notification." The instruction for a level two warning might be a warning: "The water supply in your area may be contaminated. Please boil it before drinking." Subsequently, the communication module can be activated to obtain a list of all registered user terminals, such as mobile phone numbers, within the determined area affected by the warning, and the generated warning instructions can be sent to these users in batches via SMS, APP push, or other means.
[0136] The above implementation method ensures that the information received by each user is precisely matched with the level of risk they face, achieving efficient, accurate, and differentiated pollution early warning.
[0137] Based on the above steps, this solution also includes the following embodiments: A1. Obtain user type data corresponding to the user area served by each downstream monitoring node, and determine the importance value corresponding to the user type data based on the preset mapping relationship.
[0138] Different user types have varying tolerance and coping abilities to water pollution. For example, users in places like hospitals and schools have higher requirements for water safety, and water pollution could lead to more serious consequences, thus their importance is relatively high. In contrast, the importance of users in ordinary residential areas may be lower. By obtaining user type data and determining the corresponding importance values, we can provide a basis for differentiated early warning and handling, ensuring that more appropriate measures can be taken based on the importance of the user when water pollution occurs.
[0139] Specifically, a pre-defined mapping database between user types and importance values can be established. For example, the importance value corresponding to hospital user types can be set to 5, the importance value corresponding to school user types can be set to 4, and the importance value corresponding to ordinary residential area user types can be set to 2. Then, by querying geographic information systems, the user area served by each downstream monitoring node can be determined. Then, user type data within these user areas can be obtained from relevant departments such as community management agencies and user registration systems. Based on the pre-defined mapping database, the obtained user type data can be converted into corresponding importance values.
[0140] Among them, user type data refers to classification data used to describe the nature of the user area served by the downstream monitoring node, preset mapping relationship refers to the pre-established corresponding rule system that associates various user types with corresponding importance values. Through this mapping relationship, user types can be transformed into specific, quantifiable and comparable importance values. Importance value refers to a quantitative score assigned to a user based on its type, used to characterize the relative importance of the area in water supply security incidents.
[0141] A2, send a warning command matching the warning level to user terminals within the warning impact area, and record the time when the warning command is sent.
[0142] Once the type and severity level of water pollution are determined, the relevant information needs to be promptly communicated to affected users so that they can take appropriate protective measures to reduce the health impact of the pollution. Sending warning instructions that match the warning level allows users to clearly understand the severity of the pollution and the actions they should take. Recording the time when the warning instructions are sent is for subsequent monitoring of user responses to the warning instructions to determine whether users have received and executed the warning instructions within a reasonable time.
[0143] Based on the identified warning impact area, the system obtains terminal information of users within that area. According to the warning level, it selects the appropriate warning instruction from a pre-set warning instruction template library. For example, for a mild warning, the instruction might be: "Please note that the current water quality is slightly abnormal; it is recommended to store some clean water." Then, the warning instruction is sent to user terminals via SMS, app push notifications, etc. Simultaneously, the system can record the sending time of the warning instruction. The sending time refers to the precise point in time when the warning instruction is successfully pushed to user terminals in the target area.
[0144] A3, within a preset response monitoring period after the sending time, acquire water usage behavior feedback data of user terminals within the warning impact area.
[0145] Understanding how users respond to warning commands is crucial for assessing the effectiveness of warnings and taking follow-up measures. By obtaining user water usage behavior feedback data during the preset response monitoring period, it is possible to determine whether users have performed the protective operations in the warning commands, such as whether they have stopped using water or stored clean water. This helps to identify users who have not responded to the warnings in a timely manner so that further measures can be taken.
[0146] Specifically, a pre-set response monitoring period can be established, such as 2 hours after the warning command is sent. The smart water meter system can then monitor the user's water usage in real time via the meter's flow sensor, providing data such as water flow and usage time as water usage behavior feedback data. For users without smart meters, water usage behavior feedback data can be obtained through user-reported information, such as via an app. The pre-set response monitoring period refers to a predetermined time length, such as 15 minutes, used to assess whether the user has taken the expected protective measures after receiving the warning. Water usage behavior feedback data refers to objective data that indirectly reflects the user's water usage behavior within the pre-set response monitoring period.
[0147] A4. If it is determined from the water usage behavior feedback data that the user has not performed the protective operation in the warning instruction, and the importance value is greater than the preset importance threshold, then the warning level will be raised by one level.
[0148] For user areas such as hospitals and schools where the importance value is greater than the preset importance threshold, if users do not perform the protective actions in the warning instructions, it means that these users may face higher health risks. In this case, the warning level can be raised to attract wider attention and prompt relevant departments and users to pay more attention to water pollution issues and take stricter protective measures to ensure the water safety of important users.
[0149] Specifically, the system can analyze the water usage behavior feedback data to determine whether users have performed the protective actions specified in the warning instructions. At the same time, it compares the obtained importance values with preset importance thresholds. If it is determined that the user has not performed the protective actions and the importance value is greater than the preset importance threshold, the corresponding warning level can be raised by one level. For example, if the original warning level was moderate, it can be raised to severe. Then, based on the raised warning level, a new warning instruction is generated and sent to the relevant user terminals.
[0150] Among them, protective operation refers to the specific measures required by the warning instruction for the user to take, such as immediately stopping the use of tap water, and preset importance threshold refers to the critical importance value used to determine whether an area is a critical area.
[0151] A5. If it is determined from the water usage behavior feedback data that the user has not performed the protection operation, and the importance value is less than or equal to the preset importance threshold, then the warning level remains unchanged, and the unresponsive event is recorded.
[0152] In practical applications, not all unresponsive areas need to be escalated immediately. Over-escalation may lead to a waste of resources for areas with lower importance. For user areas with importance values less than or equal to the preset importance threshold, although some users may not perform protective actions, the risk is relatively low. Maintaining the alert level can avoid unnecessary panic caused by over-alerts. At the same time, recording unresponsive events can provide data support for subsequent analysis of user behavior and improvement of the alert mechanism.
[0153] Similarly, the data obtained from water usage behavior feedback can be used to analyze whether users have performed protective actions. The obtained importance value can be compared with the preset importance threshold. If it is determined that the user has not performed protective actions, but the importance value is less than or equal to the preset importance threshold, the warning level can be kept unchanged. At the same time, non-response events can be recorded, including detailed information such as the non-response user terminal information and the time of non-response, for subsequent statistical analysis and processing.
[0154] Among them, a non-response event refers to an event in which a user area fails to take corresponding protective measures after receiving a warning.
[0155] See Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. The electronic device 40 includes: a processor 41, a memory 42, and a computer program; wherein... The memory 42 is used to store the computer program, and the memory may also be flash memory. The computer program is, for example, an application program or functional module that implements the above method.
[0156] The processor 41 is configured to execute the computer program stored in the memory to implement the various steps performed by the device in the above method. For details, please refer to the relevant descriptions in the preceding method embodiments.
[0157] Alternatively, the memory 42 can be either standalone or integrated with the processor 41.
[0158] When the memory 42 is a device independent of the processor 41, the device may further include: Bus 43 is used to connect the memory 42 and the processor 41.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for early warning of secondary water supply pollution based on the Internet of Things, characterized in that, include: The instantaneous water flow direction between adjacent IoT monitoring nodes is determined based on the real-time water pressure data at the IoT monitoring nodes, and a water supply topology map is constructed based on the instantaneous water flow direction. The IoT monitoring node with abnormal water quality data is identified as a pollution node, and all risky water supply paths originating from the pollution node are obtained based on the water supply topology map. Obtain the pipeline parameters and hydraulic characteristic parameters of the water supply pipelines on each of the risk water supply paths, and determine the hydraulic propagation time required for the polluted water source to reach each downstream monitoring node based on the pipeline parameters and hydraulic characteristic parameters; Based on the degree of pollution of the polluted water source and the hydraulic propagation time, an early warning level is assigned to each downstream monitoring node. According to the early warning level, an early warning instruction matching the early warning level is sent to the user terminal corresponding to the early warning impact area located between the polluted node and each downstream monitoring node on the risky water supply path.
2. The method according to claim 1, characterized in that, Determining the instantaneous water flow direction between adjacent IoT monitoring nodes based on real-time water pressure data at the IoT monitoring nodes includes: Obtain real-time water pressure data of each IoT monitoring node at the current sampling time, and determine adjacent IoT monitoring node pairs based on the installation location of each IoT monitoring node in the secondary water supply network; Determine the water pressure difference for each pair of adjacent IoT nodes at the current sampling time, and determine the preliminary judgment direction based on the positive or negative attribute of the water pressure difference; When the absolute value of the water pressure difference is greater than the preset water pressure resolution threshold, the preliminary judgment direction is determined to be the effective water flow direction at the current sampling time; otherwise, the water flow state at the current sampling time is marked as a non-flowing state. If the effective water flow direction at the current sampling time is consistent with the effective water flow direction at the previous sampling time, the cumulative count is incremented by one. When the cumulative count reaches the preset number of stable confirmations, the effective water flow direction is determined as the instantaneous water flow direction. If the effective water flow direction at the current sampling time is inconsistent with the effective water flow direction at the previous sampling time, the cumulative count will be reset.
3. The method according to claim 1 or 2, characterized in that, Constructing a water supply topology map based on the instantaneous water flow direction includes: Based on the installation location of each IoT monitoring node in the secondary water supply network, a topology node corresponding to each IoT monitoring node is constructed, and a connection edge is generated for each pair of adjacent IoT monitoring nodes based on the topology node. Based on the instantaneous water flow direction of each adjacent IoT monitoring node pair, the corresponding connection edges are converted into directed connection edges; If the water flow between adjacent IoT monitoring node pairs is in a state of no flow and the duration exceeds the preset dead water judgment time, then the water supply pipe section between adjacent IoT monitoring node pairs will be marked as a dead water risk zone. If, within the preset disturbance determination time period, the number of times the effective water flow direction changes between adjacent IoT monitoring node pairs exceeds the preset disturbance frequency threshold, then the water supply pipe section between adjacent IoT monitoring node pairs will be marked as a flow disturbance zone. Mark the connection status of the connecting edge corresponding to the dead water risk zone as a bidirectional isolation state, and add a disturbance identifier to the directed connecting edge corresponding to the flow disturbance zone. The graph structure consisting of the topological nodes, directed connecting edges, and additional bidirectional isolation states or disturbance identifiers is defined as the water supply topology graph.
4. The method according to claim 1, characterized in that, The IoT monitoring nodes that were identified as having abnormal water quality data are pollution nodes, including: Water quality data at each IoT monitoring node is acquired based on the IoT monitoring devices at the IoT monitoring nodes, wherein the water quality data includes multiple water quality parameters; An IoT monitoring node whose water quality parameter exceeds a preset threshold is identified as an abnormal node. Based on the directed connection edges pointing to the abnormal node in the water supply topology diagram, obtain all upstream monitoring nodes of the abnormal node; If the abnormal node has no upstream monitoring node, or if the water quality parameters of all upstream monitoring nodes do not exceed the preset threshold, then the abnormal node is identified as a pollution node.
5. The method according to claim 1, characterized in that, Based on the water supply topology map, all risky water supply paths originating from the pollution node are obtained, including: Based on the water supply topology, starting from the pollution node, each of the IoT monitoring nodes is traversed step by step along the instantaneous water flow direction, and the directed paths that satisfy the continuity of the water flow direction are recorded to obtain a set of water supply paths. By removing water supply paths that contain bidirectional isolated connection edges from the set of water supply paths, a set of feasible water supply paths is obtained. The sampling time when the water quality parameters at the pollution node first exceed the preset threshold is determined as the baseline warning time; Obtain the water quality data of the IoT monitoring nodes in each of the feasible water supply paths set at the most recent sampling time before the baseline warning time; The path in which the water quality parameters in the water quality data do not exceed the preset threshold is identified as a risky water supply path.
6. The method according to claim 1, characterized in that, Obtain the pipeline parameters and hydraulic characteristic parameters of the water supply pipelines along each of the aforementioned risky water supply paths, and determine the hydraulic propagation time required for the polluted water source to reach each downstream monitoring node based on the pipeline parameters and hydraulic characteristic parameters, including: Obtain the pipe parameters and hydraulic characteristic parameters of each segment of the water supply pipeline on each of the aforementioned risk water supply paths, wherein the pipe parameters include pipe length and pipe diameter, and the hydraulic characteristic parameters include real-time water flow rate obtained at the baseline warning time; Based on the pipeline parameters and the hydraulic characteristic parameters, the water flow velocity of each connecting edge corresponding to the risk water supply path is calculated, and the basic propagation time of each connecting edge is determined according to the water flow velocity and the pipeline length. If the disturbance marker exists on the connecting edge, the time delay is determined based on the disturbance duration and flow velocity fluctuation amplitude corresponding to the disturbance marker, and the time delay is added to the base propagation time to obtain the corrected propagation time; If the disturbance identifier is not present on the connecting edge, the corrected propagation time is the base propagation time. The corrected propagation times of each connecting edge in the risky water supply path are summed to obtain the hydraulic propagation time from the polluted node to the corresponding downstream monitoring node.
7. The method according to claim 6, characterized in that, If the disturbance marker exists on the connecting edge, the time delay is determined based on the disturbance duration and flow velocity fluctuation amplitude corresponding to the disturbance marker, including: The number of sampling moments in which the connecting edge is continuously marked as flowing towards the disturbance region is determined, and the number of sampling moments is multiplied by a preset sampling period to obtain the disturbance duration; The maximum and minimum values of the real-time water flow corresponding to the connection edge are obtained during all sampling times covered by the duration of the disturbance. The maximum and minimum water flow velocities are calculated based on the maximum and minimum values, and the difference between the maximum and minimum water flow velocities is determined as the flow velocity fluctuation amplitude. Multiply the duration of the disturbance by the amplitude of the flow velocity fluctuation to obtain the cumulative disturbance value, and divide the cumulative disturbance value by the preset flow velocity reference value to obtain the time delay.
8. The method according to claim 1, characterized in that, Based on the degree of pollution of the polluted water source and the hydraulic propagation time, an early warning level is assigned to each downstream monitoring node. According to the early warning level, an early warning instruction matching the early warning level is sent to the user terminals corresponding to the early warning impact area located between the polluted node and each downstream monitoring node along the risky water supply path. This includes: The pollution type and pollution severity level are determined based on the water quality parameters at the pollution nodes, wherein the water quality parameters include changes in residual chlorine concentration, turbidity, and conductivity. Based on the pollution type, pollution severity level, and water propagation time, a preset warning level mapping table is consulted to determine the warning level corresponding to the downstream monitoring node; Based on the direction of the connecting edge in the risk water supply path, the user area located between the pollution node and the downstream monitoring node on the risk water supply path is determined as the early warning impact area; A warning command matching the warning level of the downstream monitoring node is generated and sent to all user terminals within the warning impact area.
9. The method according to claim 8, characterized in that, The pollution type and severity level are determined based on the water quality parameters at the pollution nodes, including: The residual chlorine concentration, turbidity, and conductivity changes at the pollution node are obtained, wherein the conductivity change is the absolute value of the difference between the conductivity at the current sampling time and the conductivity at the previous sampling time. If the residual chlorine concentration is lower than a preset residual chlorine threshold and the turbidity is higher than a preset turbidity threshold, then the pollution type with a change in conductivity not exceeding a preset conductivity threshold is determined to be microbial pollution, and the pollution type with a change in conductivity exceeding a preset conductivity threshold is determined to be pipeline corrosion pollution. The absolute value of the difference between the residual chlorine concentration and the preset residual chlorine threshold, and the absolute value of the difference between the turbidity and the preset turbidity threshold are combined and calculated to obtain a comprehensive exceedance index; The severity level of pollution is determined based on the range of values for the comprehensive exceedance index.
10. The method according to claim 1, characterized in that, Also includes: Obtain user type data corresponding to the user area served by each downstream monitoring node, and determine the importance value corresponding to the user type data based on a preset mapping relationship; Send a warning command matching the warning level to user terminals within the warning impact area, and record the time when the warning command is sent; During a preset response monitoring period after the sending time, water usage behavior feedback data of user terminals within the warning impact area is acquired; If it is determined from the water usage behavior feedback data that the user has not performed the protective operation in the warning instruction, and the importance value is greater than the preset importance threshold, then the warning level will be raised by one level. If it is determined from the water usage behavior feedback data that the user has not performed any protective actions, and the importance value is less than or equal to a preset importance threshold, then the warning level remains unchanged, and the unresponsive event is recorded.