Method for identifying connection relationship of electrical main wiring diagram fusing CAD data and image
By combining Canny edge detection and object detection algorithms with a width-first search algorithm, the wiring relationships in the main electrical wiring diagram are automatically identified, solving the problems of low efficiency and large errors in manual verification in existing technologies, and achieving efficient and accurate identification of wiring relationships.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID FUJIAN ELECTRIC POWER CO LTD
- Filing Date
- 2024-12-02
- Publication Date
- 2026-06-12
AI Technical Summary
In the existing technology, the identification and verification of electrical main wiring diagrams mainly rely on manual methods, which are inefficient and prone to verification errors, and cannot accurately identify complex drawings that do not include legends.
By combining the Canny edge detection algorithm and the object detection algorithm with the width-first search algorithm, the relative coordinates of electrical equipment elements and text annotation boxes are identified, the connection relationship between wiring segments and element boxes is integrated, and the wiring relationship of the main electrical wiring diagram is automatically identified through the fusion of image and CAD data.
It improves the efficiency of electrical main wiring diagram recognition, reduces the workload of manual verification, can accurately identify wiring relationships in complex structures, and reduces recognition errors.
Smart Images

Figure CN119785375B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent recognition technology for electrical design drawings, specifically a method for recognizing wiring relationships in electrical main wiring diagrams that integrate CAD data and images. Background Technology
[0002] The electrical main wiring diagram is an important part of substation design, and its accuracy is directly related to the safe operation of the substation. When designing substation electrical drawings, it is necessary to read the electrical main wiring diagram and verify its internal wiring relationships to ensure the correctness of the drawings.
[0003] Currently, the identification and verification of electrical drawings are all done manually, which is inefficient, consumes a lot of human resources, and manual verification is subjective and prone to errors, thus affecting the safe operation of substations.
[0004] The existing technology CN103514303B, "Method and System for Identifying Wiring Diagrams of Electrical Components," discloses a method and system that uses depth-first traversal technology to parse entity objects in CAD drawings, automatically identify legend and non-legendary elements, and match relevant text based on the bounding box calculation results of the elements, thereby improving the quality and standardization of electrical drawing design.
[0005] In the existing technology, this method can identify electrical pole and tower objects and make quality assessments and rectification suggestions on drawings, aiming to improve the maintenance efficiency and reliability of power supply systems. However, it may have limitations in identifying some elements in complex drawings and relies too much on the legends in the drawings. It cannot accurately identify wiring in drawings that do not contain legends. Summary of the Invention
[0006] To address the problems existing in the prior art, this invention proposes a method for identifying wiring relationships in electrical main wiring diagrams that integrate CAD data and images.
[0007] The technical solution of the present invention is as follows:
[0008] On the one hand, this invention proposes a method for identifying wiring relationships in electrical main wiring diagrams that integrate CAD data and images, the specific steps of which include:
[0009] The collected DWG format electrical main wiring diagram is converted into a high-resolution JPG format drawing. The Canny edge detection algorithm is used to crop the drawing outline. Then, the object detection algorithm is used to identify the relative coordinates and categories of electrical equipment elements and text annotation boxes in the drawing, and each electrical equipment element is numbered.
[0010] Traverse the entity space of the original DWG drawing, parse out the data of all straight line entities and polyline entities, record the endpoint coordinates and line type of each line segment entity, and convert the endpoint coordinate data into normalized coordinates in the same format as the target detection algorithm according to the drawing range.
[0011] Identify the busbars and loop start points in the solid space of the original DWG drawing;
[0012] Based on the data of straight lines and polylines, complete original wiring data is integrated. The line segments of straight lines and some rectangular areas near the busbars in the element frame are removed step by step to obtain complete wiring segments and element frames. The corresponding numbers, endpoints and line type data of wiring segments and element frames are recorded.
[0013] Predefine connection relationships, traverse all wiring segments and element boxes, and obtain a list of connection relationships between wiring segments and element boxes or between two wiring segments based on the connection relationships;
[0014] The breadth-first search algorithm is used to search all the connection relationship lists to obtain a list of connected element wiring IDs. Then, the ID of the corresponding wiring is found by traversing the position of the loop start line segment. Finally, the wiring ID is added to each loop start point according to its position in the connection ID list.
[0015] In a preferred embodiment, the step of identifying the busbar and loop start point in the solid space of the original DWG drawing specifically includes:
[0016] The busbar data of the electrical main line diagram is generally stored in the multi-polyline entity in the entity space of the DWG drawing. Traverse all the polyline data, set the corresponding length threshold and determine whether it is horizontal, find the corresponding horizontal line, record its endpoint coordinates and corresponding line type as the busbar.
[0017] Based on the busbar data, short line segments that intersect with it are selected from the straight line data, and their coordinates are recorded as the starting point of each loop.
[0018] In a preferred embodiment, the step of integrating the complete original wiring data from the straight line and multi-segment line entity data specifically includes:
[0019] Based on whether the multi-polyline data is closed, it is divided into multiple short straight lines. Then, all the straight line data is merged into the wiring raw data. After splitting the multi-polyline data, it is divided into straight line segments according to the vertices to serve as new wiring. Then, it is merged with the straight line entity data extracted from the original DWG entity space to form the complete wiring raw data.
[0020] In a preferred embodiment, the step of removing the straight lines in the graphic element frame specifically includes:
[0021] Based on the coordinates of the primitive target detection box in the primitive target detection algorithm, all connected entities are traversed. If any edge of the primitive detection box intersects with a connected segment, the connected segment is divided into two segments according to the position of the intersection point, and the connected segments whose two endpoints belong to the same primitive target detection box are deleted.
[0022] In a preferred embodiment, the step of removing line segments from the rectangular region near the busbar specifically involves:
[0023] Set a certain threshold to remove line segments in a small rectangular area near the busbar using the same method as removing straight lines from the element box.
[0024] In a preferred embodiment, the predefined connection relationship is specifically as follows:
[0025] The predefined conditions are that a line endpoint is connected to other parts in three ways: when a line endpoint intersects with multiple line endpoints, when a line endpoint intersects with a primitive frame, and when a line endpoint is on another line. However, since there may be cases where line endpoints are not connected in actual drawing, but are actually connected, we define that the distance between two line endpoints, the distance between a line endpoint and the edge of the primitive frame, and the perpendicular distance from the endpoint to the line are all less than a very small threshold to be considered as connected.
[0026] As a preferred embodiment, the target detection algorithm is the YOLO v8 target detection algorithm.
[0027] In a preferred embodiment, the step of searching all connection relationship lists using a breadth-first search algorithm to obtain a list of connected element wiring IDs specifically involves:
[0028] The first step is to initialize a queue and enqueue a line segment L0.
[0029] The second step is to dequeue the current line segment from the queue and mark it as L. i Visited;
[0030] The third step is to find the line segment L. i For all connected line segments and primitives in the connection list, enqueue any unvisited line segments or primitives.
[0031] Repeat steps two and three until the queue is empty, then output the complete connection path.
[0032] On the other hand, the present invention proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements a wiring relationship identification method for electrical main wiring diagrams that integrates CAD data and images, as described in any embodiment of the present invention.
[0033] On the other hand, the present invention proposes a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a wiring relationship identification method for electrical main wiring diagrams that integrates CAD data and images, as described in any embodiment of the present invention.
[0034] The present invention has the following beneficial effects:
[0035] 1. The present invention integrates the results of CAD data and image data, making the identification process of electrical equipment connection relationships in the main electrical wiring diagram more efficient, greatly reducing the workload of manual verification, and improving the efficiency of drawing verification.
[0036] 2. By processing the original wiring data and using segmentation and fusion technology, this invention can effectively adapt to wiring diagrams with various complex structures, improve the adaptability to verifying the connection relationships of complex drawings, and accurately identify the wiring relationships and the topology of electrical elements, thereby reducing identification errors in drawings. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the steps of the present invention;
[0038] Figure 2 A schematic diagram of the identified electrical equipment elements and text annotation boxes;
[0039] Figure 3 This is a schematic diagram of the analyzed straight line entity;
[0040] Figure 4 A schematic diagram of the analyzed multi-fold reality;
[0041] Figure 5 This is a schematic diagram of the busbar and the starting point of the loop;
[0042] Figure 6 A schematic diagram of the original wiring data for integrating multiple polygonal lines and straight lines;
[0043] Figure 7 A schematic diagram of all detected primitive frames and the wiring segments between them (excluding busbars);
[0044] Figure 8 To remove all element frames and retain only the wiring segment diagram (excluding busbars);
[0045] Figure 9 This is a diagram showing the wiring structure between the various graphic elements;
[0046] Figure 10 This is a simplified flowchart illustrating the steps of the present invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] It should be understood that the step numbers used in the text are for ease of description only and are not intended to limit the order in which the steps are performed.
[0049] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0050] The terms “comprising” and “including” indicate the presence of the described feature, whole, step, operation, element and / or component, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0051] The term “and / or” refers to any combination of one or more of the associated listed items, as well as all possible combinations, and includes these combinations.
[0052] Example 1:
[0053] See Figure 1 A method for identifying wiring relationships in electrical main wiring diagrams that integrate CAD data and images, the specific steps of which include:
[0054] The collected DWG format electrical main wiring diagram is converted into a high-resolution JPG format drawing. The Canny edge detection algorithm is used to crop the drawing outline. Then, the object detection algorithm is used to identify the relative coordinates and categories of electrical equipment elements and text annotation boxes in the drawing, and each electrical equipment element is numbered.
[0055] In this embodiment, the electrical main wiring diagram in DWG format provided by the design institute is obtained and converted into a high-resolution JPG image. Morphological algorithms are used to augment edges, and the edge contours of the drawing are extracted and cropped using the Canny edge detection algorithm (thresholds set to 30 and 100). The cropped image is further divided into 1024x1024 pixel sub-images. Each sub-image is input into a YOLO V8 object detection model (using weights fine-tuned based on the corresponding electrical drawing dataset) to identify electrical equipment primitives and text annotation boxes. The relative coordinates and category of each primitive and text box are recorded, and the primitives are numbered according to the detection order. The identified electrical equipment primitives and text annotation boxes are as follows: Figure 2 As shown.
[0056] Traverse the entity space of the original DWG drawing, parse out the data of all straight line entities and polyline entities, record the endpoint coordinates and line type of each line segment entity, and convert the endpoint coordinate data into normalized coordinates in the same format as the target detection algorithm according to the drawing range.
[0057] In this embodiment, the dzdxf library is used to parse the DWG file, traversing all line and polyline entity records (endpoints and linetype information) in the modelspace, obtaining the drawing boundary coordinates from the header file (HEADS), and normalizing the coordinate data to align with the primitive results. The normalization formula is as follows:
[0058]
[0059] Where x min x max y min y max These are the boundary values of the drawing.
[0060] Among them, the parsed linear entities and multi-faceted entities are respectively as follows: Figure 3 and Figure 4 As shown.
[0061] Identify the busbars and loop start points in the solid space of the original DWG drawing;
[0062] In this embodiment, the identified busbar and loop start point are as follows: Figure 5 As shown, the busbar identification steps are as follows:
[0063] In the extracted polyline data, the main line typically appears as a relatively long horizontal straight line. A line segment length threshold l is set. busbar (Based on experience, the value is set to 0.05, and the total length is 1) Select straight lines that meet the length condition and have a tilt angle close to horizontal. The tilt angle satisfies the following formula:
[0064]
[0065] Where (x1, y1) and (x2, y2) represent the coordinates of the two endpoints of the line, ε bus b ar For the set small angle threshold, here ε busbar =5,l busbar =0.05.
[0066] The specific steps for loop start point identification are as follows:
[0067] After identifying the busbar, short line segments intersecting with the busbar are selected from the straight line entity data, and the coordinates of the intersection points are recorded. The identified busbar and the starting point of the loop are as follows: Figure 6 As shown.
[0068] Based on the data of straight lines and polylines, complete original wiring data is integrated. The line segments of straight lines and some rectangular areas near the busbars in the element frame are removed step by step to obtain complete wiring segments and element frames. The corresponding numbers, endpoints and line type data of wiring segments and element frames are recorded.
[0069] In this embodiment, the specific steps of this step are as follows:
[0070] First, remove text annotation box interference: Using the detection results of YOLOv8, remove the coordinate range of text annotation boxes detected in the drawing from the wiring data. Specifically, for each straight line or polyline, if its endpoints are within the range of a certain text annotation box, determine whether it is an interference segment; if so, delete it. The specific judgment conditions are as follows: (x i ,y i )∈bbox text for any i∈{1,2} where bbox text Indicates the coordinate range of the text annotation box.
[0071] Second, multi-polyline segmentation and fusion: For multi-polyline data in the drawing, it is segmented into several short straight line segments according to the vertices. The segmentation formula is: i = 1, 2, 3, ..., n-1, where n represents the number of vertices of the polyline (x i ,y i () represents the i-th vertex. Then, these short line segments are merged with the previously extracted straight line data to construct a complete wiring dataset. Figure 6 To integrate wiring data of multi-segment lines and straight lines.
[0072] Third, remove straight lines within the element box: using the coordinates of the element annotation box in the detection results, determine whether each straight line intersects with a certain element box.
[0073] If both endpoints of a line segment are within the element frame, the line segment is deleted. If a line segment is only partially within the element frame, it is divided into two parts based on the intersection point, and the part outside the frame is retained as a new connection. A schematic diagram of the connection between the element frame and the connection segment is shown below. Figure 7 As shown in the diagram, the schematic diagram with the element frame removed, leaving only the wiring segment, is as follows: Figure 8 As shown.
[0074] Fourth, remove straight lines near the busbar area and separate loops: To avoid miscellaneous wires near the busbar area affecting the identification of wiring relationships, first define the influence area of the busbar, usually by setting a vertical distance threshold d. busbar This threshold is set according to the drawing scale. For each straight line, its perpendicular distance to the busbar is determined. If the following conditions are met, the straight line is identified as a miscellaneous line and its connection relationship is removed.
[0075]
[0076] Where (x) busbar1 ,y busbar1 ), (x busbar2 ,y busbar2 ) are the two endpoints of the busbar, (x line ,y line () are the endpoints of the line. If d ⊥ <d busbar If the line is considered an interference segment near the busbar, it will be removed.
[0077] Predefine connection relationships, traverse all wiring segments and element boxes, and obtain a list of connection relationships between wiring segments and element boxes or between two wiring segments based on the connection relationships;
[0078] In this embodiment, connection relationships are defined: each line segment (including short segments branched off from the busbar) may connect to a certain element or other line segment in the drawing. To define these connection relationships, we introduce element identifiers and line segment identifiers. The basic definition of a connection relationship is: if the endpoint of a line segment falls within a certain element annotation box, or if a line segment intersects with another line segment, then there is a connection between them.
[0079] Next, based on the coordinates of each wire's endpoints, determine its connection relationship with the graphic element. If a wire's endpoint falls within the bounds of a graphic element, then the wire is assigned to that graphic element, and the connection relationship is recorded. The judgment condition is: (x end ,y end )∈bbox obj Among them bbox obj The coordinate range of the graphic element.
[0080] Obtaining the connection list: By traversing all line segments and primitives, determine whether the endpoints of each line segment are connected to other line segments or primitives, and generate a connection list. The form of the connection list is: connection_list = [(L i ,[L j ,L k ,...,obj n L i Represents the current line segment, [L j ,L k ,...,obj n [] represents the line segment or graphic element connected to it.
[0081] The breadth-first search algorithm is used to search all the connection relationship lists to obtain a list of connected element wiring IDs. Then, the ID of the corresponding wiring is found by traversing the position of the loop start line segment. Finally, the wiring ID is added to each loop start point according to its position in the connection ID list.
[0082] In this embodiment, a complete list of primitive connections is obtained using breadth-first search (BFS): the generated connection list is traversed using the BFS algorithm, starting from a certain line segment or primitive, and progressively searching for all line segments and primitives connected to it, until all connection items have been traversed. The specific steps are as follows:
[0083] The first step is to initialize a queue and enqueue a line segment L0.
[0084] The second step is to dequeue the current line segment from the queue and mark it as L. i Visited.
[0085] The third step is to find the line segment L. i For all connected segments and primitives in the connection list, enqueue any unvisited segments or primitives.
[0086] Repeat steps two and three until the queue is empty, then output the complete connection path.
[0087] Busbar topology identification: Treat each busbar and all its connected loops as a tree structure. Use BFS or DFS to traverse each busbar and its connected primitives to identify its topology. Finally, construct a topological graph of the relationship between buses and primitives.
[0088] Loop segmentation is performed based on a complete list of element connections: Wiring data is divided into different loops according to the location of the loop's starting point and the wiring relationships. By analyzing the starting and ending coordinates of each loop and its connected elements, the connection sequence of each component within the loop is ultimately determined. Figure 9 This refers to the connected elements and wiring diagram.
[0089] Based on the above method, a simplified diagram of the implementation steps of the present invention is shown below. Figure 10 As shown.
[0090] In a preferred embodiment of this invention, the step of identifying the busbar and loop start point in the solid space of the original DWG drawing specifically includes:
[0091] The busbar data of the electrical main line diagram is generally stored in the multi-polyline entity in the entity space of the DWG drawing. Traverse all the polyline data, set the corresponding length threshold and determine whether it is horizontal, find the corresponding horizontal line, record its endpoint coordinates and corresponding line type as the busbar.
[0092] Based on the busbar data, short line segments that intersect with it are selected from the straight line data, and their coordinates are recorded as the starting point of each loop.
[0093] In a preferred embodiment of this invention, the step of integrating the complete original wiring data based on the straight line and multi-segment line entity data specifically includes:
[0094] Based on whether the multi-polyline data is closed, it is divided into multiple short straight lines. Then, all the straight line data is merged into the wiring raw data. After splitting the multi-polyline data, it is divided into straight line segments according to the vertices to serve as new wiring. Then, it is merged with the straight line entity data extracted from the original DWG entity space to form the complete wiring raw data.
[0095] In a preferred embodiment of this invention, the step of removing the straight lines in the graphic element frame specifically involves:
[0096] Based on the coordinates of the primitive target detection box in the primitive target detection algorithm, all connected entities are traversed. If any edge of the primitive detection box intersects with a connected segment, the connected segment is divided into two segments according to the position of the intersection point, and the connected segments whose two endpoints belong to the same primitive target detection box are deleted.
[0097] In a preferred embodiment of this invention, the step of removing line segments from the rectangular region near the busbar specifically involves:
[0098] Set a certain threshold to remove line segments in a small rectangular area near the busbar using the same method as removing straight lines from the element box.
[0099] In a preferred embodiment of this invention, the predefined connection relationship is specifically as follows:
[0100] The predefined conditions are that a line endpoint is connected to other parts in three ways: when a line endpoint intersects with multiple line endpoints, when a line endpoint intersects with a primitive frame, and when a line endpoint is on another line. However, since there may be cases where line endpoints are not connected in actual drawing, but are actually connected, we define that the distance between two line endpoints, the distance between a line endpoint and the edge of the primitive frame, and the perpendicular distance from the endpoint to the line are all less than a very small threshold to be considered as connected.
[0101] In a preferred embodiment of this invention, the target detection algorithm is the YOLO v8 target detection algorithm.
[0102] In a preferred embodiment of this invention, the step of searching all connection relationship lists using a breadth-first search algorithm to obtain a list of connected element wiring IDs specifically involves:
[0103] The first step is to initialize a queue and enqueue a line segment L0.
[0104] The second step is to dequeue the current line segment from the queue and mark it as L. i Visited;
[0105] The third step is to find the line segment L. i For all connected line segments and primitives in the connection list, enqueue any unvisited line segments or primitives.
[0106] Repeat steps two and three until the queue is empty, then output the complete connection path.
[0107] Example 2:
[0108] This embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements a wiring relationship identification method for electrical main wiring diagrams that integrates CAD data and images, as described in any embodiment of the present invention.
[0109] Example 3:
[0110] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a wiring relationship identification method for an electrical main wiring diagram that integrates CAD data and images, as described in any embodiment of the present invention.
[0111] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for identifying wiring relationships in electrical main wiring diagrams that integrate CAD data and images, characterized in that, The specific steps include: The collected DWG format electrical main wiring diagram is converted into a high-resolution JPG format drawing. The Canny edge detection algorithm is used to crop the drawing outline. Then, the object detection algorithm is used to identify the relative coordinates and categories of electrical equipment elements and text annotation boxes in the drawing, and each electrical equipment element is numbered. Traverse the entity space of the original DWG drawing, parse out the data of all straight line entities and polyline entities, record the endpoint coordinates and line type of each line segment entity, and convert the endpoint coordinate data into normalized coordinates in the same format as the target detection algorithm according to the drawing range. Identify the busbars and loop start points in the solid space of the original DWG drawing; Based on the data of straight lines and polylines, complete original wiring data is integrated. The line segments of straight lines and some rectangular areas near the busbars in the element frame are removed step by step to obtain complete wiring segments and element frames. The corresponding numbers, endpoints and line type data of wiring segments and element frames are recorded. The specific steps for removing the straight lines from the graphic element frame are as follows: Based on the coordinates of the primitive target detection box in the primitive target detection algorithm, all connected entities are traversed. If any edge of the primitive detection box intersects with the connected segment, the connected segment is divided into two segments according to the position of the intersection point, and the connected segments whose two endpoints belong to the same primitive target detection box are deleted. Predefine connection relationships, traverse all wiring segments and element boxes, and obtain a list of connection relationships between wiring segments and element boxes or between two wiring segments based on the connection relationships; The breadth-first search algorithm is used to search all the connection relationship lists to obtain a list of connected element wiring IDs. Then, the ID of the corresponding wiring is found by traversing the position of the loop start line segment. Finally, the wiring ID is added to each loop start point according to its position in the connection ID list.
2. The wiring relationship identification method for electrical main wiring diagrams integrating CAD data and images according to claim 1, characterized in that, The specific steps for identifying busbars and loop start points in the solid space of the original DWG drawing are as follows: The busbar data of the electrical main line diagram is generally stored in the multi-polyline entity in the entity space of the DWG drawing. Traverse all the polyline data, set the corresponding length threshold and determine whether it is horizontal, find the corresponding horizontal line, record its endpoint coordinates and corresponding line type as the busbar. Based on the busbar data, short line segments that intersect with it are selected from the straight line data, and their coordinates are recorded as the starting point of each loop.
3. The wiring relationship identification method for electrical main wiring diagrams integrating CAD data and images according to claim 2, characterized in that, The specific steps for integrating the complete original wiring data based on the straight line and multi-polyline entity data are as follows: Based on whether the multi-polyline data is closed, it is divided into multiple short straight lines. Then, all the straight line data is merged into the wiring raw data. After splitting the multi-polyline data, it is divided into straight line segments according to the vertices to serve as new wiring. Then, it is merged with the straight line entity data extracted from the original DWG entity space to form the complete wiring raw data.
4. The method for identifying wiring relationships in electrical main wiring diagrams that integrate CAD data and images according to claim 1, characterized in that, The specific steps for removing line segments from the rectangular region near the busbar are as follows: Set a certain threshold to remove line segments in a small rectangular area near the busbar using the same method as removing straight lines from the element box.
5. The wiring relationship identification method for electrical main wiring diagrams integrating CAD data and images according to claim 1, characterized in that, The predefined connection relationship is specifically as follows: The predefined conditions are that a line endpoint is connected to other parts in three ways: when a line endpoint intersects with multiple line endpoints, when a line endpoint intersects with a primitive frame, and when a line endpoint is on another line. However, since there may be cases where line endpoints are not connected in actual drawing, but are actually connected, we define that the distance between two line endpoints, the distance between a line endpoint and the edge of the primitive frame, and the perpendicular distance from the endpoint to the line are all less than a very small threshold to be considered as connected.
6. The method for identifying wiring relationships in electrical main wiring diagrams that integrate CAD data and images according to claim 1, characterized in that, The target detection algorithm is the YOLO v8 target detection algorithm.
7. The method for identifying wiring relationships in electrical main wiring diagrams that integrate CAD data and images according to claim 1, characterized in that, The specific steps for obtaining the list of connected element wiring IDs by searching all connection relationship lists using the breadth-first search algorithm are as follows: The first step is to initialize a queue and put a certain line segment into it. Joining the team; The second step is to dequeue the current line segment from the queue and mark it. Visited; The third step is to locate the line segment. For all connected line segments and primitives in the connection list, enqueue any unvisited line segments or primitives. Repeat steps two and three until the queue is empty, then output the complete connection path.
8. 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 program, it implements a wiring relationship identification method for electrical main wiring diagrams that integrate CAD data and images, as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements a wiring relationship identification method for electrical main wiring diagrams that integrate CAD data and images, as described in any one of claims 1 to 7.