Pipeline network component processing method and device, processor, and computer storage medium
By determining the starting and target components of the pipeline network, traversing and recording the pipeline network components, avoiding repeated acquisition of components in the ring structure, the accuracy problem of the multi-forktree model when analyzing the ring structure in a complex pipeline network is solved, and the more High analysis accuracy and applicability.
Patent Information
- Application Number
- CN202110342489.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-03-30
AI Technical Summary
The prior art cannot accurately process the ring structure when performing connectivity analysis through multi-tree model in complex pipelines, resulting in poor analysis applicability.
By determining the starting component and target component of the pipeline network, traverse the pipeline network components from the starting component, record the set of components that have been traversed, avoid duplicating the next set of component acquisitions of the component, stop traversing the output connection route in time, and establish a cache layer to Improve data access efficiency.
It improves the accuracy of processing and analysis of pipeline components, expands the scope of application of analysis, and can effectively handle the ring structure in complex pipelines, avoid infinite loop traversal.
Smart Images

Figure CN112949013B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of pipe network analysis, and in particular to a pipe network component processing method and device, a processor, and a computer storage medium. Background Art
[0002] As smart water services become more popular in cities, towns and cities have begun to input and analyze water supply and drainage network information. Testing the connectivity of the network is an important part of smart water services. If the smart water platform detects that two pipes are connected, it can assist in the formulation of daily maintenance plans.
[0003] The pipeline connectivity analysis method in the related technology is applied to the terminal, and at least one multi-branch tree model is constructed according to the preset pipeline facilities and the connection relationship between the pipeline facilities, the flow direction value of each node in the multi-branch tree model is set, and the pipeline connectivity analysis is performed according to the flow direction value of each node.
[0004] The problem is that a section of connected pipe network may not have a tree structure. Multiple pipes may flow into one pipe, and loops may also appear. Therefore, in actual situations, a section of connected pipe network should also be processed according to the graph data structure. Related technologies may not be able to provide accurate connectivity analysis in some complex pipe networks, and their universality is poor.
[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present invention provide a method and device for processing pipe network components, a processor, and a computer storage medium, so as to at least solve the technical problem that when analyzing the pipe network connectivity in the related technology, the connectivity analysis is performed through a multi-branch tree model, and accurate analysis cannot be performed on the situation where rings appear in complex pipe network situations, resulting in poor applicability.
[0007] According to one aspect of an embodiment of the present invention, a method for processing pipe network components is provided, comprising: determining a starting component and a target component of a pipe network; starting from the starting component, while traversing the components of the pipe network, searching for a next set of components connected to a current component, and recording the traversed components through a component set, wherein the component set includes the current component; if a historical component that has been traversed appears repeatedly in the component set, no further acquisition of the next set of components of the historical component is performed; if the target component appears in the component set, stopping the traversal and outputting a connection route of the pipe network from the starting component to the target component.
[0008] Optionally, starting from the starting component, traversing the components of the pipe network, finding the next group of components connected to the current component, and recording the traversed components through the component set includes: taking the starting component as the current component, obtaining a list of components connected to the current component; selecting a component from the component list as the next group of components of the current component, and adding the next group of components to the component set; when the next group of components has no subsequent components connected, selecting another component from the component list as the next group of components of the current component, and adding the next group of components to the component set.
[0009] Optionally, before determining the starting component and target component of the pipeline network, the method includes: obtaining each pipe point and pipe segment of the pipeline network and the connection relationship between the pipe points and pipe segments; storing the IDs of the pipe points and pipe segments, the relationship IDs between different pipe points and pipe segments, and the IDs of the next group of components connected to each pipe point and pipe segment in a relationship table.
[0010] Optionally, starting from the starting component, traverse the components of the pipe network, find the next set of components connected to the current component, and record the traversed components through a component set, wherein the component set includes the following steps before including the current component: establishing the component set and adding the starting component to the component set.
[0011] Optionally, when a historical component that has been traversed appears repeatedly in the component set, not obtaining the next set of components of the historical component includes: after obtaining the current component, searching the component set for a historical component before the current component; when there is a component identical to the current component in the historical components, determining that the historical component that has been traversed appears repeatedly in the component set; and stopping obtaining the next set of builds of the current component.
[0012] Optionally, when the target component appears in the component set, the traversal is stopped, and the connection route of the pipeline network from the starting component to the target component is output, including: when the target component appears in the component set, the traversal is stopped; and all components connected from the starting component to the target component are obtained through a preset object structure, wherein the object structure records the current component ID and all component IDs from the starting component to the current component.
[0013] Optionally, the method further includes: when the number of components of the pipeline network exceeds a preset threshold, establishing a cache layer, wherein the cache layer is used to cache the component data of the pipeline network stored in the database.
[0014] According to another aspect of an embodiment of the present invention, a pipe network component processing device is also provided, including: a determination module, used to determine a starting component and a target component of a pipe network; a traversal module, used to traverse the components of the pipe network starting from the starting component, find the next group of components connected to the current component, and record the traversed components through a component set, wherein the component set includes the current component; a first judgment module, used to no longer obtain the next group of components of the historical component when the traversed historical component appears repeatedly in the component set; and a second judgment module, used to stop traversal when the target component appears in the component set, and output the connection route of the pipe network from the starting component to the target component.
[0015] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned pipe network component processing methods when running.
[0016] According to another aspect of an embodiment of the present invention, a computer storage medium is also provided, which includes a stored program, wherein when the program is running, the device where the computer storage medium is located is controlled to execute any one of the above-mentioned pipe network component processing methods.
[0017] In the embodiment of the present invention, the starting component and the target component of the pipe network are determined; starting from the starting component, when the components of the pipe network are traversed, the next group of components connected to the current component are found, and the traversed components are recorded through a component set, wherein the component set includes the current component; when the traversed historical components are repeated in the component set, the next group of components of the historical components are no longer obtained; when the target component appears in the component set, the traversal is stopped, and the connection route of the pipe network from the starting component to the target component is output. By establishing a component set, the traversed historical components are repeated in the component set, and the next group of components of the historical components are no longer obtained, the purpose of effectively determining the ring network appearing in the pipe network and jumping out of the loop traversal of the ring network in time is achieved, thereby achieving the technical effect of improving the accuracy of pipe network component processing and analysis and broadening the application scope of pipe network construction processing and analysis, thereby solving the technical problem that when the pipe network connectivity analysis is performed through a multi-branch tree model, accurate analysis cannot be performed for the situation where a ring appears in a complex pipe network, resulting in poor applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0019] Figure 1is a flow chart of a method for processing a pipe network component according to an embodiment of the present invention;
[0020] Figure 2 is a flow chart of a pipe network connectivity analysis method according to an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of a pipe network component processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] First, the nouns appearing in this embodiment are explained:
[0025] Pipe point: A pipe point connects two or more pipe sections. A pipe point is the connection point of the pipe and may have a valve.
[0026] Pipe section: A section of a water pipe, connected to other pipe sections by pipe points to form a pipe network.
[0027] Pipeline network: Pipeline networks in water services are generally divided into water supply pipe networks and drainage pipe networks. The layout of pipe networks has two basic forms: branch-shaped and ring-shaped. In the former, the main pipes and branches are distinct, forming a tree-like shape; in the latter, the pipes are connected vertically and horizontally to form a ring. The pipe network is composed of many water pipes. The water pipe materials can be divided into non-metallic pipes (reinforced concrete pipes, plastic pipes, reinforced fiberglass pipes, steel-plastic composite pipes, steel sleeve prestressed reinforced concrete pipes, etc.) and metal pipes (cast iron pipes, ductile iron pipes, steel pipes, etc.).
[0028] According to an embodiment of the present invention, a method embodiment of a pipeline component processing method 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 a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] Figure 1 is a flow chart of a method for processing a pipe network component according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0030] Step S102, determining the starting component and target component of the pipe network;
[0031] Step S104, starting from the starting component, traversing the components of the pipe network, searching for the next set of components connected to the current component, and recording the traversed components through a component set, wherein the component set includes the current component;
[0032] Step S106, if the traversed historical components are repeated in the component set, the next set of components of the historical components is not obtained;
[0033] Step S108, when the target component appears in the component set, stop traversal and output the connection route of the pipe network from the starting component to the target component.
[0034] Through the above steps, the starting component and the target component of the pipeline network are determined; starting from the starting component, when the components of the pipeline network are traversed, the next group of components connected to the current component are found, and the traversed components are recorded through the component set, wherein the component set includes the current component; when the traversed historical components are repeated in the component set, the next group of components of the historical components are no longer obtained; when the target component appears in the component set, the traversal is stopped, and the connection route of the pipeline network from the starting component to the target component is output. By establishing a component set, the traversed historical components are repeated in the component set, and the next group of components of the historical components are no longer obtained, the purpose of effectively determining the ring network appearing in the pipeline network and jumping out of the loop traversal of the ring network in time is achieved, thereby achieving the technical effect of improving the accuracy of pipeline network component processing and analysis and expanding the application scope of pipeline network construction processing and analysis, thereby solving the technical problem that when analyzing the connectivity of the pipeline network in the related technology, the connectivity analysis is performed through a multi-branch tree model, and the situation where the ring appears in the complex pipeline network situation cannot be accurately analyzed, resulting in poor applicability.
[0035] The above-mentioned pipe network can be a water pipe network, which mainly has two basic forms: branch and ring. When analyzing the connectivity of the pipe network, it is necessary to pre-specify two starting components and target components. Analyzing the connectivity of the pipe network is to determine whether the above-mentioned starting component and target component are connected. If connected, what is the connection path, the number of connection paths, etc.
[0036] The above-mentioned determination of the starting component and target component of the pipe network may be performed by receiving the set starting component and target component through an interactive device. For example, the user inputs the id of the starting component and the id of the target component through the interactive device, thereby determining the object of the pipe network analysis.
[0037] Starting from the starting component, when traversing the components of the pipe network, find the next set of components connected to the current component, and record the components that have been traversed through the component set, where the component set includes the current component. When traversing the components of the pipe network, the first component is the starting component, and the starting component is used as the current component to obtain the component information connected to the current component. If there is only one component connected to the current component, obtain the next set of components connected to the current component, and then use the next set of components as the current component to traverse the pipe network downward; if there are multiple components connected to the current component, they can be traversed in sequence according to the preset order, such as the size of the component. The larger the size, the higher its importance and the more connected components. You can traverse the components with large sizes first. In addition, if the component id is numbered, you can choose the component with the closest number to the current component to traverse first.
[0038] Through the established component set, the traversed component ID, the current component, and the connected path composed of the traversed component ID can be recorded, that is, the connected path from the initial construction to the current component. According to the component set, the ring network can be judged, the ring network situation can be discovered in time, and the loop traversal of the ring network can be jumped out in time.
[0039] In the case where there are multiple components connected to the current component, there are multiple selectable components, and a next group of components can be selected to continue traversing. If the current component does not find the target component when traversing according to the next group of components selected above, and the traversed historical components are repeated in the component set, it means that the next group of components forms a ring network, and there is no target component in the ring network, then the next group of components of the historical components will not be obtained, that is, the next group of components connected to the next group of components of the current component will not be obtained. If the current component does not find the target component when traversing according to the next group of components selected above, and the traversal reaches the next group of components that are not connected to it, it means that the branch traversal of the next group of components selected above is completed, and there is no target component. In both of the above cases, it is necessary to return to the current component with multiple selectable components and select the untraversed components to continue traversing.
[0040] The above-mentioned repeated appearance of the traversed historical components in the component set and no longer obtaining the next set of components of the historical components is to timely discover and stop the traversal when a ring network occurs, to avoid an infinite loop, resulting in the process being unable to continue and the inability to find the target component.
[0041] During the entire traversal process, once the target component is found, the analysis is completed and the connection relationship between the starting component and the target component has been found. It can also be determined that the starting component and the target component are connected.
[0042] Optionally, starting from the starting component, traversing the components of the pipeline network, finding the next group of components connected to the current component, and recording the traversed components through the component set includes: taking the starting component as the current component, obtaining a list of components connected to the current component; selecting a component from the component list as the next group of components of the current component, and adding the next group of components to the component set; when the next group of components has no subsequent components connected, selecting another component from the component list as the next group of components of the current component, and adding the next group of components to the component set.
[0043] Before traversing the components of the pipe network from the starting component, the components of the entire pipe network and the connection relationship between the components can be obtained in advance, thereby determining the component list connected to each component. When traversing the pipe network, the component list of the current component is obtained, and traversal is performed according to the components in the component list.
[0044] In the case that there are multiple components connected to the current component, there are multiple selectable components, and a next group of components can be selected to continue traversing. When the current component is traversed according to the next group of components selected above, no target component is found, and the next group of components that are not connected to it is traversed, indicating that the branch traversal of the next group of components selected above is completed and there is no target component. In addition, when the next group of components is used as the current component, the next group of components can be added to the component set.
[0045] Optionally, before determining the starting component and target component of the pipeline network, the method includes: obtaining each pipe point and pipe segment of the pipeline network and the connection relationship between the pipe points and the pipe segments; storing the IDs of the pipe points and pipe segments, the relationship IDs between different pipe points and pipe segments, and the IDs of the next group of components connected to each pipe point and pipe segment in a relationship table.
[0046] The above-mentioned components can be pipe segments or pipe points in the above-mentioned pipe network. The IDs of pipe points and pipe segments, the relationship IDs between different pipe points and pipe segments, and the IDs of the next set of components connected to each pipe point and pipe segment are stored in the relationship table, which can facilitate the quick and effective acquisition of the list of components connected to the current component when traversing the pipe network.
[0047] Optionally, starting from the starting component, traverse the components of the pipe network to find the next set of components connected to the current component, and record the traversed components through a component set, wherein the component set includes the following steps before the current component: establishing a component set and adding the starting component to the component set.
[0048] When traversing the pipe network, first determine the current component, find the next set of components connected to the current component, and record the traversed components through the component set. When the next set of components of the current component is the target component, the traversal can be stopped, and the connection path from the starting component to the target component is generated according to the record of the component set. It is also possible to output the component ID in the path according to the component set to obtain the connection relationship between the components.
[0049] Optionally, when the traversed historical components are repeated in the component collection, not obtaining the next set of components of the historical components includes: after obtaining the current component, searching the component collection for the historical components before the current component; when there is a component identical to the current component in the historical components, determining that the traversed historical components are repeated in the component collection; and stopping obtaining the next set of builds of the current component.
[0050] After obtaining the current component, search for the historical component before the current component in the component set; when there is a component identical to the current component in the historical components, it is determined that the traversed historical component is repeated in the component set, which means that the next group of components forms a ring network, and there is no target component in the ring network, then the next group of components of the historical components will not be obtained, that is, the next group of components connected to the next group of components of the above-mentioned current component will not be obtained, and the acquisition of the next group of constructions of the current component will be stopped, the ring network will be discovered in time, and the ring network will be jumped out to avoid an infinite loop.
[0051] Optionally, when the target component appears in the component set, the traversal is stopped, and the connection route of the pipeline network from the starting component to the target component is output, including: when the target component appears in the component set, the traversal is stopped; through a preset object structure, all components connected from the starting component to the target component are obtained, wherein the object structure records the current component ID and all component IDs from the starting component to the current component.
[0052] The above object structure may be: ConnRefNode, which includes the current component id and the component id list (including the current component id) that the component has passed through. According to the object structure, the connection path between the starting component and the target component can be determined.
[0053] Optionally, the method further includes: when the number of components of the pipeline network exceeds a preset threshold, establishing a cache layer, wherein the cache layer is used to cache the component data of the pipeline network stored in the database.
[0054] When there are many components in the pipe network, for example, the data volume reaches more than 10,000, by adding a cache layer, the component data of the pipe network stored in the database is cached, and when traversing the pipe network, the construction data, such as the list of components connected to the current component, is obtained quickly and efficiently. This ensures the reliability of the convenience and improves the efficiency and speed of the convenience.
[0055] It should be noted that the embodiment of the present application also provides an optional implementation, which is described in detail below.
[0056] This implementation solves the problem of pipe network connectivity analysis by analyzing the given entered pipe network data, determining whether there is connectivity between two pipes, and providing a possible path.
[0057] After obtaining the data of each pipe point, pipe segment and the connection relationship between them, the relationship between the pipe points and the pipe segments is stored in a MySQL relational table. The structure of the relational table is shown in Table 1. Table 1 is a pipe point and pipe segment relationship structure description table.
[0058] Table 1 Pipe point and pipe section relationship structure description table
[0059] Field Name Business Implications ref_id Relationship ID component_id Component ID (pipe point ID or pipe segment ID) next_id The id of the next component to connect to
[0060] This implementation method requires the specification of the starting component and the target component. Once specified, it will start from the starting component and continuously search for the id of the next group of components it is connected to. If the target component id already exists in this group of component ids, the search ends. If the target component id does not exist in this group of component ids, continue to query based on the found component id to query whether the next group of component ids it is connected to match the id of the target component, until the target component id is found or the next group of component ids that are connected do not exist. In addition, in order to prevent the possibility of loops in the pipeline network, it is necessary to establish a component set to record the ids of components that have been traversed. If a component id that has appeared before appears during the traversal, the next group of components connected to the component will no longer be obtained to avoid an infinite loop.
[0061] Figure 2 is a flow chart of a pipe network connectivity analysis method according to an embodiment of the present invention, such as Figure 2As shown, in order to record the route based on which the connectivity is determined, an object structure is defined: ConnRefNode, which contains the current component ID and the component ID list that this component has passed through (including the current component ID). If the target component is found, it proves that there is a path between the starting component and the target component. The path can be obtained by obtaining the "component ID list that this component has passed through" in the previously defined ConnRefNode, which is convenient for reference by relevant staff. If the target component is not found, it can be displayed as no connectivity.
[0062] This implementation method is more universal and takes into account the situation of a ring water supply network. It has good scalability, is not complicated to implement, and can improve the overall efficiency of the algorithm by increasing the reading rate. If the amount of pipeline data in a city reaches more than 10,000, it only needs to add a layer of Redis cache to increase the speed of obtaining from the database.
[0063] It should be noted that the above step of reading the relationship between the current component and the next component from the database can be read from a relational database or a non-relational database, which is not very relevant. Moreover, when reading, a cache layer can be added, which does not change the main idea of the algorithm and can be regarded as consistent with the algorithm idea of the present invention.
[0064] Figure 3 is a schematic diagram of a pipe network component processing device according to an embodiment of the present invention. Figure 3 As shown, according to another aspect of an embodiment of the present invention, a pipe network component processing device is also provided, including: a determination module 32, a traversal module 34, a first determination module 36 and a second determination module 38. The device is described in detail below.
[0065] A determination module 32 is used to determine the starting component and target component of the pipe network; a traversal module 34 is connected to the determination module 32 and is used to traverse the components of the pipe network starting from the starting component, find the next set of components connected to the current component, and record the traversed components through a component set, wherein the component set includes the current component; a first judgment module 36 is connected to the traversal module 34 and is used to not obtain the next set of components of the historical components when the traversed historical components are repeated in the component set; a second judgment module 38 is connected to the first judgment module 36 and is used to stop traversal when the target component appears in the component set, and output the connection route of the pipe network from the starting component to the target component.
[0066] Through the above-mentioned device, the starting component and target component of the pipeline network are determined; starting from the starting component, when the components of the pipeline network are traversed, the next group of components connected to the current component are found, and the traversed components are recorded through the component set, wherein the component set includes the current component; when the traversed historical components are repeated in the component set, the next group of components of the historical components are no longer obtained; when the target component appears in the component set, the traversal is stopped, and the connection route of the pipeline network from the starting component to the target component is output. By establishing a component set, the traversed historical components are repeated in the component set, and the next group of components of the historical components are no longer obtained, the purpose of effectively determining the ring network appearing in the pipeline network and jumping out of the loop traversal of the ring network in time is achieved, thereby achieving the technical effect of improving the accuracy of pipeline network component processing and analysis and expanding the application scope of pipeline network construction processing and analysis, thereby solving the technical problem that when analyzing the connectivity of the pipeline network in the related technology, the connectivity analysis is performed through a multi-branch tree model, and the situation where the ring appears in the complex pipeline network situation cannot be accurately analyzed, resulting in poor applicability.
[0067] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein when the program is run, any one of the above-mentioned pipe network component processing methods is executed.
[0068] According to another aspect of an embodiment of the present invention, a computer storage medium is further provided, the computer storage medium including a stored program, wherein when the program is running, the device where the computer storage medium is located is controlled to execute any one of the above-mentioned pipe network component processing methods.
[0069] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0070] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0071] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0072] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0073] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0074] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0075] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing a pipe network component, characterized in that: include: Determine the starting and target components of the network; Starting from the starting component, while traversing the components of the pipe network, searching for the next set of components connected to the current component, and recording the traversed components through a component set, wherein the component set includes the current component, wherein searching for the next set of components connected to the current component includes: searching for the next set of components connected to the current component according to a preset order; If the traversed historical components are repeated in the component set, the next set of components of the historical components will not be obtained; When the target component appears in the component set, stop traversal and output the connection route of the pipeline network from the starting component to the target component; Wherein, when the target component appears in the component set, the traversal is stopped, and the connection route of the pipe network from the starting component to the target component is outputted, which includes: when the target component appears in the component set, the traversal is stopped; all components connected from the starting component to the target component are obtained through a preset object structure, wherein the object structure records the current component ID and all component IDs from the starting component to the current component; Wherein, starting from the starting component, traversing the components of the pipe network, finding the next group of components connected to the current component, and recording the traversed components through the component set includes: taking the starting component as the current component, obtaining a list of components connected to the current component; selecting a component from the component list as the next group of components of the current component, and adding the next group of components to the component set; and when there is no component connected to the next group of components, selecting another component from the component list as the next group of components of the current component, and adding the next group of components to the component set.
2. The method according to claim 1, characterized in that Determine the starting and target components of the pipe network including: Acquire each pipe point and pipe segment of the pipe network and the connection relationship between the pipe points and pipe segments; The ids of the pipe points and pipe segments, the relationship ids between different pipe points and pipe segments, and the ids of the next group of components connected to each pipe point and pipe segment are stored in a relationship table.
3. The method according to claim 2, characterized in that Starting from the starting component, traverse the components of the pipe network to find the next set of components connected to the current component, and record the traversed components through a component set, wherein the component set includes the current component and includes: The component collection is established, and the starting component is added to the component collection.
4. The method according to claim 1, characterized in that: In the case where the traversed historical components are repeated in the component set, the next set of components of the historical components are not obtained, including: After obtaining the current component, search for the historical component before the current component in the component collection; When there is a component identical to the current component in the historical components, determining that the traversed historical components are repeated in the component set; Stops fetching the next set of builds for the current artifact.
5. The method according to any one of claims 1 to 4, characterized in that: Also includes: When the number of components of the pipeline network exceeds a preset threshold, a cache layer is established, wherein the cache layer is used to cache component data of the pipeline network stored in a database.
6. A pipe network component processing device, characterized in that: include: A determination module, used to determine the starting components and target components of the pipe network; A traversal module, configured to traverse the components of the pipe network starting from the starting component, find the next set of components connected to the current component, and record the traversed components through a component set, wherein the component set includes the current component, and finding the next set of components connected to the current component includes: finding the next set of components connected to the current component according to a preset order; A first determination module is used for not obtaining a next set of components of the historical components if the traversed historical components appear repeatedly in the component set; A second determination module is used to stop traversal and output a connection route of the pipe network from the starting component to the target component when the target component appears in the component set; The second determination module is used to stop traversal when the target component appears in the component set; obtain all components connected from the starting component to the target component through a preset object structure, wherein the object structure records the current component ID and all component IDs from the starting component to the current component; The traversal module is used to take the starting component as the current component, obtain a component list connected to the current component; select a component from the component list as the next group of components of the current component, and add the next group of components to the component set; if the next group of components has no components connected thereto, select another component from the component list as the next group of components of the current component, and add the next group of components to the component set.
7. A processor, characterized in that: The processor is used to run a program, wherein the program executes the pipeline component processing method described in any one of claims 1 to 5 when running.
8. A computer storage medium, characterized in that: The computer storage medium includes a stored program, wherein: When the program is running, the device where the computer storage medium is located is controlled to execute the pipe network component processing method described in any one of claims 1 to 5.
