Water supply network pollution tracing and positioning method and device based on graph theory

By constructing the topology structure of the water supply pipeline network and evaluating the information gain of dynamic detection point candidates based on graph theory, the problem of difficulty in quickly and accurately locate pollution sources in the water supply pipeline network is solved, and efficient and accurate pollution source traceability and water quality monitoring are achieved.

CN120087777AActive Publication Date: 2025-06-03TONGJI UNIV

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when water quality pollution incidents occur in the water supply pipeline network, it is difficult to quickly and accurately locate the pollution source, and the dynamic emergency water quality monitoring equipment and manpower are limited, resulting in insufficient traceability and accuracy.

Method used

Using a graph theory-based method, by constructing the topological structure and adjacency matrix of the water supply pipeline network, combining the breadth-first search algorithm, the initial dynamic detection point candidate range is determined, and the information gain of the dynamic detection point candidate scheme is evaluated through Bayesian probability inference and Monte Carlo simulation, and the candidate range is gradually narrowed to locate the pollution source.

Benefits of technology

It has achieved rapid optimization and determination of the best points for dynamic water quality detection, actively obtain the most valuable water quality pollution information in the water supply pipeline network, eliminate the uncertainty of pollution sources, improve the accuracy and reliability of detection, accelerate the traceability and positioning of pollution sources, support managers to make scientific decisions, and reduce the negative impact of pollution incidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120087777A_ABST
    Figure CN120087777A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a water supply network pollution tracing and positioning method and device based on a graph theory. The method comprises the following steps: S1, abstracting a topological structure of the water supply network based on a hydraulic model of the water supply network, constructing an adjacent matrix of the water supply network based on the topological structure, and determining an initial dynamic detection point candidate range by combining the adjacent matrix of the water supply network and utilizing a breadth-first search algorithm in a graph theory; s2, according to the dynamic detection point candidate range, dynamic detection point candidate schemes are generated, the information gain of each dynamic detection point candidate scheme is evaluated, and a dynamic detection point most beneficial to pollution source positioning is selected based on the information gain; s3, repeatedly executing the step S2 to obtain water quality pollution information, and continuously narrowing the candidate range of the dynamic detection points; and S4, when the calculated node pollution source result meets the positioning success condition or the dynamic detection point candidate range is empty, determining the position of the pollution source. In this way, the position of the pollution source can be quickly positioned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water supply pipe networks, and in particular, to a method and device for tracing and locating water pollution in a water supply pipe network based on graph theory. Background Art

[0002] Water supply pipe networks are important infrastructure for maintaining the normal operation of cities and are the basic guarantee for the smooth progress of residents' production and life. However, with the increasing scale and complexity of the water supply pipe network system, urban drinking water quality pollution emergencies caused by various reasons such as ecological environment deterioration and pipeline damage occur frequently, which has become a major challenge faced by current water supply enterprises in water quality safety management. Thus, water supply enterprises not only need to have the ability to maintain the daily stable operation of the water supply pipe network, but also need to have perfect abnormal recognition and emergency response capabilities when the water supply pipe network faces sudden pollution events.

[0003] When a water quality pollution event occurs in a water supply pipe network, it is necessary to quickly and accurately locate the pollution source. However, currently, a single piece of information such as water quality monitoring information of the water supply pipe network or user complaint information is generally used for pollution source location, and the utilization of various pollution-related information is not sufficient and comprehensive. Moreover, after a water quality pollution event is discovered, the equipment and manpower for dynamic emergency water quality monitoring are limited, and the water quality pollution information obtained in a short time is insufficient, which severely restricts the tracing and positioning speed and accuracy. Therefore, the integrated utilization of multi-source information, the optimal layout of dynamic emergency water quality dynamic detection points, and the rapid location of the pollution source position are technical problems that current water supply enterprises urgently need to solve for water quality safety risk prevention and control. Summary of the Invention

[0004] In a first aspect, an embodiment of the present invention provides a method for tracing and locating water pollution in a water supply pipe network based on graph theory, the method comprising:

[0005] S1: Abstract the topological structure of the water supply pipe network based on the hydraulic model of the water supply pipe network and construct the adjacency matrix of the water supply pipe network based on this. When the first sensor in the water supply pipe network alarms, combine the adjacency matrix of the water supply pipe network and use the breadth-first search algorithm in graph theory to determine the initial candidate range of dynamic detection points;

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

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

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

[0009] In some realizable ways of the first aspect, S1 includes:

[0010] Regarding the water supply network 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 topological structure, nodes, and attribute parameter values of the pipes of the water supply network, a hydraulic model of the water supply network is constructed using hydraulic model software, and hydraulic simulation is performed using the hydraulic model of the water supply network to obtain the actual flow directions of the pipes in the water supply network, that is, the topological structure of the water supply network, and an adjacency matrix A of the water supply network is constructed therefrom, and its expression is as follows:

[0011]

[0012] where n is the number of nodes in the water supply network, k i,j is the element in the i-th row and j-th column of the adjacency matrix A, indicating whether node i is the direct upstream node of node j. When node i is the 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, in combination with the adjacency matrix of the water supply network, using the breadth-first search algorithm in graph theory, all possible branches are traversed layer by layer according to the layers, the set of upstream nodes of the location where the alarmed sensor is located is determined, and the initial candidate range of dynamic detection points is determined according to the upstream and downstream relationships between the monitoring points.

[0014] In some realizable ways of the first aspect, S2 includes:

[0015] Providing status feedback on whether each node of the water supply network is polluted according to the water quality model, water quality monitoring information, and discrete user complaint information, obtaining its dynamic detection point information, collecting observation information through Monte Carlo simulation of random pollution events, and statistically calculating the probability of the observation information. Based on Bayesian probability inference, the pollution probability distribution of candidate pollution source nodes is determined and used for updating the posterior probability; different candidate schemes for dynamic detection points are rehearsed, the dynamic detection time for going to different nodes is determined, and the degree of reduction of the pollution probability information entropy after selecting a certain node is calculated, so as to evaluate the information gain of different candidate schemes for dynamic detection points, and based on this, the dynamic detection point most conducive to pollution source location is selected.

[0016] In some realizable ways of the first aspect, S2 includes:

[0017] Calculating the posterior probability distribution P(z│Y(i),X,t 0 ,W(j)) of the candidate pollution source node z through the Bayesian formula, and the specific calculation formula is:

[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, t 0 , W(j)) is the posterior probability that node z is a pollution source under the given information; P(Y(i), X, t 0 , W(j)│z) is the likelihood term; P 0 (z) is the prior probability of node z; t 0 is the first sensor alarm time; 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] Through the Monte Carlo simulation program of random pollution events, 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, and estimate each item of the posterior probability formula;

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

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

[0023] where H(Z j ) is the information entropy of pollution source probability after the jth dynamic detection; H(Z j+1 ) is the information entropy of pollution source probability after the (j + 1)th dynamic detection; ΔH j+1 is the information entropy gain of pollution probability after selecting the (j + 1)th dynamic detection point;

[0024] Use W 0 (j) to represent that the pollution state of the jth dynamic detection point is 0, and W 1 (j) to represent that the pollution state of the jth dynamic detection point is 1. The information gain of the jth round of dynamic detection points calculated is ΔH 0 and ΔH 1 . The final information gain value of the selected point is obtained by weighted calculation of the two. For node J within the candidate range of dynamic detection points, there is:

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

[0026] where ΔH j (J) is the information gain when the selected point in the jth round is node J; ΔH0 The information gain when the node selected in the j-th round is not contaminated; ΔH 1 The information gain when the node selected in the j-th round is contaminated; ω 0 and ω 1 are the corresponding weight values respectively;

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

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

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

[0030] In some realizable ways of the first aspect, S3 includes:

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

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

[0033] In the second aspect, an embodiment of the present invention provides a device for pollution source tracing and location in a water supply network based on graph theory. The device includes:

[0034] A construction module for S1: abstracting the topological structure of the water supply network based on the hydraulic model of the water supply network and constructing the adjacency matrix of the water supply network based on this. 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 candidate range of dynamic detection points;

[0035] An evaluation module for S2: generating candidate solutions for dynamic detection points according to the candidate range of dynamic detection points, evaluating the information gain of each candidate solution for dynamic detection points, and selecting the dynamic detection point that is most conducive to pollution source location based on this;

[0036] A repetition module, for S3: repetitively execute S2 to obtain water quality pollution information and continuously narrow down the candidate range of dynamic detection points;

[0037] A determination module, for S4: when the calculated node pollution source result meets the positioning success condition or the candidate range of dynamic detection points is empty, determine the pollution source location.

[0038] In a third aspect, an embodiment of the present invention provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0039] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to cause a computer to execute the method as described above.

[0040] In the embodiment of the present invention, by fusing multi-source water supply network water quality information and combining the search algorithm in graph theory, it is possible to quickly optimize and determine the best points for dynamic water quality detection, actively obtain the most valuable water quality pollution information in the water supply network in a timely manner, overcome the obstacle of insufficient information in traditional water quality monitoring, eliminate the uncertainty of water supply network pollution sources to the greatest extent, improve the accuracy and reliability of detection, accelerate the tracing and positioning of pollution sources, provide scientific decision-making support for managers' emergency response, and reduce the negative impact caused by pollution incidents.

[0041] It should be understood that the content described in the summary of the invention is not intended to limit the key or important features of the embodiments of the present invention, nor to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Combined with the drawings and referring to the following detailed description, the above and other features, advantages and aspects of the embodiments of the present invention will become more obvious. The drawings are used to better understand the present invention and do not constitute a limitation to the present invention. In the drawings, the same or similar reference numerals represent the same or similar elements, where:

[0043] Figure 1 is a flowchart of a method for tracing and positioning water supply network pollution based on graph theory provided by an embodiment of the present invention;

[0044] Figure 2 is a schematic diagram of the topological structure of a water supply network Net3 in an example provided by an embodiment of the present invention;

[0045] Figure 3 is a schematic diagram of the positioning process of a pollution case provided by an embodiment of the present invention;

[0046] Figure 4 The structural diagram of a pollution source tracing and positioning device for a water supply network based on graph theory provided by an embodiment of the present invention;

[0047] Figure 5 The structural diagram of an exemplary electronic device capable of implementing the embodiments of the present invention. Detailed implementation manners

[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0049] In addition, the term "and / or" in the present invention is only an association relationship describing associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present invention generally represents an "or" relationship between the associated objects before and after.

[0050] To solve the technical problems in the background art, the embodiments of the present invention provide a pollution source tracing and positioning method, device, equipment, and storage medium for a water supply network based on graph theory. The following will combine the accompanying drawings to specifically describe a pollution source tracing and positioning method, device, equipment, and storage medium for a water supply network based on graph theory provided by the embodiments of the present invention in detail.

[0051] Figure 1 The flowchart of a pollution source tracing and positioning method for a water supply network based on graph theory provided by an embodiment of the present invention, as Figure 1 shown, the pollution source tracing and positioning method 100 for a water supply network may include:

[0052] S1: Abstract the topological structure 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 based on this. When the first sensor in the water supply network alarms, combine the adjacency matrix of the water supply network and use the breadth-first search algorithm in graph theory to determine the initial candidate range of dynamic detection points.

[0053] Specifically, the water supply network is regarded as a directed graph G=(V, E) in graph theory, where V represents the set of nodes including the water supply network (i.e., the set of nodes such as water sources, water tanks, water-using nodes, etc.), and E represents the connecting pipes between nodes; after obtaining the topological structure of the water supply network, the attribute parameter values of nodes and pipes, a hydraulic model of the water supply network is constructed using hydraulic model software, and the hydraulic simulation is performed using the hydraulic model of the water supply network to obtain the actual flow direction of each pipe in the water supply network, that is, the topological structure of the water supply network, and based on this, the adjacency matrix A of the water supply network is constructed, and its expression is as follows:

[0054]

[0055] where n is the number of nodes in the water supply network, and k i,j is the element in the i-th row and j-th column of the adjacency matrix A, indicating whether node i is the direct upstream node of node j. When node i is the 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, combined with the adjacency matrix of the water supply network, using the breadth-first search algorithm in graph theory, all possible branches are traversed layer by layer according to the layers, the set of upstream nodes where the alarmed sensor is located is determined, and the initial candidate range of dynamic detection points is determined according to the upstream and downstream relationships between monitoring points.

[0057] S2: Generate candidate dynamic detection point schemes according to the candidate range of dynamic detection points, evaluate the information gain of each candidate dynamic detection point scheme, and based on this, select the dynamic detection point that is most conducive to pollution source location.

[0058] Specifically, according to the water quality model, water quality monitoring information, and discrete user complaint information, provide the status feedback of whether each node in the water supply network is polluted, obtain its dynamic detection point information, collect observation information by simulating random pollution events through Monte Carlo, and count the probability of observation information. Based on this, the pollution probability distribution of candidate pollution source nodes is determined by Bayesian probability inference and used for updating the posterior probability; pre-play different candidate dynamic detection point schemes, determine the dynamic detection time to different nodes, and calculate the degree of reduction of the pollution probability information entropy after selecting a certain node, so as to evaluate the information gain of different candidate dynamic detection point schemes, and based on this, select the dynamic detection point that is most conducive to pollution source location. The specific calculation includes the following parts:

[0059] Calculate the posterior probability distribution P(z |Y(i), X, t 0 , W(j)) of candidate pollution source node z through Bayes' formula, and the specific calculation formula is:

[0060]

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

[0062] Through the random pollution event Monte Carlo simulation program, 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 points are obtained to estimate each item of the posterior probability formula.

[0063] The calculation of the pollution source probability information gain 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 ) is the pollution source probability information entropy after the j-th dynamic detection, and is calculated according to the formula H(Z j ) = -∑z j P(z)log P(z); H(Z j+1 ) is the pollution source probability information entropy after the (j + 1)-th dynamic detection; ΔH j+1 is the pollution probability information entropy gain after selecting the (j + 1)-th dynamic detection point;

[0066] Use W 0 (j) to represent that the pollution state of the j-th dynamic detection point is 0, and W 1 (j) to represent that the pollution state of the j-th dynamic detection point is 1. The information gain of the j-th round of dynamic detection points calculated is ΔH 0 and ΔH 1 . The final selected point information gain value is obtained by weighted calculation of the two. For node J within the candidate range of the dynamic detection point, there is:

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

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

[0069] Finally, a calculation model for 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 for this round. If there are multiple nodes with the same information gain during the point selection process, the dynamic detection time of the nodes will be used as the second evaluation criterion for selecting dynamic detection points. 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. Considering the dynamic detection time cost of the nodes, nodes with the same maximum degree of information gain and shorter detection time are selected.

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

[0073] That is to say, repeat the "evaluation - point selection - positioning" process to efficiently obtain the most valuable water quality pollution information and continuously narrow the candidate range of dynamic detection 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 nodes are pollution source nodes. Therefore, based on the candidate range of dynamic detection points in the previous round, the strict upstream nodes of this dynamic detection point are removed from the candidate range of the (j + 1)-th round of dynamic detection points, and at the same time, the nodes with an information gain of 0 in this round are removed from the candidate range of the (j + 1)-th round of dynamic detection points.

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

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

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

[0078] For the convenience of further understanding, the water supply network pollution source tracing and positioning method 100 will be described in detail below in combination with a specific embodiment, as follows:

[0079] In this embodiment, the example water supply network Net3 is taken as an example. The water supply network consists of 97 nodes and 117 pipe segments, including 2 water source nodes, 3 water tower nodes and 2 pumps. There are also 5 sensors equipped at nodes 167, 213, 253, 149, and 117 respectively. The corresponding sensor numbers are S1, S2, S3, S4, and S5. Its topological structure is as Figure 2 shown.

[0080] First, use the EPANET software to perform hydraulic simulation to obtain the actual flow direction of each pipeline in the water supply network, and construct the adjacency matrix A of the water supply network from this.

[0081] In this embodiment, it is assumed that the pollutant is an inert substance, that is, it only migrates and diffuses with the water body without reacting. Only one pollution injection point is considered in each simulation. The pollutant injection mass concentration is 25 mg / L, the simulation duration is 36 h, the variance of water demand disturbance is 5%, the number of simulation times is 3000 times, the frequency of sensor data transmission to the dispatching center is 10 min / time, the hydraulic step length is set to 10 min, and the water quality step length is set to 5 min. The probability distribution function of the pollution time information between the sensor and the remaining nodes is obtained through Monte Carlo simulation.

[0082] Subsequently, a single pollution event is randomly simulated. Based on the location of the node where the first sensor alarms, the initial candidate range of dynamic detection points is determined. Suppose pollutants are injected at node 111, the first alarm sensor is S1, and the alarm time t0 is the 56th observation moment of the day. Apply the breadth-first search algorithm. According to the relationship between upstream and downstream monitoring points, the initial candidate range of dynamic detection points including 24 nodes (also known as the candidate range of detection points, not including sensor S1) is screened out. Specifically, as Figure 3 (a) shows.

[0083] When selecting points in the first round, the candidate range of dynamic detection points is as Figure 3As shown in (a), the information gain of each node within the candidate range of the dynamic detection point is calculated using formula (3). According to formula (4), node 120 is selected as the dynamic detection point in the first round. Assuming that the dispatching center is located at the position of node 105, the shortest path and distance from the dispatching center to node 120 are estimated using the Dijkstra algorithm. The time cost of node 120 is 2 observation time intervals. According to the simulation results of this pollution event, the pollution status of node 120 is unpolluted after 2 observation time intervals. At this time, the corresponding sensor information and dynamic detection point information are updated. The source probability of each node is calculated using formula (1), and the candidate range of the next-round dynamic detection point is updated. The candidate range of the dynamic detection point is updated from 24 nodes to 16 nodes, as specifically shown in Figure 3 (b).

[0084] When selecting points in the second round, the candidate range of the dynamic detection point is as shown in Figure 3 (b). According to formulas (3) and (4), node 267 is selected as the dynamic detection point in the second round. After comprehensively considering the dynamic detection time, the sensor and dynamic detection point information are updated. The source probability of each node is calculated using formula (1), and the candidate range of the next-round dynamic detection point is updated. The candidate range of the dynamic detection point is decreased from 16 nodes to 7 nodes, as specifically shown in Figure 3 (c).

[0085] When selecting points in the third round, the candidate range of the dynamic detection point is as shown in Figure 3 (c). According to formulas (3) and (4), node 111 is selected as the dynamic detection point in the third round. After comprehensively considering the dynamic detection time, the sensor and dynamic detection point information are updated. The source probability of each node is calculated using formula (1), and the candidate range of the next-round dynamic detection point is updated. The candidate range of the dynamic detection point is updated from 7 nodes to 4 nodes, as specifically shown in Figure 3 (d).

[0086] When selecting points in the fourth round, the candidate range of the dynamic detection point is as shown in Figure 3 (d). According to formulas (3) and (4), node 109 is selected as the dynamic detection point in the fourth round. After comprehensively considering the dynamic detection time, the sensor and dynamic detection point information are updated. The source probability of each node is calculated using formula (1), and the candidate range of the next-round dynamic detection point is updated. The candidate range of the dynamic detection point is updated from 4 nodes to 2 nodes, as specifically shown in Figure 3 (e).

[0087] When selecting points in the fifth round, the candidate range of the dynamic detection point is as shown in Figure 3As shown in (e), node 115 is selected as the dynamic detection point for the fifth round according to formulas (3) and (4). After comprehensively considering the dynamic detection time, the sensor and dynamic detection point information are updated. According to formula (1), the pollution source probability of each node is calculated, and the candidate range of the dynamic detection point for the next round is updated. At this time, node 111 becomes the only possible pollution source node, the pollution source probability value is 1, and the candidate range of the dynamic detection point is an empty set. The dynamic point selection process ends, and finally the pollution source is located at node 111, which is consistent with 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 fusing multi-source water supply network water quality information and combining the search algorithm in graph theory, it is possible to quickly optimize and determine the best points for dynamic water quality detection, actively obtain the most valuable water quality pollution information in the water supply network in a timely manner, overcome the obstacle of insufficient information in traditional water quality monitoring, maximize the elimination of the uncertainty of water supply network pollution sources, improve the accuracy and reliability of detection, accelerate the tracing and positioning of pollution sources, provide scientific decision-making support for managers' emergency response, and reduce the negative impact caused by pollution incidents.

[0090] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know 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 the introduction of the method embodiments. The following further illustrates the solution of the present invention through device embodiments.

[0092] Figure 4 As shown in the structure diagram of a water supply network pollution tracing and positioning device based on graph theory provided by an embodiment of the present invention, Figure 4 the water supply network pollution tracing and positioning device 400 may include:

[0093] A construction module 401, configured to perform S1: abstract the topological structure of the water supply network based on the water supply network hydraulic model and construct the adjacency matrix of the water supply network based on this. When the first sensor in the water supply network alarms, in combination with the adjacency matrix of the water supply network, use the breadth-first search algorithm in graph theory to determine the initial candidate range of the dynamic detection point.

[0094] An evaluation module 402, for S2: according to the dynamic detection point candidate range, generate dynamic detection point candidate solutions, and evaluate the information gain of each dynamic detection point candidate solution, and based on this, select the dynamic detection point that is most conducive to pollution source location.

[0095] A repetition module 403, for S3: repeatedly execute S2 to obtain water pollution information and continuously narrow the dynamic detection point candidate range.

[0096] A determination module 404, for S4: when the calculated node pollution source result meets the location success condition or the dynamic detection point candidate range is empty, determine the pollution source location.

[0097] It can be understood that Figure 4 each module / unit in the water supply network pollution tracing and location device 400 shown has the function of implementing Figure 1 each step in the water supply network pollution tracing and location method 100 shown, and can achieve its corresponding technical effects. For the sake of brevity, it will not be elaborated here.

[0098] Figure 5 It is a structural diagram of an exemplary electronic device capable of implementing the embodiments of the present invention. The 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. The electronic device 500 can also represent various forms of mobile devices, such as, personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown in the present invention, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described and / or claimed in the present invention.

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

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

[0101] The computing unit 501 can be various 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 dedicated 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 executes the various methods and processes described above, such as method 100. For example, in some embodiments, method 100 can be implemented as a computer program product, including a computer program, which is tangibly contained in a computer-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the method 100 described above can be executed. Alternatively, in other embodiments, the computing unit 501 can be configured to execute method 100 by any other suitable means (e.g., by means of firmware).

[0102] The various embodiments described above in the present 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), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, and the programmable processor can be a dedicated or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0103] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, executed partially on the machine and partially on a remote machine as an independent software package, or executed entirely on a remote machine or server.

[0104] In the context of the present invention, a computer-readable medium can be a tangible medium that can contain or store a program for use by or in connection 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 include, 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 a computer-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, 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 a computer to execute method 100 and achieve the corresponding technical effects achieved by the method of the embodiments of the present invention. For the sake of concise description, details are not repeated herein.

[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 various forms of the flow shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present invention can be achieved. The present invention places no restrictions herein.

[0108] The above specific embodiments do not constitute a limitation to the protection scope of the present 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 principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for tracing and locating the pollution source of a water supply network based on graph theory, characterized in that: The method comprises: S1: Based on the hydraulic model of the water supply network, the topological structure of the water supply network is abstracted and the adjacency matrix of the water supply network is constructed based on it. 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; S2: Generate dynamic detection point candidate solutions based on the dynamic detection point candidate range, and evaluate the information gain of each dynamic detection point candidate solution, based on which the dynamic detection point that is most conducive to locating the pollution source is selected; S3: Repeat S2 to obtain water pollution information and continuously narrow the candidate range of dynamic detection points; S4: When the calculated node pollution source result meets the positioning success condition or the dynamic detection point candidate range is empty, the pollution source position is determined.

2. The method according to claim 1, characterized in that: The S1 includes: The water supply network is regarded as a directed graph G = (V, E) in graph theory, where V represents the node set including the water supply network, and E represents the connecting pipes between nodes; after obtaining the topological structure, nodes, and attribute parameter values ​​of the water supply network, the hydraulic model of the water supply network is constructed using the hydraulic model software, and the hydraulic model of the water supply network is used to perform hydraulic simulation to obtain the actual flow direction of each pipe in the water supply network, that is, the topological structure of the water supply network, and thus the adjacency matrix A of the water supply network is constructed, and its expression is as follows: Where n is the number of nodes in the water supply network, k i,j is the element in the i-th row and j-th column of the adjacency matrix A, indicating whether node i is the direct upstream node of node j. When node i is the direct upstream node of node j, k i,j =1, otherwise, k i,j =0; When the first sensor in the water supply network alarms, combined with the adjacency matrix of the water supply network, the breadth-first search algorithm in graph theory is used to traverse all possible branches layer by layer according to the number of layers to determine the set of upstream nodes where the alarming sensor is located, and determine the initial candidate range of dynamic detection points based on the upstream and downstream relationships between monitoring points.

3. The method according to claim 2, characterized in that The S2 includes: Based on the water quality model, water quality monitoring information and discrete user complaint information, the status feedback of whether each node in the water supply network is polluted is provided, and its dynamic detection point information is obtained. The observation information is collected through Monte Carlo simulation of random pollution events, and the probability of the observation information is statistically analyzed. Based on this, the pollution probability distribution of the candidate pollution source node is determined based on Bayesian probability inference, and it is used to update the posterior probability; different dynamic detection point candidate schemes are previewed to determine the dynamic detection time to go to different nodes, and the degree of reduction in the pollution probability information entropy after selecting a certain node is calculated, so as to evaluate the information gain of different dynamic detection point candidate schemes, and on this basis, the dynamic detection point that is most conducive to the location of the pollution source is selected.

4. The method according to claim 3, characterized in that The S2 includes: The posterior probability distribution P(z│Y(i),X,t0,W(j)) of the candidate pollution source node z is calculated by the Bayesian formula. The specific calculation formula is: 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 under given 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 first sensor alarm time; Y(i) is the sensor alarm information sequence; X is the difference in the number of observations between the most recent alarm time and the current observation time; W(j) is the 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 dynamic detection points are obtained, and the posterior probability formula is estimated. The pollution source probability information gain is calculated according to the following formula: ΔH j+1 =H(Z j+1 )―H(Z j ); Among them, H(Z j ) is the probability information entropy of the pollution source after j dynamic detections; H(Z j+1 ) is the probability information entropy of the pollution source after j+1 dynamic detections; ΔH j+1 is the information entropy gain of the pollution probability after selecting j+1 dynamic detection points; W0(j) indicates that the pollution state of the jth dynamic detection point is 0, and W1(j) indicates that the pollution state of the jth dynamic detection point is 1. The information gain of the jth round of dynamic detection points is calculated as ΔH0 and ΔH1. The final point selection information gain value is obtained by weighted calculation of the two. For the node J within the candidate range of the dynamic detection point, there are: ΔH j (J)=ω0ΔH0+ω1ΔH1; Where ΔH j (J) is the information gain when the node selected in the jth round is node J; ΔH0 is the information gain when the node selected in the jth round is not contaminated; ΔH1 is the information gain when the node selected in the jth round is contaminated; ω0 and ω1 are the corresponding weight values ​​respectively; Finally, a calculation model for the weighted information gain value of nodes within the candidate range of dynamic detection points is constructed: J j =argmax{ΔH j (J)}; Based on this model, the node with the largest information gain is selected as the final dynamic detection point of this round. If multiple nodes have the same information gain during the point selection process, the dynamic detection time of the node is used as the second evaluation criterion for selecting the dynamic detection point.

5. The method according to claim 4, characterized in that The S3 includes: If the pollution state of the dynamic detection point in the jth round is 0, it means that the dynamic detection point and its upstream nodes are not pollution source nodes. Therefore, based on the candidate range of dynamic detection points in the previous round, the strict upstream nodes of the dynamic detection point are removed from the candidate range of dynamic detection points in the j+1th round, and the nodes with information gain of 0 in this round are removed from the candidate range of dynamic detection points in the j+1th round simultaneously; If the pollution state of the j-th round dynamic detection point is 1, it means that the pollution source node is at 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 the j+1-th round dynamic detection point, and the nodes with information gain of 0 in this round are removed from the candidate range of the j+1-th round dynamic detection point.

6. A water supply network pollution tracing and positioning device based on graph theory, characterized in that: The device comprises: Construction module, used for S1: Based on the hydraulic model of the water supply network, the topological structure of the water supply network is abstracted and the adjacency matrix of the water supply network is constructed based on it. 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 determine the initial candidate range of dynamic detection points; Evaluation module, used for S2: generating dynamic detection point candidate solutions according to the dynamic detection point candidate range, and evaluating the information gain of each dynamic detection point candidate solution, based on which the dynamic detection point that is most conducive to the location of the pollution source is selected; Repeat module, used for S3: Repeat S2 to obtain water pollution information and continuously narrow the candidate range of dynamic detection points; 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, the pollution source position is determined.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed 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 perform the method according to any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 5.

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

  • Emergency monitoring method and source tracing method for water pollution source tracing

    CN114638114A

  • Medium and long term runoff time-varying probability prediction method based on input-structure-parameter total element hierarchical combination optimization

    CN115496290A

  • Water supply network water quality abnormity pollution source identification method based on gating chart neural network

    CN116484219A

Cited By

  • Drainage pipe network data detection method and device based on graph theory

    CN120387262A

  • Intelligent water quality detection method and system for water plant

    CN120741804A

  • Sewage system traceability analysis and intelligent monitoring method, system and equipment based on graph neural network, and storage medium

    CN120764857A

  • Underground rainwater pipeline abnormal discharge traceability system and method based on DAS

    CN122413214A