Water pipe specification marking automatic matching method and system based on CAD drawing comparison

By using an automatic matching method based on CAD drawings, the problem of low efficiency in water pipe specification labeling in water engineering has been solved, realizing automated water pipe specification labeling and improving the accuracy and efficiency of engineering quantity calculation.

CN122454594APending Publication Date: 2026-07-24PINMING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PINMING TECH CO LTD
Filing Date
2026-04-28
Publication Date
2026-07-24

Smart Images

  • Figure CN122454594A_ABST
    Figure CN122454594A_ABST
Patent Text Reader

Abstract

The application relates to a water pipe specification marking automatic matching method based on CAD drawing comparison, which comprises the following steps: acquiring drawing information, dividing line segments in an isometric drawing horizontal edge line layer into isometric drawing vertical pipes and isometric drawing horizontal pipes according to angles, taking lines in a plan drawing horizontal edge line layer as plan drawing horizontal pipes, taking circles in a vertical pipe edge line layer as plan drawing vertical pipes, classifying the horizontal pipes to obtain main pipes and branch pipes, matching the main pipes based on base points and pipeline connection conditions of the main pipes, matching the branch pipes based on the number of the branch pipes on the main pipes, the included angle between the branch pipes and the main pipes and the length proportion of the branch pipes on the main pipes, matching the vertical pipes based on the matching results of the horizontal pipes, and assigning marking information on the isometric drawing matched successfully to corresponding pipelines in the plan drawing. Through the application, the problem of low efficiency of manual matching of water pipe specification marking is solved, and pipeline matching and marking assignment are automatically completed through features such as layers, base points, angles and connection relationships.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electrical intelligent monitoring, and in particular to a method and system for automatically matching water pipe specification markings based on CAD drawing comparison. Background Technology

[0002] In the field of water engineering design and cost estimation, such as water supply and drainage and fire protection water systems, two-dimensional CAD drawings remain the mainstream design medium. Water system drawings typically include two core types of drawings: plan views and isometric views. Due to limitations imposed by traditional drafting habits and drawing expression logic, some water system plan views only depict the layout of water pipes without indicating key parameters such as pipe diameter and specifications. Meanwhile, pipe specification information such as DN, De, and D is only indicated in the isometric view, making it impossible to directly use the plan views for accurate modeling and cost estimation.

[0003] In the current BIM quantity surveying software and traditional cost estimation work methods, technicians need to manually compare isometric drawings and floor plans, identify and match corresponding water pipes one by one, manually transcribe the specifications from the isometric drawings to the corresponding pipes on the floor plans, and then draw the water pipe components one by one, build a 3D model, and calculate the quantities. This process relies heavily on manual comparison and repetitive operations, which is not only time-consuming and inefficient, but also prone to problems such as incorrect pipe matching, omissions or confusion of specifications due to human error, directly affecting the accuracy of quantity calculations.

[0004] Meanwhile, some CAD drawings have issues such as non-standard drawing and inconsistent pipeline representation, which further exacerbates the difficulty of manual matching and significantly increases the time and labor costs of water pipe modeling and quantity calculation. This makes it difficult to meet the needs of efficient and accurate quantity calculation in engineering, and restricts the digitalization of water cost estimation and the popularization and application of BIM technology. Summary of the Invention

[0005] This application provides an automatic matching method, system, electronic device, and storage medium for water pipe specification annotations based on CAD drawing comparison, so as to at least solve the problem of low efficiency of manual matching of water pipe specification annotations in related technologies.

[0006] In a first aspect, embodiments of this application provide an automatic matching method for water pipe specification annotations based on CAD drawing comparison, the method comprising: Obtain the drawing information of the target project object. The drawing information includes the horizontal edge layer, annotation, leader layer, and base point of the isometric drawing, as well as the horizontal edge layer, riser edge layer, and base point of the plan drawing. The base points selected in the isometric drawing and the plan drawing correspond to each other. The CAD line segments in the horizontal edge layer of the isometric drawing are divided into vertical pipes and horizontal pipes in the isometric drawing according to their angles. The CAD lines in the horizontal edge layer of the plan view are used as horizontal pipes in the plan view, and the circles in the vertical pipe edge layer are used as vertical pipes in the plan view. The horizontal pipes in the isometric and plan views are classified into main pipes and branch pipes. Based on the base point and the pipeline connection of the main pipe, the main pipes in the isometric and plan views are matched. Based on the number of branch pipes on the main pipe, the angle between the branch pipe and the main pipe, and the length ratio of the branch pipe on the main pipe, the branch pipes in the isometric and plan views are matched. Based on the matching results of the horizontal pipe, the vertical pipes in the isometric drawing and the plan view are matched, and the annotation information on the successfully matched isometric drawing is assigned to the corresponding CAD pipeline in the plan view.

[0007] In some embodiments, classifying the horizontal pipes in the isometric and plan views to obtain main pipes and branch pipes includes: Obtain all horizontal pipeline segments passing through the base point, and select the longest one as the first-level main pipeline; use the two endpoints of the determined main pipeline as nodes; At each node, obtain all horizontal pipeline segments connected to that node, exclude segments that have been identified as main pipelines, select the longest segment as the next level main pipeline, and repeat until no new main pipeline can be identified. A line segment with only one endpoint on the main pipe and that endpoint is not located at the end of the main pipe is defined as a branch pipe. A line segment with only one endpoint on a defined branch and that endpoint is not located at the end of the defined branch is defined as a branch.

[0008] In some embodiments, the matching of the isometric view and the main pipe in the plan view requires the following conditions to be met simultaneously: The horizontal pipe in the axonometric drawing corresponds to the horizontal pipe in the plan view, and the vertical pipe in the axonometric drawing corresponds to the vertical pipe in the plan view. Axonometric drawing horizontal tubes at 45° to the X-axis of the drawing plane coordinate system are considered to have the same angle as planar drawing horizontal tubes at 90°. Axonometric drawing horizontal tubes at other angles are considered to have the same angle as planar drawing horizontal tubes at the same angle. The same angles include angles with an angle difference within a preset range. The number of CAD line segments connecting the two ends of the matching line segments in the isometric drawing and the plan view corresponds to the number of line segments connected. If the number of connections at one end is 0 and the number at the other end is not 0, they are also considered to be the same.

[0009] In some embodiments, matching the branch pipes in the isometric drawing and the plan view based on the number of branch pipes on the main pipe, the angle between the branch pipes and the main pipe, and the length ratio of the branch pipes on the main pipe includes: The branch pipes are divided into data groups according to their angle with the main pipe, and drawings with the same number of branch pipes in the same data group are matched first. For data groups with different numbers of branch pipes, matching is performed by minimizing the difference in the percentage of the length of the branch pipe on the main pipe. If the number of data groups is inconsistent, two matching operations are performed. The first matching is performed separately for each data group, and the second matching is performed after merging all branches. The result with the larger total number of successful branch matching between the two matching operations is taken as the final matching result. If the number of successful matching operations is the same in both matching operations, the result of the second matching operation is used.

[0010] In some embodiments, the matching based on minimizing the difference in the percentage of the branch pipe's length on the main pipe includes: Calculate the percentage of the projected length of each branch pipe on the main pipe in the plan view and the isometric view to the total length of the main pipe; The branch pipes in the plan view and the isometric view are paired according to the difference of the percentage value from smallest to largest. The branch pipes with the smallest difference are successfully matched, and the branch pipes that have been successfully matched will not participate in the subsequent matching again.

[0011] In some embodiments, the first matching by data group and the second matching after merging all branches include: The first matching process involves matching each data group individually using the principle of minimizing the difference in the length percentage; The second matching ignores the data group classification and merges all branches into a total data group. If the total number of branches in the plan view and the isometric view is the same, they are matched sequentially according to their position. If the total number of branches is different, the principle of minimizing the difference in the length percentage value is used again for matching.

[0012] In some embodiments, dividing the CAD line segments in the isometric horizontal edge layer into isometric vertical pipes and isometric horizontal pipes according to angle includes: In the horizontal edge layer of the isometric drawing, the line segments with an angle of 90 degrees are classified as vertical pipes in the isometric drawing, and the remaining line segments are classified as horizontal pipes in the isometric drawing.

[0013] Secondly, embodiments of this application provide an automatic matching system for water pipe specification markings based on CAD drawing comparison, the system comprising: The information acquisition module is used to acquire the drawing information of the target engineering object. The drawing information includes the horizontal edge layer, annotation, leader layer, and base point of the isometric drawing, as well as the horizontal edge layer, riser edge layer, and base point of the plan drawing. The base points selected in the isometric drawing and the plan drawing correspond to each other. The pipeline determination module is used to divide the CAD line segments in the horizontal edge layer of the isometric drawing into vertical pipes and horizontal pipes in the isometric drawing according to the angle, and to take the CAD lines in the horizontal edge layer of the plan view as horizontal pipes in the plan view, and the circles in the vertical pipe edge layer as vertical pipes in the plan view. The matching module is used to classify the horizontal pipes in the isometric drawing and the plan view respectively to obtain the main pipes and branch pipes. Based on the base point and the pipeline connection of the main pipe, the main pipes in the isometric drawing and the plan view are matched. Based on the number of branch pipes on the main pipe, the angle between the branch pipe and the main pipe, and the length ratio of the branch pipe on the main pipe, the branch pipes in the isometric drawing and the plan view are matched. The assignment module is used to match the risers in the isometric drawing and the plan drawing based on the matching result of the horizontal pipe, and assign the annotation information on the successfully matched isometric drawing to the corresponding CAD pipeline in the plan drawing.

[0014] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the automatic matching method for water pipe specification annotation based on CAD drawing comparison as described in the first aspect above.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the automatic matching method for water pipe specification annotations based on CAD drawing comparison as described in the first aspect above.

[0016] Compared to related technologies, the automatic matching of water pipe specifications based on CAD drawing comparison provided in this application eliminates the need for manual segment-by-segment comparison of isometric and plan views and manual transcription of annotations. It automatically completes pipeline matching and annotation assignment using CAD features such as layers, base points, angles, and connection relationships, significantly reducing manual intervention and improving the efficiency of water pipe quantity calculation in water-related fields. This solves the problem of low efficiency in manual matching of water pipe specifications. Using corresponding base points as a unified benchmark, and combining multiple conditions such as line segment type, angle, number of end connections, branch pipe angle, and length ratio for comprehensive judgment, the matching rules closely match the actual engineering drawings, effectively avoiding mismatches and omissions that are prone to occur during manual comparison, and improving the accuracy of annotation migration. It directly utilizes existing CAD layers and graphic features (line segments, circles, angles, connection relationships) for processing, eliminating the need for additional drawing organization; it distinguishes between main pipes and branch pipes according to the actual engineering design logic, adapting to the expression habits of common water-related drawings such as water supply and drainage and fire protection water systems. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of an automatic matching method for water pipe specification markings based on CAD drawing comparison, according to an embodiment of this application. Figure 2 This is a schematic diagram of a two-dimensional drawing function interface according to an embodiment of this application; Figure 3 This is a schematic diagram of a plan view and an axonometric view according to an embodiment of this application; Figure 4 This is a schematic diagram of an isometric line segment according to an embodiment of this application; Figure 5 This is a schematic diagram of a line segment in a plan view according to an embodiment of this application; Figure 6 This is a schematic diagram of a main pipe and branch pipe according to an embodiment of this application; Figure 7 This is a schematic diagram of branch matching for a single data group according to an embodiment of this application; Figure 8 This is a schematic diagram of branch matching of two data groups according to an embodiment of this application; Figure 9 This is a structural block diagram of an automatic matching system for water pipe specifications based on CAD drawing comparison, according to an embodiment of this application. Figure 10 This is a schematic diagram of the internal structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0019] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.

[0020] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0021] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.

[0022] This embodiment provides an automatic matching method for water pipe specification markings based on CAD drawing comparison. Figure 1 This is a flowchart of the automatic matching method for water pipe specification markings based on CAD drawing comparison according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the drawing information of the target project object. The drawing information includes the horizontal edge layer, annotation, leader line layer, and base point of the isometric drawing, as well as the horizontal edge layer, riser edge layer, and base point of the plan drawing. The base points selected in the isometric drawing and the plan drawing correspond to each other.

[0023] Import the 2D drawing into the BIM 3D quantity calculation software, call the function commands, and obtain the following drawing information according to the software prompts: Axonometric drawing: Horizontal edge layer, annotation and leader layer, base point.

[0024] Plan view: Horizontal edge layer, riser edge layer, base point.

[0025] The base points selected for the axonometric drawing and the plan view must correspond.

[0026] Figure 2 This is a schematic diagram of a two-dimensional drawing function interface according to an embodiment of this application. Figure 3 This is a schematic diagram of a plan view and an isometric view according to an embodiment of this application.

[0027] Step S102: Divide the CAD line segments in the horizontal edge layer of the isometric drawing into vertical pipes and horizontal pipes in the isometric drawing according to their angles. Use the CAD lines in the horizontal edge layer of the plan view as horizontal pipes in the plan view, and the circles in the vertical pipe edge layer as vertical pipes in the plan view.

[0028] In some embodiments, classifying CAD line segments in the horizontal edge layer of the isometric drawing into vertical and horizontal segments based on angle includes: classifying line segments with an angle of 90 degrees in the horizontal edge layer of the isometric drawing as vertical segments and the remaining line segments as horizontal segments.

[0029] For isometric drawings, in the horizontal edge layer, CAD lines with a 90-degree angle are classified as isometric risers, and the rest as isometric horizontal lines. In the annotation and leader layers, data with textual CAD feature attributes are filtered out; these textual data containing "DN / De / D + number" are annotation information.

[0030] For the plan view, the CAD lines in the horizontal edge layer represent the horizontal pipes in the plan view, and the data in the riser edge layer that are filtered to have a circle as the CAD feature attribute represents the risers in the plan view.

[0031] Figure 4 This is an isometric line segment diagram according to an embodiment of this application, such as... Figure 4 As shown, the five line segments marked with 90 degrees at the bottom right corner represent the risers in the isometric drawing, while the remaining line segments represent the horizontal pipes in the isometric drawing. DN50, DN40, DN32, DN25, and DN15 are labeling information.

[0032] Figure 5 This is a schematic diagram of a line segment in a plan view according to an embodiment of this application, such as... Figure 5 As shown, the five circles indicated by the arrows represent the vertical pipes in the plan view, while the remaining line segments represent the horizontal pipes in the plan view.

[0033] Step S103: Classify the horizontal pipes in the isometric drawing and the plan view respectively to obtain the main pipe and the branch pipe. Based on the base point and the pipeline connection of the main pipe, match the main pipe in the isometric drawing and the plan view. Based on the number of branch pipes on the main pipe, the angle between the branch pipe and the main pipe, and the length ratio of the branch pipe on the main pipe, match the branch pipe in the isometric drawing and the plan view.

[0034] In some embodiments, step S103 classifies the horizontal pipes in the isometric and plan views respectively, resulting in main pipes and branch pipes, including: Step S1031: Obtain all horizontal pipeline segments passing through the base point, and select the longest one as the first-level main pipe; use the two endpoints of the determined main pipe as nodes.

[0035] Step S1032: At each node, obtain all horizontal pipeline segments connected to that node, exclude segments that have been identified as main pipelines, select the longest segment as the next level main pipeline, and repeat until no new main pipeline can be identified.

[0036] Step S1033: Determine the line segment with only one endpoint on the main pipe and that endpoint is not at the end of the main pipe as a branch pipe; Step S1034: The line segment with only one endpoint on the determined branch pipe and that endpoint is not at the end position of the determined branch pipe is determined as the branch pipe.

[0037] Figure 6 This is a schematic diagram of a main pipe and branch pipe according to an embodiment of this application, as shown below. Figure 6 As shown, taking the base point at the right end of the main line segment 1 as an example, there are 3 main lines on the plan view and the isometric view: main line 1, main line 2, and main line 3; and 4 branch lines: branch line 1, branch line 2, branch line 3, and branch line 4.

[0038] The classification criterion for main pipelines is based on the longest length plus the base point. The entire process follows objective geometric rules, without relying on human experience, ensuring a high degree of consistency between the classification results of isometric and plan views. The next level of main pipelines is determined iteratively by expanding endpoint nodes level by level. This method can completely identify continuous, multi-segment, and complex main pipelines, preventing main pipeline breaks, omissions, and misclassifications, and is more adaptable to large-scale engineering drawings.

[0039] In some embodiments, the matching of the main pipe in the isometric drawing and the plan view in step S103 requires the following conditions to be met simultaneously: The horizontal pipe in the axonometric drawing corresponds to the horizontal pipe in the plan view, and the vertical pipe in the axonometric drawing corresponds to the vertical pipe in the plan view.

[0040] Axonometric horizontal tubes at 45° to the X-axis of the drawing plane coordinate system are considered to have the same angle as planar horizontal tubes at 90°. Axonometric horizontal tubes at other angles are considered to have the same angle as planar horizontal tubes at the same angle. Same angles include angles with an angle difference within a preset range.

[0041] The number of CAD line segments connecting the two ends of the matching line segments in the isometric drawing and the plan view should correspond. If the number of connections at one end is 0 and the number at the other end is not 0, they are also considered to be consistent.

[0042] Based on the selected base point, locate the main line where the base point is located. First, determine if the angles of the main pipes on both sides of the drawing are consistent. If they are consistent, then determine if the CAD line connections at both ends of the main pipe are consistent. If they are consistent, the match is successful. To determine if the CAD line connections are consistent, conditions 1, 2, and 3 must be met simultaneously, as follows: Condition 1: The line segment types must correspond. The line segment type refers to the classification in step S102, that is, the horizontal pipe in the isometric drawing must correspond to the horizontal pipe in the plan view, and the vertical pipe in the isometric drawing must correspond to the vertical pipe in the plan view.

[0043] Condition 2: The angles of the CAD lines must correspond. For horizontal lines, the isometric horizontal line at 45 degrees to the X-axis and the planar horizontal line at 90 degrees to the X-axis are considered to have the same angle. For other angles, the isometric horizontal line should be matched with the planar horizontal line of the same angle, allowing for a certain range of angle error.

[0044] Condition 3: The number of CAD line segments connecting the ends must correspond. A line segment has two ends, and the number of horizontal pipes and risers connected to both ends must be consistent. Special cases are handled as follows: if the number of horizontal and risers connected to the ends is 0 in the isometric / plan view, but not in the other view, it is still considered consistent. (This is to handle situations where some water supply and drainage CAD drawings are incomplete, with risers / horizontal pipes drawn at the ends of water pipes on one side, but not on the other.) Starting from the base point, perform matching downwards sequentially until all matching is completed or there are no more matching CAD lines.

[0045] by Figure 6 For example, the angle of main pipe 1 in both the isometric view and the plan view is 0 degrees, which is consistent. Next, regarding the CAD line connections at both ends, in the isometric view, the left end is connected to one 45-degree isometric horizontal pipe (main pipe 2), and the right end is connected to 0 pipes; in the plan view, the left end is connected to one 90-degree plan view horizontal pipe (main pipe 2), and the right end is connected to 0 pipes. Based on conditions 1, 2, and 3, the CAD line connections at both ends are consistent, therefore main pipe 1 is successfully matched.

[0046] Continue matching main pipe 2 sequentially. Since the angle of main pipe 2 in the isometric drawing and the plan view has been consistent in the previous step, we only need to check the CAD line connection at both ends. In the isometric drawing, the upper end connects to a 180-degree horizontal pipe from the isometric drawing, and the lower end only connects to main pipe 1; in the plan view, the upper end connects to a 180-degree horizontal pipe from the plan view, and the lower end only connects to main pipe 1. Based on conditions 1, 2, and 3, the CAD line connection at both ends is consistent, therefore main pipe 2 is successfully matched.

[0047] Match the main pipe 3 sequentially. In the isometric view, the left end connects to one isometric riser, and the right end connects only to main pipe 2; in the plan view, the left end connects to one plan riser, and the right end connects only to main pipe 2. Based on conditions 1, 2, and 3, if the CAD line connections at both ends are consistent, then main pipe 3 is successfully matched.

[0048] In some embodiments, step S103, which involves matching the branch pipes in the isometric drawing and the plan view based on the number of branch pipes on the main pipe, the angle between the branch pipes and the main pipe, and the length ratio of the branch pipes on the main pipe, includes: Step S1035: Divide the branch pipes into data groups according to their angle with the main pipe, and prioritize matching drawings with the same number of branch pipes in the same data group.

[0049] Step S1036: For data groups with different numbers of branch pipes, matching is performed based on the principle of minimizing the difference in the percentage of branch pipe length on the main pipe.

[0050] In some embodiments, the matching process in step S1036, which employs the principle of minimizing the difference in the percentage length of the branch pipe on the main pipe, includes: Step S201: Calculate the percentage of the projected length of each branch pipe on the main pipe in the plan view and isometric view to the total length of the main pipe.

[0051] Step S202: Pair the branch pipes in the plan view and the isometric view according to the difference of the percentage value from smallest to largest. The branch pipes with the smallest difference are successfully matched. The branch pipes that have been successfully matched will not participate in the subsequent matching again.

[0052] Step S1037: If the number of data groups is inconsistent, two matching operations are performed. The first matching is performed separately for each data group, and the second matching is performed after merging all branches. The result with the larger total number of successful branch matching between the two matching operations is taken as the final matching result. If the number of successful matching operations is the same in both matching operations, the result of the second matching operation is used.

[0053] In some embodiments, step S1037, which involves first matching data groups separately and then matching all branches after merging them, includes: Step S203: For the first matching, each data group is matched individually using the principle of minimizing the difference in length percentage.

[0054] Step S204: The second matching ignores the data group classification and merges all branches into a total data group. If the total number of branches in the plan view and the isometric view is the same, they are matched sequentially according to their position. If the total number of branches is different, the principle of minimizing the difference in length percentage is used again for matching.

[0055] Following the principle of matching the main pipeline first and then the branch pipeline, the optimal matching of branch pipelines is determined by comprehensively judging three conditions: the number of branch pipelines on the main pipeline, the angle between the branch pipeline and the main pipeline, and the percentage of the length of the branch pipeline on the main pipeline.

[0056] For both isometric and plan views, the angles between branch lines and main lines must first be determined, and branch lines with the same angle should be grouped into the same data group. Then, it should be determined whether the number of branch lines in the same data group is consistent between the plan view and the isometric view.

[0057] Matching method 1: Consistent data groups are matched sequentially according to the direction of the starting node.

[0058] Matching Method 2: For inconsistent data groups, each data group is matched separately. Based on the percentage of the length of the branch pipeline on the main line, the matching is performed from the worst percentage to the largest. Pipes that are successfully matched will not be matched again.

[0059] The matching order and matching method are determined based on the number of branch lines in the data group. Data groups with the same number of branch lines are matched first, using matching method 1. Then, data groups with different numbers of branch lines are matched; if there is only one such group, matching method 2 is used.

[0060] If there are multiple data sets, perform two matching steps. First matching: Each data set with different data is checked separately using matching method 2. Second matching: All data sets with different data are merged, regardless of angle, into the same data set. If the total number of branches is the same, check using matching method 1; if the total number of branches is different, check using matching method 2. Finally, the matching with the highest total number of branches is taken; if the numbers are the same, proceed with the second matching step.

[0061] by Figure 6 For example, in the plan view, there are 3 data values ​​1 that are 90 degrees to the main pipe 2: branch pipe 2, branch pipe 3, and main pipe 4; and 1 data value 2 that is 270 degrees to the main pipe: branch pipe 1. The isometric view is the same as the plan view, using matching method 1. Therefore, starting from node 1, the 3 branch pipe segments at 90 degrees in the plan view are successfully matched with the 3 branch pipe segments at 90 degrees in the isometric view; the 1 branch pipe segment at 270 degrees in the plan view is successfully matched with the 1 branch pipe segment at 270 degrees in the isometric view.

[0062] Figure 7 This is a schematic diagram of branch matching for a single data group according to an embodiment of this application, such as... Figure 7 As shown, with only one set of data and using matching method 2, the difference between the proportion of branch pipe 1 in the plan view and the proportion of branch pipe 2 in the isometric view is the smallest, indicating that the two pipeline segments are successfully matched.

[0063] The percentage of branch pipe 1 in the plan view is 4289.67 / 5282.02 = 81.21%. The percentage of branch pipe 1 in the isometric drawing is 3150.59 / 6300.19 = 50.01%. The proportion of branch pipe 2 in the isometric drawing is 4150.59 / 6300.19 = 65.88%. Figure 8 This is a schematic diagram of branch matching for two data groups according to an embodiment of this application, such as... Figure 8 As shown, there are two sets of data, and the number of data groups in each set is different. In the plan view, data group 1 at a 90-degree angle has 2 branches: branch 1 and branch 4; data group 2 at a 270-degree angle has 2 branches: branch 2 and branch 3. In the isometric view, data group 1 at a 90-degree angle has 3 branches: branch 1, branch 3, and branch 4; data group 2 at a 270-degree angle has 1 branch: branch 2.

[0064] In the first matching, each data group was matched according to matching method 2. In the plan view, data group 1 could be successfully matched with 2 branch pipes, and data group 2 could be successfully matched with 1 branch pipe, for a total of 3 segments.

[0065] In the second matching, the total number of branch pipes in both the plan view and the isometric view was 4. These were grouped into the same data set and matched using matching method 1. All 4 branch pipe segments were successfully matched. Therefore, the final result was based on the second matching.

[0066] The system uses a three-tiered approach—angle grouping, quantity priority, and length percentage—to perfectly align with the pipe layout patterns in water supply, drainage, and fire protection drawings. This method is more accurate than single-dimensional matching and reduces mismatch rates. The entire process utilizes calculable geometric parameters such as angle, quantity, and percentage differences, eliminating reliance on human experience. The software can automate the process, providing stable and reproducible results. It supports common on-site situations such as discrepancies in branch pipe quantities between isometric and plan views, inconsistent angle grouping, and non-standard drawing specifications, addressing the pain points of non-standard drawings in actual engineering projects.

[0067] A two-step matching mechanism of group matching + global merging matching is adopted to prioritize matching from the same angle, and then use the total set as a fallback to maximize the number of branch matching and avoid information loss.

[0068] Step S104: Based on the matching results of the horizontal pipes, match the risers in the isometric drawing and the plan view, and assign the annotation information on the successfully matched isometric drawing to the corresponding CAD pipeline in the plan view.

[0069] After a horizontal pipe is successfully matched, the riser is located on which side of the horizontal pipe segment. The riser in the isometric drawing is then searched for on the same side of the horizontal pipe. If a corresponding riser exists in the isometric drawing, they are matched. For matched risers, the corresponding pipe labeling information from the isometric drawing is assigned to the corresponding CAD pipe in the plan view. Pipe specifications that do not match on the plan view are generated using default values, which can be modified later.

[0070] by Figure 6 For example, branch pipe 1 has a horizontal riser at its right end, and the same riser is also shown at its right end in the isometric view; therefore, they match. The main pipe 1 in the plan view obtains the labeling information from the isometric view. Since the main pipe 1 in the isometric view is DN50, the main pipe 1 in the plan view is also DN50.

[0071] Through the above steps, there is no need for manual comparison of isometric drawings and plan views, or manual transcription of annotations. The system automatically completes pipeline matching and annotation assignment using CAD features such as layers, base points, angles, and connection relationships. This significantly reduces manual intervention and improves the efficiency of water pipe quantity calculation, solving the problem of low efficiency in manually matching pipe specifications. Using corresponding base points as a unified benchmark, and combining multiple conditions such as line segment type, angle, number of end connections, branch pipe angle, and length ratio, the matching rules closely match the actual engineering drawings, effectively avoiding mismatches and omissions that are prone to occur during manual comparison, and improving the accuracy of annotation migration. It directly utilizes existing CAD layers and graphic features (line segments, circles, angles, connection relationships) without requiring additional drawing organization; it distinguishes between main pipes and branch pipes according to the actual engineering design logic, adapting to the expression habits of common water-related drawings such as water supply and drainage, and fire protection water.

[0072] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0073] This embodiment also provides an automatic matching system for water pipe specifications based on CAD drawing comparison. This system is used to implement the above embodiments and preferred embodiments, and will not be repeated for details already described. As used below, the terms "module," "unit," "subunit," etc., can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0074] Figure 9 This is a structural block diagram of the automatic matching system for water pipe specifications based on CAD drawing comparison, according to an embodiment of this application. Figure 9 As shown, the system includes: The information acquisition module 91 is used to acquire the drawing information of the target project object. The drawing information includes the horizontal edge layer, annotation, leader line layer, and base point of the isometric drawing, as well as the horizontal edge layer, riser edge layer, and base point of the plan drawing. The base points selected in the isometric drawing and the plan drawing correspond to each other. The pipeline determination module 92 is used to divide the CAD line segments in the horizontal edge layer of the isometric drawing into vertical pipes and horizontal pipes in the isometric drawing according to the angle, and to take the CAD lines in the horizontal edge layer of the plan drawing as horizontal pipes in the plan drawing, and the circles in the vertical pipe edge layer as vertical pipes in the plan drawing.

[0075] The matching module 93 is used to classify the horizontal pipes in the isometric drawing and the plan view respectively to obtain the main pipes and branch pipes. Based on the base point and the pipeline connection of the main pipe, the main pipes in the isometric drawing and the plan view are matched. Based on the number of branch pipes on the main pipe, the angle between the branch pipe and the main pipe, and the length ratio of the branch pipe on the main pipe, the branch pipes in the isometric drawing and the plan view are matched.

[0076] The assignment module 94 is used to match the risers in the isometric drawing and the plan drawing based on the matching results of the horizontal pipes, and assign the annotation information on the successfully matched isometric drawing to the corresponding CAD pipeline in the plan drawing.

[0077] In some embodiments, the matching module 93 includes: a main branch pipe determination module, used to acquire all horizontal pipeline segments passing through the base point, select the longest one as the first-level main pipe; and use the two endpoints of the determined main pipe as nodes; At each node, obtain all horizontal pipeline segments connected to that node, exclude segments that have been identified as main pipelines, select the longest segment as the next level main pipeline, and repeat until no new main pipeline can be identified. A line segment with only one endpoint on the main pipe and that endpoint is not located at the end of the main pipe is defined as a branch pipe. A line segment with only one endpoint on a defined branch and that endpoint is not located at the end of the defined branch is defined as a branch.

[0078] In some embodiments, the matching of the main pipe in the isometric view and the plan view requires that the following conditions be met simultaneously: The horizontal pipe in the axonometric drawing corresponds to the horizontal pipe in the plan view, and the vertical pipe in the axonometric drawing corresponds to the vertical pipe in the plan view. Axonometric drawing horizontal tubes at 45° to the X-axis of the drawing plane coordinate system are considered to have the same angle as planar drawing horizontal tubes at 90°. Axonometric drawing horizontal tubes at other angles are considered to have the same angle as planar drawing horizontal tubes at the same angle. Same angles include angles with angle differences within a preset range. The number of CAD line segments connecting the two ends of the matching line segments in the isometric drawing and the plan view should correspond. If the number of connections at one end is 0 and the number at the other end is not 0, they are also considered to be consistent.

[0079] In some embodiments, the matching module 93 includes: a branch pipe matching module, used to divide the branch pipes into data groups according to their angle with the main pipe, and to prioritize matching drawings with the same number of branch pipes in the same data group; For data groups with different numbers of branch pipes, matching is performed based on the principle of minimizing the difference in the percentage of the length of the branch pipes on the main pipe. If the number of data groups is inconsistent, two matching operations are performed. The first matching is performed separately for each data group, and the second matching is performed after merging all branches. The result with the larger total number of successful branch matching between the two matching operations is taken as the final matching result. If the number of successful matching operations is the same in both matching operations, the result of the second matching operation is used.

[0080] In some embodiments, the branch matching module includes: a difference minimization principle matching module, used to calculate the percentage value of the projected length of each branch on the main pipe in the plan view and the isometric view to the total length of the main pipe; The branch pipes in the plan view and the isometric view are paired according to the difference of the percentage value from smallest to largest. The branch pipes with the smallest difference are successfully matched. The branch pipes that have been successfully matched will not participate in the subsequent matching again.

[0081] In some embodiments, the branch matching module includes: a two-stage matching module, used for the first matching to match each data group separately using the principle of minimizing the difference in length percentage; The second matching ignores the data group classification and merges all branches into a total data group. If the total number of branches in the plan view and the isometric view is the same, they are matched in order of position. If the total number of branches is different, the principle of minimizing the difference in length percentage is used again for matching.

[0082] In some embodiments, the pipeline determination module includes: an isometric pipeline determination module, used to classify line segments with an angle of 90 degrees in the horizontal edge layer of the isometric drawing as vertical pipes in the isometric drawing, and the remaining line segments as horizontal pipes in the isometric drawing.

[0083] The system eliminates the need for manual comparison of isometric and plan views, and manual transcription of annotations. It automatically completes pipeline matching and annotation assignment using CAD features such as layers, base points, angles, and connection relationships, significantly reducing manual intervention and improving the efficiency of water pipe quantity calculation. This solves the problem of low efficiency in manually matching pipe specifications. Using corresponding base points as a unified benchmark, and combining multiple conditions such as line segment type, angle, number of end connections, branch pipe angle, and length ratio, the matching rules closely match the actual engineering drawings, effectively avoiding mismatches and omissions that easily occur during manual comparison, and improving the accuracy of annotation migration. It directly utilizes existing CAD layers and graphic features (line segments, circles, angles, connection relationships) without requiring additional drawing organization; it distinguishes between main and branch pipes according to the actual engineering design logic, adapting to the expression habits of common water-related drawings such as water supply and drainage, and fire protection water systems.

[0084] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0085] This embodiment also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0086] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0087] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program: S1, obtain the drawing information of the target project object. The drawing information includes the horizontal edge layer, annotation, leader layer, and base point of the isometric drawing, as well as the horizontal edge layer, riser edge layer, and base point of the plan drawing. The base points selected in the isometric drawing and the plan drawing correspond to each other.

[0088] S2, divide the CAD line segments in the horizontal edge layer of the isometric drawing into vertical pipes and horizontal pipes in the isometric drawing according to the angle. Use the CAD lines in the horizontal edge layer of the plan view as horizontal pipes in the plan view, and the circles in the vertical pipe edge layer as vertical pipes in the plan view.

[0089] S3. Classify the horizontal pipes in the isometric and plan views respectively to obtain the main pipes and branch pipes. Based on the base point and the pipeline connection of the main pipes, match the main pipes in the isometric and plan views. Based on the number of branch pipes on the main pipes, the angle between the branch pipes and the main pipes, and the length ratio of the branch pipes on the main pipes, match the branch pipes in the isometric and plan views.

[0090] S4. Based on the matching results of the horizontal pipes, the vertical pipes in the isometric drawing and the plan view are matched, and the annotation information on the successfully matched isometric drawing is assigned to the corresponding CAD pipeline in the plan view.

[0091] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0092] In one embodiment, Figure 10 This is a schematic diagram of the internal structure of an electronic device according to an embodiment of this application, such as... Figure 10 As shown, an electronic device is provided, which can be a server, and its internal structure diagram can be as follows. Figure 10 As shown, this electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides the environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an automatic matching method for water pipe specification annotations based on CAD drawing comparison.

[0093] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0094] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0095] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0096] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for automatically matching water pipe specification annotations based on CAD drawing comparison, characterized in that, The method includes: Obtain the drawing information of the target project object. The drawing information includes the horizontal edge layer, annotation, leader layer, and base point of the isometric drawing, as well as the horizontal edge layer, riser edge layer, and base point of the plan drawing. The base points selected in the isometric drawing and the plan drawing correspond to each other. The CAD line segments in the horizontal edge layer of the isometric drawing are divided into vertical pipes and horizontal pipes in the isometric drawing according to their angles. The CAD lines in the horizontal edge layer of the plan view are used as horizontal pipes in the plan view, and the circles in the vertical pipe edge layer are used as vertical pipes in the plan view. The horizontal pipes in the isometric and plan views are classified into main pipes and branch pipes. Based on the base point and the pipeline connection of the main pipe, the main pipes in the isometric and plan views are matched. Based on the number of branch pipes on the main pipe, the angle between the branch pipe and the main pipe, and the length ratio of the branch pipe on the main pipe, the branch pipes in the isometric and plan views are matched. Based on the matching results of the horizontal pipe, the vertical pipes in the isometric drawing and the plan view are matched, and the annotation information on the successfully matched isometric drawing is assigned to the corresponding CAD pipeline in the plan view.

2. The method according to claim 1, characterized in that, The horizontal pipes in the isometric and plan views are classified to obtain main pipes and branch pipes, including: Obtain all horizontal pipeline segments passing through the base point, and select the longest one as the first-level main pipeline; use the two endpoints of the determined main pipeline as nodes; At each node, obtain all horizontal pipeline segments connected to that node, exclude segments that have been identified as main pipelines, select the longest segment as the next level main pipeline, and repeat until no new main pipeline can be identified. A line segment with only one endpoint on the main pipe and that endpoint is not located at the end of the main pipe is defined as a branch pipe. A line segment with only one endpoint on a defined branch and that endpoint is not located at the end of the defined branch is defined as a branch.

3. The method according to claim 1, characterized in that, The matching of the isometric drawing and the main pipeline in the plan view requires the following conditions to be met simultaneously: The horizontal pipe in the axonometric drawing corresponds to the horizontal pipe in the plan view, and the vertical pipe in the axonometric drawing corresponds to the vertical pipe in the plan view. Axonometric drawing horizontal tubes at 45° to the X-axis of the drawing plane coordinate system are considered to have the same angle as planar drawing horizontal tubes at 90°. Axonometric drawing horizontal tubes at other angles are considered to have the same angle as planar drawing horizontal tubes at the same angle. The same angles include angles with an angle difference within a preset range. The number of CAD line segments connecting the two ends of the matching line segments in the isometric drawing and the plan view corresponds to the number of line segments connected. If the number of connections at one end is 0 and the number at the other end is not 0, they are also considered to be the same.

4. The method according to claim 1, characterized in that, The matching of branch pipes in the isometric drawing and the plan view based on the number of branch pipes on the main pipe, the angle between the branch pipes and the main pipe, and the length ratio of the branch pipes on the main pipe includes: The branch pipes are divided into data groups according to their angle with the main pipe, and drawings with the same number of branch pipes in the same data group are matched first. For data groups with different numbers of branch pipes, matching is performed by minimizing the difference in the percentage of the length of the branch pipe on the main pipe. If the number of data groups is inconsistent, two matching operations are performed. The first matching is performed separately for each data group, and the second matching is performed after merging all branches. The result with the larger total number of successful branch matching between the two matching operations is taken as the final matching result. If the number of successful matching operations is the same in both matching operations, the result of the second matching operation is used.

5. The method according to claim 4, characterized in that, The matching process based on minimizing the difference in the percentage length of the branch pipe on the main pipe includes: Calculate the percentage of the projected length of each branch pipe on the main pipe in the plan view and the isometric view to the total length of the main pipe; The branch pipes in the plan view and the isometric view are paired according to the difference of the percentage value from smallest to largest. The branch pipes with the smallest difference are successfully matched, and the branch pipes that have been successfully matched will not participate in the subsequent matching again.

6. The method according to claim 4, characterized in that, The first matching by data group and the second matching after merging all branches include: The first matching process involves matching each data group individually using the principle of minimizing the difference in the length percentage; The second matching ignores the data group classification and merges all branches into a total data group. If the total number of branches in the plan view and the isometric view is the same, they are matched sequentially according to their position. If the total number of branches is different, the principle of minimizing the difference in the length percentage value is used again for matching.

7. The method according to claim 1, characterized in that, The step of dividing the CAD line segments in the horizontal edge layer of the isometric drawing into isometric drawing risers and isometric drawing horizontal pipes according to their angles includes: In the horizontal edge layer of the isometric drawing, the line segments with an angle of 90 degrees are classified as vertical pipes in the isometric drawing, and the remaining line segments are classified as horizontal pipes in the isometric drawing.

8. An automatic matching system for water pipe specification markings based on CAD drawing comparison, characterized in that, The system includes: The information acquisition module is used to acquire the drawing information of the target engineering object. The drawing information includes the horizontal edge layer, annotation, leader layer, and base point of the isometric drawing, as well as the horizontal edge layer, riser edge layer, and base point of the plan drawing. The base points selected in the isometric drawing and the plan drawing correspond to each other. The pipeline determination module is used to divide the CAD line segments in the horizontal edge layer of the isometric drawing into vertical pipes and horizontal pipes in the isometric drawing according to the angle, and to take the CAD lines in the horizontal edge layer of the plan view as horizontal pipes in the plan view, and the circles in the vertical pipe edge layer as vertical pipes in the plan view. The matching module is used to classify the horizontal pipes in the isometric drawing and the plan view respectively to obtain the main pipes and branch pipes. Based on the base point and the pipeline connection of the main pipe, the main pipes in the isometric drawing and the plan view are matched. Based on the number of branch pipes on the main pipe, the angle between the branch pipe and the main pipe, and the length ratio of the branch pipe on the main pipe, the branch pipes in the isometric drawing and the plan view are matched. The assignment module is used to match the risers in the isometric drawing and the plan drawing based on the matching result of the horizontal pipe, and assign the annotation information on the successfully matched isometric drawing to the corresponding CAD pipeline in the plan drawing.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the automatic matching method for water pipe specification annotation based on CAD drawing comparison as described in any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the automatic matching method for water pipe specification annotation based on CAD drawing comparison as described in any one of claims 1 to 7.