Intelligent water extraction route method, electronic device and readable storage medium

Through the intelligent water extraction route method, the interconnected pipelines in the target model body are automatically processed, and non-water pipelines and terminal pipelines are removed, which solves the problem of time-consuming and inconsistent manual water extraction routes, and achieves efficient, continuous and forked water route design.

CN114676535BActive Publication Date: 2025-04-25ZHUHAI GREE PRECISION MOLD CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210126608.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-10
Publication Date
2025-04-25
Estimated Expiration
2042-02-10

AI Technical Summary

Technical Problem

The existing manual water extraction route method is time-consuming and incoherent, increasing design time and cost.

Method used

It provides an intelligent water extraction route method, by obtaining the connected pipeline group in the target model body, removing non-water pipelines and terminal pipelines, adding water inlet pipelines and outlet pipelines, and automatically extracting the water routes to obtain a water route connected to the end without a fork.

Benefits of technology

Save design time, reduce design costs, and ensure continuity and no forks of water routes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676535B_ABST
    Figure CN114676535B_ABST
Patent Text Reader

Abstract

The present application is about a method for intelligently extracting water routes, an electronic device, and a readable storage medium, the method comprising: obtaining a group of interconnected pipes in a target model body; removing non-waterway pipes and terminal pipes from the interconnected pipe group to obtain non-terminal pipes; non-waterway pipes are interconnected pipes with a radius different from that of waterway pipes, and terminal pipes are interconnected pipes with only three pipe edges, and at least one of the pipe edges has an endpoint number of 0; obtaining an inlet pipe and an outlet pipe of the interconnected pipe group; adding an inlet pipe and an outlet pipe to the non-terminal pipe to obtain a waterway pipe; and extracting a water route according to the waterway pipe. The solution provided by the present application can obtain a water route connected end to end, which saves time compared to manually extracting a water route, thereby reducing design costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of pipeline design, and in particular to an intelligent water extraction route method, an electronic device and a readable storage medium. Background Art

[0002] In the manufacturing industry, especially in mold-related industries, 3D design software (such as UGNX) is needed to design 3D models. Most of these models contain pipelines (for example, water pipelines, gas pipelines or oil pipelines), and the number of pipelines is relatively large. In order to achieve the ideal effect of pipeline design, mold flow analysis software (such as moldflow) is often needed to perform cooling analysis on the designed pipelines (such as water pipelines). However, mold flow analysis software cannot directly analyze the pipelines of 3D design software. The pipelines need to be converted into water routes (i.e., water routes) and imported into mold flow analysis software for analysis. Converting pipelines into water routes is a manual operation. Only one water route can be extracted for each cylindrical pipeline. When the number of pipelines is large, manual extraction of water routes is extremely time-consuming, and the extracted water routes are not coherent. It is also necessary to manually adjust and trim the water routes to be coherent from beginning to end and without bifurcations.

[0003] Therefore, the existing method of artificially extracting water routes adds a lot of design time, that is, adds a lot of design costs. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present application provides an intelligent water route extraction method, an electronic device and a readable storage medium. The intelligent water route extraction method can remove non-water pipes and terminal pipes, and can also automatically extract the water route of the water pipe to obtain a water route that is connected end to end and has no bifurcations.

[0005] The first aspect of the present application provides an intelligent water extraction route method, comprising:

[0006] Get the connected pipeline group in the target model body;

[0007] Removing non-waterway pipes and terminal pipes from the interconnected pipe group to obtain non-terminal pipes; the non-waterway pipes are interconnected pipes whose radius is different from that of the waterway pipes, and the terminal pipes are interconnected pipes having only three pipe edges, and at least one of the pipe edges has an endpoint number of 0;

[0008] Obtain the water inlet pipe and the water outlet pipe of the interconnected pipe group;

[0009] Adding a water inlet pipe and a water outlet pipe to the non-terminal pipe to obtain a waterway pipe;

[0010] Extract the water route according to the water pipeline.

[0011] The obtaining of the interconnected pipelines in the target model body includes:

[0012] All N water inlet pipes of the target model body are obtained, and interconnected pipes of the N water inlet pipes are traversed to obtain the interconnected pipe group; wherein N is an integer greater than 0.

[0013] The interconnected pipeline traversal includes:

[0014] Select the first water inlet pipe as the current pipe; traverse all M1 pipe edges of the current pipe, filter out V1 untraversed pipe edges from the M1 pipe edges, and add the edge identifiers of the V1 untraversed pipe edges to the traversed edge identifier set; filter all K1 valid associated pipes of the V1 untraversed pipe edges, loop through the K1 valid associated pipes, and obtain a traversed pipe identifier set; add the traversed pipe identifier set to the filtered pipe identifier set, mark the filtered pipe identifier set, and obtain a first interconnected pipe group; clear the traversed edge identifier set and the traversed pipe identifier set; wherein M1 is an integer greater than 2, V1 is an integer greater than or equal to 0, and K1 is an integer greater than or equal to 0;

[0015] The current pipeline is the interconnected pipeline currently being traversed;

[0016] The traversed edge identifier set is a set storing edge identifiers of traversed pipeline edges;

[0017] The traversed pipe identifier set is a set of pipe identifiers that temporarily stores traversed pipes that are connected to each other;

[0018] The filtered pipe identifier set is a set storing pipe identifiers of traversed interconnected pipes.

[0019] The water route extraction according to the waterway pipeline comprises:

[0020] Extract all center lines m of the waterway pipeline, determine whether the ith center line and the i+1th center line intersect; if they intersect, add the intersection point to the path point set; if they do not intersect, select the two endpoints of the ith center line and the i+1th center line that are closest to each other, use the midpoint of the two endpoints as a substitute intersection point, and add the substitute intersection point to the path point set;

[0021] Connecting the intersection point in the path point set and the alternative intersection point to obtain the water route;

[0022] The path point set is a set of all intersection points and the replacement intersection points.

[0023] Furthermore, after obtaining the first interconnected pipeline group, the method further includes:

[0024] Clear the traversed edge identifier set and the traversed pipe identifier set;

[0025] Select a second water inlet pipe as the current pipe; traverse all M2 pipe edges of the current pipe, filter out V2 untraversed pipe edges from the M2 pipe edges, and add the edge identifiers of the V2 untraversed pipe edges to the traversed edge identifier set; filter all K2 valid associated pipes of the V2 untraversed pipe edges, loop through the K2 valid associated pipes to obtain a traversed pipe identifier set; add the traversed pipe identifier set to the filtered pipe identifier set, mark the filtered pipe identifier set, and obtain a second interconnected pipe group; wherein M2 is an integer greater than 2, V2 is an integer greater than or equal to 0, and K2 is an integer greater than or equal to 0.

[0026] The screening of all K1 valid associated pipelines of the V1 pipeline edges that have not been traversed includes:

[0027] Traverse all S1 associated pipes of the V1 untraversed pipe edges, and select the K1 valid associated pipes from the S1 associated pipes; wherein S1 is an integer greater than or equal to 1;

[0028] The valid associated pipe is a connected pipe whose pipe identifier does not exist in the traversed pipe identifier set.

[0029] The loop traverses the K1 valid associated pipelines, including:

[0030] Select the first valid associated pipeline among the K1 valid associated pipelines as the current pipeline, traverse all E1 pipeline edges in the current pipeline, and screen out F1 untraversed pipeline edges from the E1 pipeline edges; add the edge identifiers of the F1 untraversed pipeline edges to the traversed edge identifier set, screen all G1 valid associated pipelines of the F1 untraversed pipeline edges, and add the pipeline identifiers of the G1 valid associated pipelines to the traversed pipeline identifier set; wherein E1 is an integer greater than 2, F1 is an integer greater than or equal to 0, and G1 is an integer greater than or equal to 0;

[0031] The untraversed pipeline edge is a pipeline edge whose edge identifier does not exist in the edge identifier set.

[0032] Furthermore, after adding the pipe identifiers of the G1 valid associated pipes to the traversed pipe identifier set, the method further includes:

[0033] The second valid associated pipe among the K1 valid associated pipes is used as the current pipe, all E2 pipe edges in the current pipe are traversed, and F2 untraversed pipe edges are screened out from the E2 pipe edges; the edge identifiers of the F2 untraversed pipe edges are added to the traversed edge identifier set, all G2 valid associated pipes of the F2 untraversed pipe edges are screened, and the pipe identifiers of the G2 valid associated pipes are added to the traversed pipe identifier set; wherein E2 is an integer greater than 2, F2 is an integer greater than or equal to 0, and G2 is an integer greater than or equal to 0.

[0034] The method of removing non-water pipelines comprises:

[0035] Detecting the radius of all interconnected pipes corresponding to the filtered pipe identifier set;

[0036] The radii of all the interconnected pipes are compared with the radius of the waterway pipe, pipe identifiers of the interconnected pipes whose radii are inconsistent with the radius of the waterway pipe are screened out, and the pipe identifiers are excluded from the set of screened pipe identifiers.

[0037] The removal of the terminal pipeline comprises:

[0038] Obtain the total number of pipe edges q of each interconnected pipe corresponding to the filtered pipe identifier set, and determine whether the total number of pipe edges q is greater than 3; if so, the interconnected pipe is not a terminal pipe, and if not, obtain the number of endpoints of each pipe edge of the interconnected pipe;

[0039] Determine whether the connected pipe has a pipe edge with an endpoint number of 0; if so, the connected pipe is a terminal pipe, if not, the connected pipe is not a terminal pipe.

[0040] Furthermore, after adding the intersection point to the path point set and before connecting the intersection point in the path point set with the replacement intersection point, the method further includes:

[0041] Add the coordinates of the point on the first center line that is farthest from the second center line to the front of the path point set;

[0042] The coordinates of the point on the mth center line that is farthest from the m-1th center line are added to the end of the path point set.

[0043] The traversing the N water inlet pipes in communication with each other includes:

[0044] When the time consumed by the traversal of the interconnected pipelines exceeds the preset screening time, the traversal of the interconnected pipelines ends;

[0045] The preset screening time is the maximum time required to traverse the interconnected pipelines.

[0046] A second aspect of the present application provides an electronic device, including:

[0047] Processor; and

[0048] The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method as described above.

[0049] A third aspect of the present application provides a non-transitory machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor is caused to execute the method as described above.

[0050] The technical solution provided by this application may have the following beneficial effects:

[0051] The present application performs interconnected pipeline traversal on all N water inlet pipes of the target model body to obtain an interconnected pipeline group. Non-water pipelines and terminal pipelines are excluded from the interconnected pipeline group to obtain non-terminal pipelines, and water inlet pipelines and water outlet pipelines are added to the non-terminal pipelines to obtain water pipelines. Excluding non-water pipelines can prevent pipelines for other purposes from interfering with the water inlet pipelines, and excluding terminal pipelines can make the subsequently extracted water routes without bifurcations. By connecting the intersection points and alternative intersection points of the center lines of the water pipelines, a water route connected end to end can be obtained. Compared with manually extracting water routes, the present application saves time, thereby reducing design costs.

[0052] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The above and other objects, features and advantages of the present application will become more apparent through a more detailed description of exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.

[0054] Figure 1 It is a schematic diagram of the process of the intelligent water extraction route method shown in the embodiment of the present application;

[0055] Figure 2 It is a schematic diagram of the process of extracting water according to the embodiment of the present application;

[0056] Figure 3 It is a schematic diagram of the process of traversing the interconnected pipelines shown in the embodiment of the present application;

[0057] Figure 4 It is a schematic diagram of a process for removing a terminal pipeline according to an embodiment of the present application;

[0058] Figure 5 is a schematic diagram of the structure of a connected pipeline group shown in an embodiment of the present application;

[0059] Figure 6 is a schematic diagram of obtaining the intersection point of two center lines and the alternative intersection point shown in an embodiment of the present application;

[0060] Figure 7 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0061] The following will describe the preferred embodiments of the present application in more detail with reference to the accompanying drawings. Although the preferred embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0062] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0063] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0064] Embodiment 1

[0065] The existing method of manually extracting water routes of interconnected pipelines takes a lot of time, and the extracted water routes are not continuous, which increases the cost of pipeline design.

[0066] In view of the above problems, the present application embodiment provides a method for intelligent water extraction route. Figure 1 , Figure 1 It is a flow chart of the intelligent water extraction route method shown in the embodiment of the present application.

[0067] The method for intelligently extracting water routes provided in the embodiment of the present application is as follows:

[0068] A1. Traverse the interconnected water inlet pipes.

[0069] Traverse the interconnected pipes of all N water inlet pipes of the model stored by the user, and store the pipe identifiers of the N water inlet pipes in the water inlet pipe set, where N is an integer greater than 0. Traverse all pipe edges of all N water inlet pipes, traverse all associated pipes containing all pipe edges, obtain a traversed pipe identifier set, add all pipe identifiers of the traversed pipe identifier set to the filtered pipe identifier set, mark the filtered pipe identifier set, and obtain the first interconnected pipe group. Clear the traversed edge identifier set and the traversed pipe identifier set.

[0070] For example, the pipe identifiers corresponding to the traversed pipe identifier set are added to the filtered pipe identifier set, and the pipe identifiers of the first connected pipe group obtained by the traversal are marked as P1={W1, a1, ..., a k , Q1}, k is an integer greater than 1.

[0071] In practical applications, the marking of the pipe identifier of the first interconnected pipe group in the filtered pipe identifier set may also be in other forms, depending on the specific situation, and is not limited here.

[0072] A2. Remove non-water pipes from the interconnected pipe groups.

[0073] The radius of the interconnected pipes corresponding to the filtered pipe identifier set is compared with the set water inlet pipe radius, and the pipe identifiers of the interconnected pipes whose radii are different from the water inlet pipe radius are excluded from the filtered pipe identifier set.

[0074] As an alternative, non-waterway pipes may be removed from the communicating pipes through steps A21-A31.

[0075] A21. Obtain all pipeline edges of the current pipeline according to the pipeline identifier of the current pipeline.

[0076] According to the current pipeline S d The identifier of the current pipeline is used to obtain all pipeline edges m, and the number of loops j = 0.

[0077] When d=1, the current pipeline S1 is the initial pipeline.

[0078] A22. Determine whether all pipeline edges of the current pipeline have been cycled.

[0079] Let j = j + 1, and determine whether j is greater than m. If so, end the current pipeline S d Perform the same pipeline traversal, if not, execute A23.

[0080] A23. Determine whether the edge identifier of the current edge exists in the traversed edge identifier set.

[0081] It is determined whether the jth pipeline edge exists in the traversed edge identifier set. If so, it means that the jth pipeline edge has been traversed, and A22 is executed. If not, it means that the jth pipeline edge needs to be traversed, and A24 is executed.

[0082] A24. Add the edge identifier of the current edge to the set of traversed edge identifiers.

[0083] Set the current pipeline S d The edge identifier of the j-th pipeline edge is added to the traversed edge identifier set to prevent subsequent loops from traversing this pipeline edge again.

[0084] A25. Get all associated pipelines containing the current edge.

[0085] Get the total number n of associated pipelines that include the current j-th pipeline edge, and set the associated pipeline loop identifier l to 0.

[0086] A26. Determine whether all associated pipelines of the current edge have been traversed.

[0087] The associated pipeline loop identifier is increased by 1, l=l+1, and it is determined whether the associated pipeline l is greater than n. If so, it means that all associated pipelines containing the current edge have been traversed, and A22 is executed. If not, it means that other associated pipelines of the current edge need to be traversed continuously, and A27 is executed.

[0088] A27. Determine whether the associated pipeline is a water pipeline.

[0089] Compare whether the radius of the associated pipe l is the same as the radius of the water pipe. If so, it means that the associated pipe l is a water pipe, and execute A28; if not, it means that the associated pipe l is not a water pipe, and execute A26.

[0090] A28. Remove non-water pipes.

[0091] Clear the filtered pipe identifier collection and add the pipe identifier of the waterway pipe to the filtered pipe identifier collection.

[0092] Check whether the pipe identifier of the associated pipe l exists in the traversed pipe identifier set and the filtered pipe identifier set. If yes, it means that the associated pipe l has been traversed, and execute A26; if no, it means that the associated pipe l has not been traversed, and execute A29.

[0093] A29. Add the pipe identifier of the associated pipe to the traversed pipe identifier set.

[0094] The pipe identifier of the associated pipe l is added to the traversed pipe identifier set to prevent the associated pipe l from being traversed next time.

[0095] In practical applications, the solution of removing non-water pipes is selected according to specific circumstances, and is not limited here.

[0096] A3. Remove the terminal pipe from the connected pipe group.

[0097] A terminal pipe is a connected pipe with three and only three edges, and at least one of the edges has zero endpoints.

[0098] It is determined from the filtered pipe identifier set whether the corresponding connected pipe is a terminal pipe, the terminal pipe is filtered out, and the pipe identifier corresponding to the terminal pipe is excluded from the filtered pipe identifier set to obtain a non-terminal pipe.

[0099] A4. Add water inlet and outlet pipes.

[0100] Determine whether the pipe identifier of the water inlet pipe exists at the front of the connected pipe group corresponding to the filtered pipe identifier set. If so, end the process of adding the water inlet pipe and the water outlet pipe. If not, add the pipe identifier of the water inlet pipe to the front of the connected pipe group corresponding to the filtered pipe identifier set. The pipe identifier of the water inlet pipe is stored in the water inlet pipe set.

[0101] Determine whether the pipe identifier of the outlet pipe exists at the end of the connected pipe group corresponding to the filtered pipe identifier set. If so, end the process of adding the inlet pipe and the outlet pipe. If not, add the pipe identifier of the outlet pipe to the end of the connected pipe group corresponding to the filtered pipe identifier set. The pipe identifier of the outlet pipe is stored in the outlet pipe set.

[0102] For example, the water inlet pipe set W = {W1, W2, ..., W N}, the outlet pipe set Q = {Q1, Q2, ..., Q N}, N is an integer greater than 0. The first connected pipe group is marked as P1={W1, a1, ..., a k , Q1}, k is an integer greater than 1.

[0103] A5. Extract the water route of the water pipeline.

[0104] All m waterway pipes in the filtered pipe identifier set are obtained, and the center lines of all m waterway pipes are extracted.

[0105] Determine whether the two center lines intersect. If they do, add the intersection coordinates to the path point set. If they do not intersect, use the midpoint of the two closest endpoints of the two center lines as the alternate intersection point, and add the alternate intersection coordinates to the path point set.

[0106] Connect all intersection points and alternative intersection points in the path point set to obtain the water route.

[0107] The embodiment of the present application performs interconnected pipeline traversal on all N water inlet pipes of the target model body to obtain an interconnected pipeline group. Non-water pipelines and terminal pipelines are excluded from the interconnected pipeline group to obtain non-terminal pipelines, and water inlet pipelines and water outlet pipelines are added to the non-terminal pipelines to obtain water pipelines. Excluding non-water pipelines can prevent pipelines for other purposes from interfering with the water inlet pipelines, and excluding terminal pipelines can make the water routes extracted subsequently without bifurcations. By connecting the intersection points and alternative intersection points of the center lines of the water pipelines, a water route connected end to end can be obtained. The solution provided by the embodiment of the present application saves time compared to manually extracting water routes, thereby reducing design costs.

[0108] Embodiment 2

[0109] The artificially extracted water route is discontinuous and has bifurcations, which cannot reflect the actual water inlet route. It is necessary to obtain a water route that is connected end to end and has no bifurcations.

[0110] Figure 2 This is a schematic diagram of the water extraction process shown in the embodiment of the present application. Please refer to Figure 2 The scheme of the water extraction route provided in the embodiment of the present application is as follows:

[0111] B1. Obtain all water pipes in the filtered pipe identifier set.

[0112] Get all waterway pipes m in the filtered pipe identifier set, start looping, and set the loop count i to 0.

[0113] B2. Extract the center lines of all water pipes.

[0114] Extract the center line of all water pipes m, which is a virtual center line. There are m center lines in total.

[0115] B3. Determine whether the loop traversal of all center lines has been completed.

[0116] Let i=i+1, and determine whether i is greater than m-1. If yes, execute B8, if no, execute B4.

[0117] B4. Determine whether the i-th center line and the i+1-th center line intersect.

[0118] Determine whether the i-th center line intersects with the i+1-th center line. If yes, execute B7; if no, execute B5. Figure 6 This is a schematic diagram of obtaining the intersection point of two center lines and the alternative intersection point shown in the embodiment of the present application. Please refer to Figure 6 .

[0119] For example, Figure 6 The m in the equation is the intersection of the i-th center line and the i+1-th center line.

[0120] B5. Find the two closest points between the i-th center line and the i+1-th center line.

[0121] Measure the distances between the four endpoints of the i-th center line and the i+1-th center line, select the two endpoints closest to each other, and execute B6.

[0122] B6. Add the midpoint coordinates of the two closest endpoints of the i-th center line and the i+1-th center line to the path point set.

[0123] Add the midpoint coordinates of the two closest endpoints of the i-th center line and the i+1-th center line to the path point set, and return to B3.

[0124] For example, Figure 6 b and c are the two closest endpoints of the i-th line and the i+1-th line. Take the midpoint of b and c as the alternative intersection point, and add the coordinates of the alternative intersection point to the path point set.

[0125] B7. Add the coordinates of the intersection of the i-th center line and the i+1-th center line to the path point set.

[0126] Add the coordinates of the intersection of the i-th center line and the i+1-th center line to the path point set and return to B3.

[0127] B8. Add the point on the first center line that is farthest from the second center line to the front of the path point set.

[0128] Add the coordinates of the point on the first center line that is farthest from the second center line to the front of the path point set as the starting point of the waterway line, and execute B9.

[0129] B9. Add the point on the mth center line that is farthest from the m-1th center line to the end of the path point set.

[0130] Add the coordinates of the point on the mth center line that is farthest from the m-1th center line to the end of the path point set as the end point of the waterway route, and execute B10.

[0131] B10. Connect all the points in the path point set to obtain the water route.

[0132] Connect all intersections and alternative intersections in the path point set to obtain a water route that is connected end to end and has no bifurcations.

[0133] The embodiment of the present application provides a solution for extracting a water route, which determines whether two adjacent center lines intersect. If they intersect, the coordinates of the intersection are added to the path point set. If they do not intersect, the coordinates of the midpoints of the two points closest to the two adjacent center lines are added to the path point set. Connect all points in the path point set to obtain a water route that is connected end to end and has no bifurcations. The embodiment of the present application can obtain alternative intersection points of non-intersecting center lines, so that the extracted water route is connected end to end.

[0134] Embodiment 3

[0135] The interconnected pipeline traversal is performed by traversing all pipeline edges of the current pipeline, and then traversing all interconnected pipelines including each pipeline edge to obtain an interconnected pipeline group.

[0136] For the similar pipeline traversal scheme provided in the embodiment of this application, please refer to Figure 3 and Figure 5 , Figure 3 It is a schematic diagram of the process of traversing the interconnected pipelines shown in the embodiment of the present application. Figure 5 1 is a schematic diagram of the structure of the interconnected pipeline group shown in the embodiment of the present application, 1 and 2 represent interconnected pipeline group 1 and interconnected pipeline group 2 respectively, interconnected pipeline group 1 and interconnected pipeline group 2 are independent of each other and cannot be connected through any interconnected pipeline. The interconnected pipeline traversal is as follows:

[0137] C1. Obtain all pipeline edges of the current pipeline according to the pipeline identifier of the current pipeline.

[0138] According to the current pipeline S d Get the current pipe S by the pipe identifier d For all pipeline edges m, where m is an integer greater than 2, let the number of pipeline edge loops j = 0.

[0139] When d=1, the current pipeline S1 is the initial pipeline. When d≠1, the current pipeline S d The associated pipe in the set of traversed pipe identifiers.

[0140] C2. Determine whether all pipeline edges of the current pipeline have been cycled.

[0141] Let j=j+1, and determine whether j is greater than m. If so, execute C10, if not, execute C3.

[0142] C3. Determine whether the edge identifier of the current edge exists in the traversed edge identifier set.

[0143] The current edge is the jth pipeline edge. Check whether the current edge exists in the traversed edge identifier set. If yes, it means that the current edge has been traversed, and execute C2. If not, it means that the current edge needs to be traversed, and execute C4.

[0144] C4. Add the edge identifier of the current edge to the set of traversed edge identifiers.

[0145] Set the current pipeline S d The edge identifier of the current edge is added to the set of traversed edge identifiers to prevent subsequent loops from traversing this pipeline edge again.

[0146] C5. Get all associated pipelines containing the current edge.

[0147] Get the total number n of associated pipelines that include the current edge, set the associated pipeline loop identifier l to 0, and set n to an integer greater than or equal to 1.

[0148] C6. Determine whether all associated pipelines of the current edge have been traversed.

[0149] Add 1 to the associated pipeline loop identifier, l=l+1, and determine whether l is greater than n. If so, it means that all associated pipelines containing the current edge have been traversed, and return to C2. If not, it means that other associated pipelines of the current edge need to be traversed, and execute C7.

[0150] C7. Determine whether the associated pipelines are interconnected pipelines.

[0151] According to the pipe identifier of the associated pipe 1, it is determined whether the associated pipe 1 is a cylindrical pipe. If so, it means that the associated pipe 1 is a connected pipe, and C8 is executed. If not, it means that the associated pipe 1 is not a connected pipe, and C6 is executed.

[0152] C8. Determine whether the associated pipeline has been traversed.

[0153] Check whether the pipe identifier of the associated pipe l exists in the traversed pipe identifier set and the filtered pipe identifier set. If so, it means that the associated pipe l has been traversed, and return to C6. If not, it means that the associated pipe l is a valid associated pipe that has not been traversed, and execute C9.

[0154] C9. Add the pipe identifier of the associated pipe to the traversed pipe identifier set.

[0155] Add the pipeline identifier of the valid associated pipeline l to the traversed pipeline identifier set to prevent the valid associated pipeline l from being traversed next time, d=d+1, and use the valid associated pipeline l as the current pipeline S d , return to C6.

[0156] Exemplarily, the pipe identifier of the valid associated pipe l is added to the set of traversed pipe identifiers, and at this time d=2.

[0157] C10. Determine whether the time consumed in traversing the same pipeline exceeds the preset screening time.

[0158] Determine whether the time spent on traversing the same pipeline exceeds the preset screening time. If yes, execute C12; if no, execute C11.

[0159] One water inlet pipe corresponds to only one interconnected pipe group. No matter how long it takes, it is impossible to traverse the interconnected pipes from one water inlet pipe to obtain another interconnected pipe group.

[0160] C11. Update the current pipeline.

[0161] Update the current pipeline using the valid associated pipeline traversed from the traversed pipeline identifier set and execute C1.

[0162] For example, the valid associated pipeline l in the traversed pipeline identifier set is used as the current pipeline. At this time, the current pipeline S d is S2.

[0163] C12. End the traversal of the connected pipelines.

[0164] The embodiment of the present application provides a scheme for traversing interconnected pipes, which obtains all pipe edges of the current pipe, traverses each untraversed pipe edge, traverses all interconnected pipes including the untraversed pipe edges, determines the pipe type and whether the pipes have been traversed for all interconnected pipes including the untraversed pipe edges, and adds the untraversed interconnected pipes to the set of traversed pipe identifiers. Through the interconnected pipe traversal, the interconnected pipe group where the current pipe is located can be found, and the pipe identifiers of all interconnected pipes in the entire interconnected pipe group can be stored. The scheme can also prevent the traversal of the already traversed pipe edges and interconnected pipes, avoid repeated operations, and improve the efficiency of finding interconnected pipe groups.

[0165] Embodiment 4

[0166] In order to obtain the water pipeline, it is necessary to remove the terminal pipeline after removing the non-water pipeline in the interconnected pipeline group.

[0167] Figure 4 For a schematic diagram of the process of removing the terminal pipeline shown in the embodiment of the present application, please refer to Figure 4 The terminal pipeline removal solution provided in the embodiment of the present application is as follows:

[0168] D1. Obtain all pipeline edges of connected pipelines according to pipeline identifiers.

[0169] According to the pipeline identifiers in the filtered pipeline identifier set, all pipeline edges of each connected pipeline are obtained. The total number of pipeline edges of each connected pipeline is m, and there are n connected pipelines in total. Set the current pipeline edge loop count i to 0, set the pipeline traversal count j to 0, and start looping through the current pipeline.

[0170] D2. Determine whether all connected pipelines have been traversed.

[0171] j=j+1, determine whether the number of pipeline traversal j is greater than n. If yes, execute D8. If not, execute D3.

[0172] D3. Determine whether the total number of pipeline edges of the current pipeline is greater than 3.

[0173] Determine whether the total number of pipe edges of the current pipe is greater than 3. If so, the current pipe is a non-terminal pipe, and determine whether the next connected pipe is a terminal pipe, and return to D2. If not, execute D4.

[0174] D4. Determine whether all pipeline edges of the current pipeline have been traversed.

[0175] i=i+1, determine whether i is greater than m. If so, all pipeline edges of the current pipeline have been traversed, and determine whether the next connected pipeline is a terminal pipeline, and return to D2. If not, execute D5.

[0176] D5. Obtain the number of endpoints of the i-th pipeline edge.

[0177] Get the number k of endpoints of the i-th pipe edge.

[0178] D6. Determine whether the number k of endpoints of the i-th pipe edge is 0.

[0179] Determine whether the number of endpoints k of the i-th pipe edge is 0. If so, the current pipe is a terminal pipe and execute D7. If not, return to D4.

[0180] D7. Exclude the pipe identifier of the current pipe from the filtered pipe identifier set.

[0181] Excludes the pipe identifier of the current pipe from the filtered set of pipe identifiers and returns D2.

[0182] D8. Finish removing the terminal pipe.

[0183] The embodiment of the present application provides a solution for removing terminal pipes, which obtains all pipe edges of all interconnected pipes in the filtered pipe identifier set, loops through each interconnected pipe, and when the total number of pipe edges of the current pipe is 3 and the number of endpoints of at least one pipe edge is 0, the current pipe is a terminal pipe. The embodiment of the present application can accurately filter out the terminal pipes in the filtered pipe identifier set, and by excluding the interconnected pipes, the water route extracted subsequently can be free of bifurcations.

[0184] Embodiment 5

[0185] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides an electronic device and corresponding embodiments.

[0186] Figure 7 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.

[0187] See also Figure 7 , the electronic device 1000 includes a memory 1010 and a processor 1020 .

[0188] The processor 1020 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0189] The memory 1010 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 1020 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 1010 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 1010 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0190] The memory 1010 stores executable codes, and when the executable codes are processed by the processor 1020 , the processor 1020 can execute part or all of the methods described above.

[0191] The scheme of the present application has been described in detail above with reference to the accompanying drawings. In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, refer to the relevant description of other embodiments. Those skilled in the art should also know that the actions and modules involved in the description are not necessarily required for the present application. In addition, it can be understood that the steps in the method of the embodiment of the present application can be adjusted in order, merged and deleted according to actual needs, and the modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0192] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.

[0193] Alternatively, the present application can also be implemented as a non-temporary machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or electronic device, server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.

[0194] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the application herein may be implemented as electronic hardware, computer software, or combinations of both.

[0195] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system and method according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, a program segment or a code, and the part of the module, the program segment or the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or the flow chart, and the combination of the square boxes in the block diagram and / or the flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0196] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. An intelligent water extraction route method, characterized in that: include: Get the connected pipeline group in the target model body; Removing non-waterway pipes and terminal pipes from the interconnected pipe group to obtain non-terminal pipes; the non-waterway pipes are interconnected pipes whose radius is different from that of the waterway pipes, and the terminal pipes are interconnected pipes having only three pipe edges, and at least one of the pipe edges has an endpoint number of 0; Obtain the water inlet pipe and the water outlet pipe of the interconnected pipe group; Adding a water inlet pipe and a water outlet pipe to the non-terminal pipe to obtain a waterway pipe; Extracting a water route according to the water pipeline; The water route extraction according to the waterway pipeline comprises: Extract all center lines m of the waterway pipeline, determine whether the ith center line and the i+1th center line intersect; if they intersect, add the intersection point to the path point set; if they do not intersect, select the two endpoints of the ith center line and the i+1th center line that are closest to each other, use the midpoint of the two endpoints as a substitute intersection point, and add the substitute intersection point to the path point set; Connecting the intersection point in the path point set and the alternative intersection point to obtain the water route; The path point set is a set of all intersection points and the replacement intersection points.

2. The intelligent water extraction route method according to claim 1, characterized in that: The obtaining of the interconnected pipelines in the target model body includes: All N water inlet pipes of the target model body are obtained, and interconnected pipes of the N water inlet pipes are traversed to obtain the interconnected pipe group; wherein N is an integer greater than 0.

3. The intelligent water extraction route method according to claim 2, characterized in that: The interconnected pipeline traversal includes: Select the first water inlet pipe as the current pipe; traverse all M1 pipe edges of the current pipe, filter out V1 untraversed pipe edges from the M1 pipe edges, and add the edge identifiers of the V1 untraversed pipe edges to the traversed edge identifier set; filter all K1 valid associated pipes of the V1 untraversed pipe edges, loop through the K1 valid associated pipes, and obtain a traversed pipe identifier set; add the traversed pipe identifier set to the filtered pipe identifier set, mark the filtered pipe identifier set, and obtain a first connected pipe group; clear the traversed edge identifier set and the traversed pipe identifier set; wherein M1 is an integer greater than 2, V1 is an integer greater than or equal to 0, and K1 is an integer greater than or equal to 0; The current pipeline is the interconnected pipeline currently being traversed; The traversed edge identifier set is a set storing edge identifiers of traversed pipeline edges; The traversed pipe identifier set is a set of pipe identifiers that temporarily stores traversed pipes that are connected to each other; The filtered pipe identifier set is a set storing pipe identifiers of traversed interconnected pipes.

4. The intelligent water extraction route method according to claim 3, characterized in that: After obtaining the first interconnected pipeline group, the method further includes: Clear the traversed edge identifier set and the traversed pipe identifier set; Select a second water inlet pipe as the current pipe; traverse all M2 pipe edges of the current pipe, filter out V2 untraversed pipe edges from the M2 pipe edges, and add the edge identifiers of the V2 untraversed pipe edges to the traversed edge identifier set; filter all K2 valid associated pipes of the V2 untraversed pipe edges, loop through the K2 valid associated pipes to obtain a traversed pipe identifier set; add the traversed pipe identifier set to the filtered pipe identifier set, mark the filtered pipe identifier set, and obtain a second interconnected pipe group; wherein M2 is an integer greater than 2, V2 is an integer greater than or equal to 0, and K2 is an integer greater than or equal to 0.

5. The intelligent water extraction route method according to claim 3, characterized in that: The screening of all K1 valid associated pipelines of the V1 pipeline edges that have not been traversed includes: Traverse all S1 associated pipes of the V1 untraversed pipe edges, and select the K1 valid associated pipes from the S1 associated pipes; wherein S1 is an integer greater than or equal to 1; The valid associated pipe is a connected pipe whose pipe identifier does not exist in the traversed pipe identifier set.

6. The intelligent water extraction route method according to claim 3, characterized in that: The loop traverses the K1 valid associated pipelines, including: Select the first valid associated pipeline among the K1 valid associated pipelines as the current pipeline, traverse all E1 pipeline edges in the current pipeline, and screen out F1 untraversed pipeline edges from the E1 pipeline edges; add the edge identifiers of the F1 untraversed pipeline edges to the traversed edge identifier set, screen all G1 valid associated pipelines of the F1 untraversed pipeline edges, and add the pipeline identifiers of the G1 valid associated pipelines to the traversed pipeline identifier set; wherein E1 is an integer greater than 2, F1 is an integer greater than or equal to 0, and G1 is an integer greater than or equal to 0; The untraversed pipeline edge is a pipeline edge whose edge identifier does not exist in the edge identifier set.

7. The intelligent water extraction route method according to claim 6, characterized in that: After adding the pipe identifiers of the G1 valid associated pipes to the traversed pipe identifier set, the method further includes: The second valid associated pipe among the K1 valid associated pipes is used as the current pipe, all E2 pipe edges in the current pipe are traversed, and F2 untraversed pipe edges are screened out from the E2 pipe edges; the edge identifiers of the F2 untraversed pipe edges are added to the traversed edge identifier set, all G2 valid associated pipes of the F2 untraversed pipe edges are screened, and the pipe identifiers of the G2 valid associated pipes are added to the traversed pipe identifier set; wherein E2 is an integer greater than 2, F2 is an integer greater than or equal to 0, and G2 is an integer greater than or equal to 0.

8. The intelligent water extraction route method according to claim 1, characterized in that: The method of removing non-water pipes comprises: Detect the radius of all interconnected pipes corresponding to the filtered pipe identifier set; The radii of all the interconnected pipes are compared with the radius of the waterway pipe, pipe identifiers of the interconnected pipes whose radii are inconsistent with the radius of the waterway pipe are screened out, and the pipe identifiers are excluded from the set of screened pipe identifiers.

9. The intelligent water extraction route method according to claim 1, characterized in that: The removal of the terminal pipeline comprises: Obtain the total number of pipe edges q of each interconnected pipe corresponding to the filtered pipe identifier set, and determine whether the total number of pipe edges q is greater than 3; if so, the interconnected pipe is not a terminal pipe, and if not, obtain the number of endpoints of each pipe edge of the interconnected pipe; Determine whether the connected pipe has a pipe edge with an endpoint number of 0; if so, the connected pipe is a terminal pipe, if not, the connected pipe is not a terminal pipe.

10. The intelligent water extraction route method according to claim 1, characterized in that: After adding the intersection point to the path point set and before connecting the intersection point in the path point set with the replacement intersection point, the method further includes: Add the coordinates of the point on the first center line that is farthest from the second center line to the front of the path point set; The coordinates of the point on the mth center line that is farthest from the m-1th center line are added to the end of the path point set.

11. The intelligent water extraction route method according to claim 2, characterized in that: The traversing the N water inlet pipes in communication with each other includes: When the time consumed by the traversal of the interconnected pipelines exceeds the preset screening time, the traversal of the interconnected pipelines ends; The preset screening time is the maximum time required to traverse the interconnected pipelines.

12. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the intelligent water extraction route method according to any one of claims 1 to 11.

13. A non-transitory machine-readable storage medium, characterized in that: Executable codes are stored thereon, and when the executable codes are executed by a processor of an electronic device, the processor is caused to execute the intelligent water extraction route method as described in any one of claims 1-11.

Citation Information

Patent Citations

  • Path planning method, path planning device, computer device and storage medium

    CN110221600A

  • Drainage line data display method and device, computer equipment and storage medium

    CN112100272A