Method and equipment for establishing upstream and downstream relationship of heat supply pipeline

By clustering and comparing the GIS data of the heating pipeline, establishing an undirected graph and determining the upstream and downstream relationships, the problem of inaccurate judgment of water flow direction in the heating pipeline is solved, and efficient upstream and downstream relationship determination and heating system management are achieved.

CN119621866APending Publication Date: 2025-03-14SHANDONG SYNTHESIS ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411791236.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The automatic determination of water flow direction in the existing heating pipeline is inaccurate, and it is difficult to use the direction in the GIS data to determine the upstream and downstream relationship of the pipeline.

Method used

By performing point number clustering processing and comparison judgment on the GIS data of the heating pipeline, a dictionary mapping of each point number to a representative point number is generated, and the heating pipeline corresponding to different representative point numbers is added to the undirected graph. Through the classification and division of the point number set and the starting point difference calculation, the upstream and downstream relationship information of the heating pipeline is determined.

Benefits of technology

It realizes the rapid determination of the upstream and downstream relationships of the heating pipeline, improves work efficiency, and the generated directed path set can be displayed visually on the map. The clear upstream and downstream relationship information helps better manage and maintain the heating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621866A_ABST
    Figure CN119621866A_ABST
Patent Text Reader

Abstract

The invention discloses a method and equipment for establishing an upstream and downstream relationship of a heat supply pipeline, belongs to the technical field of knowledge graph creation in the heat supply field, and is used for solving the technical problems that the automatic judgment of a water flow direction in an existing heat supply pipeline is inaccurate, and the upstream and downstream relationship of the pipeline is difficult to judge by utilizing a direction in GIS data. The method comprises the following steps: carrying out point number clustering processing on point number information and latitude and longitude coordinate information at two ends in each pipeline, and generating dictionary mapping from each point number to a representative point number; comparing and judging the representative point number of each pipeline, and adding the heat supply pipelines corresponding to different representative point numbers into a preset undirected graph; starting point difference calculation between point number information is carried out on the multiple point sets, and a non-connected initial point set is generated; point number communication judgment processing related to the list to be connected is carried out on the non-communication initial point set, and upstream and downstream relation information of the heat supply pipeline is determined; and determining a directed path set of the heat supply pipeline based on the upstream and downstream relation information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of knowledge graph creation in the field of heating, and in particular to a method and device for establishing upstream and downstream relationships of a heating pipeline. Background Art

[0002] In the field of heating, the primary network refers to the pipe network system from the heat source plant to each heat exchange station, including water supply and return pipes. The secondary network refers to the pipe network system from the heat exchange station to the end user, also including water supply and return pipes. The primary network and the secondary network exchange heat in the heat exchange station, but the water flow inside the primary network and the secondary network is not connected, and they are independent pipe network systems.

[0003] In order to realize real-time monitoring and intelligent fault diagnosis of the operation status of the primary and secondary network pipe networks, it is first necessary to model the data of the pipelines of the primary and secondary networks. A variety of methods can be used to construct pipeline data, such as manual construction method: that is, manually marking the starting point, end point, location and other information of each pipeline. The pipeline data generated by the manual marking method is of high quality, but the time and resource costs are huge, which is not realistic for larger pipe network systems. The pipe network GIS data is generally generated by professional surveying and mapping agencies after field measurements of the pipelines of the primary and secondary networks, and has high accuracy. Processing GIS data to extract the attributes of each pipeline entity in the primary and secondary networks, as well as the upstream and downstream relationships between pipelines, is a more feasible pipeline data modeling method. In the patent of this invention, it is assumed that the pipe network GIS data is composed of pipeline data, and each pipeline data contains at least 4 fields: starting point number, end point number, latitude and longitude coordinates of the starting point, and latitude and longitude coordinates of the end point. This conforms to the general situation of pipe network GIS data.

[0004] Previous methods generally assume that GIS data is completely accurate, that is, the starting point and end point of the pipeline correspond to the direction of water flow: water flows from the starting point of the pipeline to the end point of the pipeline. If this assumption is followed, the flow direction of water supply and return water can be completely determined from GIS data, which will greatly simplify the pipeline data modeling process. However, in the actual GIS data construction process, the starting point and end point of each pipeline do not necessarily correspond to the actual flow direction of water. The personnel of the surveying and mapping agency do not understand the background knowledge of heating. When they measure the heating pipeline in a certain area, they only start from a certain point and measure along the water supply / return pipeline. They do not know the flow direction of water inside the pipeline, but only mark the starting point and end point of the pipeline from near to far. On the other hand, surveying and mapping is measured step by step according to the area, so there is no necessary relationship between the starting points and end points of the pipelines marked in different areas. This results in a completely unspecified relationship between the starting point and end point of the pipelines in the entire pipeline network and the flow direction, which can be considered as a random relationship. This greatly increases the difficulty of pipeline data modeling, that is, it is impossible to use the directions (starting point, end point) in the GIS data to determine the upstream and downstream relationships of the pipeline. Summary of the invention

[0005] The embodiments of the present application provide a method and device for establishing upstream and downstream relationships of a heating pipeline, which are used to solve the following technical problems: the automatic determination of water flow direction in existing heating pipelines is inaccurate, and it is difficult to use the direction in GIS data to determine the upstream and downstream relationships of the pipeline.

[0006] The present application embodiment adopts the following technical solutions:

[0007] On the one hand, the embodiment of the present application provides a method for establishing an upstream and downstream relationship of a heating pipeline, comprising: performing point number clustering processing on the point number information and latitude and longitude coordinate information at both ends of each pipeline according to the GIS data of the heating pipeline, and generating a dictionary mapping of each point number to a representative point number; comparing and judging the representative point number of each pipeline through the dictionary mapping, and adding the heating pipelines corresponding to the different representative point numbers to a preset undirected graph; classifying and dividing the point number set of the undirected graph to obtain multiple point sets; wherein the multiple point sets include: an initial point set , terminal point set, golden path set, intermediate path set; perform starting point difference calculation between point number information of the multiple point sets to generate a disconnected initial point set; perform point number connectivity judgment processing on the disconnected initial point set related to the list to be connected to determine the upstream and downstream relationship information of the heating pipeline; based on the upstream and downstream relationship information, determine the directed path set of the heating pipeline, so that each directed path in the directed path set can complete the map visualization display; wherein, the directed path set is a non-overlapping heating pipeline connection path in the water flow direction.

[0008] The embodiment of the present application can quickly determine the upstream and downstream relationship of the heating pipeline through automated point number clustering and comparative judgment, thereby improving work efficiency. The generated directed path set can be used for map visualization, which facilitates intuitive understanding and analysis of the layout and flow direction of the heating pipeline. Ensure that each path in the directed path set does not overlap to avoid confusion and errors. Clear upstream and downstream relationship information helps to better manage and maintain the heating system. It provides an important basis for the planning and optimization of the heating system. Resources can be reasonably allocated according to the upstream and downstream relationship to improve the heating efficiency. At the same time, the pipeline direction defined in the GIS data is not used, but the water flow direction is determined by the algorithm, which greatly reduces the requirements for GIS data and significantly enhances the practicality of the application scenario of using GIS data to establish the upstream and downstream relationship of the heating pipeline. The accuracy of the automatic upstream and downstream relationship determination algorithm in this application is very high, and only a small amount of manual annotation is required, saving a lot of manpower.

[0009] In a feasible implementation manner, based on the GIS data of the heating pipeline, the point number information and the longitude and latitude coordinate information at both ends of each pipeline are clustered to generate a dictionary mapping from each point number to a representative point number, specifically including: extracting the point number information and the longitude and latitude coordinate information of each heating pipeline in the GIS data, and determining the point number information as a key value and the longitude and latitude coordinate information as a value; generating a storage dictionary based on the key value and the value value; and storing the point number information and the longitude and latitude coordinate information in a file through the storage dictionary; reading an initialization starting point set of a single point number starting point in the current heating area; querying the storage dictionary based on the two point number information of each pipeline in the initialization point set to obtain the same point number information at the same longitude and latitude coordinate information; clustering the same point number information, and selecting a representative point number based on each clustering cluster; mapping each point number information with the representative point number to obtain the dictionary mapping.

[0010] In a feasible implementation manner, the representative point number of each pipeline is compared and judged through the dictionary mapping, and the heating pipelines corresponding to the different representative point numbers are added to a preset undirected graph, which specifically includes: traversing the two current point number information of each heating pipeline in the GIS data of the current heating area; querying and processing the two current point number information through the dictionary mapping to obtain two current representative point numbers; comparing and judging the two current representative point numbers with the two current point number information to obtain a point number comparison result; if the point number comparison result is different, the current heating pipeline represented by the two current representative point numbers is added to the undirected graph; wherein the undirected graph is created using the networkx library; the undirected edges in the undirected graph include the current heating pipelines connected by the two current representative point numbers, and the undirected edges do not specify the water flow direction in the current heating pipelines.

[0011] In a feasible implementation, the undirected graph is classified and divided into point number sets to obtain multiple point sets, specifically including: extracting the initial point set of the undirected graph in the current heating area; calculating the point number information of all degree 1 in the undirected graph to obtain the initial set of start and end points; and using the initial point set, the start and end point set is deleted to obtain the terminal point set; based on the point number information in the initial point set and the terminal point set, a golden path set is determined; and the path set corresponding to the pre-acquired directed edges is merged into the golden path; wherein the directed edge is a list containing all manually specified two point number information with worker pipeline connections, and the directed edge specifies the direction of water flow; according to the golden path set, other path sets in the undirected graph are statistically processed to obtain the intermediate path set.

[0012] In a feasible implementation manner, starting point difference calculations are performed on the multiple point sets between point number information to generate a disconnected initial point set, specifically including: calculating a simple path set between the initial point set and the terminal point set; performing path conflict judgment between the simple path set and the golden path set through a preset golden path verification function; if the simple path set and the golden path set are non-conflicting sets, merging the simple path set into the golden path set to obtain a merged golden path set; and synchronously updating the intermediate path set and the point pair set; wherein the point pair set records a number of point number information pairs that can be directed connected between the initial point set and the terminal point set; calculating the difference between the initial point set and the point pair set about the point number starting point to obtain a number of disconnected initial points; wherein the disconnected initial point is the point number information in the initial point set that cannot be directed connected with the terminal point set; and generating the disconnected initial point set based on the number of the disconnected initial points.

[0013] In a feasible implementation, before the disconnected initial point set is subjected to a point number connectivity judgment process related to the list to be connected and the upstream and downstream relationship information of the heating pipeline is determined, the method further includes: traversing each point number information in the disconnected initial point set, and performing a shortest distance calculation between each point number information and the point number information in the terminal point set to obtain the shortest path; performing a legality judgment on the shortest path through a golden path verification function to determine a directed path; wherein the directed path is the legal shortest path; based on the directed path, performing corresponding update processing on the preset list to be connected and the golden path set; and adding the updated list to be connected and the golden path set to the undirected graph through the add_edge technology; wherein the list to be connected is used to store directed connections about the heating pipeline.

[0014] In a feasible implementation, the disconnected initial point set is subjected to a point number connectivity judgment process related to the list to be connected, and the upstream and downstream relationship information of the heating pipeline is determined, specifically including: if the list to be connected is not an empty list, then according to the list to be connected and the point pair set, the initial point set and the terminal point set are updated to obtain the upstream and downstream relationship information of the heating pipeline; if the list to be connected is an empty list, then the point pair set is judged whether it is an empty set, and if the point pair set is not an empty set, then the initial point set and the terminal point set are updated. An update process is performed to obtain the upstream and downstream relationship information of the heating pipeline; if the point pair set is an empty set, it means that the upstream and downstream relationship information no longer exists in the heating pipeline; if the list to be connected is an empty list, it is also necessary to perform a connection judgment on the point number information in the intermediate path set and the point number information in the terminal point set; if the intermediate path set is an empty set, it means that the upstream and downstream relationship information no longer exists in the heating pipeline; if the intermediate path set is not an empty set, a judgment is performed on whether the newly created new connection set is an empty set to determine the upstream and downstream relationship information of the heating pipeline.

[0015] In a feasible implementation, if the intermediate path set is not an empty set, the newly created new connection set is judged to be an empty set to determine the upstream and downstream relationship information of the heating pipeline, specifically including: initializing the new connection set; traversing each heating pipeline in the intermediate path set, and based on a first preset threshold, calculating the distance between the point number information in each heating pipeline and the point number information in the terminal point set, and screening out candidate connection point pairs; judging the legitimacy of the candidate connection point pairs through the golden path verification function; if the candidate If the candidate directed connection corresponding to the connection point pair is a legal connection path, the golden path set is updated and the updated golden path set is added to the undirected graph; and the candidate connection point pair is updated to the new connection set; if the new connection set is an empty set, it means that there is no upstream and downstream relationship information in the heating pipeline; if the new connection set is not an empty set, it means that the intermediate path set has updated the new directed connection, and according to the new connection set, the initial point set and the terminal point set are updated to obtain the upstream and downstream relationship information of the heating pipeline.

[0016] In a feasible implementation, based on the upstream and downstream relationship information, a directed path set of the heating pipeline is determined so that each directed path in the directed path set can be visualized on a map, specifically including: based on the obtained upstream and downstream relationship information, counting the point pair information in the golden path set to obtain the directed path information; performing non-overlapping path calculations on the directed path information through the preset collect_no_overlap_paths function to obtain the directed path set; performing manual maintenance on the directed path set; and visually displaying the directed path set on a map through a drawing library function.

[0017] On the other hand, an embodiment of the present application also provides a device for establishing upstream and downstream relationships of a heating pipeline, comprising: 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, so that the at least one processor can execute a method for establishing upstream and downstream relationships of a heating pipeline as described in any of the above embodiments.

[0018] The present application provides a method and device for establishing upstream and downstream relationships of a heating pipeline. Compared with the prior art, the embodiments of the present application have the following beneficial technical effects:

[0019] 1. Through automated point number clustering and comparative judgment, the upstream and downstream relationship of the heating pipeline can be quickly determined, thus improving work efficiency.

[0020] 2. The generated directed path set can be visualized on a map, making it easier to intuitively understand and analyze the layout and flow direction of the heating pipeline.

[0021] 3. Ensure that each path in the directed path set does not overlap, avoiding confusion and errors.

[0022] 4. Clear upstream and downstream relationship information helps to better manage and maintain the heating system.

[0023] 5. Resources can be reasonably allocated according to upstream and downstream relationships to improve heating efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0025] Figure 1A flow chart of a method for establishing upstream and downstream relationships of a heating pipeline provided in an embodiment of the present application;

[0026] Figure 2 A structural schematic diagram of an upstream and downstream relationship establishment device for a heating pipeline provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0028] It should be noted that since the GIS data formats of the primary network and the secondary network are basically the same, and the water supply pipeline and the return pipeline only differ in the pipeline type field, both contain the point numbers and longitude and latitude coordinates of the starting point and end point, the GIS data of the primary network water supply pipeline is taken as an example to illustrate the technical solution of this application.

[0029] The present application embodiment provides a method for establishing upstream and downstream relationships of a heating pipeline, such as Figure 1 As shown, the method for establishing the upstream and downstream relationship of the heating pipeline specifically includes steps S101-S106:

[0030] S101. Based on the GIS data of the heating pipeline, point number information and longitude and latitude coordinate information at both ends of each pipeline are clustered to generate a dictionary mapping from each point number to a representative point number.

[0031] Specifically, it is necessary to first extract the point number information and longitude and latitude coordinate information of each heating pipeline in the GIS data, and determine the point number information as the key value and the longitude and latitude coordinate information as the value.

[0032] Furthermore, a storage dictionary is generated based on the key value and the value value; and the point number information and the latitude and longitude coordinate information are stored in a file through the storage dictionary.

[0033] Furthermore, the initialization starting point set of the single point number starting point in the current heating area is read. According to the two point number information of each pipeline in the initialization point set, the storage dictionary is queried to obtain the same point number information at the same longitude and latitude coordinate information. The same point number information is clustered, and a representative point number is selected based on each cluster cluster. Each point number information is mapped with the representative point number to obtain a dictionary mapping.

[0034] In one embodiment, the present application utilizes the GIS data of the heating pipeline, which is in GDB format and can be opened using software such as ArcGIS and QGIS, and exported to jsonl format, which can save geometry information, which contains the longitude and latitude coordinates of the endpoints of the pipeline. Analysis of the exported jsonl data found that the point number information of the pipeline is not globally unique. After confirmation, it is known that the limiting condition of the heating company needs to be added, that is, the point number of the pipeline under the management of the same heating company is unique. Therefore, it is necessary to extract the pipeline data of each heating company one by one for processing. In order to facilitate the processing of subsequent algorithms, the longitude and latitude information of the point is saved separately as a json file, and the starting and ending point numbers of the pipeline are saved as edge information in a csv file.

[0035] That is, after processing the GIS data of the heating pipeline, extract the point number and longitude and latitude coordinate information of the two endpoints of each pipeline, generate a dictionary with the point number information as the key and the longitude and latitude coordinate information as the value, and save it as a json file. On the other hand, take the point numbers of the two endpoints of each pipeline as a row and store it as a csv file. This json file stores the point information (longitude and latitude coordinates), and the csv file stores the edge information (pipeline). Then read the json file containing the point longitude and latitude information, and the csv file containing the edge information; initialize the starting point set. For the Shanghe primary water supply network, the starting point is a single point number.

[0036] Next, the edge information is further processed: the two point numbers of each heating pipeline are read, the corresponding longitude and latitude coordinates are obtained after querying the dictionary, and the points with the same coordinates are collected, that is, the points are clustered according to the same coordinates. Then, for each cluster, a representative point number is selected, and a dictionary mapping (equal_point_map) from each point number to the representative point number is generated.

[0037] S102. Compare and judge the representative point number of each pipeline through dictionary mapping, and add the heating pipelines corresponding to different representative point numbers into a preset undirected graph.

[0038] Specifically, it is also necessary to traverse the two current point number information of each heating pipeline in the GIS data of the current heating area, and query and process the two current point number information through dictionary mapping to obtain two current representative point numbers.

[0039] Furthermore, the two current representative point numbers are compared with the two current point number information to obtain the point number comparison result. If the point number comparison result is different, the current heating pipeline represented by the two current representative point numbers is added to the undirected graph. The undirected graph is created using the networkx library. The undirected edges in the undirected graph include the current heating pipelines connected by the two current representative point numbers, and the undirected edges do not specify the flow direction of water in the current heating pipeline.

[0040] In one embodiment, an undirected graph is created using the networkx library, and the two current point number information of each heating pipeline is traversed. After being mapped into two representative point numbers according to equal_point_map, if they are different, the two representative point numbers are added to the undirected graph (add_edge) as the current heating pipeline.

[0041] Among them, check the two patches obtained by manual annotation: undirected edge patch and directed edge patch. The undirected edge patch contains a list of all manually specified two point numbers with pipeline connections, but does not specify the flow direction of the water. The flow direction needs to be automatically inferred by the algorithm. The directed edge patch contains a list of all manually specified two point numbers with pipeline connections, and specifies the flow direction of the water. Check each heating pipeline in the undirected edge patch and the directed edge patch, and map them into two representative point numbers according to equal_point_map. If they are different, add them to the undirected graph.

[0042] S103, classify and divide the point number set of the undirected graph to obtain multiple point sets, wherein the multiple point sets include: an initial point set, a terminal point set, a golden path set, and an intermediate path set.

[0043] It should be noted that although the upstream and downstream relationship between pipelines is automatically determined by the upstream and downstream relationship inference algorithm, it is still necessary to manually specify a starting direction, and then the subsequent upstream and downstream relationship inference algorithm uses this direction as the initial condition to automatically spread the determined water flow direction to other pipelines. This is because the geographical locations of the water supply pipeline and the return pipeline are closely overlapped in most cases. If the starting point / starting direction is not specified, it is impossible to distinguish whether it is a water supply pipeline or a return pipeline.

[0044] Specifically, an initial point set of the undirected graph in the current heating area is extracted.

[0045] Furthermore, the point number information of all the points with degree 1 in the undirected graph is calculated to obtain the initial set of start and end points. And the set of start and end points is deleted through the initial point set to obtain the set of terminal points.

[0046] Furthermore, based on the point number information in the initial point set and the terminal point set, the golden path set is determined. And the path set corresponding to the pre-acquired directed edges is merged into the golden path. Among them, the directed edge is a list containing all the manually specified two point number information that exist in the worker pipeline connection, and the directed edge specifies the flow direction of the water.

[0047] Furthermore, based on the golden path set, other path sets in the undirected graph are statistically processed to obtain an intermediate path set.

[0048] In one embodiment, all points with degree 1 in the undirected graph are calculated, and the initial point set of the undirected graph in the current heating area is subtracted to obtain the initial terminal point set. Initialize b_set as the initial point set, and initialize e_set as the terminal point set. Initialize the golden path set golden_paths, and initialize the intermediate path set inner_paths. Convert the directed edge patch to a path set and add it to golden_paths.

[0049] S104, performing starting point difference calculations between point number information of various point sets to generate a disconnected initial point set.

[0050] Specifically, a set of simple paths between the initial point set and the terminal point set is calculated.

[0051] Furthermore, through the preset golden path verification function, the simple path set and the golden path set are judged for path conflict. If the simple path set and the golden path set are non-conflicting sets, the simple path set is merged into the golden path set to obtain the merged golden path set. The intermediate path set and the point pair set are also updated synchronously. Among them, the point pair set records several point number information pairs that can achieve directed connectivity between the initial point set and the terminal point set.

[0052] Furthermore, the difference between the initial point set and the point pair set about the point number starting point is calculated to obtain several disconnected initial points. The disconnected initial points are point number information in the initial point set that cannot be connected to the terminal point set in a directed manner. Based on several disconnected initial points, a disconnected initial point set is generated.

[0053] In one embodiment, it is necessary to start the main algorithm loop to determine the subsequent upstream and downstream relationship information, the condition is that e_set is not an empty set, otherwise the loop is continued:

[0054] First check the connectivity from the points in b_set (initial point set) to the points in e_set (terminal point set): calculate the simple path from each point in b_set to each point in e_set, if it exists, call the golden_path_check function (golden path check function) to check whether the path conflicts with the golden path set, if not, add the path to golden_paths, and update path_info (point pair set) and inner_paths (intermediate path set) at the same time. Path_info records the point pairs that can be connected in a directed way between the points in b_set and the points in e_set.

[0055] Then calculate the difference between b_set and path_info about the starting point based on path_info: that is, which points in b_set cannot be connected to the points in e_set in a directed manner, and collect these points into b_left_set (a set of disconnected initial points).

[0056] S105, performing a connection judgment process on the point numbers in the to-be-connected list on the unconnected initial point set to determine the upstream and downstream relationship information of the heating pipeline.

[0057] Specifically, each point number information in the disconnected initial point set is traversed, and the shortest distance between each point number information and the point number information in the terminal point set is calculated to obtain the shortest path.

[0058] Furthermore, the shortest path is judged for legality through the golden path verification function, and a directed path is determined; wherein the directed path is a legal shortest path.

[0059] Furthermore, based on the directed path, the preset list to be connected and the set of golden paths are updated accordingly. And through the add_edge technology, the updated list to be connected and the set of golden paths are added to the undirected graph. Among them, the list to be connected is used to store the directed connections about the heating pipeline.

[0060] Furthermore, if the list to be connected is not an empty list, the initial point set and the terminal point set are updated according to the list to be connected and the point pair set to obtain the upstream and downstream relationship information of the heating pipeline.

[0061] If the list to be connected is an empty list, the point pair set is judged to be an empty set. If the point pair set is not an empty set, the initial point set and the terminal point set are updated to obtain the upstream and downstream relationship information of the heating pipeline. If the point pair set is an empty set, it means that there is no upstream and downstream relationship information in the heating pipeline.

[0062] If the connection list is an empty list, it is also necessary to make a connection judgment between the point number information in the intermediate path set and the point number information in the terminal point set.

[0063] If the intermediate path set is an empty set, it means that there is no upstream and downstream relationship information in the heating pipeline.

[0064] If the intermediate path set is not an empty set, then a judgment is made as to whether the newly created new connection set is an empty set, and the upstream and downstream relationship information of the heating pipeline is determined.

[0065] Furthermore, a new connection set is initialized.

[0066] Furthermore, each heating pipeline in the intermediate path set is traversed, and based on a first preset threshold, the distance between the point number information in each heating pipeline and the point number information in the terminal point set is calculated to screen out candidate connection point pairs.

[0067] Furthermore, the golden path verification function is used to judge the legitimacy of the candidate connection point pairs.

[0068] If the candidate directed connection corresponding to the candidate connection point pair is a legal connection path, the golden path set is updated and the updated golden path set is added to the undirected graph. The candidate connection point pair is also updated to the new connection set.

[0069] If the new connection set is an empty set, it means that there is no upstream and downstream relationship information in the heating pipeline.

[0070] If the new connection set is not an empty set, it means that the intermediate path set has updated a new directed connection, and based on the new connection set, the initial point set and the terminal point set are updated to obtain the upstream and downstream relationship information of the heating pipeline.

[0071] In one embodiment, the main algorithm loop is started continuously, the condition is that e_set is not an empty set, otherwise the loop is continued:

[0072] 5.1 If b_left_set is not an empty set, a directed connection needs to be created. First, define the path_linked list (list to be connected) and collect the created directed connections into this list. Traverse each point number information in b_left_set (disconnected initial point set), calculate which point in e_set is closest to it, that is, determine the shortest path. If the threshold condition is met, these two points form a directed path, call the golden_path_check function (golden path verification function) to check its legality. If it is legal, the created directed connection is considered reasonable, update the path_linked list, the golden_paths set, and call the add_edge technology to add it to the undirected graph.

[0073] 5.1.1 If path_linked is not an empty list, it means that a directed link has been successfully created. At this time, after updating b_set and e_set according to path_info and path_linked, continue to return to the main algorithm loop.

[0074] 5.1.2 If path_linked is empty, a new directed link cannot be created. First check whether path_info (point pair set) is an empty set. If it is not empty, it means that there is still a directed connected path between b_set and e_set. Then you can continue to update b_set and e_set and return to the main algorithm loop.

[0075] 5.1.3 If path_info is empty, it means that b_set and e_set are not connected. In this case, you need to check the paths saved in inner_paths (intermediate path set) and try to create a connection to e_set at a point on these paths.

[0076] 5.1.3.1 If inner_paths is an empty set, exit the algorithm loop and execute the subsequent steps.

[0077] 5.1.3.2 If inner_paths is not an empty set, first initialize the created_links set (new connection set), then traverse each path in inner_paths, calculate the distance from e_set to each point number information passed on the path, use the threshold to filter out candidate connection point pairs (point number information and a point in e_set), and call the golden_path_check function to check the legality of the directed connection formed by the connection point pair. If it is legal, the created directed connection is considered reasonable, update the golden_paths set, call the add_edge technology to add it to the undirected graph, and add the connection point pair to the created_links set.

[0078] 5.1.3.3 If the created_links set is not an empty set, it means that a new link has been successfully created from inner_paths. After updating b_set and e_set according to created_links, continue to return to the main algorithm loop.

[0079] 5.1.3.4 If created_links is an empty collection, exit the algorithm loop and execute the subsequent steps.

[0080] 5.2 If b_left_set is empty, it means that all points in the current b_set can be connected to a point in e_set. After updating b_set and e_set according to path_info, continue to return to the main algorithm loop.

[0081] As a feasible implementation method, the upstream and downstream relationship inference algorithm:

[0082] Step 1. Read the json file containing the point longitude and latitude information and the csv file containing the edge information; initialize the starting point set.

[0083] Step 2. Use the networkx library to create an undirected graph and add each edge to the undirected graph. Because it is an undirected graph, the start and end point information is not used, so the order of the start and end point numbers in the csv file is irrelevant.

[0084] Step 3. Calculate all points with degree 1 in the undirected graph, subtract the initial point set, and the result is the initial terminal point set. The points in the terminal point set are connected to only one edge, corresponding to the primary network water supply pipeline, which is equivalent to the terminal point candidate of the water supply pipeline.

[0085] Step 4. Calculate the connected paths from the starting point to the terminal point in the undirected graph, and use each path as a candidate path for the water flow direction to determine the direction consistency. Because in the water supply pipeline, the water flows from one pipeline to another, and the water flow is unidirectional, and there will be no backflow. The next pipeline may have three situations:

[0086] 1) There is only one downstream pipeline, the water flow direction is consistent with the water flow direction of the current pipeline.

[0087] 2) Forked downstream pipelines, that is, the current pipeline is forked into multiple pipelines at the end of the water flow, then the water flow direction of each downstream pipeline should also be "consistent" with the water flow direction of the current pipeline.

[0088] 3) Converging downstream pipelines, that is, the current pipeline and multiple other pipelines (>=1) merge into one pipeline at the end of the water flow, then the water flow direction of this pipeline should be "consistent" with the water flow direction of all the converging upstream pipelines.

[0089] Step 5. Based on the above physical facts about the direction of water flow, a direction consistency determination algorithm can be designed. For each candidate connection path generated in step 4, call the direction consistency determination function to determine whether its path direction is consistent with the existing golden direction set. The golden direction set is initially set to empty. With each call to the direction consistency determination function, the path directions that meet the requirements are continuously added to the golden direction set. Collect all candidate paths that meet the direction consistency and use them to update the starting point set and the terminal point set. When the terminal point set is not empty, go to step 4 to continue.

[0090] Step 6. During the loop execution of steps 4 and 5, several situations may occur, resulting in the need for additional processing. For example, some points in the starting point set cannot always be connected to some points in the terminal point set, and a connected path cannot be generated. At this time, it is necessary to select some starting points and some terminal points, and directly create a connection from the starting point to the terminal point under certain conditions, and then pass the judgment of the direction consistency judgment function. If the judgment result is valid, the starting point set and the terminal point set are updated according to the newly created path, and step 4 is re-executed. If the judgment is invalid, further processing is required, which is explained in step 7.

[0091] Step 7. If the direct path created from a certain starting point to a certain terminal point is invalid, it is necessary to select an intermediate point that a certain connected path passes through from all the connected paths that have been determined to be valid, and try to create a connection from the intermediate point to a certain terminal point, and then pass the judgment of the direction consistency judgment function. If the judgment result is valid, update the starting point set and the terminal point set according to the newly created path, and re-execute step 4. If the connections created by all the intermediate path sets are determined to be invalid, in order to avoid an infinite loop in the program running, the execution of the algorithm program is exited at this time.

[0092] S106: Based on the upstream and downstream relationship information, determine a directed path set of the heating pipeline, so that each directed path in the directed path set can be visualized on the map. The directed path set is a non-overlapping heating pipeline connection path in the water flow direction.

[0093] Specifically, based on the obtained upstream and downstream relationship information, point pair information in the golden path set is counted to obtain directed path information.

[0094] Furthermore, the non-overlapping paths are calculated for the directed path information by using the preset collect_no_overlap_paths function to obtain a directed path set, and the directed path set is manually inspected and processed.

[0095] In one embodiment, after obtaining the upstream and downstream relationship information, the golden_paths (golden path set) information is counted and printed out, and the point pair information, i.e., the directed edge information, is extracted from the golden_paths and saved as a CSV file. On the other hand, a directed graph structure stored in the form of an adjacency list is created based on the point pair information, and the collect_no_overlap_paths function is called as a parameter to calculate all non-overlapping directed path sets. The non-overlapping directed path set is used to draw each path on the map for manual inspection and correction.

[0096] As a feasible implementation method, according to the actual operation results of the algorithm program, after running the upstream and downstream inference algorithm for the first time, the generated directed edges generally cannot cover all points, resulting in some pipelines still unable to be connected in a directed manner. At this time, it is necessary to use manual correction methods to manually mark the connections between certain points, and then re-run the upstream and downstream inference algorithm. Through repeated manual labeling and algorithm operation, the directed connectivity of all pipelines is achieved, that is, the establishment of upstream and downstream relationships between all pipelines is achieved. Through actual operation, the number of connections that need to be manually labeled accounts for about 1% to 2% of the total number of connections, that is, most of the upstream and downstream relationship determinations are automatically completed by the algorithm, with a high accuracy rate (>98%).

[0097] Furthermore, the directed path set can be visualized on a map through the drawing library function.

[0098] In one embodiment, it is also necessary to call a drawing library function to draw a set of non-overlapping directed paths on the map. On the other hand, the points that the current algorithm cannot reach are counted and drawn on the map. The pipeline water supply paths marked on the map are manually checked to see whether the flow direction is correct and which paths are missing. If a problem is found, a series of auxiliary judgment functions are called to determine which data corrections need to be made, and the corrected data is updated to the undirected edge patch and the directed edge patch, and the upstream and downstream relationship inference algorithm is re-executed. If no problem is found, the execution of the upstream and downstream relationship inference algorithm is completed, and finally the map visualization display is realized.

[0099] As a feasible implementation method, the input of the system is the pipeline data in jsonl format exported by GIS software, and then the data preprocessing program is called to save the point information and edge information separately. The upstream and downstream relationship inference algorithm is called to generate the initial upstream and downstream relationship of the pipeline, and a front-end user interface is provided to intuitively display which pipelines are interconnected, what the water flow direction is, and which points are not connected, so that users can easily and intuitively find problem points and make corrections.

[0100] As a feasible implementation method, users can query the system to find out which adjacent points are adjacent to a certain point, what the point number is, and manually create connections based on this information. The upstream and downstream relationship inference algorithm can be started again, and the system will update the display of the front-end interface based on the new operation results. When the user checks and finds that all pipelines are connected in a certain direction, the call of the upstream and downstream relationship inference algorithm can be stopped. The system provides the function of exporting the current operation results as a CSV file. The exported CSV file stores the information of each directed edge, that is, the upstream and downstream relationship information corresponding to the flow direction of the water.

[0101] The embodiment of the present application can quickly determine the upstream and downstream relationship of the heating pipeline through automated point number clustering and comparative judgment, thereby improving work efficiency. The generated directed path set can be used for map visualization, which facilitates intuitive understanding and analysis of the layout and flow direction of the heating pipeline. Ensure that each path in the directed path set does not overlap to avoid confusion and errors. Clear upstream and downstream relationship information helps to better manage and maintain the heating system. It provides an important basis for the planning and optimization of the heating system. Resources can be reasonably allocated according to the upstream and downstream relationship to improve the heating efficiency. At the same time, the pipeline direction defined in the GIS data is not used, but the water flow direction is determined by the algorithm, which greatly reduces the requirements for GIS data and significantly enhances the practicality of the application scenario of using GIS data to establish the upstream and downstream relationship of the heating pipeline. The accuracy of the automatic upstream and downstream relationship determination algorithm in this application is very high, and only a small amount of manual annotation is required, saving a lot of manpower.

[0102] In addition, the embodiment of the present application also provides a device for establishing upstream and downstream relationships of a heating pipeline, such as Figure 2 As shown, the upstream and downstream relationship establishment device 200 of the heating pipeline specifically includes:

[0103] At least one processor 201; and a memory 202 in communication with the at least one processor 201; wherein the memory 202 stores instructions executable by the at least one processor 201, so that the at least one processor 201 can execute:

[0104] Based on the GIS data of the heating pipeline, the point number information and longitude and latitude coordinate information at both ends of each pipeline are clustered to generate a dictionary mapping from each point number to the representative point number;

[0105] Through dictionary mapping, the representative point number of each pipeline is compared and judged, and the heating pipelines corresponding to different representative point numbers are added to the preset undirected graph;

[0106] The undirected graph is classified and divided into point sets to obtain multiple point sets; wherein the multiple point sets include: initial point set, terminal point set, golden path set, and intermediate path set;

[0107] Calculate the starting point difference between point number information of various point sets to generate a disconnected initial point set;

[0108] The unconnected initial point set is processed for connection judgment of the point numbers in the list to be connected, and the upstream and downstream relationship information of the heating pipeline is determined;

[0109] Based on the upstream and downstream relationship information, a directed path set of the heating pipeline is determined so that each directed path in the directed path set can complete the map visualization display; wherein the directed path set is a non-overlapping heating pipeline connection path in the water flow direction.

[0110] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0111] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0112] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for establishing upstream and downstream relationships of a heating pipeline, characterized in that: The method comprises: Based on the GIS data of the heating pipeline, the point number information and longitude and latitude coordinate information at both ends of each pipeline are clustered to generate a dictionary mapping from each point number to the representative point number; By using the dictionary mapping, the representative point number of each pipeline is compared and judged, and the heating pipelines corresponding to the different representative point numbers are added to a preset undirected graph; Classifying and dividing the point number set of the undirected graph to obtain multiple point sets; wherein the multiple point sets include: an initial point set, a terminal point set, a golden path set, and an intermediate path set; Performing starting point difference calculations between point number information of the plurality of point sets to generate a disconnected initial point set; The disconnected initial point set is processed for connection determination of the point numbers in the list to be connected, and the upstream and downstream relationship information of the heating pipeline is determined; Based on the upstream and downstream relationship information, a directed path set of the heating pipeline is determined so that each directed path in the directed path set can be visualized on a map; wherein the directed path set is a non-overlapping heating pipeline connection path in the direction of water flow.

2. A method for establishing upstream and downstream relationships of a heating pipeline according to claim 1, characterized in that: According to the GIS data of the heating pipeline, the point number information and longitude and latitude coordinate information at both ends of each pipeline are clustered to generate a dictionary mapping from each point number to the representative point number, including: Extracting the point number information and the longitude and latitude coordinate information of each heating pipeline in the GIS data, and determining the point number information as a key value and the longitude and latitude coordinate information as a value; Based on the key value and the value value, a storage dictionary is generated; and the point number information and the latitude and longitude coordinate information are stored in a file through the storage dictionary; Read the initialization starting point set of the single point number starting point in the current heating area; According to the two point number information of each pipeline in the initialization point set, query processing is performed on the storage dictionary to obtain the same point number information at the same longitude and latitude coordinate information; Clustering the same point number information, and selecting a representative point number based on each cluster; Map each of the point number information with the representative point number to obtain the dictionary mapping.

3. A method for establishing upstream and downstream relationships of a heating pipeline according to claim 1, characterized in that: By using the dictionary mapping, the representative point number of each pipeline is compared and judged, and the heating pipelines corresponding to the different representative point numbers are added to the preset undirected graph, which specifically includes: Traverse the two current point number information of each heating pipeline in the GIS data of the current heating area; Through the dictionary mapping, query the two current point number information to obtain two current representative point numbers; Compare and judge the two current representative point numbers with the two current point number information to obtain a point number comparison result; If the point number comparison result is different, the current heating pipelines represented by the two current representative point numbers are added to the undirected graph; wherein the undirected graph is created using the networkx library; the undirected edges in the undirected graph include the current heating pipelines connected by the two current representative point numbers, and the undirected edges do not specify the direction of water flow in the current heating pipelines.

4. The method for establishing upstream and downstream relationships of a heating pipeline according to claim 1, characterized in that: The undirected graph is classified and divided into point sets to obtain multiple point sets, including: Extracting an initial point set of the undirected graph in the current heating area; Calculate the point number information of all the points with degree 1 in the undirected graph to obtain an initial set of start and end points; and delete the start and end point set through the initial point set to obtain a terminal point set; Based on the point number information in the initial point set and the terminal point set, a golden path set is determined; and the path set corresponding to the pre-acquired directed edges is merged into the golden path; wherein the directed edges are a list containing all manually specified two point number information where worker pipelines are connected, and the directed edges specify the direction of water flow; According to the golden path set, statistical processing is performed on other path sets in the undirected graph to obtain the intermediate path set.

5. The method for establishing upstream and downstream relationships of a heating pipeline according to claim 1, characterized in that: The starting point difference calculation between the point number information of the plurality of point sets is performed to generate a disconnected initial point set, specifically including: Calculating a set of simple paths between the initial point set and the terminal point set; Through the preset golden path verification function, the simple path set and the golden path set are judged for path conflict; if the simple path set and the golden path set are non-conflicting sets, the simple path set is merged into the golden path set to obtain the merged golden path set; and the intermediate path set and the point pair set are synchronously updated; wherein the point pair set records a number of point number information pairs that can achieve directed connectivity between the initial point set and the terminal point set; Calculate the difference between the initial point set and the point pair set about the point number starting point to obtain a number of disconnected initial points; wherein the disconnected initial points are point number information in the initial point set that cannot be directed connected with the terminal point set; Based on the plurality of disconnected initial points, the disconnected initial point set is generated.

6. A method for establishing upstream and downstream relationships of a heating pipeline according to claim 1, characterized in that: Before the disconnected initial point set is subjected to a connection judgment process of the point numbers in the to-be-connected list to determine the upstream and downstream relationship information of the heating pipeline, the method further includes: Traversing each point number information in the disconnected initial point set, and calculating the shortest distance between each point number information and the point number information in the terminal point set to obtain the shortest path; The shortest path is judged to be legal by the golden path verification function, and a directed path is determined; wherein the directed path is a legal shortest path; Based on the directed path, the preset list to be connected and the golden path set are updated accordingly; and through the add_edge technology, the updated list to be connected and the golden path set are added to the undirected graph; wherein the list to be connected is used to store directed connections about the heating pipeline.

7. A method for establishing upstream and downstream relationships of a heating pipeline according to claim 6, characterized in that: The unconnected initial point set is subjected to a connection judgment process of the point numbers in the to-be-connected list to determine the upstream and downstream relationship information of the heating pipeline, specifically including: If the list to be connected is not an empty list, the initial point set and the terminal point set are updated according to the list to be connected and the point pair set to obtain upstream and downstream relationship information of the heating pipeline; If the list to be connected is an empty list, then the point pair set is judged to be an empty set. If the point pair set is not an empty set, the initial point set and the terminal point set are updated to obtain the upstream and downstream relationship information of the heating pipeline. If the point pair set is an empty set, it means that there is no upstream and downstream relationship information in the heating pipeline. If the list to be connected is an empty list, it is also necessary to make a connection judgment between the point number information in the intermediate path set and the point number information in the terminal point set; If the intermediate path set is an empty set, it means that there is no upstream and downstream relationship information in the heating pipeline; If the intermediate path set is not an empty set, a judgment is made as to whether the newly created new connection set is an empty set, and the upstream and downstream relationship information of the heating pipeline is determined.

8. A method for establishing upstream and downstream relationships of a heating pipeline according to claim 7, characterized in that: If the intermediate path set is not an empty set, then the newly created new connection set is judged to be an empty set, and the upstream and downstream relationship information of the heating pipeline is determined, specifically including: Initializing the new connection set; Traversing each heating pipeline in the intermediate path set, and based on a first preset threshold, calculating the distance between the point number information in each heating pipeline and the point number information in the terminal point set, and screening out candidate connection point pairs; Using the golden path verification function, the legitimacy of the candidate connection point pairs is judged; If the candidate directed connection corresponding to the candidate connection point pair is a legal connection path, then the golden path set is updated and the updated golden path set is added to the undirected graph; and the candidate connection point pair is updated to the new connection set; If the new connection set is an empty set, it means that there is no upstream and downstream relationship information in the heating pipeline; If the new connection set is not an empty set, it means that the intermediate path set has updated a new directed connection, and according to the new connection set, the initial point set and the terminal point set are updated to obtain the upstream and downstream relationship information of the heating pipeline.

9. A method for establishing upstream and downstream relationships of a heating pipeline according to claim 1, characterized in that: Based on the upstream and downstream relationship information, a directed path set of the heating pipeline is determined so that each directed path in the directed path set can be visualized on a map, specifically including: Based on the obtained upstream and downstream relationship information, counting the point pair information in the golden path set to obtain directed path information; By using the preset collect_no_overlap_paths function, non-overlapping path calculation is performed on the directed path information to obtain the directed path set; Performing manual maintenance on the directed path set; The directed path set is visualized on a map through a drawing library function.

10. A device for establishing upstream and downstream relationships of a heating pipeline, characterized in that: The 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, so that the at least one processor can execute the method for establishing upstream and downstream relationships of a heating pipeline according to any one of claims 1-9.