Pipeline diagram automatic drawing method and system, electronic equipment and storage medium

By automatically drawing drainage pipeline diagrams by constructing topology structures, the problem of low drawing efficiency and accuracy in existing technologies is solved, achieving efficient and accurate pipeline diagram generation and supporting real-time updates and data consistency for complex networks.

CN120995629APending Publication Date: 2025-11-21CHANGJIANG GEOPHYSICAL EXPLORATION & TESTING (WUHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510972511.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

The existing technology for drawing drainage pipeline diagrams has low efficiency and accuracy, relying on manual drawing or semi-automatic block insertion methods, resulting in large operational errors and making it difficult to meet the needs of engineering design and operation and maintenance.

Method used

A topology structure with pipe points as vertices and pipelines as edges is constructed. By traversing the pipe points and pipeline nodes, the rotation angle and topological relationship are automatically determined, thereby realizing the automatic drawing of pipeline diagrams, especially the calculation of box culvert boundary lines.

Benefits of technology

It significantly improves the efficiency and accuracy of drawing drainage pipeline diagrams, reduces human error, ensures that graphic symbols are consistent with the actual pipeline direction, and supports rapid updates of network structures and data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120995629A_ABST
    Figure CN120995629A_ABST
Patent Text Reader

Abstract

The invention provides a pipeline diagram automatic drawing method and system, electronic equipment and a storage medium, and belongs to the technical field of geographic information systems.The pipeline diagram automatic drawing method includes the steps that according to position information of pipe points and pipelines in a pipe network, a topological structure with the pipe points as vertexes and the pipelines as edges is constructed; the topological structure comprises a plurality of pipe point nodes and a plurality of pipeline nodes; traversing each pipe point node in the topological structure, and determining the rotation angle of each pipe point according to the direction of the in-degree pipeline and / or out-degree pipeline recorded by each pipe point node; all pipeline nodes in the topological structure are traversed, and the topological relation between pipelines is determined; and in the target drawing coordinate system, automatically drawing a pipeline diagram according to the rotation angles of all the pipe points and the topological relation between the pipelines. The spatial relationship of the drainage pipe network is converted into the graph structure information by constructing the topological structure, the pipe point rotation angle calculation is realized based on the structure, and the drawing of each element of the drainage pipe graph is realized, so that the drawing efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of geographic information system technology, and in particular to a method, system, electronic device and storage medium for automatically drawing pipeline maps. Background Technology

[0002] Currently, in the design and operation of urban drainage systems, drainage pipeline diagrams serve as core documents, playing a crucial role in representing pipe points, pipelines, and their connections. As pipeline network structures become increasingly complex, the diagrams must not only cover centerlines, node symbols, and pipeline types, but also comprehensively represent geometric elements such as corner structures and boundaries of special-shaped structures.

[0003] In existing technologies, the generation of drainage pipeline diagrams typically relies on manual drawing or semi-automatic block insertion. Designers must first draw the graphics one by one based on the coordinates of the pipe points and pipelines, then manually adjust the symbol direction, and manually determine the connection relationships to draw the centerline and boundary structure. This method is inefficient and susceptible to operational errors, resulting in low efficiency and accuracy in pipeline diagram drawing.

[0004] Therefore, improving the efficiency and accuracy of pipeline diagram drawing has become an urgent technical problem to be solved. Summary of the Invention

[0005] This invention provides a method, system, electronic device, and storage medium for automatically drawing pipeline diagrams, in order to overcome the deficiencies in the prior art and improve the efficiency and accuracy of pipeline diagram drawing.

[0006] This invention provides a method for automatically drawing pipeline diagrams, comprising the following steps: Based on the location information of pipe points and pipelines in the pipeline network, a topology structure is constructed with pipe points as vertices and pipelines as edges. The topology structure includes multiple pipe point nodes and multiple pipeline nodes. Each pipe point node is used to record the in-degree pipelines and / or out-degree pipelines connected to the corresponding pipe point. Each pipeline node is used to record the starting pipe point, the ending pipe point, and the next out-degree pipeline starting from the starting pipe point and the next in-degree pipeline ending from the ending pipe point for chain traversal of the pipeline. Traverse each of the pipe nodes in the topology and determine the rotation angle of each pipe node based on the direction of the in-degree pipeline and / or out-degree pipeline recorded by each pipe node. Traverse all the pipeline nodes in the topology to determine the topological relationships between the pipelines; In the target drawing coordinate system, the pipeline diagram is automatically drawn based on the rotation angles of all the pipe points and the topological relationships between the pipelines.

[0007] According to the present invention, an automatic pipeline diagram drawing method is provided, wherein determining the rotation angle of each pipeline node based on the direction of the in-line pipeline and / or out-line pipeline recorded at each pipeline node includes: When only the infeed line is connected to the pipe point, the direction angle of the infeed line is taken as the rotation angle of the pipe point. When only the outlet pipeline is connected to the pipe point, the sum of the direction angle of the outlet pipeline and the preset angle is used as the rotation angle of the pipe point. When both the infeed pipeline and the outfeed pipeline are connected to the pipe point simultaneously, the average of the direction angles of the infeed pipeline and the outfeed pipeline is taken as the rotation angle of the pipe point.

[0008] The automatic pipeline diagram drawing method provided by the present invention further includes: When the pipeline type corresponding to the pipeline node is a drainage culvert, the target in-degree pipeline and the target out-degree pipeline connected to the target pipeline node are determined according to the topology. Based on the coordinates of the target pipe point, the angle formed between the directions of the target infeed pipeline and the target outfeed pipeline, and the preset box culvert width parameter, calculate the reference point used to draw the box culvert boundary line; In the target drawing coordinate system, the boundary line of the box culvert is drawn based on the reference point.

[0009] According to the present invention, an automatic pipeline diagram drawing method is provided, wherein the reference points include a left reference point and a right reference point; the step of calculating the reference points for drawing the box culvert boundary line based on the coordinates of the target pipe point, the angle formed between the directions of the target in-line pipeline and the target out-line pipeline, and a preset box culvert width parameter includes: Taking the intersection of the directional extensions of the target infeed pipeline and the target outfeed pipeline at the target pipeline point as the starting point, a first vector is defined that starts from the intersection point and points along the target infeed pipeline, and a second vector starts from the intersection point and points along the target outfeed pipeline. Determine the positional relationship of the first vector relative to the second vector; Based on the positional relationship, the coordinates of the target pipe point, the angle between the first vector and the second vector, and the preset box culvert width parameter, the left reference point and the right reference point are calculated respectively.

[0010] According to the present invention, an automatic pipeline diagram drawing method is provided, wherein the step of calculating the left reference point and the right reference point based on the positional relationship, the coordinates of the target pipe point, the angle between the first vector and the second vector, and the preset box culvert width parameter includes: When the first vector is to the left of the second vector, the left reference point and the right reference point are calculated using the following formula: In the formula, The left reference point, The right-side reference point, For the target pipe point, The preset box culvert width parameter is half the width of the box culvert. The angle between the first vector and the second vector. For the first vector, For the second vector, The supplementary angle of the included angle. For point Point of view Vectors in the direction.

[0011] According to the present invention, an automatic pipeline diagram drawing method is provided, wherein the step of calculating the left reference point and the right reference point based on the positional relationship, the coordinates of the target pipe point, the angle between the first vector and the second vector, and the preset box culvert width parameter, further includes: When the first vector is to the right of the second vector, the left reference point and the right reference point are calculated using the following formula: In the formula, The left reference point, The right-side reference point, For the target pipe point, The preset box culvert width parameter, The angle between the first vector and the second vector. For the first vector, For the second vector, The supplementary angle of the included angle. For point Point of view Vectors in the direction.

[0012] The present invention also provides an automatic pipeline diagram drawing system, comprising the following modules: The first processing module is used to construct a topology structure with pipe points as vertices and pipelines as edges based on the location information of pipe points and pipelines in the pipeline network. The topology structure includes multiple pipe point nodes and multiple pipeline nodes. Each pipe point node is used to record the in-degree pipelines and / or out-degree pipelines connected to the corresponding pipe point. Each pipeline node is used to record the starting pipe point, the ending pipe point, and the next out-degree pipeline starting from the starting pipe point and the next in-degree pipeline ending from the ending pipe point for chain traversal of the pipeline. The second processing module is used to traverse each of the pipe nodes in the topology and determine the rotation angle of each pipe node according to the direction of the in-degree pipeline and / or out-degree pipeline recorded by each pipe node. The third processing module is used to traverse all the pipeline nodes in the topology structure and determine the topological relationships between the pipelines. The fourth processing module is used to automatically draw a pipeline diagram in the target drawing coordinate system based on the rotation angles of all the pipe points and the topological relationships between the pipelines.

[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the pipeline diagram automatic drawing method as described above.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the pipeline diagram automatic drawing method as described above.

[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the pipeline diagram automatic drawing method as described above.

[0016] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: By constructing a topology with pipe nodes as vertices and pipelines as edges, graph theory modeling of the drainage network structure is achieved, explicitly representing the connectivity and directional attributes between pipe nodes and pipelines, providing a data foundation for subsequent automatic drawing. By recording the in-degree and / or out-degree pipelines for each pipe node, and the starting and ending pipe nodes, as well as a linked traversal pointer for each pipeline node, the network can be traversed quickly and supports real-time linkage during additions, deletions, and modifications, significantly improving the structural maintainability and data consistency of complex drainage networks. By traversing pipe nodes and automatically determining the pipe node rotation angle based on their in-degree and out-degree pipeline directions, adaptive matching of the block symbol orientation with the actual pipeline direction is achieved, avoiding a large amount of repetitive operations caused by manual rotation and improving the accuracy of symbol representation. By traversing pipeline nodes and determining upstream and downstream topological relationships based on linked list pointers, complete pipeline connectivity paths can be quickly obtained without the need for coordinate approximation, providing a reliable structural basis for subsequent continuous drawing. By automatically drawing pipeline diagrams by calling the aforementioned rotation angles and topological relationships in the target drawing coordinate system, the efficiency and accuracy of drawing drainage pipeline diagrams are significantly improved. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is one of the flowcharts illustrating the automatic pipeline diagram drawing method provided by the present invention.

[0019] Figure 2 This is the second flowchart of the pipeline diagram automatic drawing method provided by the present invention.

[0020] Figure 3 This is the third flowchart of the pipeline diagram automatic drawing method provided by the present invention.

[0021] Figure 4 This is the fourth flowchart of the pipeline diagram automatic drawing method provided by the present invention.

[0022] Figure 5 This is a schematic diagram of box culvert boundary line calculation provided by the present invention.

[0023] Figure 6 This is a schematic diagram of the boundary line of the box culvert provided by the present invention.

[0024] Figure 7 This is a schematic diagram of the automatic pipeline diagram drawing system provided by the present invention.

[0025] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0027] It should be noted that in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The terms "upper," "lower," etc., indicating orientation or positional relationships according to the accompanying drawings, are only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the system or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0028] The terms "first," "second," etc., used in this invention are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0029] The following is combined Figures 1-8 This invention describes the automatic pipeline diagram drawing method, system, electronic device, and storage medium provided by the present invention.

[0030] In the process of drawing drainage pipeline diagrams, traditional methods generally rely on manual drawing of pipe points and pipelines sequentially, followed by manual correction of the orientation, connection relationships, and structural closure of graphic symbols to complete the drawing. This workflow is not only inefficient but also prone to problems such as inconsistencies between pipe points and pipelines, incorrect rotation of graphic symbols, and poor connection of culvert boundaries, making it difficult to meet the actual needs of engineering design or drainage facility operation and maintenance for graphic accuracy and automation. Therefore, this embodiment proposes a drawing workflow driven by the diagram structure, referring to... Figure 1 , Figure 1 This is one of the flowcharts illustrating the automatic pipeline diagram drawing method provided by the present invention, such as... Figure 1 As shown, steps 101 to 104 are included: Step 101: Based on the location information of pipe points and pipelines in the pipeline network, construct a topology with pipe points as vertices and pipelines as edges. The topology includes multiple pipe point nodes and multiple pipeline nodes. Each pipe point node is used to record the in-degree pipelines and / or out-degree pipelines connected to the corresponding pipe point. Each pipeline node is used to record the starting pipe point, ending pipe point, and the next out-degree pipeline starting from the starting pipe point and the next in-degree pipeline ending from the ending pipe point for chained traversal of the pipeline.

[0031] In this embodiment, step 101 specifically involves: constructing a topology structure with pipe nodes as vertices and pipelines as edges based on the location information of pipe points and pipelines in the pipeline network. This topology structure includes multiple pipe node nodes and multiple pipeline nodes. Each pipe node is used to record the in-degree pipelines and / or out-degree pipelines connected to the corresponding pipe node. Each pipeline node is used to record the starting pipe node, the ending pipe node, and the next out-degree pipeline starting from the starting pipe node and the next in-degree pipeline ending at the ending pipe node for chain-like traversal of the pipeline.

[0032] In its implementation, the system first reads the spatial coordinates and attribute information of each pipe point (such as inspection wells, storm drain grates, and reducer wells) and pipeline (such as drainage pipe sections and box culverts) in the pipe network. For each pipe point, a "pipe point node" object is constructed. Its core data structure includes an in-degree pipeline list and an out-degree pipeline list, used to store pipelines connected to the pipe point and pointing towards it, as well as pipelines originating from the pipe point and connecting to other pipe points. For each pipeline, a "pipeline node" object is constructed, explicitly recording its starting pipe point (tail point) and ending pipe point (head point). Simultaneously, based on a "cross-linked list" approach, pointers to other adjacent pipeline nodes are constructed, specifically including: a pointer (tlink) to the next out-degree pipeline node starting from the starting pipe point of the pipeline, and a pointer (hlink) to the next in-degree pipeline node ending at the ending pipe point of the pipeline. This allows the entire drainage network to form a structured, directed graph model in memory.

[0033] By constructing the aforementioned topology, this invention not only preserves the geometric information of the original graphics but also introduces the node-edge model from graph theory, effectively expressing the connection relationships between points and lines and the directionality of water flow in the drainage network. This structure achieves a strong binding between the drawing logic and the data structure, enabling the generation of graphics to evolve synchronously with the network structure. When any pipeline is modified, added, deleted, or redirected, the system can immediately update the in / out degree status of the relevant pipeline points and their associated line segments, thereby achieving true point-line linkage and intelligent graphics refresh.

[0034] In summary, step 101, as the foundation of the entire method, not only realizes the structural modeling and connection logic abstraction of the drainage network, but also, through the design of the cross-linked list data structure, enables the drainage pipeline diagram to have graph theory properties of being traversable, derivable, and self-updating, laying the core data foundation for realizing an automated and high-precision graphics drawing process.

[0035] Step 102: Traverse each pipe node in the topology and determine the rotation angle of each pipe node based on the direction of the in-degree pipe and / or out-degree pipe recorded by each pipe node.

[0036] After completing the topology construction in step 101, to achieve automatic orientation derivation of block symbols in the pipeline diagram and further improve the intelligence level of graphic drawing and the geometric consistency of the drawings, the system needs to determine the rotation angle of the block symbol corresponding to each pipe node in the topology based on the pipeline direction associated with that node. In traditional drawing methods, the orientation of block symbols (such as manholes, storm drain grates, etc.) usually relies on manual judgment and adjustment, which is prone to affecting the accuracy of the drawing due to incorrect symbol orientation settings, and can lead to batch deviations in large-scale drawing scenarios, affecting engineering design and subsequent analysis. Therefore, this embodiment proposes an automatic rotation angle derivation mechanism oriented towards the topology structure, which is used to accurately calculate the block rotation angle of each pipe node based on the graph structure.

[0037] Step 102 specifically includes: traversing each pipe node in the topology and determining the rotation angle of each pipe node based on the direction of the in-degree pipeline and / or out-degree pipeline recorded by each pipe node. The core of this step is to map the existing pipeline direction attributes in the topology information to the rotation angle parameters of the pipe node blocks, so that the subsequently inserted graphic symbols have a geometric representation consistent with the direction of the drainage pipeline.

[0038] In one possible implementation, refer to Figure 2 , Figure 2 This is a second schematic flowchart of the pipeline diagram automatic drawing method provided by the present invention, as shown below. Figure 2 As shown, step 102 specifically includes steps 201 to 203: Step 201: When only the infeed pipeline is connected to the pipe point, the direction angle of the infeed pipeline is used as the rotation angle of the pipe point.

[0039] Step 202: When only the outgoing pipeline is connected to the pipe point, the sum of the direction angle of the outgoing pipeline and the preset angle is used as the rotation angle of the pipe point.

[0040] Step 203: When both the inlet pipeline and the outlet pipeline are connected to the pipe point at the same time, the average of the direction angles of the inlet pipeline and the outlet pipeline is taken as the rotation angle of the pipe point.

[0041] In the automatic drawing process of drainage pipeline diagrams, to achieve precise control over the direction of pipe point symbols, it is necessary to deduce the rotation angle of each pipe point based on the direction information of the pipelines connected to the pipe points in the topology. Step 102 has clarified the overall angle determination logic, while steps 201 to 203 refine the calculation for three common connection scenarios, proposing specific angle calculation rules. By establishing a one-to-one correspondence between the pipe point connection structure mode and the symbol rotation angle calculation, it is possible to ensure that the representation of various drainage structures in the drawing conforms to the actual installation direction, further improving the accuracy and automation level of the drawing results.

[0042] In step 201, for cases where only the incoming pipeline connects to the pipe point, the system uses the direction angle of the incoming pipeline as the rotation angle of the pipe point. This implementation is suitable for scenarios where the pipe point is located at the end of a drainage system and serves only as a water inflow point, such as a terminal inspection well. Since such structures need to be installed in the direction of incoming water, directly using the direction of the incoming pipeline for setting the rotation angle is both practical and avoids unnecessary deflection errors. In actual execution, the system converts the incoming pipeline direction vector recorded by the pipe point node into an angle value and assigns the pipe point symbol as its final drawing orientation.

[0043] In step 202, for cases where only the outgoing pipeline connects to the pipe point, the system adds a preset angle parameter to the outgoing pipeline's direction angle as the rotation angle of the pipe point. This solution is particularly suitable for structures such as rainwater grates, which are often installed above pipes and need to be placed vertically. In practical implementation, the system can preset a rotation offset angle (e.g., 90 degrees), add it to the outgoing pipeline's direction angle to obtain the final rotation angle, thus making the symbol direction perpendicular to the water flow direction. This mechanism eliminates the need for manual symbol rotation in traditional drawing of rainwater grates, improving the level of drawing automation.

[0044] In step 203, for cases where both inbound and outbound pipelines are connected to the same pipe point, the system takes the average of the inbound and outbound direction angles as the rotation angle of that pipe point. Such structures are typically located at the connection points between two pipe sections, such as reducers or intermediate inspection wells. Considering that their symbols should ideally be located at the center of the pipe to maintain a balanced orientation, taking the average angle value achieves directional symmetry, contributing to the aesthetics and geometric consistency of the graphics. During processing, the system extracts the inbound and outbound direction angles separately, generates the rotation angle using an arithmetic mean, and automatically updates the tile attributes associated with that pipe point.

[0045] Step 103: Traverse all pipeline nodes in the topology to determine the topological relationships between pipelines.

[0046] Step 103 specifically includes traversing all pipeline nodes in the topology to determine the topological relationships between pipelines. The technical basis of this step lies in the topology established in step 101, where each pipeline node explicitly records its starting point (tail point) and ending point (head point). Furthermore, the `tlink` and `hlink` fields in the "cross-linked list" structure point to the next out-degree pipeline originating from the same starting point and the next in-degree pipeline received by the same ending point, respectively. Therefore, the system can efficiently identify the upstream and downstream pipelines connected to any pipeline without relying on coordinate matching, simply by traversing pointers in the graph structure, thus achieving connectivity analysis of the chain structure.

[0047] In a specific implementation, the system first traverses all pipeline nodes. For each node, it reads the pipeline node information corresponding to its TailVex and HeadVex, and obtains the tlink and hlink values ​​of the current pipeline. Using the tlink field, the system can quickly find the next out-degree pipeline originating from the starting pipeline, achieving multi-line structure identification starting from a single point. Using the hlink field, it can find other in-degree pipelines merging into the terminating pipeline, achieving multi-line convergence structure identification. During the traversal, the system can construct a topology table containing "pipeline number—previous pipeline—subsequent pipeline," thereby clarifying the upstream and downstream structural position of each pipeline in the entire network.

[0048] Leveraging the aforementioned structured topology recognition mechanism, the system can not only draw the centerline of a single pipeline but also effectively support the derivation of boundary lines for special structures such as drainage culverts. The left and right boundaries rely on the angle between the in-degree and out-degree, which presupposes the availability of connectivity information between upstream and downstream pipelines. Furthermore, when the graphics need updating or the structure changes (such as inserting new line segments or moving pipe points), the system can also update the connection pointers in the graph structure to achieve synchronous updates of the structure and linked adjustments to the graphics.

[0049] Step 104: In the target drawing coordinate system, automatically draw the pipeline diagram based on the rotation angle of all pipe points and the topological relationship between pipelines.

[0050] After completing the topology construction, pipe point rotation angle calculation, and pipeline topology relationship identification, the system needs to complete the drawing operations of all block symbols and pipeline graphics in the target drawing coordinate system to achieve the graphical output and visual expression of the drainage pipeline diagram. In the traditional method, pipe point blocks need to be manually inserted and rotated by the drafter, and pipelines need to be generated by drawing line segments between two points. The process is cumbersome, error-prone, and difficult to adjust in a coordinated manner. Especially in cases with complex network structures or diverse pipeline types, traditional methods often fail to effectively ensure the coherence of the graphical structure and the standardization of expression. To this end, this embodiment proposes a structure information-driven automatic graphics generation mechanism, which automatically completes the overall drawing of the drainage pipeline diagram in the drawing coordinate system by calling the aforementioned structural data.

[0051] Step 104 specifically involves automatically drawing a pipeline diagram in the target drawing coordinate system based on the rotation angles of all pipe points and the topological relationships between pipelines. The core of this step is to map the geometric, directional, and connection information stored in the topological structure into graphic generation instructions, thereby achieving a unified output of block graphics and pipeline graphics.

[0052] In a specific implementation, the system first reads the position information and calculated rotation angle parameters of each pipe node, and then, based on a preset symbol style library, batch inserts block symbols in the graphics editing environment. Each block is positioned according to its coordinates during insertion, while its orientation is controlled by the rotation angle to ensure that all symbols are consistent with the actual pipeline direction. For example, inspection wells use circular blocks, and rainwater grates use rectangular blocks, which are automatically rotated to match the pipeline direction according to the angle parameters, avoiding manual rotation errors and improving the neatness of the graphics.

[0053] Subsequently, the system draws pipeline graphics on a per-node basis, based on the topological relationship between the starting and ending pipeline points. In general, a centerline is formed by connecting two points with a straight line. For special types of pipelines, such as drainage culverts, the system, after identifying the type, further utilizes the included angles of the upstream and downstream pipelines, preset width parameters, and calculated left and right boundary reference points to accurately draw the left and right boundary lines of the culvert in the coordinate system, ensuring its outline is closed and conforms to actual structural requirements. Furthermore, all drawing operations are performed uniformly in the target drawing coordinate system, ensuring accurate positioning of the overall drawing in the spatial reference system.

[0054] This step utilizes structural information from the topology to automate the entire drawing process from pipe points to pipelines, symbols, and boundaries. This significantly reduces the frequency and complexity of human intervention and avoids inconsistencies in engineering drawings caused by rotation angle deviations, mismatched connections, or incorrect graphic positions.

[0055] In the automatic drawing process of drainage pipeline diagrams, in addition to drawing the centerline for conventional pipelines, for special structures such as drainage box culverts, it is also necessary to draw their left and right boundary lines to restore the actual structural form. Box culverts usually have a certain width and cannot be simplified to a single line segment. If they are still expressed using the centerline, it will lead to geometric distortion of the drawing, thus affecting the accuracy of engineering design and facility maintenance. Therefore, to achieve automatic drawing of box culvert boundary lines, in one possible implementation, refer to... Figure 3 , Figure 3 This is the third flowchart illustrating the automatic pipeline diagram drawing method provided by the present invention, as shown below. Figure 3 As shown, the method also includes steps 301 to 303: Step 301: When the pipeline type corresponding to the pipeline node is a drainage box culvert, determine the target in-degree pipeline and target out-degree pipeline connected to the target pipeline node according to the topology.

[0056] Step 301 specifically includes: when the pipeline type corresponding to the pipeline node is a drainage culvert, determining the target in-degree pipeline and target out-degree pipeline connected to the target pipeline node based on the topology. The implementation of this step relies on the directed graph structure constructed in step 101, with pipeline nodes as vertices and pipelines as edges. Each pipeline node records a type field (used to identify whether it is a drainage culvert), a starting pipeline node, an ending pipeline node, and a chain traversal field (tlink, hlink) for fast access to adjacent pipelines.

[0057] In the specific implementation process, the system first traverses all pipeline nodes in the topology and determines the pipeline type field associated with each node. When the type field indicates that the pipeline is a "drainage culvert," the system marks it as a special processing object. Subsequently, the system obtains the starting and ending points of the culvert pipeline as reference nodes and sequentially accesses the sets of in-degree and out-degree pipelines maintained by these two points in the topology. Among them, the in-degree pipeline connected to the starting point is used to represent the upstream direction of the culvert, and the system uses it as the "target in-degree pipeline"; the out-degree pipeline connected to the ending point is used to represent the downstream direction of the culvert, and the system uses it as the "target out-degree pipeline." The above two directional pipelines jointly define the dominant water flow path of the culvert and will be used in subsequent steps for angle calculation, vector construction, and reference point derivation.

[0058] Step 302: Calculate the reference point for drawing the box culvert boundary line based on the coordinates of the target pipe point, the angle formed between the directions of the target in-line pipe and the target out-line pipe, and the preset box culvert width parameters.

[0059] In the automatic drawing of drainage pipeline diagrams, the graphical representation of drainage box culverts requires not only identifying their upstream and downstream structural relationships (as in step 301), but also deriving the key geometric control points constituting the culvert boundary lines based on these relationships. Since box culverts differ from ordinary pipelines, possessing a fixed width and explicit boundary lines, simply connecting two points with a centerline without considering boundary offsets will fail to accurately represent their spatial structure. Therefore, this embodiment proposes a reference point derivation mechanism based on angle analysis and joint calculation of width parameters to generate the left and right control points of the box culvert boundary lines, serving as the core foundation for subsequent boundary line drawing.

[0060] Step 302 specifically involves calculating a reference point for drawing the box culvert boundary line based on the coordinates of the target pipe point, the angle formed between the directions of the target inlet pipe and the target outlet pipe, and the preset box culvert width parameters. The "target pipe point" involved in this step is the starting or ending pipe point of the box culvert determined in step 301. The "target inlet pipe" and "target outlet pipe" represent the directional paths of water entering and exiting the box culvert. The "angle" represents the geometric angle between two directional vectors, used to measure the sharpness of the water flow change direction. The "box culvert width parameters" are the preset design standard or default structural width.

[0061] Specifically, the reference points include a left reference point and a right reference point. In one possible implementation, the reference... Figure 4 , Figure 4 This is the fourth flowchart illustrating the automatic pipeline diagram drawing method provided by the present invention, as shown below. Figure 4 As shown, step 302 specifically includes steps 401 to 403: Step 401: Taking the intersection of the directional extensions of the target in-line pipeline and the target out-line pipeline at the target pipeline point as the starting point, define a first vector starting from the intersection point and pointing along the target in-line pipeline, and a second vector starting from the intersection point and pointing along the target out-line pipeline.

[0062] In the automatic drawing process of drainage culverts, after identifying the target in-degree and out-degree pipelines, it is necessary to further construct geometric vectors consistent with the directions of these two pipelines to facilitate subsequent calculations of angles, determination of positional relationships, and derivation of boundary line reference points. However, the topological relationships in the pipeline topology alone are insufficient for graphical calculations; the topological relationships must be specifically mapped into geometric vectors with clear directions and coordinate origins to perform angle analysis and geometric transformations. Therefore, this embodiment introduces a vector construction mechanism based on the graph structure, using the target pipeline point as a unified reference origin to establish a consistent geometric description of the in-degree and out-degree directions, ensuring the logical continuity and geometric accuracy of subsequent calculations.

[0063] Step 401 specifically involves defining a first vector originating from this intersection point and extending along the target inlet and outlet pipelines at the target pipe point, using this intersection as the starting point. A second vector originating from this intersection and extending along the target outlet pipeline is also defined. The "starting point" in this step is the target pipe point itself, serving as the unified origin for structural and geometric transformations. The "first vector" represents the direction vector extending from the target pipe point along the inlet pipeline, and the "second vector" represents the direction vector extending from the target pipe point along the outlet pipeline. By constructing these two vectors, the direction and angle of the upstream and downstream water flow in the drainage culvert can be clearly represented in geometric space.

[0064] In a specific implementation, the system first extracts the coordinates of the two endpoints of the target inlet and outlet pipelines and constructs their respective direction vectors. To unify the reference starting point, the system forcibly sets the starting point of these two direction vectors to the coordinates of the target pipeline point, that is, shifts the remaining points towards the target pipeline point. The resulting first and second vectors both start from the target pipeline point, and their endpoints extend along the inlet and outlet directions, respectively, consistent with the actual water flow direction.

[0065] Step 402: Determine the positional relationship between the first vector and the second vector.

[0066] In the automatic generation of drainage culvert boundary lines, determining the left and right reference points for boundary calculation is a core operation. Since the calculation formula for the reference points relies on the supplementary angle and the offset of the geometric direction, and the offset direction is closely related to the spatial relative position of upstream and downstream pipelines, relying solely on the angle of the direction vector is insufficient to uniquely determine the offset direction of the left and right boundaries. Directly using the offset formula without considering the relative position may result in the left and right boundaries being reversed, leading to geometric errors or inverted shapes in the drawn culvert structure. Therefore, this embodiment, based on the construction of the in-degree and out-degree direction vectors, proposes a spatial relative position determination method based on the vector cross product or rotation matrix to clarify the positional relationship between the first vector and the second vector, providing a decision-making basis for the selection of the reference point offset formula.

[0067] Step 402 specifically involves determining the positional relationship between the first vector and the second vector. In this step, the "first vector" refers to the direction vector constructed by the target pipe point along the target in-degree pipeline direction; the "second vector" refers to the direction vector constructed by the target pipe point along the target out-degree pipeline direction. Determining the positional relationship is used to identify whether the first vector is located to the left or right of the second vector, thus serving as the judgment condition for different offset logic branches in step 403.

[0068] In a specific implementation, the system first calculates the cross product of the two direction vectors constructed in step 401 (or equivalently uses a two-dimensional vector rotation judgment method). Let the first vector be a and the second vector be b. If the cross product a×b>0, it can be determined that a is to the left of b; if a×b<0, it can be determined that a is to the right of b; if the cross product is zero, it indicates that the two vectors are collinear, and their relative orientation can be determined by further judging their directional consistency. This judgment has a clear geometric meaning in a two-dimensional coordinate system, that is, when the target tube point is taken as the origin, the counterclockwise direction of a in b is considered to be the left, and the clockwise direction is considered to be the right.

[0069] Step 403: Calculate the left reference point and the right reference point based on the positional relationship, the coordinates of the target pipe point, the angle between the first vector and the second vector, and the preset box culvert width parameter.

[0070] Step 403 specifically involves calculating the left and right reference points based on the positional relationship between the first vector and the second vector, the coordinates of the target pipe point, the angle between the first and second vectors, and the preset box culvert width parameter. In this step, the "positional relationship" is derived from the judgment result of step 402 and is used to distinguish whether the current geometric scene is "the first vector is to the left of the second vector" or "the first vector is to the right of the second vector"; the "angle" is the angle between the vectors obtained in step 302. its supplementary angle , used to control the boundary offset magnitude; "box culvert width parameter" is denoted as W, and the value of the box culvert width parameter is preferably half of the preset transverse dimension of the box culvert in the drainage design; "target pipe point coordinates" is the origin as the boundary offset reference.

[0071] In a specific implementation, the system first reads the coordinates of the target pipe point and then fills in the angle based on the included angle known from the previous steps. Based on the positional relationship, select the corresponding set of coordinate offset formulas to calculate the left and right reference points respectively.

[0072] In one possible implementation, step 403 specifically includes the following steps: When the first vector is positioned to the left of the second vector, the left and right reference points are calculated using the following formula: In the formula, Use the left-side reference point. As the reference point on the right, For the target management point, The preset box culvert width parameter (half the box culvert width) is used. The angle between the first vector and the second vector. Let be the first vector. For the second vector, The supplementary angle of the included angle. For point Point of view Vectors in the direction.

[0073] In another possible implementation, step 403 further includes the following steps: When the first vector is positioned to the right of the second vector, the left and right reference points are calculated using the following formula: In the formula, Use the left-side reference point. As the reference point on the right, For the target management point, The preset box culvert width parameters, The angle between the first vector and the second vector. Let be the first vector. For the second vector, The supplementary angle of the included angle. For point Point of view Vectors in the direction.

[0074] This application uses the example of a first vector a being positioned to the left of a second vector b to provide a detailed explanation of the method for calculating the left and right reference points. (Refer to...) Figure 5 , Figure 5 This is a schematic diagram of box culvert boundary line calculation provided by the present invention.

[0075] In such Figure 5 In the drainage culvert structure shown, firstly, geometrically, vector a represents the in-direction from upstream node Y1 to target pipe point Y2, and vector b represents the out-direction from Y2 to downstream node Y3. When vector a is to the left relative to vector b, the system determines that the connection structure of the culvert at that node is a left-biased configuration, meaning that the water flow path turns counterclockwise in the plane from the target pipe point. In this context, to achieve a reasonable symmetrical distribution of the boundary lines, a reasonable geometric offset must be constructed based on the current directional relationship and angular characteristics to obtain the coordinates of the left and right reference points.

[0076] The reference point offset is the target pipe point Y2, and its spatial coordinates are... The coordinates of all boundary points are derived by offsetting from this point. This is based on the angle between vectors a and b. The system calculates the supplementary angle. This supplementary angle is used to control the offset of the boundary line relative to the centerline in the plane. The offset value is directly related to the design width of the box culvert (i.e., twice the box culvert width parameter 2W), which is usually a construction parameter set in the project to control the spacing between the left and right boundaries.

[0077] After clarifying the angular relationship and width parameters, the left reference point is calculated using the following formula: The reference point on the right is calculated using the following formula: The left and right reference points thus form a set of geometric control points that constitute the starting point of the box culvert boundary. These points can then be directly used to draw the left and right boundary polyline segments, thereby achieving automatic closure of the box culvert's outer contour.

[0078] Step 303: In the target drawing coordinate system, draw the boundary line of the box culvert based on the reference point.

[0079] In the automated drawing process of drainage culverts, after deriving the coordinates of the left and right reference points, the boundary line of the culvert needs to be generated in the target drawing coordinate system using this set of reference points. Traditionally, the culvert boundary line is usually drawn manually by designers, relying on coordinate estimation and graphic copying. This process is cumbersome, lacks accuracy, and is difficult to adapt to complex pipeline corner structures. This embodiment, however, achieves automatic generation of the culvert boundary line in a spatial coordinate system by linking structural information-driven and reference point calculation results. This ensures that the boundary line is consistent with the water flow direction, node angles, and culvert width, forming a crucial link in the graphic representation.

[0080] In the target drawing coordinate system, draw the boundary line of the box culvert based on the reference point. Referring to the illustration, target pipe point Y2 is the connection node of the current box culvert structure, and the left reference point (e.g., in the figure) is... ) and the reference point on the right (e.g., in the figure) The two reference points are the starting points of the box culvert boundary derived from the previous steps. These two reference points are symmetrically offset along the midline of the angle between the in-degree vector a and the out-degree vector b, respectively, forming the spatial starting positions of the left and right boundaries of the box culvert, and constituting the first node of the boundary polyline.

[0081] In its implementation, the system first extracts the coordinates of the left and right reference points corresponding to the current node (e.g., Y2), and then finds the upstream and downstream nodes (e.g., Y1 and Y3) of this node in the box culvert connection path to further obtain their corresponding reference points. Subsequently, the system connects the reference points on the same side sequentially: for example, connecting... Forming the left boundary line of the box culvert, connecting This forms the right-side boundary line. At nodes, if there are corner structures, inflection point segments can be automatically generated based on changes in the included angle, ensuring that the boundary forms a continuous and closed outer contour structure in space. The final boundary line of the box culvert can be referenced. Figure 6 , Figure 6 This is a schematic diagram of the boundary line of the box culvert provided by the present invention.

[0082] By executing step 303, the culvert boundary line is automatically generated based on existing reference points, eliminating the need for manual drawing. This not only ensures the correctness and closure of the boundary direction but also guarantees strict alignment with the pipeline connection structure, ensuring the accuracy and consistency of the overall geometric representation of the drawing. It completely solves the problems of error-prone boundaries, omissions, and misalignments in traditional manual drawing, enhancing the practicality and reliability of the drainage pipeline drawing system in actual engineering design and data delivery.

[0083] Reference Figure 7 , Figure 7 This is a schematic diagram of the automatic pipeline diagram drawing system provided by the present invention. The system includes: The first processing module is used to construct a topology structure with pipe points as vertices and pipelines as edges based on the location information of pipe points and pipelines in the pipeline network. The topology structure includes multiple pipe point nodes and multiple pipeline nodes. Each pipe point node is used to record the in-degree pipelines and / or out-degree pipelines connected to the corresponding pipe point. Each pipeline node is used to record the starting pipe point, the ending pipe point, and the next out-degree pipeline starting from the starting pipe point and the next in-degree pipeline ending from the ending pipe point for chain traversal of the pipeline. The second processing module is used to traverse each pipe node in the topology and determine the rotation angle of each pipe node based on the direction of the in-degree pipe and / or out-degree pipe recorded by each pipe node. The third processing module is used to traverse all pipeline nodes in the topology and determine the topological relationships between pipelines. The fourth processing module is used to automatically draw pipeline diagrams in the target drawing coordinate system based on the rotation angles of all pipe points and the topological relationships between pipelines.

[0084] In one possible implementation, the second processing module is further configured to: When only the infeed pipeline is connected to the pipe point, the direction angle of the infeed pipeline is taken as the rotation angle of the pipe point. When only the outgoing pipeline is connected to the pipe point, the sum of the direction angle of the outgoing pipeline and the preset angle is used as the rotation angle of the pipe point. When both the infeed pipeline and the outfeed pipeline are connected to the pipe point simultaneously, the average of the direction angles of the infeed pipeline and the outfeed pipeline is taken as the rotation angle of the pipe point.

[0085] In one possible implementation, the system further includes a fifth module for: When the pipeline type corresponding to the pipeline node is a drainage box culvert, the target in-degree pipeline and the target out-degree pipeline connected to the target pipeline node are determined according to the topology. Based on the coordinates of the target pipe point, the angle formed between the directions of the target in-line pipe and the target out-line pipe, and the preset box culvert width parameters, calculate the reference point used to draw the box culvert boundary line; In the target drawing coordinate system, draw the boundary line of the box culvert based on the reference point.

[0086] In one possible implementation, the fifth module is further configured to: Taking the intersection of the directional extensions of the target in-line pipeline and the target out-line pipeline at the target pipeline point as the starting point, define a first vector that starts from the intersection point and points along the target in-line pipeline, and a second vector that starts from the intersection point and points along the target out-line pipeline. Determine the positional relationship of the first vector relative to the second vector; Based on the positional relationship, the coordinates of the target pipe point, the angle between the first and second vectors, and the preset box culvert width parameters, the left reference point and the right reference point are calculated respectively.

[0087] In one possible implementation, the fifth module is further configured to: When the first vector is positioned to the left of the second vector, the left and right reference points are calculated using the following formula: In the formula, Use the left-side reference point. As the reference point on the right, For the target management point, The preset box culvert width parameter (half the box culvert width) is used. The angle between the first vector and the second vector. Let be the first vector. For the second vector, The supplementary angle of the included angle. For point Point of view Vectors in the direction.

[0088] In one possible implementation, the fifth module is further configured to: When the first vector is positioned to the right of the second vector, the left and right reference points are calculated using the following formula: In the formula, Use the left-side reference point. As the reference point on the right, For the target management point, The preset box culvert width parameters, The angle between the first vector and the second vector. Let be the first vector. For the second vector, The supplementary angle of the included angle. For point Point of view Vectors in the direction.

[0089] It should be noted that the pipeline diagram automatic drawing system provided by the present invention can execute the pipeline diagram automatic drawing method of any of the above embodiments during specific operation, which will not be described in detail in this embodiment.

[0090] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 8As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call logic instructions in the memory 830 to execute an automatic pipeline diagram drawing method. This method includes: constructing a topology structure with pipe points as vertices and pipelines as edges based on the position information of pipe points and pipelines in the pipeline network; the topology structure includes multiple pipe point nodes and multiple pipeline nodes, each pipe point node recording the in-degree and / or out-degree pipelines connected to the corresponding pipe point, and each pipeline node recording the starting and ending pipe points of the corresponding pipeline, as well as the next out-degree pipeline starting from the starting pipe point and the next in-degree pipeline ending at the ending pipe point for chained traversal of the pipeline; traversing each pipe point node in the topology structure and determining the rotation angle of each pipe point based on the direction of the in-degree and / or out-degree pipelines recorded by each pipe point node; traversing all pipeline nodes in the topology structure and determining the topological relationships between pipelines; and automatically drawing the pipeline diagram in the target drawing coordinate system based on the rotation angles of all pipe points and the topological relationships between pipelines.

[0091] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, 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 a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0092] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer is able to execute the pipeline diagram automatic drawing method provided in the above embodiments.

[0093] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the pipeline diagram automatic drawing method provided in the above embodiments.

[0094] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0095] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for automatically drawing pipeline diagrams, characterized in that, include: Based on the location information of pipe points and pipelines in the pipeline network, a topology structure is constructed with pipe points as vertices and pipelines as edges; The topology includes multiple pipe nodes and multiple pipeline nodes. Each pipe node is used to record the in-degree pipeline and / or out-degree pipeline connected to the corresponding pipe node. Each pipeline node is used to record the starting pipe node, the ending pipe node, and the next out-degree pipeline starting from the starting pipe node and the next in-degree pipeline ending from the ending pipe node for chained traversal of the pipeline. Traverse each of the pipe nodes in the topology and determine the rotation angle of each pipe node based on the direction of the in-degree pipeline and / or out-degree pipeline recorded by each pipe node. Traverse all the pipeline nodes in the topology to determine the topological relationships between the pipelines; In the target drawing coordinate system, the pipeline diagram is automatically drawn based on the rotation angles of all the pipe points and the topological relationships between the pipelines.

2. The method for automatically drawing pipeline diagrams according to claim 1, characterized in that, The step of determining the rotation angle of each pipe point based on the direction of the inbound and / or outbound pipelines recorded at each pipe point node includes: When only the infeed line is connected to the pipe point, the direction angle of the infeed line is taken as the rotation angle of the pipe point. When only the outlet pipeline is connected to the pipe point, the sum of the direction angle of the outlet pipeline and the preset angle is used as the rotation angle of the pipe point. When both the infeed pipeline and the outfeed pipeline are connected to the pipe point simultaneously, the average of the direction angles of the infeed pipeline and the outfeed pipeline is taken as the rotation angle of the pipe point.

3. The method for automatically drawing pipeline diagrams according to claim 1, characterized in that, Also includes: When the pipeline type corresponding to the pipeline node is a drainage culvert, the target in-degree pipeline and the target out-degree pipeline connected to the target pipeline node are determined according to the topology. Based on the coordinates of the target pipe point, the angle formed between the directions of the target infeed pipeline and the target outfeed pipeline, and the preset box culvert width parameter, calculate the reference point used to draw the box culvert boundary line; In the target drawing coordinate system, the boundary line of the box culvert is drawn based on the reference point.

4. The method for automatically drawing pipeline diagrams according to claim 3, characterized in that, The reference points include a left reference point and a right reference point; the calculation of reference points for drawing the box culvert boundary line based on the coordinates of the target pipe point, the angle formed between the directions of the target in-line pipe and the target out-line pipe, and the preset box culvert width parameter includes: Taking the intersection of the directional extensions of the target infeed pipeline and the target outfeed pipeline at the target pipeline point as the starting point, a first vector is defined that starts from the intersection point and points along the target infeed pipeline, and a second vector starts from the intersection point and points along the target outfeed pipeline. Determine the positional relationship of the first vector relative to the second vector; Based on the positional relationship, the coordinates of the target pipe point, the angle between the first vector and the second vector, and the preset box culvert width parameter, the left reference point and the right reference point are calculated respectively.

5. The method for automatically drawing pipeline diagrams according to claim 4, characterized in that, The step of calculating the left reference point and the right reference point based on the positional relationship, the coordinates of the target pipe point, the angle between the first vector and the second vector, and the preset box culvert width parameter includes: When the first vector is to the left of the second vector, the left reference point and the right reference point are calculated using the following formula: In the formula, The left reference point, The right-side reference point, For the target pipe point, The preset box culvert width parameter is half the width of the box culvert. The angle between the first vector and the second vector. For the first vector, For the second vector, The supplementary angle of the included angle. For point Point of view Vectors in the direction.

6. The method for automatically drawing pipeline diagrams according to claim 4, characterized in that, The step of calculating the left reference point and the right reference point based on the positional relationship, the coordinates of the target pipe point, the angle between the first vector and the second vector, and the preset box culvert width parameter, further includes: When the first vector is to the right of the second vector, the left reference point and the right reference point are calculated using the following formula: In the formula, The left reference point, The right-side reference point, For the target pipe point, The preset box culvert width parameter, The angle between the first vector and the second vector. For the first vector, For the second vector, The supplementary angle of the included angle. For point Point of view Vectors in the direction.

7. An automatic pipeline diagram drawing system, characterized in that, include: The first processing module is used to construct a topology structure with pipe points as vertices and pipelines as edges based on the location information of pipe points and pipelines in the pipeline network. The topology structure includes multiple pipe point nodes and multiple pipeline nodes. Each pipe point node is used to record the in-degree pipelines and / or out-degree pipelines connected to the corresponding pipe point. Each pipeline node is used to record the starting pipe point, the ending pipe point, and the next out-degree pipeline starting from the starting pipe point and the next in-degree pipeline ending from the ending pipe point for chain traversal of the pipeline. The second processing module is used to traverse each of the pipe nodes in the topology and determine the rotation angle of each pipe node according to the direction of the in-degree pipeline and / or out-degree pipeline recorded by each pipe node. The third processing module is used to traverse all the pipeline nodes in the topology structure and determine the topological relationships between the pipelines. The fourth processing module is used to automatically draw a pipeline diagram in the target drawing coordinate system based on the rotation angles of all the pipe points and the topological relationships between the pipelines.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the pipeline diagram automatic drawing method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the pipeline diagram automatic drawing method as described in any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the pipeline diagram automatic drawing method as described in any one of claims 1-6.