Drainage pipe network data detection method and device based on graph theory
By constructing a directed graph of the drainage pipeline network based on graph theory, completing missing nodes and performing topological detection and classification of reverse slope pipe sections, the missed and mis-checking problems in data detection of complex and huge drainage pipeline networks are solved, and efficient and accurate data quality inspection is achieved.
Patent Information
- Application Number
- CN202510873727.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-06-26
AI Technical Summary
The existing technology is difficult to effectively deal with the detection of complex and huge drainage pipeline data, resulting in low quality inspection efficiency and even missed or missed inspections.
A directed graph of drainage pipeline network is constructed based on graph theory. By obtaining pipe segment connection information and known node data, missing nodes are completed, topological detection and classification identification of reverse slope pipe segments are carried out, and graph theory and indicators are used to quickly find topological errors of pipe segments and reverse slope pipe segments.
It improves the accuracy and efficiency of the quality inspection of drainage pipeline network data, avoids missed or misinspection, and ensures the accuracy and completeness of drainage pipeline network data.
Smart Images

Figure CN120387262A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water conservancy engineering, and in particular to a method and device for detecting drainage pipe network data based on graph theory. Background Art
[0002] A drainage network refers to a system consisting of pipes and their ancillary facilities that collect and discharge sewage, wastewater, and rainwater. It is primarily used to collect, transport, and treat urban sewage and rainwater. Monitoring drainage network data can promptly identify problems such as blockages and damage, thus avoiding high repair costs due to worsening problems. This is of great significance for ensuring the normal operation of the drainage system and protecting the urban water environment.
[0003] Due to the complex interconnection structure of the drainage network and the huge amount of data, the relevant drainage network data detection methods are difficult to effectively cope with the complex and huge drainage network data, resulting in low quality inspection efficiency and even missed detection or false detection. Summary of the Invention
[0004] In view of this, the present invention provides a drainage network data detection method and device based on graph theory to solve the problem that it is difficult to effectively deal with complex and huge drainage network data, resulting in low quality inspection efficiency and even missed detection or false detection.
[0005] In a first aspect, the present invention provides a method for detecting drainage network data based on graph theory, the method comprising: Obtaining pipe segment connection information of the target drainage pipe network, and constructing a directed graph of the target drainage pipe network based on the pipe segment connection information; Obtain the known pipe segment node data of the target drainage network, and use the directed graph of the target drainage network to complete the missing pipe segment nodes of the known pipe segment node data; Construct the directed graph of the current drainage network using the known pipe segment node data after completing the missing pipe segment nodes; Perform pipe segment topology detection on the current drainage network directed graph to obtain pipe segment topology detection data; Classify and identify reverse slope pipe sections on the current drainage network directed graph to obtain reverse slope pipe section detection data; The drainage network data detection results are determined based on the topology detection data and the reverse slope pipe section detection data.
[0006] The method for detecting drainage pipe network data based on graph theory provided by this embodiment obtains the pipe segment connection information of the target drainage pipe network, constructs a directed graph of the target drainage pipe network based on the pipe segment connection information; obtains the known pipe segment node data of the target drainage pipe network, and uses the directed graph of the target drainage pipe network to complete the missing nodes of the pipe segments for the known pipe segment node data; constructs a directed graph of the current drainage pipe network by using the known pipe segment node data after the missing nodes of the pipe segments are completed; performs pipe segment topology detection on the directed graph of the current drainage pipe network to obtain pipe segment topology detection data; performs reverse slope pipe segment classification and identification on the directed graph of the current drainage pipe network to obtain reverse slope pipe segment detection data; determines the drainage pipe network data detection result based on the topology detection data and the reverse slope pipe segment detection data; by using the relevant theories and indicators of graph theory, without traversing the entire directed graph of the target drainage pipe network, the missing nodes of the pipe segments can be quickly completed, the topology errors of the pipe segments and the reverse slope pipe segments can be found, greatly improving the accuracy and efficiency of the quality inspection of the target drainage pipe network data, and avoiding the situation of missed inspection or misinspection of the drainage pipe network data.
[0007] In an alternative embodiment, completing the missing nodes of the pipe segments for the known pipe segment node data includes: Determine the directed graph pipe segment node data based on the directed graph of the target drainage pipe network, and determine the non-set based on the directed graph pipe segment node data and the known pipe segment node data; Use the starting pipe bottom elevation and the ending pipe bottom elevation of the pipe segment nodes in the directed graph of the target drainage pipe network to complete the node elevation data of the missing nodes of the pipe segments in the non-set, as well as the node elevation data of the known nodes in the known pipe segment node data; Based on the known pipe segment node data and the pipe network topology connection relationship in the directed graph of the target drainage pipe network, traverse and complete the spatial position coordinates of the missing nodes of the pipe segments layer by layer; Traverse the other missing nodes of the pipe segments in the non-set. After the traversal of the missing nodes of the pipe segments is completed, update the known pipe segment node data based on the missing nodes of the pipe segments after the node elevation data and the spatial position coordinates are completed; Update the non-set based on the updated known pipe segment node data and the directed graph pipe segment node data; If the number of missing nodes of the pipe segments in the updated non-set meets the preset conditions, output the known pipe segment node data after the missing nodes of the pipe segments are completed.
[0008] The method for detecting drainage pipe network data based on graph theory provided by this embodiment uses the starting pipe bottom elevation and the ending pipe bottom elevation of the pipe segment nodes in the directed graph of the target drainage pipe network to complete the node elevation data of the missing nodes of the pipe segments in the non-set and the node elevation data of the known nodes in the known pipe segment node data, and traverses and completes the spatial position coordinates of the missing nodes of the pipe segments layer by layer, realizing the completion of the missing node data in the pipe segments, laying a foundation for the detection of drainage pipe network data.
[0009] In an alternative embodiment, based on the known pipe segment node data and the pipe network topological connection relationship in the target drainage pipe network directed graph, the spatial position coordinates of the missing nodes of the pipe segments are filled in by traversing hierarchically, including: Based on the missing nodes of the pipe segments, use the pipe network topological connection relationship in the target drainage pipe network directed graph to locate the pipe segments corresponding to the missing nodes of the pipe segments; Determine whether there are known nodes at the vertices of the pipe segments corresponding to the missing nodes of the pipe segments. If one of the vertices of the pipe segment is a known node, then use the coordinates of the other vertex of the pipe segment as the spatial position coordinates of the missing node of the pipe segment.
[0010] The drainage pipe network data detection method based on graph theory provided in this embodiment gradually finds the spatial position coordinates of the missing nodes by combining the known node data in the target drainage pipe directed graph with the pipe segment topological connection information, realizing the filling of the spatial position coordinates of the missing nodes of the pipe segments, and laying a foundation for the detection of mixed connection nodes and isolated pipe segments.
[0011] In an alternative embodiment, use the known pipe segment node data after filling in the missing nodes of the pipe segments to construct the current drainage pipe network directed graph, including: Perform mixed connection identification based on the known pipe segment node data after filling in the missing nodes of the pipe segments to determine the mixed connection nodes; among them, the mixed connection nodes are the rainwater pipe segment nodes and sewage pipe segment nodes with repeated positions; Identify isolated pipe segments based on the known pipe segment node data after filling in the missing nodes of the pipe segments; among them, the isolated pipe segments are the pipe segments that cannot be connected by the pipe segments composed of known nodes, or the pipe segments with the number of independent concentrated edges less than three; Construct the current drainage pipe network directed graph based on the known pipe segment node data after removing the mixed connection nodes and isolated pipe segments.
[0012] The drainage pipe network data detection method based on graph theory provided in this embodiment uses the known pipe segment node data after filling in the missing nodes of the pipe segments to identify the missing nodes and isolated pipe segments in the drainage pipe network directed graph, reducing the influence of abnormal data in the target drainage pipe network on the drainage pipe network data detection, and improving the accuracy of the drainage pipe network data detection.
[0013] In an alternative embodiment, perform pipe segment topology detection on the current drainage pipe network directed graph to obtain pipe segment topology detection data, including: Identify the source points and sink points in the current drainage pipe network directed graph, and obtain the degrees of the source points and the degrees of the sink points; Screen the source points with degrees greater than one, and analyze the pipe segment directions of the pipe segments connected to the source points with degrees greater than one one by one to obtain the pipe segment direction analysis results; Screen the sink points with degrees greater than one, use the topological structure of the current drainage pipe network directed graph to determine the starting points corresponding to the sink points with degrees greater than one, and obtain the out-degrees of the starting points; If the out-degree of the starting point is greater than one, the pipe segment between the starting point and the sink point is a reverse pipe segment; Filter out the sink points with a degree equal to one, calculate the distance between the sink points with a degree equal to one and the source point, and compare the distance with a preset threshold; If the distance is less than the preset threshold, use the sink point with a degree equal to one as the break point; Determine the pipe segment topology detection data based on the pipe segment direction analysis result, reverse pipe segment, and break point.
[0014] The drainage pipe network data detection method based on graph theory provided in this embodiment accurately obtains the pipe segment topology detection data by identifying the source point and sink point of the updated directed graph and performing pipe segment direction analysis on the pipe segments connected to the source point and sink point, greatly improving the accuracy and efficiency of the pipe network data quality inspection.
[0015] In an alternative embodiment, classify and identify the reverse slope pipe segments of the current drainage pipe network directed graph to obtain reverse slope pipe segment detection data, including: Traverse the end pipe bottom elevation and start pipe bottom elevation of the pipe segment nodes in the current drainage pipe network directed graph, use the pipe segments with the end pipe bottom elevation greater than the start pipe bottom elevation as reverse slope pipe segments, and use other pipe segments as non-reverse slope pipe segments; Construct a reverse slope directed graph based on the reverse slope pipe segments and convert the reverse slope directed graph into a reverse slope undirected graph; Partition the reverse slope undirected graph to obtain multiple subgraphs. If the number of edges of a subgraph is greater than one, mark the reverse slope pipe segment as a continuous reverse slope; Obtain the end points corresponding to the non-reverse slope pipe segments, as well as the start pipe bottom elevation of the downstream pipe segments connected to the end points and the end pipe bottom elevation of the upstream pipe segments; Compare the start pipe bottom elevation of the downstream pipe segments and the end pipe bottom elevation of the upstream pipe segments. If the end pipe bottom elevation of the upstream pipe segments is less than the start pipe bottom elevation of the downstream pipe segments, mark the non-reverse slope pipe segment as a point reverse slope; Determine the reverse slope pipe segment detection data based on the continuous reverse slope and point reverse slope.
[0016] The drainage pipe network data detection method based on graph theory provided in this embodiment identifies reverse slope pipe segments and non-reverse slope pipe segments through the end pipe bottom elevation and start pipe bottom elevation of pipe segment nodes, generates a reverse slope directed graph based on the reverse slope pipe segments, calculates the reverse slope subgraph, and marks the reverse slope pipe segments with a side length greater than 1 in the reverse slope subgraph as continuous reverse slopes; for non-reverse slope pipe segments, compare the start pipe bottom elevation of the downstream pipe segments and the end pipe bottom elevation of the upstream pipe segments, and mark the non-reverse slope pipe segments with the end pipe bottom elevation of the upstream pipe segments less than the start pipe bottom elevation of the downstream pipe segments as point reverse slopes, effectively identifying the point reverse slopes and continuous reverse slopes in the target drainage pipe network, providing a basis for the detection of the target drainage pipe network data, and effectively improving the accuracy and efficiency of the target drainage pipe network data quality inspection.
[0017] Second aspect, the present invention provides a drainage pipe network data detection device based on graph theory, the device includes: A first construction module, configured to obtain the pipe segment connection information of the target drainage pipe network, and construct a directed graph of the target drainage pipe network based on the pipe segment connection information; A completion module, configured to obtain the known pipe segment node data of the target drainage pipe network, and use the directed graph of the target drainage pipe network to complete the missing nodes of the known pipe segment node data; A second construction module, configured to construct a directed graph of the current drainage pipe network by using the known pipe segment node data after completing the missing nodes of the pipe segment; A detection module, configured to perform pipe segment topology detection on the directed graph of the current drainage pipe network to obtain pipe segment topology detection data; An identification module, configured to classify and identify the reverse slope pipe segments of the directed graph of the current drainage pipe network to obtain reverse slope pipe segment detection data; A determination module, configured to determine the drainage pipe network data detection result based on the topology detection data and the reverse slope pipe segment detection data.
[0018] Third aspect, the present invention provides a computer device, including: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the drainage pipe network data detection method based on graph theory in the first aspect or any corresponding embodiment thereof.
[0019] Fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the drainage pipe network data detection method based on graph theory in the first aspect or any corresponding embodiment thereof.
[0020] Fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the drainage pipe network data detection method based on graph theory in the first aspect or any corresponding embodiment thereof. Description of the Drawings
[0021] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required to be used in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 It is a schematic flowchart of a drainage pipe network data detection method based on graph theory according to an embodiment of the present invention; Figure 2It is a schematic diagram of the pipe segment node topology according to an embodiment of the present invention; Figure 3 It is a schematic flowchart of another graph theory-based drainage pipe network data detection method according to an embodiment of the present invention; Figure 4 It is a schematic flowchart of a missing node completion algorithm according to an embodiment of the present invention; Figure 5 It is a schematic flowchart of the identification of isolated pipe segments according to an embodiment of the present invention; Figure 6 It is a schematic flowchart of yet another graph theory-based drainage pipe network data detection method according to an embodiment of the present invention; Figure 7 It is a schematic flowchart of the topological detection of pipe segments connected to a confluence point with a degree greater than 1 according to an embodiment of the present invention; Figure 8 It is a schematic flowchart of the breakpoint identification according to an embodiment of the present invention; Figure 9 It is a schematic flowchart of still another graph theory-based drainage pipe network data detection method according to an embodiment of the present invention; Figure 10 It is a schematic flowchart of the continuous reverse slope identification according to an embodiment of the present invention; Figure 11 It is a schematic flowchart of the point reverse slope identification according to an embodiment of the present invention; Figure 12 It is a structural block diagram of a graph theory-based drainage pipe network data detection device according to an embodiment of the present invention; Figure 13 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed implementation manners
[0023] 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.
[0024] Underground pipe networks are buried underground and are "invisible and unclear"; the connection forms of drainage pipe networks are very complex. For example, in a certain urban area, there are 24,000 surveyed pipelines and 11,000 pipe segment nodes. For the above-mentioned surveyed data, it is obviously unrealistic to conduct quality inspections manually.
[0025] To solve the above technical problems, an embodiment of the present invention provides a method for detecting drainage pipe network data based on graph theory. By using relevant theories and indicators of graph theory, without traversing the entire graph, it is possible to quickly complete the missing nodes of pipe segments, find topological errors of pipe segments, identify rain-sewage mixed connections and reverse slope pipe segments, greatly improving the accuracy and efficiency of pipe network data quality inspection, and providing a strong guarantee for constructing a "one map" system of underground pipe networks with accurate basic data.
[0026] An embodiment of the present invention provides a method for detecting drainage pipe network data based on graph theory. It should be noted that for the method for detecting drainage pipe network data based on graph theory provided by the embodiment of the present invention, the execution subject can be a device for detecting drainage pipe network data based on graph theory. This device for detecting drainage pipe network data based on graph theory can be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware. Among them, the electronic device can be a server or a terminal. Among them, the server in the embodiment of the present application can be a single server or a server cluster composed of multiple servers. The terminal in the embodiment of the present application can be other intelligent hardware devices such as a smart phone, a personal computer, a tablet computer, a wearable device, and a smart robot. In the following method embodiments, the execution subject is taken as an electronic device for illustration.
[0027] According to an embodiment of the present invention, an embodiment of a method for detecting drainage pipe network data based on graph theory is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0028] In this embodiment, a method for detecting drainage pipe network data based on graph theory is provided, which can be used for the above-mentioned electronic device. Figure 1 It is a flowchart of the method for detecting drainage pipe network data based on graph theory according to an embodiment of the present invention, as Figure 1 shown, the process includes the following steps: Step S101, obtain the pipe segment connection information of the target drainage pipe network, and construct a directed graph of the target drainage pipe network based on the pipe segment connection information.
[0029] Specifically, collect the pipe section information and pipe section node information of the target drainage pipe network, and form a GIS (Geographic Information System) type file based on the pipe section information and pipe section node information. Among them, the pipe section attributes in the pipe section information include the starting node name, ending node name, starting pipe bottom elevation, ending pipe bottom elevation, pipe section name, pipe section direction, and pipe section description, etc. The name of the pipe section is the starting node name - ending node name, and the starting and ending node names correspond to the node names spatially located at the pipe section nodes; the node attributes in the pipe section node information include data such as node name, node surface elevation, node depth, and node bottom elevation, etc.; among them, the sewage pipe and node names should indicate the sewage attribute (such as WS), and the rainwater pipe and node names should indicate the rainwater attribute (such as YS).
[0030] Furthermore, the pipe section node topology composed of the starting node, pipe section, and ending node of the target drainage pipe network is as Figure 2 shown; among them, the starting node and the ending node are used as nodes in the directed graph, and the pipe section is used as an edge in the directed graph. A directed graph GDI0 storing pipe section node information is constructed through the connection information of the upstream and downstream nodes (i.e., the starting node and the ending node) of the pipe section. When constructing the directed graph, the ending pipe bottom elevation (H b ) of the inflowing pipe section and the starting pipe bottom elevation (H s ) of the outflowing pipe section at this node are stored in the nodes.
[0031] Step S102, obtain the known pipe section node data of the target drainage pipe network, and use the directed graph of the target drainage pipe network to complete the missing pipe section nodes of the known pipe section node data.
[0032] Specifically, since the known pipe section node data collected in real time often has missing pipe section node data, and at the same time, the starting pipe bottom elevation / ending pipe bottom elevation of the known pipe section node data is often missing, therefore, use the pipe bottom elevation information of the relevant access and outlet pipe sections of the pipe section nodes to complete the missing nodes and the starting pipe bottom elevation / ending pipe bottom elevation of the known pipe section nodes, as well as the spatial position coordinates of the missing pipe section nodes.
[0033] Step S103, construct the directed graph of the current drainage pipe network using the known pipe section node data after completing the missing pipe section nodes.
[0034] Step S104, perform pipe section topology detection on the directed graph of the current drainage pipe network to obtain pipe section topology detection data.
[0035] Step S105, perform reverse slope pipe section classification and identification on the directed graph of the current drainage pipe network to obtain reverse slope pipe section detection data.
[0036] Step S106: Determine the detection result of the drainage pipe network data based on the topological detection data and the reverse slope pipe section detection data.
[0037] The drainage pipe network data detection method based on graph theory provided in this embodiment obtains the pipe section connection information of the target drainage pipe network, constructs a directed graph of the target drainage pipe network based on the pipe section connection information; obtains the known pipe section node data of the target drainage pipe network, and uses the directed graph of the target drainage pipe network to complete the missing nodes of the known pipe section data; constructs a directed graph of the current drainage pipe network using the known pipe section node data after completing the missing nodes of the pipe section; performs pipe section topology detection on the directed graph of the current drainage pipe network to obtain pipe section topology detection data; performs reverse slope pipe section classification and identification on the directed graph of the current drainage pipe network to obtain reverse slope pipe section detection data; determines the detection result of the drainage pipe network data based on the topology detection data and the reverse slope pipe section detection data; using the relevant theories and indicators of graph theory, without traversing the entire directed graph of the target drainage pipe network, the missing nodes of the pipe section can be quickly completed, the topology errors of the pipe section and the reverse slope pipe section can be found, greatly improving the accuracy and efficiency of the quality inspection of the target drainage pipe network data, and avoiding the situation of missed inspection or misjudgment of the drainage pipe network data.
[0038] In this embodiment, a drainage pipe network data detection method based on graph theory is provided, which can be used in the above-mentioned electronic device. Figure 3 It is a flowchart of the drainage pipe network data detection method based on graph theory according to an embodiment of the present invention. As Figure 3 shown, this process includes the following steps: Step S301: Obtain the pipe section connection information of the target drainage pipe network, and construct a directed graph of the target drainage pipe network based on the pipe section connection information. For details, please refer to Figure 1 Step S101 of the embodiment shown, which will not be elaborated here.
[0039] Step S302: Obtain the known pipe section node data of the target drainage pipe network, and use the directed graph of the target drainage pipe network to complete the missing nodes of the known pipe section data.
[0040] Specifically, as Figure 4 shown, the above step S302 includes: Step S3021: Determine the directed graph pipe section node data based on the directed graph of the target drainage pipe network, and determine the non-set based on the directed graph pipe section node data and the known pipe section node data.
[0041] Specifically, use the Set function (duplicate removal function) in Python (a widely used high-level programming language) to process the pipe section nodes in the directed graph of the target drainage pipe network to obtain non-repeated directed graph pipe section nodes {P i p}; and use the same steps to process the known pipe section nodes to obtain a non-repeated set of known pipe section nodes {Pi n}, compare the directed graph pipe segment nodes {P i p} with the known pipe segment nodes {P i n}, that is, {P i p}-{P i n}, and obtain the difference set {P n}.
[0042] Step S3022, use the starting pipe bottom elevation and the ending pipe bottom elevation of the pipe segment nodes in the target drainage pipe network directed graph to complete the node elevation data of the missing nodes of the non - centralized pipe segments, as well as the node elevation data of the known nodes in the known pipe segment node data.
[0043] Specifically, traverse the pipe segment nodes in the known pipe segment nodes {P i n} that lack the starting pipe bottom elevation / ending pipe bottom elevation, and obtain the point set {P l}.
[0044] Furthermore, for the starting pipe bottom elevation / ending pipe bottom elevation missing in the point set {P l} and the difference set {P n}, use the starting pipe bottom elevation H s and the ending pipe bottom elevation H b of the pipe segment nodes in the target drainage pipe network directed graph to complete the elevation; among them, the ending pipe bottom elevation value of the missing node of the pipe segment after completing the elevation information is Min{H b i}, and the starting pipe bottom elevation value of the missing node of the pipe segment after completing the elevation information is Max{H s i}.
[0045] Step S3023, based on the known pipe segment node data and the pipe network topological connection relationship in the target drainage pipe network directed graph, traverse and complete the spatial position coordinates of the missing pipe segment nodes layer by layer.
[0046] Specifically, for the x and y coordinate data of the missing pipe segment nodes in {P n}, traverse and complete the spatial position coordinates of the missing pipe segment nodes layer by layer through the known pipe segment node data combined with the target drainage pipe network topological relationship.
[0047] In some alternative embodiments, the above - mentioned step S3023 includes:[[]] Step a1, based on the missing pipe segment nodes, use the pipe network topological connection relationship in the target drainage pipe network directed graph to locate the pipe segments corresponding to the missing pipe segment nodes.
[0048] Specifically, traverse the pipe segment missing nodes p in the non-set {P n}, and use the edges of the target drainage pipe network directed graph to locate the pipe segment missing node p n i corresponding pipe segment l n i n .
[0049] Step a2, determine whether there are known nodes at the vertices of the pipe segment corresponding to the pipe segment missing node. If one vertex of the pipe segment is a known node, then use the coordinates of the other vertex of the pipe segment as the spatial position coordinates of the pipe segment missing node.
[0050] Specifically, determine whether there are known nodes at the two vertices of the pipe segment l n corresponding to the pipe segment missing node. If one vertex of the pipe segment l n corresponding to the pipe segment missing node is a known node, then use the coordinates of the other vertex as the spatial position coordinates of the pipe segment missing node p n i ; if neither of the two vertices of the pipe segment l n belongs to the known nodes, then traverse the other pipe segment missing nodes in the non-set {P n} until all pipe segment missing nodes are traversed; where a vertex is a basic unit in a directed graph and is used to represent an entity or object.
[0051] Step S3024, traverse the other pipe segment missing nodes in the non-set until all pipe segment missing nodes are traversed, and then update the known pipe segment node data based on the pipe segment missing nodes after supplementing the node elevation data and spatial position coordinates.
[0052] Specifically, add the spatial position coordinates of the pipe segment missing node p n i to the known pipe segment node data to obtain the updated known pipe segment node data {P i n} new .
[0053] Step S3025, update the non-set based on the updated known pipe segment node data and the directed graph pipe segment node data.
[0054] Specifically, after all missing nodes in all non-sets {P n} are traversed, update the non-set between the directed graph pipe segment nodes {P i p} and {P i n} new to obtain the updated non-set {P n new}
[0055] Step S3026, if the number of missing nodes in the updated non - centralized pipe segments meets the preset condition, output the known pipe segment node data after completing the missing nodes of the pipe segments.
[0056] Specifically, repeatedly traverse the missing nodes of other non - centralized pipe segments until the number of elements in {P n new} no longer decreases, that is, |{P n new}| = |{P n} pre |, where {P n} pre represents the non - centralized obtained in the previous traversal.
[0057] Step S303, construct the current drainage network directed graph using the known pipe segment node data after completing the missing nodes of the pipe segments.
[0058] Specifically, the above - mentioned step S303 includes: Step S3031, perform mixed - connection identification based on the known pipe segment node data after completing the missing nodes of the pipe segments to determine the mixed - connection nodes; among them, the mixed - connection nodes are the rainwater pipe segment nodes and sewage pipe segment nodes with repeated positions.
[0059] Specifically, through the node attributes in the known pipe segment node data after completing the missing nodes of the pipe segments, find the repeated - position rainwater nodes and sewage nodes, and then use the rainwater pipe segment nodes and sewage pipe segment nodes with repeated positions as the mixed - connection nodes {P H}.
[0060] Step S3032, identify the isolated pipe segments based on the known pipe segment node data after completing the missing nodes of the pipe segments; among them, the isolated pipe segments are the pipe segments that cannot be connected through the pipe segments composed of known nodes, or the pipe segments with an independent concentrated edge number less than three.
[0061] Specifically, as Figure 5 shown, during the process of supplementing the spatial position coordinates of the missing nodes of the pipe segments, the pipe segments corresponding to the missing nodes of the pipe segments that cannot be connected by known nodes are used as isolated pipe segments; or, construct the current drainage network directed graph based on the known pipe segment node data after completing the missing nodes of the pipe segments, convert the current drainage network directed graph into the current drainage network undirected graph, identify the disconnected independent sets in the current drainage network undirected graph, and use the pipe segments with an independent concentrated edge number less than 3 in the independent sets as isolated pipe segments; among them, the independent set is a set of non - adjacent vertices in the directed graph, indicating a set of vertices without direct connections.
[0062] Step S3033, construct the current drainage network directed graph based on the known pipe segment node data after removing the mixed - connection nodes and isolated pipe segments.
[0063] Specifically, isolated pipe segments and misconnected nodes are removed from the known pipe segment node data to generate the current directed graph GDI1 of the drainage pipe network.
[0064] Step S304: Perform pipe segment topology detection on the current directed graph of the drainage pipe network to obtain pipe segment topology detection data. For details, please refer to Figure 1 Step S104 of the illustrated embodiment, which will not be elaborated here.
[0065] Step S305: Classify and identify reverse slope pipe segments in the current directed graph of the drainage pipe network to obtain reverse slope pipe segment detection data. For details, please refer to Figure 1 Step S105 of the illustrated embodiment, which will not be elaborated here.
[0066] Step S306: Determine the drainage pipe network data detection result based on the topology detection data and the reverse slope pipe segment detection data. For details, please refer to Figure 1 Step S106 of the illustrated embodiment, which will not be elaborated here.
[0067] The drainage pipe network data detection method based on graph theory provided in this embodiment, through the known node data in the target directed graph of the drainage pipe and combined with the pipe segment topology connection information, gradually finds the spatial position coordinates of the missing nodes, realizes the supplementation of the spatial position coordinates of the missing nodes of the pipe segment, and lays a foundation for the detection of misconnected nodes and isolated pipe segments; uses the starting pipe bottom elevation and the ending pipe bottom elevation of the pipe segment nodes in the target drainage pipe network to complete the node elevation data of the missing nodes of the non-concentrated pipe segment and the node elevation data of the known nodes in the known pipe segment node data, and traverses layer by layer to complete the spatial position coordinates of the missing nodes of the pipe segment, realizing the supplementation of the missing node data in the pipe segment and laying a foundation for the drainage pipe network data detection.
[0068] In this embodiment, a drainage pipe network data detection method based on graph theory is provided, which can be used in the above-mentioned electronic device. Figure 6 It is a flowchart of the drainage pipe network data detection method based on graph theory according to an embodiment of the present invention. As Figure 6 shown, the process includes the following steps: Step S601: Obtain the pipe segment connection information of the target drainage pipe network, and construct a target directed graph of the drainage pipe network based on the pipe segment connection information. For details, please refer to Figure 3 Step S301 of the illustrated embodiment, which will not be elaborated here.
[0069] Step S602: Obtain the known pipe segment node data of the target drainage pipe network, and use the target directed graph of the drainage pipe network to complete the missing pipe segment nodes of the known pipe segment node data. For details, please refer to Figure 3 Step S302 of the illustrated embodiment, which will not be elaborated here.
[0070] Step S603: Construct a directed graph of the current drainage pipe network using the known pipe segment node data after complementing the missing nodes of the pipe segments. For details, please refer to Figure 3 Step S303 of the embodiment shown, which will not be elaborated here.
[0071] Step S604: Conduct a pipe segment topology detection on the directed graph of the current drainage pipe network to obtain pipe segment topology detection data.
[0072] Specifically, the above Step S604 includes: Step S6041: Identify the source point and sink point in the directed graph of the current drainage pipe network, and obtain the degree of the source point and the degree of the sink point.
[0073] Specifically, identify the source point S i and the sink point O i in the directed graph GDI1 of the current drainage pipe network, and calculate the corresponding degrees of the source point S i and the sink point O i . Among them, the source point S i and the sink point O i should not include the misconnected nodes {P H}.
[0074] Furthermore, the degree is the number of edges directly connected to the node. The out-degree is the number of directed edges starting from a certain vertex, indicating how many edges leave from this vertex. The in-degree is the number of directed edges pointing to a certain vertex, indicating how many edges enter this vertex. The source point is the vertex with an in-degree of 0, that is, the vertex without edges pointing to it. The sink point is the vertex with an out-degree of 0, that is, the vertex without edges starting from it.
[0075] Step S6042: Screen the source points with a degree greater than one, and analyze the pipe segment directions of the pipe segments connected to the source points with a degree greater than one one by one to obtain the pipe segment direction analysis results.
[0076] Specifically, screen the source points S i with a degree greater than 1, and analyze the pipe segment directions of the pipe segments connected to the source points with a degree greater than 1 one by one to determine whether there are topological errors in the surrounding pipe segments.
[0077] Step S6043: Screen the sink points with a degree greater than one, use the topological structure of the directed graph of the current drainage pipe network to determine the starting points corresponding to the sink points with a degree greater than one, and obtain the out-degree of the starting points.
[0078] Specifically, screen the sink points O i with a degree greater than 1. According to the topological structure of the directed graph GDI1 of the current drainage pipe network, traverse the starting points O i of the sink points O i pre , and calculate the out-degree of O i pre .
[0079] Step S6044: If the out-degree of the starting point is greater than one, the pipe segment between the starting point and the sink point is a reverse pipe segment.
[0080] Specifically, as Figure 7 shown, if the out-degree of the starting point is greater than 1, then the pipe segment direction from the starting point O i pre to the sink point O i must be incorrect.
[0081] Furthermore, analyze one by one the pipe segments connected between the starting point and the sink point when the out-degree of the starting point is greater than 1, and determine whether there is a topological error.
[0082] Step S6045: Screen out the sink points with a degree equal to one, calculate the distance between the sink points with a degree equal to one and the source point, and compare the distance with a preset threshold.
[0083] Specifically, traverse the sink point O i with a degree equal to one, calculate the Euclidean distance d between its coordinates and the source point S i . Assume that the preset threshold is 0.5 m, and compare the Euclidean distance d with 0.5 m.
[0084] Furthermore, when calculating the distance between the sink point O i and the source point S i , the calculation cost is relatively large. The cdist function in Scipy (a scientific computing library), which is used to calculate the distance between two sets, can be considered to accelerate the calculation.
[0085] Step S6046: If the distance is less than the preset threshold, use the sink point with a degree equal to one as a break point.
[0086] Specifically, as Figure 8 shown, if the Euclidean distance d is less than 0.5 m, then the sink point O i is determined as a break point, that is, the pipe segments are not connected together at this sink point; if the Euclidean distance d is greater than 0.5 m, then traverse other sink points O i with a degree equal to one, calculate the Euclidean distance d between their coordinates and the source point S i , and compare it with 0.5 until all sink points O i with a degree equal to one are traversed.
[0087] Step S6047: Determine the pipe segment topology detection data based on the pipe segment direction analysis result, reverse pipe segment, and break point.
[0088] Step S605: Classify and identify the reverse slope pipe segments in the current drainage pipe network directed graph to obtain the reverse slope pipe segment detection data. For details, please refer to Figure 3 Step S305 in the embodiments shown herein, which will not be elaborated herein.
[0089] Step S606, determine the detection result of the drainage pipe network data based on the topological detection data and the reverse slope pipe segment detection data. For details, please refer to Figure 3 Step S306 of the embodiment shown, which will not be elaborated here.
[0090] The method for detecting drainage pipe network data based on graph theory provided in this embodiment identifies missing nodes and isolated pipe segments in the directed graph of the drainage pipe network by using the known pipe segment node data after complementing the missing nodes of the pipe segments, reduces the influence of abnormal data in the target drainage pipe network on the detection of drainage pipe network data, and improves the accuracy of the detection of drainage pipe network data; by identifying the source point and sink point of the updated directed graph and analyzing the directions of the pipe segments connected to the source point and sink point, the topological detection data of the pipe segments is accurately obtained, greatly improving the accuracy and efficiency of the quality inspection of the pipe network data.
[0091] In this embodiment, a method for detecting drainage pipe network data based on graph theory is provided, which can be used in the above-mentioned electronic device, Figure 9 is a flowchart of the method for detecting drainage pipe network data based on graph theory according to an embodiment of the present invention. As Figure 9 shown, this process includes the following steps: Step S901, obtain the pipe segment connection information of the target drainage pipe network, and construct a directed graph of the target drainage pipe network based on the pipe segment connection information. For details, please refer to Figure 5 Step S501 of the embodiment shown, which will not be elaborated here.
[0092] Step S902, obtain the known pipe segment node data of the target drainage pipe network, and use the directed graph of the target drainage pipe network to complement the missing nodes of the pipe segments in the known pipe segment node data. For details, please refer to Figure 5 Step S502 of the embodiment shown, which will not be elaborated here.
[0093] Step S903, construct a directed graph of the current drainage pipe network by using the known pipe segment node data after complementing the missing nodes of the pipe segments. For details, please refer to Figure 5 Step S503 of the embodiment shown, which will not be elaborated here.
[0094] Step S904, perform pipe segment topology detection on the directed graph of the current drainage pipe network to obtain pipe segment topology detection data. For details, please refer to Figure 5 Step S504 of the embodiment shown, which will not be elaborated here.
[0095] Step S905, perform classification and identification of reverse slope pipe segments on the directed graph of the current drainage pipe network to obtain reverse slope pipe segment detection data.
[0096] Specifically, the above-mentioned step S905 includes: Step S9051: Traverse the end pipe bottom elevation and start pipe bottom elevation of the pipe segment nodes in the current drainage pipe network directed graph. The pipe segments with the end pipe bottom elevation greater than the start pipe bottom elevation are regarded as reverse slope pipe segments, and the other pipe segments are regarded as non-reverse slope pipe segments.
[0097] Specifically, traverse the end pipe bottom elevation H of the pipe segment nodes in the current drainage pipe network directed graph b and the start pipe bottom elevation H s . If the end pipe bottom elevation H b is greater than the start pipe bottom elevation H s , then this pipe segment is a reverse slope pipe segment P inv , marked as reverse slope, and the other pipe segments are marked as non-reverse slope pipe segments P normal .
[0098] Step S9052: Construct a reverse slope directed graph based on the reverse slope pipe segments, and convert the reverse slope directed graph into a reverse slope undirected graph.
[0099] Step S9053: Partition the reverse slope undirected graph to obtain multiple subgraphs. If the number of edges of a subgraph is greater than one, then mark the reverse slope pipe segments as continuous reverse slope.
[0100] Specifically, as Figure 10 shown, partition the reverse slope undirected graph to obtain multiple subgraphs, and screen according to the number of edges of the subgraphs. The reverse slope pipe segments corresponding to the subgraphs with the number of edges greater than 1 are continuous reverse slope and need to be verified emphatically, and are marked as continuous reverse slope; for example, Figure 10 in subgraph A, there are reverse slope pipe segment b and reverse slope pipe segment c. Therefore, the number of edges in subgraph A is greater than 1, and it is necessary to verify reverse slope pipe segment b and reverse slope pipe segment c and mark them as continuous reverse slope.
[0101] Step S9054: Obtain the end points corresponding to the non-reverse slope pipe segments, as well as the start pipe bottom elevation of the downstream pipe segments connected to the end points and the end pipe bottom elevation of the upstream pipe segments.
[0102] Step S9055: Compare the start pipe bottom elevation of the downstream pipe segments with the end pipe bottom elevation of the upstream pipe segments. If the end pipe bottom elevation of the upstream pipe segments is less than the start pipe bottom elevation of the downstream pipe segments, then mark the non-reverse slope pipe segments as point reverse slope.
[0103] Specifically, as Figure 11 shown, in the non-reverse slope pipe segment P normal , first find all the node sets P e i that are end points, calculate the minimum value h e i of the start pipe bottom elevations of all the downstream pipe segments of the end point P n min , and compare the end pipe bottom elevation of the upstream pipe segment with h nmin Compare. If the elevation of the end pipe bottom of the upstream pipe section is less than h n min , then there is a situation where the elevation of the downstream pipe section is higher than that of this non-inverse slope pipe section, which is recorded as a point inverse slope. For example, assume Figure 11 In the non-inverse slope pipe section f, the upstream pipe section is e, and the minimum value h of the starting pipe bottom elevations of all downstream pipe sections corresponding to the non-inverse slope pipe section f n min , and the elevation of the end pipe bottom of the upstream pipe section e is less than h n min , then mark the non-inverse slope pipe section f as a point inverse slope.
[0104] Step S9056, determine the inverse slope pipe section detection data based on the continuous inverse slope and the point inverse slope.
[0105] Step S906, determine the detection result of the drainage network data based on the topology detection data and the inverse slope pipe section detection data. For details, please refer to Figure 5 Step S506 of the embodiment shown, which will not be elaborated here.
[0106] The drainage network data detection method based on graph theory provided in this embodiment identifies inverse slope pipe sections and non-inverse slope pipe sections through the elevation of the end pipe bottom and the starting pipe bottom of pipe section nodes, generates an inverse slope directed graph based on the inverse slope pipe sections, calculates the inverse slope subgraph, and marks the inverse slope pipe sections with side lengths greater than 1 in the inverse slope subgraph as continuous inverse slopes; for non-inverse slope pipe sections, compare the starting pipe bottom elevation of the downstream pipe section and the end pipe bottom elevation of the upstream pipe section, and mark the non-inverse slope pipe section with the end pipe bottom elevation of the upstream pipe section less than the starting pipe bottom elevation of the downstream pipe section as a point inverse slope, effectively identifying the point inverse slope and continuous inverse slope in the target drainage network, providing a basis for the detection of the target drainage network data, and effectively improving the accuracy and efficiency of the quality inspection of the target drainage network data.
[0107] The following uses a specific embodiment to illustrate the specific steps of a drainage network data detection method based on graph theory.
[0108] Embodiment 1: 1) Obtain the pipe section connection information of the target drainage network, and construct a directed graph of the target drainage network based on the pipe section connection information.
[0109] 2) Use the directed graph of the target drainage network to complete the missing nodes of the known pipe section nodes: Through the known pipe section node data in the directed graph of the target drainage network and combined with the pipe section topology connection information, gradually find the spatial position coordinates of the missing nodes to obtain the known pipe section node data after completing the missing nodes of the pipe sections.
[0110] 3) For the known pipe segment node data after completing the missing nodes of the pipe segments, if the rainwater node and the sewage node overlap, it is determined that the pipe segment node is a mixed connection node, and the pipe segments that cannot be connected through the pipe segments composed of known nodes are regarded as isolated pipe segments.
[0111] 4) Based on the known pipe segment node data after removing the mixed connection nodes and isolated pipe segments, construct the current drainage pipe network directed graph.
[0112] 5) Find the source point and the sink point of the current drainage pipe network directed graph, calculate the degrees of the source point and the sink point, screen the source points and sink points with degrees greater than 1, calculate the out-degree of the starting point of the sink point with a degree greater than 1. Among them, there is a reverse in the pipe segments around the starting point with an out-degree greater than 1. For the sink point with a degree equal to 1, calculate its Euclidean distance from the source point. If the Euclidean distance is less than 0.5 m, the sink point with a degree equal to 1 is a break point, that is, the pipe segment is wrongly disconnected here, and determine the pipe segment topology detection data according to the above judgment results.
[0113] 6) Inverse slope classification and identification: Use the end pipe bottom elevation, the starting pipe bottom elevation and the flow direction of the pipe segment nodes to screen the inverse slope pipe segments, generate an inverse slope directed graph through the screened inverse slope pipe segments, calculate the subgraph, and the inverse slope pipe segments with a side length of the subgraph exceeding 1 are continuous inverse slopes and should be inspected key points. For non-inverse slope pipe segments, if the end pipe bottom elevation of the upstream pipe segment is less than the starting pipe bottom elevation of the downstream pipe segment, then mark the non-inverse slope pipe segment as a point inverse slope, and determine the inverse slope pipe segment detection data according to the identification situation of the continuous inverse slope and the point inverse slope.
[0114] 7) Determine the drainage pipe network data detection result based on the topology detection data and the inverse slope pipe segment detection data.
[0115] The beneficial effects of the above-mentioned Embodiment 1 include: 1) Clearly define the data format requirements of the pipe segments, and point out what types of data are required for pipe segment measurement and the specific forms of the data to carry out the quality inspection of the target drainage pipe network.
[0116] 2) Construct the target drainage pipe network directed graph through the pipe segment connection information. The target drainage pipe network directed graph plays a "navigation" role in the quality inspection of pipe segment information, which can help the program identify the topological connection information of the pipe segments. Without having to traverse the entire directed graph, some key parameters of the target drainage pipe network directed graph, such as degree, out-degree, etc., can be used to effectively screen abnormal nodes during the pipe network quality inspection process.
[0117] In this embodiment, a drainage pipe network data detection device based on graph theory is also provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0118] This embodiment provides a drainage pipe network data detection device based on graph theory, as Figure 12 shown, including: The first construction module 1201 is used to obtain the pipe section connection information of the target drainage pipe network and construct a directed graph of the target drainage pipe network based on the pipe section connection information.
[0119] The complement module 1202 is used to obtain the known pipe section node data of the target drainage pipe network and use the directed graph of the target drainage pipe network to complete the missing nodes of the pipe sections for the known pipe section node data.
[0120] The second construction module 1203 is used to construct a directed graph of the current drainage pipe network using the known pipe section node data after the missing nodes of the pipe sections are completed.
[0121] The detection module 1204 is used to perform pipe section topology detection on the directed graph of the current drainage pipe network to obtain pipe section topology detection data.
[0122] The recognition module 1205 is used to classify and recognize the reverse slope pipe sections of the directed graph of the current drainage pipe network to obtain reverse slope pipe section detection data.
[0123] The determination module 1206 is used to determine the drainage pipe network data detection result based on the topology detection data and the reverse slope pipe section detection data.
[0124] In some alternative embodiments, the complement module 1202 includes: The first determination unit is used to determine the directed graph pipe section node data based on the directed graph of the target drainage pipe network, and determine the non-set based on the directed graph pipe section node data and the known pipe section node data.
[0125] The complement unit is used to complete the node elevation data of the missing nodes of the non-concentrated pipe sections and the node elevation data of the known nodes in the known pipe section node data by using the starting pipe bottom elevation and the ending pipe bottom elevation of the pipe section nodes in the directed graph of the target drainage pipe network.
[0126] The traversal unit is used to sequentially traverse and complete the spatial position coordinates of the missing nodes of the pipe sections based on the known pipe section node data and the pipe network topology connection relationship in the directed graph of the target drainage pipe network.
[0127] The first update unit is used to traverse the other missing nodes of the non-concentrated pipe sections. After the traversal of the missing nodes of the pipe sections is completed, the known pipe section node data is updated based on the missing nodes of the pipe sections after the node elevation data and the spatial position coordinates are completed.
[0128] The second update unit is used to update the non-set based on the updated known pipe section node data and the directed graph pipe section node data.
[0129] An output unit, configured to output the known pipe segment node data after supplementing the missing nodes of the pipe segment if the number of missing nodes of the updated non-central pipe segment meets a preset condition.
[0130] In some alternative embodiments, the traversal unit includes: A positioning subunit, configured to locate the pipe segment corresponding to the missing node of the pipe segment based on the missing node of the pipe segment and using the pipe network topology connection relationship in the target drainage pipe network directed graph.
[0131] A judgment subunit, configured to judge whether there is a known node at the vertex of the pipe segment corresponding to the missing node of the pipe segment. If one side vertex of the pipe segment is a known node, the coordinate of the other side vertex of the pipe segment is used as the spatial position coordinate of the missing node of the pipe segment.
[0132] In some alternative embodiments, the second construction module 1203 includes: A mixed connection identification unit, configured to perform mixed connection identification based on the known pipe segment node data after supplementing the missing nodes of the pipe segment to determine mixed connection nodes; wherein, the mixed connection nodes are rainwater pipe segment nodes and sewage pipe segment nodes with repeated positions.
[0133] A first identification unit, configured to identify isolated pipe segments based on the known pipe segment node data after supplementing the missing nodes of the pipe segment; wherein, the isolated pipe segments are pipe segments that cannot be connected through pipe segments composed of known nodes, or pipe segments with an independent concentrated edge number less than three.
[0134] A construction unit, configured to construct the current drainage pipe network directed graph based on the known pipe segment node data after removing the mixed connection nodes and isolated pipe segments.
[0135] In some alternative embodiments, the detection module 1204 includes: A second identification unit, configured to identify the source point and the sink point in the current drainage pipe network directed graph, and obtain the degree of the source point and the degree of the sink point.
[0136] An analysis unit, configured to screen out source points with a degree greater than one, and perform pipe segment direction analysis on the pipe segments connected to the source points with a degree greater than one one by one to obtain a pipe segment direction analysis result.
[0137] A second determination unit, configured to screen out sink points with a degree greater than one, use the topological structure of the current drainage pipe network directed graph to determine the starting point corresponding to the sink point with a degree greater than one, and obtain the out-degree of the starting point.
[0138] A judgment unit, if the out-degree of the starting point is greater than one, the pipe segment between the starting point and the sink point is a reverse pipe segment.
[0139] A first comparison unit, configured to screen out sink points with a degree equal to one, calculate the distance between the sink point with a degree equal to one and the source point, and compare the distance with a preset threshold.
[0140] As a unit, if the distance is less than a preset threshold, a sink point with a degree equal to one is used as a break point.
[0141] A third determination unit is configured to determine pipe network topology detection data based on the pipe segment direction analysis result, the reverse pipe segment, and the break point.
[0142] In some alternative embodiments, the recognition module 1205 includes: A conversion unit is configured to construct an inverse slope directed graph based on the inverse slope pipe segment and convert the inverse slope directed graph into an inverse slope undirected graph.
[0143] A partitioning unit is configured to partition the inverse slope undirected graph to obtain a plurality of subgraphs. If the number of edges of a subgraph is greater than one, the inverse slope pipe segment is marked as a continuous inverse slope.
[0144] An acquisition unit acquires the end point corresponding to the non-inverse slope pipe segment, and the starting pipe bottom elevation of the downstream pipe segment connected to the end point and the ending pipe bottom elevation of the upstream pipe segment.
[0145] A second comparison unit is configured to compare the starting pipe bottom elevation of the downstream pipe segment and the ending pipe bottom elevation of the upstream pipe segment. If the ending pipe bottom elevation of the upstream pipe segment is less than the starting pipe bottom elevation of the downstream pipe segment, the non-inverse slope pipe segment is marked as a point inverse slope.
[0146] A fourth determination unit is configured to determine inverse slope pipe segment detection data based on the continuous inverse slope and the point inverse slope.
[0147] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding embodiments above, and will not be elaborated here.
[0148] The graph theory-based drainage pipe network data detection device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0149] The embodiment of the present invention further provides a computer device having the above-mentioned Figure 12 graph theory-based drainage pipe network data detection device shown.
[0150] Please refer to Figure 13 , Figure 13 which is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention. As Figure 13As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (such as an array of servers, a set of blade servers, or a multi-processor system). Figure 13 Taking one processor 10 as an example in
[0151] The processor 10 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above hardware chip can be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above programmable logic device can be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.
[0152] Among them, the memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiments.
[0153] The memory 20 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 20 can include a high-speed random access memory and can also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 can optionally include a memory remotely set relative to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0154] The memory 20 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 20 can also include a combination of the above types of memories.
[0155] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 can be connected through a bus or other means.Figure 13 Take the bus connection as an example.
[0156] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED), and a haptic feedback device (e.g., a vibration motor), etc. The above display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.
[0157] The embodiments of the present invention also provide a computer-readable storage medium. The methods according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the methods described herein can be stored as such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, the processor, or the hardware, the methods shown in the above embodiments are implemented.
[0158] A part of the present invention can be applied as a computer program product, such as computer program instructions. When executed by a computer, through the operation of the computer, the methods and / or technical solutions according to the present invention can be invoked or provided. Those skilled in the art should be able to understand that the forms of existence of computer program instructions in a computer-readable medium include but are not limited to source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include but are not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0159] Although embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for detecting drainage pipe network data based on graph theory, characterized in that The method includes: Obtaining the pipe section connection information of the target drainage pipe network, and constructing a directed graph of the target drainage pipe network based on the pipe section connection information; Obtaining the known pipe section node data of the target drainage pipe network, and using the directed graph of the target drainage pipe network to complete the missing nodes of the pipe sections for the known pipe section node data; Constructing a directed graph of the current drainage pipe network by using the known pipe section node data after completing the missing nodes of the pipe sections; Performing pipe section topology detection on the directed graph of the current drainage pipe network to obtain pipe section topology detection data; Performing reverse slope pipe section classification and identification on the directed graph of the current drainage pipe network to obtain reverse slope pipe section detection data; Determining the drainage pipe network data detection result based on the topology detection data and the reverse slope pipe section detection data.
2. The method according to claim 1, wherein The completing the missing nodes of the pipe sections for the known pipe section node data includes: Determining the directed graph pipe section node data based on the directed graph of the target drainage pipe network, and determining the non-set based on the directed graph pipe section node data and the known pipe section node data; Using the starting pipe bottom elevation and the ending pipe bottom elevation of the pipe section nodes in the directed graph of the target drainage pipe network to complete the node elevation data of the missing nodes of the pipe sections in the non-set, and the node elevation data of the known nodes in the known pipe section node data; Based on the known pipe section node data and the pipe network topology connection relationship in the directed graph of the target drainage pipe network, traversing layer by layer to complete the spatial position coordinates of the missing nodes of the pipe sections; Traversing the other missing nodes of the pipe sections in the non-set, and after the traversal of the missing nodes of the pipe sections is completed, updating the known pipe section node data based on the missing nodes of the pipe sections with the completed node elevation data and spatial position coordinates; Updating the non-set based on the updated known pipe section node data and the directed graph pipe section node data; If the number of the missing nodes of the pipe sections in the updated non-set meets the preset condition, outputting the known pipe section node data after completing the missing nodes of the pipe sections.
3. The method according to claim 2, wherein The traversing layer by layer to complete the spatial position coordinates of the missing nodes of the pipe sections based on the known pipe section node data and the pipe network topology connection relationship in the directed graph of the target drainage pipe network includes: Based on the missing nodes of the pipe sections, using the pipe network topology connection relationship in the directed graph of the target drainage pipe network to locate the pipe section corresponding to the missing nodes of the pipe sections; Judging whether there is a known node at the vertex of the pipe section corresponding to the missing node of the pipe section. If one side vertex of the pipe section is a known node, taking the coordinates of the other side vertex of the pipe section as the spatial position coordinates of the missing node of the pipe section.
4. The method according to claim 1, characterized in that The constructing a directed graph of the current drainage pipe network by using the known pipe section node data after completing the missing nodes of the pipe sections includes: Performing mixed connection identification based on the known pipe section node data after completing the missing nodes of the pipe sections to determine the mixed connection nodes; wherein, the mixed connection nodes are the rainwater pipe section nodes and the sewage pipe section nodes with repeated positions; Identifying the isolated pipe sections based on the known pipe section node data after completing the missing nodes of the pipe sections; wherein, the isolated pipe sections are the pipe sections that cannot be connected through the pipe sections composed of known nodes, or the pipe sections with the number of independent concentrated edges less than three. Construct the current drainage pipe network directed graph based on the known pipe segment node data after removing the mixed connection nodes and the isolated pipe segments.
5. The method according to claim 2, wherein Perform pipe segment topology detection on the current drainage pipe network directed graph to obtain pipe segment topology detection data, including: Identify the source point and the sink point in the current drainage pipe network directed graph, and obtain the degree of the source point and the degree of the sink point; Filter the source points with a degree greater than one, and analyze the pipe segment directions of the pipe segments connected to the source points with a degree greater than one one by one to obtain the pipe segment direction analysis results; Filter the sink points with a degree greater than one, use the topological structure of the current drainage pipe network directed graph to determine the starting point corresponding to the sink point with a degree greater than one, and obtain the out-degree of the starting point; If the out-degree of the starting point is greater than one, the pipe segment between the starting point and the sink point is a reverse pipe segment; Filter the sink points with a degree equal to one, calculate the distance between the sink point with a degree equal to one and the source point, and compare the distance with a preset threshold; If the distance is less than the preset threshold, use the sink point with a degree equal to one as a break point; Determine the pipe segment topology detection data based on the pipe segment direction analysis results, the reverse pipe segments, and the break points.
6. The method according to claim 1, characterized in that Perform reverse slope pipe segment classification and identification on the current drainage pipe network directed graph to obtain reverse slope pipe segment detection data, including: Traverse the end pipe bottom elevation and the start pipe bottom elevation of the pipe segment nodes in the current drainage pipe network directed graph, use the pipe segments with the end pipe bottom elevation greater than the start pipe bottom elevation as reverse slope pipe segments, and use other pipe segments as non-reverse slope pipe segments; Construct a reverse slope directed graph based on the reverse slope pipe segments, and convert the reverse slope directed graph into a reverse slope undirected graph; Partition the reverse slope undirected graph to obtain multiple subgraphs. If the number of edges of the subgraph is greater than one, mark the reverse slope pipe segments as continuous reverse slopes; Obtain the end points corresponding to the non-reverse slope pipe segments, as well as the start pipe bottom elevation of the downstream pipe segments connected to the end points and the end pipe bottom elevation of the upstream pipe segments; Compare the start pipe bottom elevation of the downstream pipe segments with the end pipe bottom elevation of the upstream pipe segments. If the end pipe bottom elevation of the upstream pipe segments is less than the start pipe bottom elevation of the downstream pipe segments, mark the non-reverse slope pipe segments as point reverse slopes; Determine the reverse slope pipe segment detection data based on the continuous reverse slopes and the point reverse slopes.
7. A drainage pipe network data detection device based on graph theory, characterized in that The device includes: A first construction module, configured to obtain the pipe segment connection information of the target drainage pipe network, and construct a target drainage pipe network directed graph based on the pipe segment connection information; A complement module, configured to obtain the known pipe segment node data of the target drainage pipe network, and use the target drainage pipe network directed graph to complement the missing pipe segment nodes in the known pipe segment node data; A second construction module, configured to construct the current drainage pipe network directed graph by using the known pipe segment node data after complementing the missing pipe segment nodes; A detection module, configured to perform pipe segment topology detection on the current drainage pipe network directed graph to obtain pipe segment topology detection data; An identification module, configured to perform reverse slope pipe segment classification and identification on the current drainage pipe network directed graph to obtain reverse slope pipe segment detection data; A determination module, configured to determine the drainage pipe network data detection result based on the topology detection data and the reverse slope pipe segment detection data.
8. A computer device, characterized in that, Includes: A memory and a processor, which are communicatively connected to each other. Computer instructions are stored in the memory, and the processor executes the computer instructions to execute the graph theory-based drainage pipe network data detection method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause a computer to execute the graph theory-based drainage pipe network data detection method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, It includes computer instructions, and the computer instructions are used to cause a computer to execute the graph theory-based drainage pipe network data detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Model analysis method for checking topological structural relation of drain network and medium
CN107038287A
Method for determining oil search path in crude oil pipe network based on graph theory
CN113255090A
Three-dimensional pipe network leakage flow direction analysis method using directed graph
CN113673066A
Water supply network pollution tracing and positioning method and device based on graph theory
CN120087777A
Method and apparatus for correcting topological data of urban drainage system
WO2024221808A1
Cited By
Method, device and system for judging mixed connection of rain and sewage in drainage pipe network
CN122286104A