An electrical graph element recognition and topology construction method, system, device and medium

CN122990733APending Publication Date: 2026-10-27NARI INFORMATION & COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611401247.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-10
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0009]本发明的目的在于克服现有技术中的不足,提供一种电气图元识别与拓扑构建方法、系统、装置及介质,解决接线图数字化过程中识别效率低、场景泛化能力不足、无法建立拓扑关联的问题

Benefits of technology

[0065]本发明提供的一种电气图元识别与拓扑构建方法,通过构建结构化拓扑,实现图元、文字、连接接线段的关联,解决现有技术无法建立拓扑关联的痛点;通过PaddleOCR模型与改进YOLOv11模型,实现对文字和图元的识别,提升低质量图纸的识别精度,解决现有通用算法鲁棒性不足的问题,提升场景适用性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990733A_ABST
    Figure CN122990733A_ABST
Patent Text Reader

Abstract

The application discloses an electrical graph element identification and topology construction method, system and device and a medium, and belongs to the technical field of electrical graph element topology construction. The method comprises the following steps: inputting a target wiring diagram into a PaddleOCR model to obtain a character recognition result; inputting the target wiring diagram into an improved YOLOv11 model to obtain a graph element recognition result; extracting a plurality of initial wiring segments in the target wiring diagram, and performing merging processing on the initial wiring segments that meet the collinear approximation condition to obtain to-be-connected wiring segments; judging whether the to-be-connected wiring segments have a connection relationship with the graph elements according to graph element frame coordinates, and taking a connection point of the to-be-connected wiring segments and the graph elements as a graph element terminal if the connection relationship exists; matching the graph elements with the character recognition result according to a YAML rule file; and constructing a structured topology. The application solves the problems of low recognition efficiency and the inability to establish a topology correlation in the wiring diagram digitization process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electrical element topology construction technology, specifically relating to an electrical element identification and topology construction method, system, device and medium. Background Technology

[0002] The primary wiring diagram of a power plant is a core technical graphic in the power grid dispatch and control system, describing the composition of electrical equipment, electrical connection logic, and network topology. It serves as the core basis for power grid operation dispatch, mode arrangement, fault handling, and equipment maintenance. The graphic element parameters, topological relationships, and equipment names it contains directly determine the accuracy of power grid dispatch operations and the safety of power grid operation. To adapt to the development requirements of the continuously expanding power grid scale and dynamic optimization of the grid structure under the construction of new power systems, power grid companies, power design institutes, and other units need to complete the compilation and updating of primary wiring diagrams for a large number of new construction projects and technical renovation projects every year. The relevant drawings are stored in multiple sources and distributed in formats such as images and PDF (Portable Document Format).

[0003] With the ongoing construction of new power systems, the power grid is expanding rapidly, and its topology and equipment are being updated and iterated quickly. The power grid dispatch and management system needs to simultaneously update and dynamically maintain wiring diagram information in real time. Currently, the extraction and digitization of primary wiring diagrams at power plants still heavily relies on the traditional processing method of "manual reading, line-by-line verification, manual entry, and cross-checking." This method is not only extremely time-consuming but also prone to errors and omissions due to human visual fatigue, differences in professional experience, and the complexity of the drawings, making it difficult to meet the real-time and accuracy requirements of the power grid dispatch system for data updates. Furthermore, primary wiring diagrams within the power grid include high-definition electronic design drawings, as well as scanned copies and on-site photographs. Even diagrams of the same type often exhibit significant differences in symbol styles, equipment naming rules, and layout styles due to variations in the region of origin and design unit.

[0004] In recent years, the industry has attempted to use general OCR (Optical Character Recognition) and basic image detection algorithms to automatically extract wiring diagram information, but it still faces the following insurmountable core technologies and engineering implementation challenges:

[0005] (1) The general recognition scheme has extremely poor business adaptability and cannot realize the topological relationship analysis of the core value of the wiring diagram. Existing general OCR and image recognition algorithms can only realize independent text recognition and simple graphic detection. They cannot establish the topological association between "graphic element-line-name" and cannot analyze the core electrical connection logic of the wiring diagram. The output recognition results are only scattered text and graphic fragments, which cannot be directly applied to the power grid dispatch and maintenance business scenario.

[0006] (2) Insufficient scenario generalization capability, and extremely high secondary development and maintenance costs. Wiring diagrams in different regions have significant differences in element symbol styles, equipment naming rules, and drawing layout styles. Traditional identification schemes based on fixed templates and hard-coded rules require the development of new detection rules and templates for each new drawing type, resulting in extremely poor reusability and inability to adapt to the needs of large-scale and multi-scenario engineering implementation in power grids.

[0007] (3) The recognition accuracy and robustness cannot meet the requirements of industrial applications. Wiring diagrams collected on site generally have problems such as blurriness, shadows, wrinkles, partial stamp obscuration, and background noise. The recognition accuracy of general algorithms for low-quality drawings drops significantly. At the same time, the text such as element numbers and equipment names in the wiring diagrams have the characteristics of compact characters, single font, and large differences in font size. General OCR models have not been customized and optimized for this scenario, which makes it easy to misidentify or miss characters, thus causing the overall recognition result to fail.

[0008] In addition, existing general OCR recognition technologies can only extract text and cannot recognize electrical elements and circuits; existing basic image detection algorithms, such as YOLOv8, are not optimized for wiring diagram scenarios, have low recognition accuracy, and cannot establish topological associations. Summary of the Invention

[0009] The purpose of this invention is to overcome the shortcomings of the prior art and provide an electrical element recognition and topology construction method, system, device and medium to solve the problems of low recognition efficiency, insufficient scene generalization ability and inability to establish topology associations in the process of digitizing wiring diagrams.

[0010] This invention provides the following technical solution:

[0011] In a first aspect, a method for electrical element recognition and topology construction is provided, including: obtaining a target wiring diagram;

[0012] Input the target wiring diagram into the PaddleOCR model to obtain the text recognition result;

[0013] The target wiring diagram is input into a pre-trained improved YOLOv11 model to obtain primitive recognition results including primitive bounding box coordinates; the improved YOLOv11 model is to replace the P5 detection head in the YOLOv11 model with the P2 detection head;

[0014] Extract several initial wiring segments from the target wiring diagram, and merge the initial wiring segments that meet the preset collinearity approximation conditions to obtain the wiring segments to be connected;

[0015] Based on the coordinates of the graphic element's border, determine whether the wiring segment to be connected has a connection relationship with the graphic element. If a connection relationship exists, take the connection point between the wiring segment to be connected and the graphic element as the graphic element terminal to obtain the wiring-terminal matching result.

[0016] Based on the pre-acquired YAML rule file, the primitives are matched with the text recognition results to obtain the text matching results;

[0017] Construct a structured topology that includes wiring-terminal matching results and text matching results.

[0018] As an optional technical solution of the present invention, after obtaining the target wiring diagram, the target wiring diagram is preprocessed, including:

[0019] The target wiring diagram can be in JPG, PNG, PDF, or DXF formats.

[0020] After converting target wiring diagrams of different formats into OpenCV-processable arrays, denoising, adaptive binarization, and size normalization are performed sequentially to obtain standard target wiring diagrams.

[0021] As an optional technical solution of the present invention, the step of inputting the target wiring diagram into a pre-trained improved YOLOv11 model to obtain a primitive recognition result including primitive bounding box coordinates includes:

[0022] The improved YOLOv11 model identifies the outlines of various power grid graphics in the target wiring diagram and obtains the graphic element recognition results, which also include graphic element type and graphic element center point coordinates.

[0023] During the training of the improved YOLOv11 model, the classification loss function uses the Focal loss function, and the bounding box regression loss function uses the CIOU loss function.

[0024] As an optional technical solution of the present invention, the step of extracting several initial wiring segments from the target wiring diagram and merging the initial wiring segments that satisfy the preset collinearity approximation condition to obtain the wiring segments to be connected includes:

[0025] The Canny edge detection algorithm is used to perform edge detection on the target wiring diagram;

[0026] A contour retrieval algorithm is used to extract all wiring segments from the edge detection results;

[0027] An area screening algorithm is used to filter out invalid wiring segments caused by noise and interference residues from all wiring segments to obtain the initial wiring segments;

[0028] For any two initial connection segments, calculate their angle difference and minimum distance, respectively, as follows:

[0029] ;

[0030] ;

[0031] ;

[0032] ;

[0033] ;

[0034] in, This indicates the angle difference between the two initial wiring segments. This represents a function that converts radian degrees to degrees. This function represents rounding a real number to the nearest integer. Indicates the direction angle of an initial connection segment. Indicates the direction angle of the other initial connection segment. Indicates the first The direction angle of the initial wiring segment, and They represent the first The x and y coordinates of one endpoint of the initial wiring segment. and They represent the first The x and y coordinates of the other endpoint of the initial wiring segment, This represents the minimum distance between two initial connection segments. This indicates taking the minimum value. Indicates an initial wiring segment One endpoint To another initial wiring segment The minimum distance, Indicates an initial wiring segment Another endpoint To another initial wiring segment The minimum distance, Indicates an initial wiring segment One endpoint To another initial wiring segment The minimum distance, Indicates an initial wiring segment Another endpoint To another initial wiring segment The minimum distance, Represents Euclidean distance. Indicates the projection coefficient;

[0035] The collinearity approximation condition includes: if and Then the two initial wiring segments are merged. Indicates the threshold of angle difference. Indicates the distance threshold;

[0036] During the merging process, the direction of the longer initial segment is retained, and the endpoints of the shorter initial segment are projected onto the straight line containing the longer initial segment. The extreme values ​​of all projected points are taken as the endpoints of the merged segment, represented as:

[0037] ;

[0038] ;

[0039] ;

[0040] in, This represents one endpoint of the merged line segment. Indicates the other endpoint of the merged line segment. This represents one end of a relatively long initial wiring segment. This indicates taking the maximum value. This represents the unit direction vector of a relatively long initial wiring segment. Indicates the initial wiring segment The two endpoints are relative to the endpoints in the unit direction vector of the longer initial wiring segment. The projected scalar value, These represent the initial wiring segments. The two endpoints;

[0041] The connection segments to be connected include all merged segments and the initial connection segments that have not been merged.

[0042] As an optional technical solution of the present invention, the step of determining whether the segment to be connected has a connection relationship with the graphic element based on the coordinates of the graphic element's border, and if a connection relationship exists, includes:

[0043] The element border is determined based on the element border coordinates, and the element border includes the top edge. bottom edge ,left and the right , respectively represented as:

[0044] ;

[0045] ;

[0046] ;

[0047] ;

[0048] in, These represent the x and y coordinates of the top-left corner of the element's border, respectively. These represent the x and y coordinates of the bottom right corner of the graphic element's border, respectively.

[0049] For any segment to be connected, if the projection coefficient from any endpoint to any side of the element's border is... satisfy and the minimum distance to that edge. If so, it is determined that the connection segment to be connected has a connection relationship with the graphic element.

[0050] As an optional technical solution of the present invention, the step of matching graphic elements with text recognition results according to a pre-acquired YAML rule file to obtain text matching results includes:

[0051] The text recognition result includes the text identifier and the text pixel coordinates;

[0052] The YAML rule file is parsed to configure corresponding named regular expressions for different graphic element types, enabling the graphic elements to perform an initial match with text identifiers that conform to their named regular expressions;

[0053] For text identifiers that are initially matched, the spatial distance between them is calculated based on the pixel coordinates of the text and the center point coordinates of the corresponding graphic element. If the spatial distance is greater than the preset spatial distance threshold, the final match fails.

[0054] As an optional technical solution of the present invention, the structured topology is represented as: [graphic element, terminal, connection segment, text identifier].

[0055] Secondly, an electrical element recognition and topology construction system is provided, including: a data acquisition module for acquiring target wiring diagrams;

[0056] The text recognition module is used to input the target wiring diagram into the PaddleOCR model and obtain the text recognition results;

[0057] The primitive recognition module is used to input the target wiring diagram into a pre-trained improved YOLOv11 model to obtain primitive recognition results including primitive bounding box coordinates; the improved YOLOv11 model is to replace the P5 detection head in the YOLOv11 model with the P2 detection head;

[0058] The connection module is used to extract several initial wiring segments from the target wiring diagram and merge the initial wiring segments that meet the preset collinearity approximation conditions to obtain the wiring segments to be connected.

[0059] The first matching module is used to determine whether the wiring segment to be connected has a connection relationship with the graphic element based on the coordinates of the graphic element's border. If a connection relationship exists, the connection point between the wiring segment to be connected and the graphic element is taken as the graphic element terminal, and the wiring-terminal matching result is obtained.

[0060] The second matching module is used to match the primitives with the text recognition results according to the pre-acquired YAML rule file to obtain the text matching results;

[0061] The topology building module is used to construct structured topologies that include wire-terminal matching results and text matching results.

[0062] Thirdly, an electrical element recognition and topology construction apparatus is provided, including a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the electrical element recognition and topology construction method of the first aspect.

[0063] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the electrical element identification and topology construction method described in the first aspect.

[0064] Compared with the prior art, the beneficial effects of the present invention are:

[0065] This invention provides an electrical element recognition and topology construction method. By constructing a structured topology, it realizes the association between elements, text, and connection segments, solving the pain point that existing technologies cannot establish topology associations. Through the PaddleOCR model and the improved YOLOv11 model, it realizes the recognition of text and elements, improves the recognition accuracy of low-quality drawings, solves the problem of insufficient robustness of existing general algorithms, and improves the applicability of scenarios. Attached Figure Description

[0066] Figure 1 This is a flowchart of the electrical element identification and topology construction method in an embodiment of the present invention;

[0067] Figure 2 This is a schematic diagram of the structure of the improved YOLOv11 model in an embodiment of the present invention. Detailed Implementation

[0068] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0069] Example 1

[0070] This embodiment provides a method for electrical element identification and topology construction. For example... Figure 1 As shown, the specific steps include the following:

[0071] Step 1: Obtain the target wiring diagram.

[0072] The target wiring diagram formats include JPG (Joint Photographic Experts Group), PNG (Portable Network Graphics), PDF, and DXF (Drawing Exchange Format).

[0073] After obtaining the target wiring diagram, the target wiring diagram is preprocessed. The target wiring diagrams of different formats are converted into arrays that can be processed by OpenCV (Open Source Computer Vision Library). Then, noise reduction, adaptive binarization and size normalization are performed in sequence to obtain the standard target wiring diagram.

[0074] Specifically, for a single image file, format verification and reading are performed; for PDF files, each page is rendered into a high-resolution image sequence; for DXF and DWG files, they are converted into image files for subsequent processing. Then, the image preprocessing tool is called to perform image noise reduction, adaptive binarization, and size normalization in sequence, eliminating interference from drawing blur, background noise, watermarks, stamps, etc., and outputting a standard target wiring diagram.

[0075] Step 2: Input the target wiring diagram into the PaddleOCR (Paddle Optical Character Recognition) model to obtain the text recognition results.

[0076] Using the PaddleOCR text recognition engine, the corresponding OCR model is loaded to perform high-precision recognition of target content such as element names, numbers, line markings, and annotation text in the target wiring diagram.

[0077] Step 3: Input the target wiring diagram into the pre-trained improved YOLOv11 model to obtain the primitive recognition results, including the primitive bounding box coordinates.

[0078] like Figure 2The diagram illustrates the improved YOLOv11 model structure proposed in this embodiment. Based on YOLOv11, this structure optimizes the detection head and feature hierarchy to address the characteristics of extremely small and densely distributed primitives in power grid substation wiring diagrams. Specifically, the model input is a 640×640×3 RGB image. After initial convolutional layer downsampling, it sequentially passes through multiple levels of C3K2 modules and convolution operations to extract first-scale features, second-scale features, third-scale features, and fourth-scale features. The fourth-scale feature is processed sequentially by a fast spatial pyramid pooling module (SPPF) and a cross-channel partial self-attention module (C2PSA). The processed fourth-scale feature is then upsampled and concatenated with the third-scale feature to obtain the first concatenated feature. This first concatenated feature is then processed by the C3K2 module to obtain the first intermediate feature. The first intermediate feature is then upsampled and concatenated with the second-scale feature to obtain the second concatenated feature. This second concatenated feature is then processed by the C3K2 module to obtain the second intermediate feature. The second intermediate feature is upsampled and then concatenated with the first-scale feature to obtain the third concatenated feature. This third concatenated feature is then processed by the C3K2 module to obtain the third intermediate feature. The third intermediate feature is then convolved with the second intermediate feature to obtain the fourth concatenated feature. This fourth concatenated feature is then processed by the C3K2 module to obtain the fourth intermediate feature. Finally, the fourth intermediate feature is convolved with the first intermediate feature to obtain the fifth concatenated feature. This fifth concatenated feature is then processed by the C3K2 module to obtain the fifth intermediate feature.

[0079] To enhance the perception of small targets such as small switches, knife switches, and meters, this model retains three feature maps (P2, P3, and P4) with sizes of 80×80, 40×40, and 20×20 respectively, and sets up three corresponding detector heads (P2, P3, and P4) to replace the original YOLOv11 detector heads (P3, P4, and P5). The third intermediate feature is input to the P2 detector head, the fourth intermediate feature to the P3 detector head, and the fifth intermediate feature to the P4 detector head. The P2 detector head has a higher feature resolution, effectively capturing detailed information of small targets and significantly improving the model's recall and localization accuracy for small primitives. Meanwhile, to accommodate the detection needs of medium-scale targets, the P3 and P4 detector heads retain a medium receptive field, forming a complementary multi-scale detection system with the P2 detector head. In the feature fusion stage, convolution and upsampling operations are used to achieve top-down feature pyramid enhancement, and a self-attention mechanism is introduced through the C2PSA module to strengthen the response weights of key primitive regions. Furthermore, the number of channels in each layer of the network is adaptively scaled based on the width factor mc, effectively reducing redundant parameters and computational overhead while ensuring detection performance, thus improving the model's operating efficiency in industrial deployment scenarios. This improved model significantly optimizes the detection performance of dense small target primitives without introducing additional complex branches, while also meeting the engineering requirements of lightweight model and real-time detection.

[0080] The YOLOv11 model is improved to identify the outlines of various power grid graphics such as disconnect switches, circuit breakers, transformers, and instrument transformers in the target wiring diagram, and the graphic element recognition results are obtained. The graphic element recognition results also include graphic element type and graphic element center point coordinates.

[0081] In the original YOLOv11 model, the classification loss uses the binary cross-entropy loss function. However, in actual power grid substation map detection tasks, many sample imbalance problems have been found. For example, the number of disconnect switches and grounding switches is far greater than the number of other elements, while the number of reactors and capacitors is relatively small. The binary cross-entropy loss function is easily affected by imbalanced samples, leading to a decrease in recognition accuracy. Therefore, in the training process of the improved YOLOv11 model, the classification loss function adopts the Focal loss function, and the bounding box regression loss function adopts the CIOU loss function to alleviate the problems caused by sample imbalance. The Focal loss function allocates sample weights differently by adjusting the factor and weights, weakening the weight of easily classified samples and strengthening the weight of difficult-to-classify samples, thereby improving the model's ability to fit imbalanced samples.

[0082] Step 4: Extract several initial wiring segments from the target wiring diagram, and merge the initial wiring segments that meet the preset collinearity approximation conditions to obtain the wiring segments to be connected.

[0083] The Canny edge detection algorithm is used to perform edge detection on the target wiring diagram.

[0084] A contour retrieval algorithm is used to extract all wiring segments from the edge detection results.

[0085] An area screening algorithm is used to filter out invalid wiring segments caused by noise and interference residues from all wiring segments to obtain the initial wiring segments.

[0086] For any two initial connection segments, calculate their angle difference and minimum distance, respectively, as follows:

[0087] ;

[0088] ;

[0089] ;

[0090] ;

[0091] ;

[0092] in, This indicates the angle difference between the two initial wiring segments. A function that converts radian angles to degrees. This function represents rounding a real number to the nearest integer. Indicates the direction angle of an initial connection segment. Indicates the direction angle of the other initial connection segment. Indicates the first The direction angle of the initial wiring segment, and They represent the first The x and y coordinates of one endpoint of the initial wiring segment. and They represent the first The x and y coordinates of the other endpoint of the initial wiring segment, This represents the minimum distance between two initial connection segments. This indicates taking the minimum value. Indicates an initial wiring segment One endpoint To another initial wiring segment The minimum distance, Indicates an initial wiring segment Another endpoint To another initial wiring segment The minimum distance, Indicates an initial wiring segment One endpoint To another initial wiring segment The minimum distance, Indicates an initial wiring segment Another endpoint To another initial wiring segment The minimum distance, Represents Euclidean distance. This represents the projection coefficient.

[0093] Collinearity approximation conditions include: if and Then the two initial wiring segments are merged. Indicates the threshold of angle difference. This represents the distance threshold.

[0094] initial wiring segment and initial wiring segment There exists a longer initial connection segment and a shorter initial connection segment. During the merging process, the direction of the longer initial connection segment is retained, and the endpoints of the shorter initial connection segment are projected onto the straight line containing the longer initial connection segment. The extreme values ​​of all projected points are taken as the endpoints of the merged line segment, expressed as:

[0095] ;

[0096] ;

[0097] ;

[0098] ;

[0099] in, This represents one endpoint of the merged line segment. Indicates the other endpoint of the merged line segment. This represents one end of a relatively long initial wiring segment. This represents the other end of a longer initial wiring segment. This indicates the length of the longer initial wiring segment. This indicates taking the maximum value. This represents the unit direction vector of a relatively long initial wiring segment. Indicates the initial wiring segment The two endpoints are relative to the endpoints in the unit direction vector of the longer initial wiring segment. The projected scalar value, These represent the initial wiring segments. The two endpoints.

[0100] The wiring segments to be connected include all merged segments as well as the initial wiring segments that have not been merged.

[0101] Step 5: Based on the coordinates of the graphic element's border, determine whether the wiring segment to be connected has a connection relationship with the graphic element. If a connection relationship exists, take the connection point between the wiring segment to be connected and the graphic element as the graphic element terminal to obtain the wiring-terminal matching result.

[0102] The element border is determined based on the element border coordinates. The element border includes the top edge. bottom edge ,left and the right , respectively represented as:

[0103] ;

[0104] ;

[0105] ;

[0106] ;

[0107] in, These represent the x and y coordinates of the top-left corner of the element's border, respectively. These represent the x and y coordinates of the bottom right corner of the graphic element's border, respectively.

[0108] For any segment to be connected, if the projection coefficient from any endpoint to any side of the element's border is... satisfy and the minimum distance to that edge. If so, it is determined that the connection segment to be connected has a connection relationship with the graphic element.

[0109] Step 6: Match the primitives with the text recognition results according to the pre-acquired YAML rule file to obtain the text matching results.

[0110] The text recognition results include the text identifier and the text pixel coordinates.

[0111] To address the significant differences in naming rules for power grid substation wiring diagrams across different regions, YAML rule files are parsed to configure corresponding naming regular expressions for different graphic element types, enabling preliminary matching between graphic elements and text identifiers that conform to their naming regular expressions.

[0112] For text identifiers that are initially matched, the spatial distance between them is calculated based on the pixel coordinates of the text and the center point coordinates of the corresponding graphic element. If the spatial distance is greater than the preset spatial distance threshold, the final match fails, effectively reducing the false match rate between text identifiers and graphic elements.

[0113] Step 7: Construct a structured topology that includes wiring-terminal matching results and text matching results.

[0114] The structured topology is represented as: [graphical elements, terminals, connection segments, text labels], providing standardized and reusable topology data for subsequent system business processing.

[0115] The structured topology described above is returned to the web front-end, where it is presented visually, simultaneously displaying the original wiring diagram, electrical element recognition results, complete text recognition results, and the circuit connection topology. Furthermore, when a user clicks on any electrical element, connection segment, or text label on the front-end interface, the corresponding location on the original diagram is automatically highlighted, enabling traceability and verification of the recognition results and enhancing the convenience of the visual interaction.

[0116] Example 2

[0117] This embodiment provides an application scenario based on embodiment 1.

[0118] A provincial power grid company's dispatch center has a need to digitize and archive nearly 2,000 primary wiring diagrams for 20 substations under its jurisdiction. Under the traditional manual processing mode, for a single complex primary wiring diagram, professional maintenance personnel need to spend 2-3 hours to complete the information entry, verification and archiving work. The entire project requires a large investment of professional manpower, and the manual operation is prone to problems such as information errors and omissions due to fatigue and negligence, making it difficult to ensure the accuracy of the archived data.

[0119] After applying the method in Example 1, maintenance personnel can upload wiring diagram PDF files in batches via a web front-end. The system automatically loads the region-specific configuration parameters and strictly follows the implementation process described above to complete core operations such as image preprocessing, OCR text recognition, electrical element recognition, and topology correlation analysis. Practical application verification shows that the average recognition time for a single drawing is only 2 minutes, with text recognition and electrical element recognition accuracy reaching 98%, and line connection relationship recognition accuracy reaching 95%. The output structured topology can be directly imported into the power grid company's existing digital drawing management platform without additional data format conversion. Simultaneously, maintenance personnel can quickly verify and accurately correct the recognition results through the web front-end interface. Clicking on any recognition result automatically locates the corresponding original position on the drawing, significantly reducing the difficulty and workload of manual verification. The entire digital archiving project's implementation cycle was shortened from the originally planned 3 months to 2 weeks, reducing manpower input by more than 90%, while significantly improving the accuracy and consistency of digitally archived data, effectively solving the pain points of traditional manual archiving methods.

[0120] Example 3

[0121] This embodiment provides an electrical element recognition and topology construction system, including:

[0122] The data acquisition module is used to acquire the target wiring diagram;

[0123] The text recognition module is used to input the target wiring diagram into the PaddleOCR model and obtain the text recognition results;

[0124] The primitive recognition module is used to input the target wiring diagram into the pre-trained improved YOLOv11 model to obtain primitive recognition results including primitive bounding box coordinates; the improved YOLOv11 model is to replace the P5 detection head in the YOLOv11 model with the P2 detection head;

[0125] The connection module is used to extract several initial wiring segments from the target wiring diagram and merge the initial wiring segments that meet the preset collinearity approximation conditions to obtain the wiring segments to be connected.

[0126] The first matching module is used to determine whether the wiring segment to be connected has a connection relationship with the graphic element based on the coordinates of the graphic element's border. If a connection relationship exists, the connection point between the wiring segment to be connected and the graphic element is taken as the graphic element terminal, and the wiring-terminal matching result is obtained.

[0127] The second matching module is used to match the primitives with the text recognition results according to the pre-acquired YAML rule file to obtain the text matching results;

[0128] The topology building module is used to construct structured topologies that include wire-terminal matching results and text matching results.

[0129] Example 4

[0130] This embodiment provides an electrical element recognition and topology construction device, including a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the electrical element recognition and topology construction method described in Embodiment 1.

[0131] Example 5

[0132] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the electrical element identification and topology construction method described in Embodiment 1.

[0133] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0134] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0135] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0136] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0137] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for electrical element recognition and topology construction, characterized in that, include: Obtain the target wiring diagram; Input the target wiring diagram into the PaddleOCR model to obtain the text recognition result; The target wiring diagram is input into a pre-trained improved YOLOv11 model to obtain primitive recognition results including primitive bounding box coordinates; the improved YOLOv11 model is to replace the P5 detection head in the YOLOv11 model with the P2 detection head; Extract several initial wiring segments from the target wiring diagram, and merge the initial wiring segments that meet the preset collinearity approximation conditions to obtain the wiring segments to be connected; Based on the coordinates of the graphic element's border, determine whether the wiring segment to be connected has a connection relationship with the graphic element. If a connection relationship exists, take the connection point between the wiring segment to be connected and the graphic element as the graphic element terminal to obtain the wiring-terminal matching result. Based on the pre-acquired YAML rule file, the primitives are matched with the text recognition results to obtain the text matching results; Construct a structured topology that includes wiring-terminal matching results and text matching results.

2. The electrical element recognition and topology construction method according to claim 1, characterized in that, After obtaining the target wiring diagram, the target wiring diagram is preprocessed, including: The target wiring diagram can be in JPG, PNG, PDF, or DXF formats. After converting target wiring diagrams of different formats into OpenCV-processable arrays, denoising, adaptive binarization, and size normalization are performed sequentially to obtain standard target wiring diagrams.

3. The electrical element recognition and topology construction method according to claim 1, characterized in that, The step of inputting the target wiring diagram into a pre-trained improved YOLOv11 model to obtain primitive recognition results including primitive bounding box coordinates includes: The improved YOLOv11 model identifies the outlines of various power grid graphics in the target wiring diagram and obtains the graphic element recognition results, which also include graphic element type and graphic element center point coordinates. During the training of the improved YOLOv11 model, the classification loss function uses the Focal loss function, and the bounding box regression loss function uses the CIOU loss function.

4. The electrical element recognition and topology construction method according to claim 1, characterized in that, The process involves extracting several initial wiring segments from the target wiring diagram and merging the initial wiring segments that satisfy the preset collinearity approximation condition to obtain the wiring segments to be connected, including: The Canny edge detection algorithm is used to perform edge detection on the target wiring diagram; A contour retrieval algorithm is used to extract all wiring segments from the edge detection results; An area screening algorithm is used to filter out invalid wiring segments caused by noise and interference residues from all wiring segments to obtain the initial wiring segments; For any two initial connection segments, calculate their angle difference and minimum distance, respectively, as follows: ; ; ; ; ; in, This indicates the angle difference between the two initial connection segments. This represents a function that converts radian degrees to degrees. This function represents rounding a real number to the nearest integer. Indicates the direction angle of an initial connection segment. Indicates the direction angle of the other initial connection segment. Indicates the first The direction angle of the initial wiring segment, and They represent the first The x and y coordinates of one endpoint of the initial wiring segment. and They represent the first The x and y coordinates of the other endpoint of the initial wiring segment, This represents the minimum distance between two initial connection segments. This indicates taking the minimum value. Indicates an initial wiring segment One endpoint To another initial wiring segment The minimum distance, Indicates an initial wiring segment Another endpoint To another initial wiring segment The minimum distance, Indicates an initial wiring segment One endpoint To another initial wiring segment The minimum distance, Indicates an initial wiring segment Another endpoint To another initial wiring segment The minimum distance, Represents Euclidean distance. Indicates the projection coefficient; The collinearity approximation condition includes: if and Then the two initial wiring segments are merged. Indicates the threshold of angle difference. Indicates the distance threshold; During the merging process, the direction of the longer initial connection segment is retained. The endpoints of the shorter initial connection segment are projected onto the straight line containing the longer initial connection segment. The extreme values ​​of all projected points are taken as the endpoints of the merged line segment, represented as: ; ; ; in, This represents one endpoint of the merged line segment. Indicates the other endpoint of the merged line segment. This represents one end of a relatively long initial wiring segment. This indicates taking the maximum value. This represents the unit direction vector of a relatively long initial wiring segment. Indicates the initial wiring segment The two endpoints are relative to the endpoints in the unit direction vector of the longer initial wiring segment. The projected scalar value, These represent the initial wiring segments. The two endpoints; The connection segments to be connected include all merged segments and the initial connection segments that have not been merged.

5. The electrical element recognition and topology construction method according to claim 4, characterized in that, The step of determining whether the segment to be connected has a connection relationship with the graphic element based on the coordinates of the graphic element's border, and if a connection relationship exists, includes: The element border is determined based on the element border coordinates, and the element border includes the top edge. bottom edge ,left and the right , respectively represented as: ; ; ; ; in, These represent the x and y coordinates of the top-left corner of the element's border, respectively. These represent the x and y coordinates of the bottom right corner of the graphic element's border, respectively. For any segment to be connected, if the projection coefficient from any endpoint to any side of the element's border is... satisfy and the minimum distance to that edge. If so, it is determined that the connection segment to be connected has a connection relationship with the graphic element.

6. The electrical element recognition and topology construction method according to claim 3, characterized in that, The step of matching primitives with text recognition results based on a pre-acquired YAML rule file to obtain text matching results includes: The text recognition result includes the text identifier and the text pixel coordinates; The YAML rule file is parsed to configure corresponding named regular expressions for different graphic element types, enabling the graphic elements to perform an initial match with text identifiers that conform to their named regular expressions; For text identifiers that are initially matched, the spatial distance between them is calculated based on the pixel coordinates of the text and the center point coordinates of the corresponding graphic element. If the spatial distance is greater than the preset spatial distance threshold, the final match will fail.

7. The electrical element recognition and topology construction method according to claim 6, characterized in that, The structured topology is represented as: [graphical element, terminal, connection segment, text label].

8. An electrical element recognition and topology construction system, characterized in that, include: The data acquisition module is used to acquire the target wiring diagram; The text recognition module is used to input the target wiring diagram into the PaddleOCR model and obtain the text recognition results; The primitive recognition module is used to input the target wiring diagram into a pre-trained improved YOLOv11 model to obtain primitive recognition results including primitive bounding box coordinates; the improved YOLOv11 model is to replace the P5 detection head in the YOLOv11 model with the P2 detection head; The connection module is used to extract several initial wiring segments from the target wiring diagram and merge the initial wiring segments that meet the preset collinearity approximation conditions to obtain the wiring segments to be connected. The first matching module is used to determine whether the wiring segment to be connected has a connection relationship with the graphic element based on the coordinates of the graphic element's border. If a connection relationship exists, the connection point between the wiring segment to be connected and the graphic element is taken as the graphic element terminal, and the wiring-terminal matching result is obtained. The second matching module is used to match the primitives with the text recognition results according to the pre-acquired YAML rule file to obtain the text matching results; The topology building module is used to construct structured topologies that include wire-terminal matching results and text matching results.

9. An electrical element recognition and topology construction device, characterized in that, Including processor and storage media; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the electrical element recognition and topology construction method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the electrical element recognition and topology construction method according to any one of claims 1 to 7.