A graph theory-based method and device for tracing and locating pollution sources in water supply networks

By using graph theory-based methods, combining the topology and adjacency matrix of the water supply network, and employing breadth-first search and Bayesian probabilistic inference, the source tracing and localization of pollution in the water supply network is optimized. This solves the problem of low speed and accuracy in locating pollution sources in the water supply network, and achieves fast and accurate pollution source localization.

CN120087777BActive Publication Date: 2026-01-30TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510001382.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2026-01-30
Estimated Expiration
2045-01-02

AI Technical Summary

Technical Problem

Existing technologies for tracing and locating pollution sources in water supply networks do not fully utilize information, and there is a shortage of dynamic emergency water quality monitoring equipment and manpower, resulting in low speed and accuracy in tracing and locating pollution sources, making it difficult to quickly and accurately locate pollution sources.

Method used

A graph theory-based approach was adopted, utilizing the topology and adjacency matrix of the water supply network, combined with a breadth-first search algorithm to determine the initial candidate range of dynamic detection points. Information gain was evaluated through Bayesian probabilistic inference and Monte Carlo simulation to optimize the selection of dynamic detection points and finally determine the location of the pollution source.

Benefits of technology

It improves the accuracy and reliability of pollution source location, rapidly optimizes dynamic water quality monitoring points, reduces pollution source uncertainty, provides scientific decision support, and reduces the negative impact of pollution incidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120087777B_ABST
    Figure CN120087777B_ABST
Patent Text Reader

Abstract

This invention provides a graph theory-based method and apparatus for tracing and locating pollution sources in water supply networks. The method includes: S1: Abstracting the topological structure of the water supply network based on a hydraulic model and constructing an adjacency matrix. Using this adjacency matrix, a breadth-first search algorithm in graph theory is employed to determine an initial candidate range of dynamic detection points; S2: Generating candidate dynamic detection point schemes based on the candidate range and evaluating the information gain of each scheme. The most favorable dynamic detection point for locating the pollution source is then selected; S3: Repeating S2 to acquire water pollution information and continuously narrow down the candidate range of dynamic detection points; S4: Determining the pollution source location when the calculated node pollution source result meets the location success condition or the candidate range of dynamic detection points is empty. This method enables rapid location of pollution sources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water supply network technology, and in particular to a method and device for tracing and locating pollution sources in water supply networks based on graph theory. Background Technology

[0002] Water supply networks are crucial infrastructure for maintaining the normal operation of cities and are the fundamental guarantee for the smooth production and daily life of residents. However, with the increasingly large scale and complexity of water supply networks, sudden incidents of urban drinking water pollution caused by various factors such as ecological degradation and pipeline damage occur frequently, posing a major challenge to water quality safety management for water supply companies. Therefore, water supply companies not only need the ability to maintain the stable daily operation of water supply networks, but also need comprehensive anomaly identification and emergency response capabilities when faced with sudden pollution incidents.

[0003] When water pollution incidents occur in water supply networks, it is crucial to quickly and accurately locate the pollution source. However, current methods generally rely on single pieces of information, such as water quality monitoring data from the water supply network or user complaints, which is insufficient and incomplete in utilizing various types of pollution-related information. Furthermore, after a water pollution incident is discovered, the equipment and manpower available for dynamic emergency water quality monitoring are limited, resulting in insufficient information to be obtained in a short period, severely restricting the speed and accuracy of source tracing and location. Therefore, the integrated use of information from multiple sources, the optimized layout of dynamic emergency water quality monitoring points, and the rapid location of pollution sources are urgent technical problems that water supply companies need to solve in their water quality safety risk prevention and control efforts. Summary of the Invention

[0004] In a first aspect, embodiments of the present invention provide a graph theory-based method for tracing and locating pollution sources in water supply networks, the method comprising:

[0005] S1: Based on the hydraulic model of the water supply network, the topology of the water supply network is abstracted and the adjacency matrix of the water supply network is constructed. When the first sensor in the water supply network alarms, the initial candidate range of dynamic detection points is determined by combining the adjacency matrix of the water supply network and using the breadth-first search algorithm in graph theory.

[0006] S2: Based on the candidate range of dynamic detection points, generate candidate schemes for dynamic detection points, evaluate the information gain of each candidate scheme, and select the dynamic detection point that is most conducive to locating the pollution source.

[0007] S3: Repeat S2 to obtain water pollution information and continuously narrow down the candidate range of dynamic monitoring points;

[0008] S4: When the calculated node pollution source results meet the location success conditions or the candidate range of dynamic detection points is empty, determine the pollution source location.

[0009] Among some possible implementations of the first aspect, S1 includes:

[0010] The water supply network is considered as a directed graph G = (V, E) in graph theory, where V represents the set of nodes including the water supply network, and E represents the connecting pipes between nodes. After obtaining the topology, node, and pipe attribute parameters of the water supply network, a hydraulic model of the water supply network is constructed using hydraulic modeling software. The actual flow direction of each pipe in the water supply network, i.e., the topology, is then obtained using this model. Based on this, the adjacency matrix A of the water supply network is constructed, and its expression is shown below:

[0011]

[0012] Where n is the number of nodes in the water supply network, k i,j Let k be the element in the i-th row and j-th column of the adjacency matrix A, representing whether node i is a direct upstream node of node j. When node i is a direct upstream node of node j, k... i,j =1, otherwise, k i,j =0;

[0013] When the first sensor in the water supply network alarms, the adjacency matrix of the water supply network is combined with the breadth-first search algorithm in graph theory to traverse all possible branches layer by layer according to the number of layers, determine the set of upstream nodes of the alarm sensor, and determine the initial candidate range of dynamic detection points based on the upstream and downstream relationships between monitoring points.

[0014] Among some possible implementations of the first aspect, S2 includes:

[0015] Based on water quality models, water quality monitoring information, and discrete user complaint information, the system provides status feedback on whether each node of the water supply network is contaminated, obtains dynamic monitoring point information, and collects observation information by simulating random pollution events using Monte Carlo simulation. The probability of the observed information is statistically analyzed, and based on Bayesian probability inference, the pollution probability distribution of candidate pollution source nodes is determined and used to update the posterior probability. Different dynamic monitoring point candidate schemes are simulated to determine the dynamic monitoring time to different nodes, and the degree of reduction in pollution probability information entropy after selecting a certain node is calculated. This evaluates the information gain of different dynamic monitoring point candidate schemes, and based on this, the dynamic monitoring point most conducive to pollution source location is selected.

[0016] Among some possible implementations of the first aspect, S2 includes:

[0017] The posterior probability distribution P(z│Y(i),X,t0,W(j)) of the candidate pollution source node z is calculated using Bayes' theorem. The specific calculation formula is as follows:

[0018]

[0019] Where z is a candidate pollution source node, z∈Z; Z is the set of candidate pollution source nodes; P(z│Y(i),X,t0,W(j)) is the posterior probability of node z as a pollution source given the information; P(Y(i),X,t0,W(j)│z) is the likelihood term; P0(z) is the prior probability of node z; t0 is the time of the first sensor alarm; Y(i) is the sequence of sensor alarm information; X is the difference in the number of observations between the most recent alarm time and the current observation time; W(j) is the sequence of dynamic detection point information.

[0020] The Monte Carlo simulation program for random pollution events was used to simulate the propagation of pollutants in the water supply network and obtain the corresponding sensor alarm information and pollution time information of dynamic detection points. The terms of the posterior probability formula were estimated.

[0021] The information gain of pollution source probability is calculated according to the following formula:

[0022] ΔH j+1 =H(Z) j+1 )-H(Z j );

[0023] Among them, H(Z) j H(Z) represents the probabilistic information entropy of the pollution source after j-fold dynamic detection; j+1 ) represents the probabilistic information entropy of the pollution source after j+1 dynamic detections; ΔH j+1 The entropy gain of the pollution probability information after selecting j+1 dynamic detection points;

[0024] Let W0(j) represent the state of the j-th dynamic detection point being contaminated (0), and W1(j) represent the state of the j-th dynamic detection point being contaminated (1). The calculated information gain for the j-th round of dynamic detection points is ΔH0 and ΔH1. The final selected point information gain value is obtained by weighting these two values. For any node J within the candidate range of dynamic detection points, the following holds:

[0025] ΔH J (J)=ω0ΔH0+ω1ΔH1;

[0026] Where, ΔH j (J) represents the information gain when node J is selected in the j-th round; ΔH0 represents the information gain when the node selected in the j-th round is not contaminated; ΔH1 represents the information gain when the node selected in the j-th round is contaminated; ω0 and ω1 are the corresponding weight values;

[0027] Finally, a model for calculating the weighted information gain value of nodes within the candidate range of dynamic detection points is constructed:

[0028] J j =argmax{ΔHj (J)};

[0029] Based on this model, the node with the largest information gain is selected as the final dynamic detection point in this round. If multiple nodes have the same information gain during the selection process, the dynamic detection time of the node is used as the second evaluation criterion for selecting the dynamic detection point.

[0030] Among some possible implementations of the first aspect, S3 includes:

[0031] If the pollution status of the dynamic detection point in the j-th round is 0, it means that neither the dynamic detection point nor its upstream node is a pollution source node. Therefore, based on the candidate range of the dynamic detection point in the previous round, the strict upstream node of the dynamic detection point is removed from the candidate range of the dynamic detection point in the (j+1)-th round, and the node with information gain of 0 in this round is removed from the candidate range of the dynamic detection point in the (j+1)-th round.

[0032] If the pollution status of the dynamic detection point in round j is 1, it means that the pollution source node is the upstream node of the dynamic detection point. Therefore, the possible upstream nodes of the dynamic detection point are updated to the candidate range of dynamic detection points in round j+1, and the nodes with information gain of 0 in this round are removed from the candidate range of dynamic detection points in round j+1.

[0033] Secondly, embodiments of the present invention provide a graph theory-based device for tracing and locating pollution sources in water supply networks, the device comprising:

[0034] The module for S1 is used to abstract the topology of the water supply network based on the hydraulic model of the water supply network and construct the adjacency matrix of the water supply network. When the first sensor in the water supply network alarms, the initial candidate range of dynamic detection points is determined by combining the adjacency matrix of the water supply network and using the breadth-first search algorithm in graph theory.

[0035] The evaluation module, used in S2, generates dynamic detection point candidate schemes based on the candidate range of dynamic detection points, evaluates the information gain of each dynamic detection point candidate scheme, and selects the dynamic detection point that is most conducive to the location of the pollution source based on this.

[0036] The repeat module is used for S3: repeatedly execute S2 to obtain water pollution information and continuously narrow down the candidate range of dynamic detection points;

[0037] The determination module, used in S4, determines the location of the pollution source when the calculated node pollution source results meet the location success conditions or the candidate range of dynamic detection points is empty.

[0038] Thirdly, embodiments of the present invention provide an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described above.

[0039] Fourthly, embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described above.

[0040] In this embodiment of the invention, by integrating water quality information from multiple water supply networks and combining it with search algorithms in graph theory, the optimal location for dynamic water quality monitoring can be quickly optimized and determined. This allows for timely and proactive acquisition of the most valuable water pollution information from the water supply network, overcoming the obstacle of insufficient information in traditional water quality monitoring, minimizing the uncertainty of pollution sources in the water supply network, improving the accuracy and reliability of detection, accelerating the tracing and location of pollution sources, and providing scientific decision support for managers in emergency response, thereby reducing the negative impact of pollution incidents.

[0041] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0042] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the invention and are not intended to limit the invention. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0043] Figure 1 A flowchart illustrating a graph theory-based method for tracing and locating pollution sources in a water supply network, provided as an embodiment of the present invention.

[0044] Figure 2 A schematic diagram of the Net3 topology of a water supply network provided in an embodiment of the present invention;

[0045] Figure 3 A schematic diagram illustrating the location process of a pollution case provided in an embodiment of the present invention;

[0046] Figure 4 A structural diagram of a graph theory-based water supply network pollution tracing and location device provided in an embodiment of the present invention;

[0047] Figure 5 This is a structural diagram of an exemplary electronic device capable of implementing embodiments of the present invention. Detailed Implementation

[0048] 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.

[0049] Furthermore, the term "and / or" in this invention is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this invention generally indicates that the preceding and following related objects have an "or" relationship.

[0050] To address the technical problems mentioned in the background art, embodiments of the present invention provide a graph-based method, apparatus, equipment, and storage medium for tracing and locating pollution sources in water supply networks. The following, in conjunction with the accompanying drawings, provides a detailed description of the graph-based method, apparatus, equipment, and storage medium for tracing and locating pollution sources in water supply networks provided by the present invention through specific embodiments.

[0051] Figure 1 A flowchart of a graph theory-based method for tracing and locating pollution sources in a water supply network, as provided in this embodiment of the invention, is shown below. Figure 1 As shown, the water supply network pollution source tracing and location method 100 may include:

[0052] S1: Based on the hydraulic model of the water supply network, the topology of the water supply network is abstracted and the adjacency matrix of the water supply network is constructed. When the first sensor in the water supply network alarms, the initial candidate range of dynamic detection points is determined by combining the adjacency matrix of the water supply network and using the breadth-first search algorithm in graph theory.

[0053] Specifically, the water supply network is considered as a directed graph G = (V, E) in graph theory, where V represents the set of nodes in the water supply network (i.e., the set of nodes including water sources, water tanks, and water-using nodes), and E represents the connecting pipes between nodes. After obtaining the topology, node, and pipe attribute parameters of the water supply network, a hydraulic model of the water supply network is constructed using hydraulic modeling software. The actual flow direction of each pipe in the water supply network is obtained through hydraulic simulation using this model, which is the topology of the water supply network. Based on this, the adjacency matrix A of the water supply network is constructed, and its expression is shown below:

[0054]

[0055] Where n is the number of nodes in the water supply network, k i,j Let k be the element in the i-th row and j-th column of the adjacency matrix A, representing whether node i is a direct upstream node of node j. When node i is a direct upstream node of node j, k... i,j =1, otherwise, k i,j =0.

[0056] When the first sensor in the water supply network alarms, the adjacency matrix of the water supply network is combined with the breadth-first search algorithm in graph theory to traverse all possible branches layer by layer according to the number of layers, determine the set of upstream nodes of the alarm sensor, and determine the initial candidate range of dynamic detection points based on the upstream and downstream relationships between monitoring points.

[0057] S2: Based on the candidate range of dynamic detection points, generate candidate schemes for dynamic detection points, evaluate the information gain of each candidate scheme, and select the dynamic detection point that is most conducive to locating the pollution source.

[0058] Specifically, based on water quality models, water quality monitoring information, and discrete user complaint information, the system provides status feedback on whether each node of the water supply network is contaminated, obtaining dynamic monitoring point information. It also collects observation information through Monte Carlo simulation of random pollution events, statistically analyzes the probabilities of these observations, and uses Bayesian probability inference to determine the pollution probability distribution of candidate pollution source nodes, which is then used to update the posterior probability. Different dynamic monitoring point candidate schemes are simulated to determine the dynamic monitoring time to different nodes, and the reduction in pollution probability information entropy after selecting a node is calculated. This evaluates the information gain of different dynamic monitoring point candidate schemes, and based on this, the most favorable dynamic monitoring point for pollution source location is selected. The specific calculations include the following parts:

[0059] The posterior probability distribution P(z |Y(i), X, t0, W(j)) of the candidate pollution source node z is calculated using Bayes' theorem. The specific calculation formula is as follows:

[0060]

[0061] Where z is a candidate pollution source node, z∈Z; Z is the set of candidate pollution source nodes; P(z|Y(i), X, t0, W(j)) is the posterior probability of node z as a pollution source given the information; P(Y(i), X, t0, W(j)|z) is the likelihood term; P0(z) is the prior probability of node z; t0 is the time of the first sensor alarm; Y(i) is the sequence of sensor alarm information; X is the difference in the number of observations between the most recent alarm time and the current observation time; W(j) is the sequence of dynamic detection point information.

[0062] The Monte Carlo simulation program for random pollution events is used to simulate the propagation of pollutants in the water supply network and obtain corresponding sensor alarm information and pollution time information of dynamic detection points. The terms of the posterior probability formula are then estimated.

[0063] The information gain of pollution source probability is calculated according to the following formula:

[0064] ΔH j+1 =H(Z) j+1 )-H(Z j (2)

[0065] Among them, H(Z) j Let H(Z) be the probabilistic information entropy of the pollution source after j dynamic detections, according to the formula H(Z) j )=-∑z j P(z)log P(z) is obtained; H(Z) is obtained by calculation. j+1 ) represents the probabilistic information entropy of the pollution source after j+1 dynamic detections; ΔH j+1 The entropy gain of the pollution probability information after selecting j+1 dynamic detection points;

[0066] Let W0(j) represent the state of the j-th dynamic detection point being contaminated (0), and W1(j) represent the state of the j-th dynamic detection point being contaminated (1). The calculated information gain for the j-th round of dynamic detection points is ΔH0 and ΔH1. The final selected point information gain value is obtained by weighting these two values. For any node J within the candidate range of dynamic detection points, the following holds:

[0067] ΔH j (J)=ω0ΔH0+ω1ΔH1 (3)

[0068] Where, ΔH j (J) represents the information gain when node J is selected in the j-th round; ΔH0 represents the information gain when the node selected in the j-th round is not contaminated; ΔH1 represents the information gain when the node selected in the j-th round is contaminated; ω0 and ω1 are the corresponding weight values;

[0069] Finally, a model for calculating the weighted information gain value of nodes within the candidate range of dynamic detection points is constructed:

[0070] J j =argmax{ΔH j (J)} (4)

[0071] Based on this model, the node with the largest information gain is selected as the final dynamic detection point in this round. If multiple nodes have the same information gain during the selection process, the dynamic detection time of the node is used as the second evaluation criterion for selecting the dynamic detection point. The dynamic detection time is calculated using a search algorithm (such as Dijkstra's algorithm) to estimate the shortest distance between nodes. The primary criterion is to select the node with the largest information gain, while also considering the dynamic detection time cost of the nodes, selecting nodes with a consistent degree of information gain maximization and a short detection time.

[0072] S3: Repeat S2 to obtain water pollution information and continuously narrow down the candidate range of dynamic monitoring points.

[0073] In other words, by repeatedly performing the "assessment-site selection-location" process, the most valuable water pollution information can be efficiently obtained, continuously narrowing down the candidate range of dynamic monitoring points. The specific process is as follows:

[0074] If the pollution status of the dynamic detection point in the j-th round is 0, it means that neither the dynamic detection point nor its upstream node is a pollution source node. Therefore, based on the candidate range of the dynamic detection point in the previous round, the strict upstream node of the dynamic detection point is removed from the candidate range of the dynamic detection point in the (j+1)-th round, and the node with information gain of 0 in this round is removed from the candidate range of the dynamic detection point in the (j+1)-th round.

[0075] If the pollution status of the dynamic detection point in round j is 1, it means that the pollution source node is the upstream node of the dynamic detection point. Therefore, the possible upstream nodes of the dynamic detection point are updated to the candidate range of dynamic detection points in round j+1, and the nodes with information gain of 0 in this round are removed from the candidate range of dynamic detection points in round j+1.

[0076] S4: When the calculated node pollution source results meet the location success conditions or the candidate range of dynamic detection points is empty, determine the pollution source location.

[0077] In other words, the selection of dynamic detection points and the update of the candidate range of dynamic detection points in the next round can be completed according to the above steps. When the node pollution source result calculated in S2 meets the location success condition or the candidate range of dynamic detection points is empty, the point selection process ends and the location of the pollution source is determined.

[0078] To facilitate further understanding, the method for tracing and locating pollution sources in water supply networks 100 will be described in detail below with reference to a specific embodiment, as shown in the following figure:

[0079] This embodiment uses the water supply network Net3 as an example. This network consists of 97 nodes and 117 pipe segments, including 2 water source nodes, 3 water tower nodes, and 2 pumps. It is also equipped with 5 sensors located at nodes 167, 213, 253, 149, and 117, corresponding to sensor numbers S1, S2, S3, S4, and S5. Its topology is as follows: Figure 2 As shown.

[0080] First, hydraulic simulation is performed using EPANET software to obtain the actual flow direction of each pipe in the water supply network, and the adjacency matrix A of the water supply network is constructed accordingly.

[0081] This embodiment assumes the pollutant is an inert substance, meaning it only migrates and diffuses with the water body without reacting. Only one pollutant injection point is considered in each simulation, with an injection concentration of 25 mg / L. The simulation duration is 36 hours, the water demand perturbation variance is 5%, and the simulation is run 3000 times. Sensor data is transmitted to the dispatch center at a frequency of 10 minutes per transmission, with a hydraulic step size of 10 minutes and a water quality step size of 5 minutes. The probability distribution function of the pollution time information between the sensor and other nodes is obtained through Monte Carlo simulation.

[0082] Subsequently, a single pollution event was randomly simulated, and the initial candidate range of dynamic detection points was determined based on the node location of the first sensor alarm. Assuming pollutants are injected at node 111, the first alarming sensor is S1, and the alarm time t0 is the 56th observation time of the day, a breadth-first search algorithm is applied to filter out an initial candidate range of dynamic detection points (excluding sensor S1) including 24 nodes, specifically as follows: Figure 3 As shown in (a).

[0083] In the first round of point selection, the candidate range of dynamic detection points is as follows: Figure 3 As shown in (a), the information gain of each node within the candidate range of dynamic detection points is calculated using formula (3). Node 120 is selected as the first round of dynamic detection point according to formula (4). Assuming the scheduling center is located at node 105, the shortest path and distance from the scheduling center to node 120 are estimated using Dijkstra's algorithm. The time cost of node 120 is 2 observation time intervals. According to the simulation results of this pollution event, after 2 observation time intervals, the pollution state of node 120 is unpolluted. At this time, the corresponding sensor information and dynamic detection point information are updated. The pollution source probability of each node is calculated according to formula (1), and the candidate range of dynamic detection points for the next round is updated. The candidate range of dynamic detection points is updated from 24 nodes to 16 nodes, as detailed below. Figure 3 As shown in (b).

[0084] In the second round of point selection, the candidate range of dynamic detection points is as follows: Figure 3 As shown in (b), node 267 is selected as the second round of dynamic detection point according to formulas (3) and (4). After comprehensively considering the dynamic detection time, the sensor and dynamic detection point information are updated. The pollution source probability of each node is calculated according to formula (1), and the candidate range of dynamic detection points for the next round is updated. The candidate range of dynamic detection points is reduced from 16 nodes to 7 nodes, as detailed below. Figure 3 As shown in (c).

[0085] In the third round of point selection, the candidate range of dynamic detection points is as follows: Figure 3 As shown in (c), according to formulas (3) and (4), node 111 is selected as the dynamic detection point for the third round. After comprehensively considering the dynamic detection time, the sensor and dynamic detection point information are updated. The pollution source probability of each node is calculated according to formula (1), and the candidate range of dynamic detection points for the next round is updated. The candidate range of dynamic detection points is updated from 7 nodes to 4 nodes, as detailed below. Figure 3 As shown in (d).

[0086] In the fourth round of point selection, the candidate range of dynamic detection points is as follows: Figure 3 As shown in (d), node 109 is selected as the fourth round of dynamic detection point according to formulas (3) and (4). After comprehensively considering the dynamic detection time, the sensor and dynamic detection point information are updated. The pollution source probability of each node is calculated according to formula (1), and the candidate range of dynamic detection points for the next round is updated. The candidate range of dynamic detection points is updated from 4 nodes to 2 nodes, as detailed below. Figure 3 As shown in (e).

[0087] In the fifth round of point selection, the candidate range of dynamic detection points is as follows: Figure 3 As shown in (e), node 115 is selected as the fifth round of dynamic detection point according to formulas (3) and (4). After comprehensively considering the dynamic detection time, the sensor and dynamic detection point information are updated. The pollution source probability of each node is calculated according to formula (1), and the candidate range of dynamic detection points for the next round is updated. At this time, node 111 becomes the only possible pollution source node with a pollution source probability of 1. The candidate range of dynamic detection points is an empty set, the dynamic point selection process ends, and the pollution source is finally located at node 111, which matches the actual pollution source node.

[0088] In summary, according to the embodiments of the present invention, at least the following technical effects are achieved:

[0089] By integrating water quality information from multiple water supply networks and combining it with search algorithms in graph theory, the optimal locations for dynamic water quality monitoring can be quickly determined. This allows for the timely and proactive acquisition of the most valuable water pollution information from the water supply network, overcoming the limitations of insufficient information in traditional water quality monitoring. It also minimizes the uncertainty of pollution sources in the water supply network, improves the accuracy and reliability of detection, accelerates the tracing and location of pollution sources, and provides scientific decision support for managers in emergency response, thereby reducing the negative impact of pollution incidents.

[0090] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0091] The above is an introduction to the method embodiments. The following describes the solution of the present invention further through device embodiments.

[0092] Figure 4 A structural diagram of a graph-based water supply network pollution tracing and location device provided in an embodiment of the present invention is shown below. Figure 4 As shown, the water supply network pollution source tracing and locating device 400 may include:

[0093] Module 401 is used for S1: Based on the hydraulic model of the water supply network, the topology of the water supply network is abstracted and the adjacency matrix of the water supply network is constructed. When the first sensor in the water supply network alarms, the initial candidate range of dynamic detection points is determined by combining the adjacency matrix of the water supply network and using the breadth-first search algorithm in graph theory.

[0094] Evaluation module 402 is used for S2: generating dynamic detection point candidate schemes based on the dynamic detection point candidate range, evaluating the information gain of each dynamic detection point candidate scheme, and selecting the dynamic detection point that is most conducive to the location of the pollution source based on this.

[0095] The repeat module 403 is used for S3: repeatedly executing S2 to obtain water pollution information and continuously narrow down the candidate range of dynamic detection points.

[0096] The determination module 404 is used in S4: when the calculated node pollution source result meets the location success condition or the candidate range of dynamic detection points is empty, the pollution source location is determined.

[0097] Understandable Figure 4 Each module / unit in the water supply network pollution tracing and locating device 400 shown has the ability to realize Figure 1 The functions of each step in the water supply network pollution tracing and location method 100 shown are explained, and their corresponding technical effects are achieved. For the sake of brevity, they will not be elaborated here.

[0098] Figure 5 This is a structural diagram of an exemplary electronic device capable of implementing embodiments of the present invention. Electronic device 500 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 500 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown in this invention, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0099] like Figure 5 As shown, the electronic device 500 may include a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. The RAM 503 may also store various programs and data required for the operation of the electronic device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0100] Multiple components in electronic device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows electronic device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0101] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as method 100. For example, in some embodiments, method 100 may be implemented as a computer program product, including a computer program tangibly contained in a computer-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of method 100 described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform method 100 by any other suitable means (e.g., by means of firmware).

[0102] The various embodiments described above in this invention can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), payload programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0103] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0104] In the context of this invention, a computer-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of computer-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0105] It should be noted that the present invention also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute method 100 and achieve the corresponding technical effects achieved by the embodiments of the present invention in executing the method. For the sake of brevity, they will not be described in detail here.

[0106] In addition, the present invention also provides a computer program product, which includes a computer program that implements method 100 when executed by a processor.

[0107] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this invention does not impose any limitations on them.

[0108] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A graph-based method for contaminant source localization in water distribution networks, characterized in that, The method comprises: S1: abstracting the topological structure of the water supply network based on the water supply network hydraulic model and constructing the adjacency matrix of the water supply network, when the first sensor in the water supply network alarms, combining the adjacency matrix of the water supply network, and using the breadth-first search algorithm in graph theory to determine the initial dynamic detection point candidate range; S2: generating a dynamic detection point candidate scheme according to the dynamic detection point candidate range, evaluating the information gain of each dynamic detection point candidate scheme, and selecting the dynamic detection point most beneficial to the pollution source positioning based on this; S3: repeatedly performing S2 to obtain water quality pollution information and continuously narrow the dynamic detection point candidate range; S4: when the calculated node pollution source result meets the positioning success condition or the dynamic detection point candidate range is empty, determining the pollution source position; The S1 comprises: A water supply network is regarded as a directed graph in graph theory wherein, V represents a node set comprising the water supply network, E represents connecting pipes between nodes; after obtaining attribute parameter values of the topology, nodes and pipes of the water supply network, a water supply network hydraulic model is constructed by using a hydraulic model software, and a hydraulic simulation is performed by using the water supply network hydraulic model to obtain actual flow directions of each pipe in the water supply network, i.e. the topology of the water supply network, and thereby an adjacency matrix of the water supply network is constructed A and the expression is as follows: ; wherein, n is the number of nodes in the water supply network, is the adjacency matrix A is the element in the i-th row, j-th column of the matrix A, indicating whether node i is a direct upstream node of node j, when node i is a direct upstream node of node j, = 1, otherwise, = 0. When the first sensor in the water supply network alarms, combining the adjacency matrix of the water supply network, using the breadth-first search algorithm in graph theory, traversing all possible branches layer by layer, determining the upstream node set of the position of the alarmed sensor, and determining the initial dynamic detection point candidate range according to the upstream and downstream relationship between the monitoring points; The S2 comprises: According to the water quality model, the water quality monitoring information and the discrete user complaint information, providing the state feedback of whether each node of the water supply network is polluted, obtaining the dynamic detection point information, collecting observation information through Monte Carlo simulation of random pollution events, and statistically analyzing the observation information probability to determine the pollution probability distribution of the candidate pollution source node and update the posterior probability; the dynamic detection time to different nodes is determined by pre-playing different dynamic detection point candidate schemes, and the reduction degree of the pollution probability information entropy after selecting a node is calculated, so as to evaluate the information gain of different dynamic detection point candidate schemes, and select the dynamic detection point most beneficial to the pollution source positioning based on this; The S2 comprises: The posterior probability distribution of the candidate pollution source node is calculated by a Bayesian formula The specific calculation formula is:​ ; wherein, is a certain candidate pollution source node, ; Z is a candidate pollution source node set; is a node posterior probability of being a pollution source; is a likelihood term; is a prior probability of a node ; is a first sensor alarm time; is a sensor alarm information sequence; X is an observation number difference between the last alarm time and the current observation time; is a dynamic detection point information sequence; Through the Monte Carlo simulation program of random pollution events, the propagation of pollutants in the water supply network is simulated, and the corresponding sensor alarm information and pollution time information of the dynamic detection point are obtained, and each term of the posterior probability formula is estimated; The pollution source probability information gain is calculated according to the following formula: ; wherein, H Z j is the information entropy of the pollution source probability after the first dynamic detection; is the information entropy of the pollution source probability after the second dynamic detection; is the information entropy gain of the pollution probability after the second dynamic detection point is selected;​ Use to represent the dynamic detection point pollution state is 0, to represent the dynamic detection point pollution state is 1, the calculated wheel dynamic detection point information gain is and , the final selected point information gain value is calculated by weighting, for the nodes in the dynamic detection point candidate range, all ; wherein, is the information gain when the node is selected in the first round; is the information gain when the node selected in the first round is not contaminated; is the information gain when the node selected in the first round is contaminated; is the information gain when the node and are the corresponding weight values, respectively. Finally, the node weighted information gain value calculation model in the dynamic detection point candidate range is constructed: ; Based on the model, the node with the maximum information gain is selected as the final dynamic detection point of this round, and if multiple nodes have the same information gain during the selection process, the dynamic detection time of the node is used as the second evaluation criterion for selecting the dynamic detection point; The S3 comprises: If the pollution state of the jth round dynamic detection point is 0, it means that the dynamic detection point and its upstream nodes are not pollution source nodes, so the strictly upstream nodes of the dynamic detection point are removed from the j+1th round dynamic detection point candidate range based on the dynamic detection point candidate range of the previous round, and the nodes with information gain of 0 in this round are also removed from the j+1th round dynamic detection point candidate range. If the pollution state of the jth round of dynamic detection point is 1, it represents that the pollution source node is the upstream node of the dynamic detection point, and therefore the possible upstream nodes of the dynamic detection point are updated to the j+1th round of dynamic detection point candidate range, and the nodes with information gain of 0 in the current round are removed from the j+1th round of dynamic detection point candidate range.

2. A graph-based water distribution network contamination source localization device, characterized in that, The device is used to execute the method of claim 1, comprising: The construction module is used for S1: abstracting the topology structure of the water supply network based on the water supply network hydraulic model and constructing the adjacency matrix of the water supply network, and when the first sensor in the water supply network alarms, combining the adjacency matrix of the water supply network, and determining the initial dynamic detection point candidate range by using the breadth-first search algorithm in graph theory; The evaluation module is used for S2: generating the dynamic detection point candidate scheme according to the dynamic detection point candidate range, evaluating the information gain of each dynamic detection point candidate scheme, and selecting the dynamic detection point most beneficial to the pollution source positioning based on the information gain; The repetition module is used for S3: repeatedly executing S2 to obtain the water quality pollution information and continuously narrowing the dynamic detection point candidate range; The determination module is used for S4: when the calculated node pollution source result meets the positioning success condition or the dynamic detection point candidate range is empty, determining the pollution source position.

3. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of claim 1.

4. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to execute the method of claim 1.

Citation Information

Patent Citations

  • Water pollution rapid tracing method and system

    CN111986064A

  • Water supply network pollution source positioning method based on water quality dynamic optimization sampling

    CN114459810A