Intelligent processing method and system for transformer substation secondary circuit drawing
By using U-Net network and electrical rule matching methods, substation secondary circuit drawings are processed automatically, generating structured topology tables and building a graph database. This solves the problems of low efficiency and poor accuracy in existing technologies, and achieves efficient and standardized digital processing of drawings.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YINCHUAN POWER SUPPLY COMPANY OF STATE GRID NINGXIA ELECTRIC POWER
- Filing Date
- 2025-10-28
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies for processing substation secondary circuit drawings suffer from low efficiency due to manual processing, easy damage to drawings, delayed updates, difficulty in achieving deep mapping from images to electrical logic and full-process automation, and cannot meet the real-time and accuracy requirements of smart grids.
Image segmentation is performed using the U-Net network to generate segmentation masks. Combining contour detection and electrical connection rule matching, a structured topology table is constructed, and automated processing is achieved through a graph database integrating a version management module and a rule checking engine.
It improves the accuracy of primitive segmentation and topology construction, ensures data standardization and traceability, enhances processing efficiency and convenience, and supports real-time topology analysis of power grids.
Smart Images

Figure CN121904210A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital technology of power systems, and in particular relates to a method and system for intelligent processing of secondary circuit drawings in substations. Background Technology
[0002] With the deepening of smart grid construction, substation secondary circuit drawings, as the core data carrier for the safe and stable operation of the power system, face multiple technical challenges in their digital processing. Traditional secondary circuit drawings are mainly in paper or early CAD formats, and the management mode that relies on manual drawing and recognition has significant drawbacks: manual processing is inefficient and cannot meet the needs of digitizing massive amounts of drawings; paper drawings are prone to fading and damage, resulting in missing graphic element information, and manual recognition is prone to errors and omissions; drawing updates lag behind actual changes in the power grid topology, failing to meet real-time operation and maintenance needs.
[0003] In existing technologies, such as the patent document with publication number CN119622994A, the system identifies graphic symbols in CAD drawings using image processing technology and a feature primitive library, and performs feature modeling on the graphics. The system extracts graphic features and matches them with a predefined model. If a match is successful, the feature primitive is replaced, and the coordinates of the graphic are extracted for primitive position matching. If automatic matching fails, a human-computer interaction method is used for recognition, and finally, the graphic information is summarized and matched with the feature model. Another example is the patent document with publication number CN119027970B, which first performs image preprocessing and segmentation to obtain sub-images. Then, based on a component detection model, the component frames and component categories in each sub-image are identified. Through text detection and recognition, the content in the text frames is extracted and associated with the component frames to obtain a complete recognition result. This method combines image processing and deep learning technologies, and can efficiently identify equipment components and text information in substation drawings. However, existing technical solutions have significant technical bottlenecks: 1. Traditional algorithms based on edge detection and template matching have a high rate of false negatives and false positives when dealing with fuzzy elements and non-standard wiring in old drawings; 2. Early deep learning models could only perform primitive segmentation, lacked semantic understanding of complex topological connections, and could not achieve deep mapping from images to electrical logic; 3. Existing solutions generally lack full-process automation capabilities from image preprocessing and intelligent recognition to structured topology generation, and do not adequately support structured management functions such as version management of drawing data and electrical rule verification, making it difficult to meet the requirements of smart grids for real-time and accurate topology analysis.
[0004] Therefore, there is a need for a fully automated substation secondary circuit drawing processing method that can achieve full-process automation of drawing digitization, topology structuring, and electrical rule verification. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an intelligent processing method and system for substation secondary circuit drawings. The method involves segmenting substation secondary circuit images using a U-Net network to generate a segmentation mask. Based on the segmentation mask and a pre-defined primitive database, a structured topology table is generated through contour detection and electrical connection rule matching. The primitive symbols in the structured topology table are converted into nodes with electrical attributes, and the connection relationships are converted into directed edges. A queryable graph database integrating a version management module and a rule checking engine is constructed. The topology data in the graph database is parsed to generate standard-format secondary circuit drawing files. This application achieves automation and intelligence in secondary circuit drawing processing by combining neural networks and rule matching, effectively improving the accuracy of primitive segmentation and topology construction. Simultaneously, the version management and rule verification mechanisms of the graph database ensure data standardization and traceability.
[0006] The present invention adopts the following technical solution: A method for intelligent processing of substation secondary circuit drawings, comprising: S11. Collect images of actual secondary circuit diagrams of substations at different voltage levels, perform image preprocessing, add primitive annotations and equipment attribute labels to generate a dataset; use the dataset to train the segmentation network, use the trained segmentation network to segment the images of the substation secondary circuits to be segmented, and generate a segmentation mask through post-processing. S12, based on the segmentation mask and the preset primitive database, a structured topology table is generated by contour detection and matching based on electrical connection priority rules; the structured topology table is stored in a relational data structure and contains field information such as primitive ID, type, coordinate position and connection relationship; S13, convert each element symbol in the structured topology table into a node with electrical attributes, convert the connection relationship in the element information into directed edges, and construct a queryable graph database that integrates a version management module, a rule checking engine, and a weighted directed layout optimization algorithm based on electrical attributes; S14, parse the topology data of the queryable graph database and generate a standard format secondary loop drawing file.
[0007] More preferably, the segmentation mask is binarized to extract the category label of each pixel in the segmentation mask and convert it into a single-channel mask image; the single-channel mask image is then subjected to noise reduction optimization to remove interfering contours. The contour detection algorithm is used to extract the primitive boundary information of the denoised single-channel mask image, and a set containing the contour coordinates of each primitive is generated. The extracted contour coordinates of each primitive are matched with a preset primitive database, and the wiring between primitives is filtered in combination with electrical connection priority rules to generate a structured topology table.
[0008] More preferably, in S13, the weighted guided layout optimization algorithm based on electrical properties transforms the node weights mapped by electrical properties into a composite force field between nodes, calculating the basic attraction and basic repulsion forces; the version management module records the operation records of nodes and edges, and uses an incremental storage strategy to save the topology data structure of different versions generated under different operation records; during version iteration, force field adjustments are applied only to the changed nodes and their associated nodes, and it is determined whether the safety distance constraint is met during adjustment; when the node parameters are modified, causing changes in node weights, the tension coefficient of the associated edges is fine-tuned; The rule checking engine has multiple built-in electrical specification rule templates. When the node and edge information of the structured topology table is written into the queryable graph database, it verifies the compliance of the topology structure. If non-compliance is found, an early warning is triggered, and the non-compliant edge and node are marked, generating an early warning report containing the non-compliance ID and location. Based on the early warning report, the tension coefficient of the non-compliant edge is adjusted.
[0009] More preferably, in S13, the weighted guided layout optimization algorithm based on electrical attributes defines node weights based on the electrical attributes of the nodes, and uses the node weights as the basic parameters of attraction and repulsion in the layout; the node weights are the product of the basic value of equipment importance and the voltage level coefficient; Based on the fundamental logic of the force-directed algorithm, the gravity calculation formula is multiplied by the product of the node weights of the two nodes to obtain the weighted fundamental gravity calculation result; based on the fundamental logic of the force-directed algorithm, the repulsion calculation formula is divided by the product of the node weights of the two nodes to obtain the weighted fundamental repulsion calculation result. The weighted guided layout optimization algorithm based on electrical properties transforms the electrical parameters of directed edges into tension coefficients and directional constraints to drive the arrangement of nodes. Based on the preset primitive database, the current intensity corresponding to the directed edge is obtained, the tension coefficient is determined according to the current intensity, and a directional thrust is applied to the directed edge so that the nodes are naturally arranged along the current flow direction. Safety distance constraints are set for conductors of different specifications.
[0010] More preferably, the current intensity range is divided into several levels, and a fixed basic tensile force coefficient is set for each level; the basic tensile force coefficient is corrected by multiplying the material coefficient of the conductor of different materials with the basic tensile force coefficient. Extract the cross-sectional area of the conductor from the preset primitive database, divide it into several levels according to the cross-sectional area, and set a corresponding minimum safety distance for each level; When arranging nodes, the distance between two nodes corresponding to the conductor is detected in real time. If the distance between the two nodes does not meet the minimum safe distance, the basic repulsive force between the nodes is adjusted to forcibly increase the distance. When the alarm condition is met, the system alarm is triggered.
[0011] More preferably, in S13, the method for locating the changed node and the associated node specifically includes: During version iteration, version iteration trigger events are extracted from the operation logs of the version management module to locate change nodes and identify change types; the change types include node parameter modification, node addition, and node deletion. Traverse the graph database, filter and change nodes that are directly connected by directed edges, i.e., associated nodes, and generate a set of associated nodes.
[0012] More preferably, in S13, the weighted guided layout optimization algorithm based on electrical properties transforms the node weights mapped by electrical properties into a composite force field between nodes, and calculates the basic attraction and basic repulsion. The version management module records the operation records of nodes and edges, and uses an incremental storage strategy to save the topology data structure of different versions generated under different operation records. During version iteration, force field adjustments are only applied to the changed nodes and their associated nodes. When the node parameters are modified, causing changes in node weights, the tension coefficient of the associated edges is fine-tuned. In S13, the method for applying force field adjustment to the changed node and its associated nodes specifically includes: Extract the version coordinate snapshot of the node in the version management module, and obtain the node weight before the change and the node weight after the change from the version coordinate snapshot; Calculate the original force field and the new force field of the changed node and each associated node to obtain the changes in gravitational force and repulsive force; The sum of the changes in gravity and repulsion is multiplied by a step size coefficient to obtain the movement step size of the changed node; the step size coefficient is set according to the actual situation; a proportional value is set, and the changes in gravity, repulsion, and movement step size of the changed node are multiplied by the proportional value to obtain the changes in gravity, repulsion, and movement step size of the associated node. After adjustment, check whether the distance between the changed node and each associated node meets the safe distance constraint. If not, repeat the above steps until the requirement is met.
[0013] More preferably, in step 13, the specific method for fine-tuning the pull coefficient of the associated edge when the modification of the node parameters causes a change in the node weight includes: Calculate the node weight change rate and use the absolute value of the node weight change rate as the fine-tuning coefficient; Extract the original tension coefficients of associated edges from the graph database; the associated edges are those connecting the changed node and the associated node. The product of the fine-tuning coefficient and the rate of change of weight is used as the coefficient adjustment ratio. Based on the direction of weight change, the new tension coefficient is calculated: When the node weight increases, the new tension coefficient is increased by the coefficient adjustment ratio based on the original tension coefficient; When the node weight decreases, the new tension coefficient is reduced by the coefficient adjustment ratio based on the original tension coefficient; The adjusted new tensile coefficient must not exceed the set range.
[0014] More preferably, in S13, the warning report is used as a semantic constraint to extract the set of violation edges, risk level, and violation type; The semantic constraints are classified according to risk level and violation type, and the adjustment direction of the edge tension coefficient corresponding to each type of constraint is clarified. A risk prominence coefficient is set for different risk levels. The original tensile coefficient is multiplied by the risk prominence coefficient to obtain the adjusted tensile coefficient. If the risk path still exists, increase the risk prominence coefficient, while setting the risk prominence coefficient to not exceed the maximum set threshold, until the risk is mitigated; if the risk cannot be mitigated, trigger a manual intervention prompt.
[0015] More preferably, the nodes and directed edges in the queryable graph database are visually laid out according to preset drawing layout rules; The electrical attribute information of the nodes is labeled in a standardized format at the corresponding location on the drawing; The generated drawing files are format-checked, and if they do not conform to the standard format, the format is automatically converted and errors are corrected.
[0016] This invention also proposes an intelligent processing system for substation secondary circuit drawings, including an image segmentation module, a topology table generation module, a graph database construction module, and a drawing file generation module. The image segmentation module is configured to segment the acquired substation secondary circuit image based on the U-Net network and generate a segmentation mask; The topology table generation module is configured to generate a structured topology table based on the segmentation mask and a preset primitive database, through contour detection and electrical connection rule matching. The graph database construction module is configured to convert the graph primitives in the structured topology table into nodes with electrical attributes and the connection relationships into directed edges, and to build a queryable graph database that integrates a version management module, a rule checking engine, and a weighted directed layout optimization algorithm based on electrical attributes. The drawing file generation module is configured to parse the topology data of the graph database and generate standard format secondary loop drawing files.
[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention utilizes the U-Net network to automatically segment images and generate primitive mask images. Combined with contour detection and rule matching, it automatically generates a structured topology table, thereby constructing a graph database integrating a version management module and a rule checking engine, and automatically generating standard format drawing files. This process significantly reduces manual intervention and improves processing efficiency; through scientific model training and optimization and rule verification, it ensures accurate and reliable processing results; it achieves efficient and standardized data management through version management and rule checking; and through standard format generation and digital model construction, it enhances the ease of use of drawings and facilitates integration and interaction with other systems.
[0018] 2. This invention focuses on the digital processing of secondary circuits in substations, achieving several breakthroughs in both technical approach and practical application. By replacing traditional manual operation with a deep learning network, it automatically captures complex graphic elements such as relays and terminal blocks in secondary circuit images, accurately completing image segmentation and avoiding the problems of low efficiency and easy omissions in manual interpretation. Relying on a full-link process of "image segmentation - topology table generation - graph database construction - standard drawing output," it first completes graphic element contour detection and electrical rule matching based on segmentation masks and a preset graphic element database to generate a structured topology table. This table is then converted into nodes and directed edges with electrical attributes, constructing a graph database integrating version management and rule checking engines. Finally, standardized drawings are output, achieving efficient conversion of visual information into structured data. Attached Figure Description
[0019] Figure 1 This is a flowchart of a method for intelligent processing of substation secondary circuit drawings according to the present invention; Figure 2 This is a flowchart of the intelligent processing method for secondary circuit drawings in substations according to the present invention. Figure 3 This is a schematic diagram of the training of the U-net network of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this invention.
[0021] The present invention proposes the following technical solution: This invention proposes an intelligent processing method for substation secondary circuit drawings, such as... Figure 1 As shown, it includes: S11. Collect images of actual secondary circuit diagrams of substations at different voltage levels, perform image preprocessing, add primitive annotations and equipment attribute labels to generate a dataset; use the dataset to train the segmentation network, use the trained segmentation network to segment the images of the substation secondary circuits to be segmented, and generate a segmentation mask through post-processing. S12, based on the segmentation mask and the preset primitive database, a structured topology table is generated by contour detection and matching based on electrical connection priority rules; the structured topology table is stored in a relational data structure and contains field information such as primitive ID, type, coordinate position and connection relationship; In S12, the segmentation mask is binarized, the category label of each pixel in the segmentation mask is extracted, and it is converted into a single-channel mask image; the single-channel mask image is then denoised and optimized to remove interfering contours. The contour detection algorithm is used to extract the primitive boundary information of the denoised single-channel mask image, and a set containing the contour coordinates of each primitive is generated. The extracted contour coordinates of each primitive are matched with a preset primitive database, and the wiring between primitives is filtered in combination with electrical connection priority rules to generate a structured topology table.
[0022] S13, convert each element symbol in the structured topology table into a node with electrical attributes, convert the connection relationship in the element information into directed edges, and construct a queryable graph database that integrates a version management module, a rule checking engine, and a weighted directed layout optimization algorithm based on electrical attributes; In S13, the weighted guided layout optimization algorithm based on electrical attributes transforms the node weights mapped by electrical attributes into a composite force field between nodes, calculating the basic attraction and basic repulsion forces. The version management module records the operation records of nodes and edges, and uses an incremental storage strategy to save the topology data structure of different versions generated under different operation records. During version iteration, force field adjustments are only applied to the changed nodes and their associated nodes, and it is determined whether the safety distance constraint is met during the adjustment. When the node parameters are modified, causing a change in node weight, the tension coefficient of the associated edge is fine-tuned. The rule checking engine has multiple built-in electrical specification rule templates. When the node and edge information of the structured topology table is written into the queryable graph database, it verifies the compliance of the topology structure. If non-compliance is found, an early warning is triggered, and the non-compliant edge and node are marked, generating an early warning report containing the non-compliance ID and location. Based on the early warning report, the tension coefficient of the non-compliant edge is adjusted.
[0023] In S13, the weighted guided layout optimization algorithm based on electrical attributes defines node weights based on the electrical attributes of the nodes, and uses the node weights as the basic parameters of attraction and repulsion in the layout; the node weights are the product of the basic value of equipment importance and the voltage level coefficient; Based on the fundamental logic of the force-directed algorithm, the gravity calculation formula is multiplied by the product of the node weights of the two nodes to obtain the weighted fundamental gravity calculation result; based on the fundamental logic of the force-directed algorithm, the repulsion calculation formula is divided by the product of the node weights of the two nodes to obtain the weighted fundamental repulsion calculation result. The weighted guided layout optimization algorithm based on electrical properties transforms the electrical parameters of directed edges into tension coefficients and directional constraints to drive the arrangement of nodes. Based on the preset primitive database, the current intensity corresponding to the directed edge is obtained, the tension coefficient is determined according to the current intensity, and a directional thrust is applied to the directed edge so that the nodes are naturally arranged along the current flow direction. Safety distance constraints are set for conductors of different specifications.
[0024] The current intensity range is divided into several levels, and a fixed basic tensile force coefficient is set for each level; the basic tensile force coefficient is corrected by multiplying the material coefficient of the conductor of different materials by the basic tensile force coefficient. Extract the cross-sectional area of the conductor from the preset primitive database, divide it into several levels according to the cross-sectional area, and set a corresponding minimum safety distance for each level; When arranging nodes, the distance between two nodes corresponding to the conductor is detected in real time. If the distance between the two nodes does not meet the minimum safe distance, the basic repulsive force between the nodes is adjusted to forcibly increase the distance. When the alarm condition is met, the system alarm is triggered.
[0025] In S13, the specific methods for locating changed nodes and associated nodes include: During version iteration, version iteration trigger events are extracted from the operation logs of the version management module to locate change nodes and identify change types; the change types include node parameter modification, node addition, and node deletion. Traverse the graph database, filter and change nodes that are directly connected by directed edges, i.e., associated nodes, and generate a set of associated nodes.
[0026] In S13, the weighted guided layout optimization algorithm based on electrical attributes transforms the node weights mapped by electrical attributes into a composite force field between nodes, and calculates the basic attraction and basic repulsion. The version management module records the operation records of nodes and edges, and uses an incremental storage strategy to save the topology data structure of different versions generated under different operation records. During version iteration, force field adjustments are only applied to the changed nodes and their associated nodes. When the node parameters are modified, causing changes in node weights, the tension coefficient of the associated edges is fine-tuned. In S13, the method for applying force field adjustment to the changed node and its associated nodes specifically includes: Extract the version coordinate snapshot of the node in the version management module, and obtain the node weight before the change and the node weight after the change from the version coordinate snapshot; Calculate the original force field and the new force field of the changed node and each associated node to obtain the changes in gravitational force and repulsive force; The sum of the changes in gravity and repulsion is multiplied by a step size coefficient to obtain the movement step size of the changed node; the step size coefficient is set according to the actual situation; a proportional value is set, and the changes in gravity, repulsion, and movement step size of the changed node are multiplied by the proportional value to obtain the changes in gravity, repulsion, and movement step size of the associated node. After adjustment, check whether the distance between the changed node and each associated node meets the safe distance constraint. If not, repeat the above steps until the requirement is met.
[0027] In step 13, the specific method for fine-tuning the pull coefficient of the associated edge when the node weight changes due to the modification of the node parameters includes: Calculate the node weight change rate and use the absolute value of the node weight change rate as the fine-tuning coefficient; Extract the original tension coefficients of associated edges from the graph database; the associated edges are those connecting the changed node and the associated node. The product of the fine-tuning coefficient and the rate of change of weight is used as the coefficient adjustment ratio. Based on the direction of weight change, the new tension coefficient is calculated: When the node weight increases, the new tension coefficient is increased by the coefficient adjustment ratio based on the original tension coefficient; When the node weight decreases, the new tension coefficient is reduced by the coefficient adjustment ratio based on the original tension coefficient; The adjusted new tensile coefficient must not exceed the set range.
[0028] In S13, the warning report is used as a semantic constraint to extract the set of violation edges, risk level, and violation type; The semantic constraints are classified according to risk level and violation type, and the adjustment direction of the edge tension coefficient corresponding to each type of constraint is clarified. A risk prominence coefficient is set for different risk levels. The original tensile coefficient is multiplied by the risk prominence coefficient to obtain the adjusted tensile coefficient. If the risk path still exists, increase the risk prominence coefficient, while setting the risk prominence coefficient to not exceed the maximum set threshold, until the risk is mitigated; if the risk cannot be mitigated, trigger a manual intervention prompt.
[0029] S14, parse the topology data of the queryable graph database and generate a standard format secondary loop drawing file.
[0030] In S14, the nodes and directed edges in the queryable graph database are visualized and laid out according to the preset drawing layout rules. The electrical attribute information of the nodes is labeled in a standardized format at the corresponding location on the drawing; The generated drawing files are format-checked, and if they do not conform to the standard format, the format is automatically converted and errors are corrected.
[0031] This invention also proposes an intelligent processing system for substation secondary circuit drawings, including an image segmentation module, a topology table generation module, a graph database construction module, and a drawing file generation module. The image segmentation module is configured to segment the acquired substation secondary circuit image based on the U-Net network and generate a segmentation mask; The topology table generation module is configured to generate a structured topology table based on the segmentation mask and a preset primitive database, through contour detection and electrical connection rule matching. The graph database construction module is configured to convert the graph primitives in the structured topology table into nodes with electrical attributes and the connection relationships into directed edges, and to build a queryable graph database that integrates a version management module, a rule checking engine, and a weighted directed layout optimization algorithm based on electrical attributes. The drawing file generation module is configured to parse the topology data of the graph database and generate standard format secondary loop drawing files.
[0032] Example 1 See Figure 2 As shown, this invention proposes an intelligent processing method for substation secondary circuit drawings, the method comprising steps S11 to S14, wherein: S11, Perform image segmentation on the acquired substation secondary circuit image based on the U-Net network to generate a segmentation mask.
[0033] Before processing images of substation secondary circuits based on the U-Net network, it is necessary to clarify the source and applicability of the image data. For example, the collected image data all come from actual secondary circuit drawings of substations at different voltage levels, covering various common electrical equipment layouts and wiring configurations.
[0034] Specifically, such as Figure 3 As shown in step S111, the quadratic loop image is preprocessed and labeled to generate a dataset, which includes the preprocessed quadratic loop image and the labeled quadratic loop image.
[0035] Because substation secondary circuit drawings often suffer from paper fading due to age, noise interference during scanning, and adhesion and blurring of lines due to aging, directly inputting them into the model can lead to errors in relay contact identification and misjudgment of wire breaks. To address these issues, this application employs a multi-dimensional preprocessing strategy to systematically improve image quality to meet model input requirements.
[0036] The preprocessing includes median filtering to remove noise, histogram equalization and contrast stretching to enhance the image, morphological thinning to enhance line features, threshold segmentation to remove background interference, and size normalization.
[0037] Specifically, the preprocessing first uses a median filtering algorithm to eliminate salt-and-pepper noise and speckle interference caused by paper aging and scanning, ensuring the purity of primitive outlines. Simultaneously, histogram equalization and contrast stretching techniques are used to expand the dynamic range of grayscale values in faded paper, clearly restoring the originally blurred outlines of relay contacts, wires, and other primitives. Then, morphological thinning operations are used to enhance the line features in the image. Iterative erosion and dilation operations are used to accurately extract the skeleton structure of linear primitives such as wires and contacts, effectively solving the problem of line adhesion caused by paper scanning distortion. Next, a threshold segmentation algorithm is used to automatically distinguish primitive and non-primitive regions based on grayscale distribution characteristics, removing background interference. Finally, the image is normalized to unify papers with different scanning resolutions to the standard size required for model input, ensuring the consistency and stability of feature extraction during subsequent U-Net network processing.
[0038] Once the preprocessed drawings are ready, they enter the annotation stage, a process that combines human expertise with automated tools. Electrical engineers, adhering to industry standards, use specialized tools to perform pixel-level outline annotations on elements such as relays and circuit breakers in the images, assigning unique identifiers to different elements. For complex wiring areas such as overlapping current transformers and protection devices in transformer protection circuits, a layered annotation strategy is employed to accurately distinguish overlapping elements, while adding equipment attribute labels. An automated annotation tool developed using edge detection algorithms can quickly identify the approximate outlines of elements, requiring engineers to make only minor corrections to complete the annotation, significantly improving efficiency. The layered annotation strategy involves displaying equipment symbols on the main drawing and linking them to parameter tables via lead-out lines.
[0039] As an example of this invention, taking the main transformer protection drawing of a 110kV substation as an example: before preprocessing, the drawing was faded due to moisture, resulting in blurred outlines of many conductors and terminal block markings being covered by noise; after median filtering and contrast stretching, the clarity of the element edges was significantly improved, and noise interference was basically eliminated. In the annotation stage, a layered strategy was used to accurately separate overlapping voltage transformer and fuse symbols, and automated tools assisted in completing most of the outline extraction, reducing the time spent by engineers on annotation by nearly half compared to traditional methods.
[0040] This collaborative preprocessing and annotation process enables the generated dataset to exhibit stronger feature representation capabilities during U-Net network training, especially in segmentation of complex wiring areas, which better reflects actual electrical logic.
[0041] S112, the dataset is divided into a training set, a validation set, and a test set; the U-Net network is trained using the training set data, and the model weights are optimized by calculating the loss function and combining backpropagation and stochastic gradient descent algorithms.
[0042] In a preferred embodiment of the present invention, the training set, validation set, and test set are divided in an 8:1:1 ratio. A stratified sampling strategy is employed during the division, classifying the data according to dimensions such as substation voltage level and circuit type. Samples are drawn from each category in the same proportion to ensure uniform data distribution across different business scenarios. For datasets containing multiple circuit types, samples are drawn from each circuit type in the same proportion to avoid overfitting the model to specific scenarios due to data bias. Most of the data serves as the training set for iterative optimization of model parameters; a portion of the data serves as the validation set to evaluate model performance in real time during training and adjust hyperparameters to prevent overfitting; the remaining data serves as the test set for final performance evaluation after model training is complete.
[0043] Specifically, the training set images are input into the U-Net network, and the predicted segmentation results are generated through forward propagation.
[0044] This invention inputs preprocessed training set images into a U-Net network and performs forward propagation through an encoder-decoder architecture. Considering the significant size differences and detailed features of primitives such as relay contacts and wires in secondary circuit diagrams, this architecture extracts multi-scale features (such as local texture of contacts and global direction of wires) through multi-layer convolution and pooling operations in the encoder. The decoder uses deconvolution and skip connections to fuse deep semantic features with shallow contour information, thereby mapping abstract features into pixel-level segmentation masks and generating preliminary prediction results.
[0045] The loss function value between the preliminary prediction result and the true label is calculated. The loss function adopts a combination of cross-union loss and binary cross-entropy loss. The loss function value is passed to each layer of the network using the backpropagation algorithm, and the model weight parameters are adjusted by combining the stochastic gradient descent algorithm.
[0046] Specifically, after obtaining the prediction results, it is necessary to calculate the loss function value between the prediction result and the actual labeled result to quantify the difference and provide a basis for model optimization. As a preferred embodiment of the present invention, the present invention adopts a combination strategy of intersection-to-union (IoU) loss and binary cross-entropy loss. Since IoU loss can measure the degree of overlap between the predicted region and the actual region, it can effectively solve the problem of integrity segmentation of primitives of different scales such as transformer protection devices and terminal blocks; while binary cross-entropy loss focuses on pixel classification within a 3-5 pixel range of primitive boundaries, which can suppress the jagged error of the segmentation result. The combination of the two achieves synergistic optimization of overall accuracy and boundary details.
[0047] After the loss function is calculated, the parameters are optimized using backpropagation combined with stochastic gradient descent (SGD). Backpropagation, based on the chain rule, derives the influence of each weight parameter on the loss value from the output layer to the input layer, while the SGD algorithm iteratively updates the parameters along the direction of error reduction based on this gradient information.
[0048] Finally, through iterative processes of forward propagation, loss calculation, and parameter optimization, the model gradually learns more discriminative feature representations. In the early stages of training, the model has a weak ability to segment complex structures such as thin wires and overlapping terminal blocks. As iterations deepen and network parameters are continuously optimized, it gradually achieves accurate segmentation of complex electrical wiring relationships.
[0049] When the backpropagation algorithm is combined with SGD to optimize parameters, if a thin wire with a diameter less than 3 pixels is missed due to a weight bias in a convolutional kernel of the encoder's third layer, backpropagation will propagate this error signal to the corresponding layer along the chain rule. SGD improves the accuracy of thin wire recognition by adjusting the convolutional kernel weights (such as enhancing the response to brightness abrupt changes between blue wires and yellowish-brown backgrounds in the RGB color space). After multiple rounds of iterative training, the model's segmentation error rate for the region where relays and terminal blocks are adhered decreases, and the final semantic mask can accurately distinguish primitives such as relays, wires, and terminal blocks.
[0050] S113, Repeat the above steps until the preset training termination condition is met.
[0051] S114 utilizes validation and test sets to evaluate model performance using multidimensional evaluation metrics, and adjusts model hyperparameters based on the evaluation results.
[0052] Specifically, including: S1141, Input the validation set images into the trained U-Net network to generate the predicted segmentation results; S1142, Calculate a multidimensional evaluation index based on the predicted segmentation results and the real annotations of the validation set; This includes, but is not limited to, using multi-dimensional metrics such as Intersection over Union (IoU), Dice coefficient, Precision, and Recall for quantitative analysis.
[0053] S1143, Adjust the model hyperparameters according to the multidimensional evaluation index; As a preferred embodiment of the present invention, a strategy combining grid search and engineering experience is adopted to optimize hyperparameters to address the problems exposed during the evaluation process. Specifically, firstly, the hyperparameter space is systematically explored using a grid search algorithm. The value range and step size of parameters such as BatchSize, learning rate, and loss function weights are pre-defined. Candidate parameter combinations are generated through exhaustive search or sampling, and their performance is tested one by one on the validation set to select the optimal parameter range.
[0054] Based on this, targeted optimizations are made using practical engineering experience. Specifically, if the evaluation reveals low recall values for small primitives such as terminal blocks, indicating missed detections, the batch size is appropriately reduced to minimize the impact of gradient oscillations on the learning of small primitive features. Simultaneously, the weight of boundary pixels in the binary cross-entropy loss is increased to enhance the model's ability to recognize the boundaries of small primitives. If the validation set loss fluctuates, it indicates an unreasonable learning rate setting. The learning rate decay strategy is adjusted, such as starting decay earlier or increasing the decay coefficient, to optimize the parameter update step size. For example, when the model's segmentation precision for severely faded regions is insufficient, the contrast stretching parameter in data augmentation is dynamically adjusted within the parameter range determined by grid search to enhance the model's adaptability to low-contrast scenes. This combination of global search and scene-specific adjustment achieves efficient hyperparameter optimization.
[0055] S1144: Use the test set to perform final performance verification on the model after adjusting hyperparameters and generate a comprehensive evaluation report; S1145, Based on the comprehensive evaluation report, iteratively adjust the model hyperparameters until the preset performance threshold is met.
[0056] Specifically, after hyperparameter optimization, independent test set data containing different voltage levels and drawing ages are input into the model to obtain the final segmentation results. By calculating indicators such as IoU, precision, recall, and F1 score, the predicted results are compared with the actual annotations to evaluate the accuracy and completeness of the model's segmentation of various primitives. At the same time, special analyses are conducted for special scenarios such as faded and blurred old drawings and complex wiring, and the performance is compared with the unoptimized model and similar models. Finally, a detailed performance verification report is generated to provide a basis for determining the optimal hyperparameter combination.
[0057] As an example of this invention, in a secondary circuit drawing test at a 330kV substation, the initial model exhibited low recall values for connecting wires with a width less than 4 pixels on the validation set, and the validation set loss curve showed severe oscillations. After combining and testing BatchSize, learning rate, and binary cross-entropy weights using grid search, it was initially determined that a BatchSize of 32 and a learning rate of 5e-4 resulted in relatively stable loss convergence. Based on engineering experience, to address the issue of missed detections of small wires, the BatchSize was further reduced to 24, and the boundary pixel weight in the binary cross-entropy loss was increased from 1.0 to 1.15. To address the loss oscillation issue, the learning rate decay coefficient was adjusted from 0.95 to 0.92, with decay initiated earlier in the 30th training round. Simultaneously, it was found that the model lacked sufficient precision in segmenting severely faded fuse symbols, so the contrast stretching parameter in data augmentation was adjusted from the default 1.2 to 1.5. After optimization, the model's recall value for small wires on the validation set improved, and the loss curve became smoother. In the independent test set, which covers old drawings from different periods and newly designed digital drawings, the model's average IoU for complex wiring areas improved from a low level before optimization to a high level, and the F1 score was significantly improved, outperforming similar U-Net improved models.
[0058] S115: Input the image of the quadratic loop to be segmented into the optimized model for inference, combine morphological post-processing to optimize the mask quality, and output the segmentation mask for each pixel.
[0059] Specifically, including: The preprocessed image to be segmented is input into the model to obtain the initial segmentation result. A binary mask is generated by thresholding. Morphological operations are performed on the mask to eliminate noise, fill holes and separate adhesion regions. Topological anomalies are repaired based on electrical rules. The results are verified by quality evaluation indicators and iteratively optimized until they meet the preset standards.
[0060] Specifically, firstly, the same preprocessing steps as the training data are performed on the images to be segmented, including grayscale normalization and median filtering to eliminate scanning noise and color bias, ensuring that the image features meet the model input standards. The preprocessed images are then input into the optimized U-Net model. The encoder extracts multi-scale features such as relay contact texture and wire topology through multi-layer convolution and pooling operations. The decoder outputs a tensor of dimensions [H, W, C] (where H and W are image dimensions, and C corresponds to 12 primitive categories), with each tensor element representing the original predicted score of a pixel belonging to a specific category. After transformation using the Softmax function, a probability distribution for each pixel corresponding to different primitive categories is generated.
[0061] Specifically, due to the aging and fading of actual secondary circuit drawings, as well as scanning distortion, the segmentation results output by the model are prone to defects such as noise interference, broken or adhered primitives. For example, in complex wiring areas, discrete noise caused by fading may be misjudged as primitives, and overlapping relay contacts can blur the segmentation boundaries, affecting the accuracy of subsequent topology analysis. Therefore, morphological post-processing optimization of the probabilistic graph is necessary. Specifically, opening operations are used to eliminate small-area noise while preserving the true primitive outlines; dilation and erosion operations are used to repair breaks in linear primitives such as wires, enhancing the continuity of key connections; and to address the primitive adhesion problem, reasonable boundaries are intelligently defined in the overlapping areas of relay contacts, based on electrical rules such as current flow direction and device connection logic.
[0062] Finally, the primitive category is determined based on the highest probability value of each pixel in the probability map, resulting in a mask map. The complete probability distribution information is preserved, yielding a probability map, which is then used to generate a segmentation mask. The segmentation mask contains both the probability map and the mask map. In practical applications, this result can efficiently support the digital reconstruction of drawings: high-confidence areas of the model are directly used for primitive recognition, while low-confidence areas are marked as content to be reviewed, achieving an organic combination of automated processing and manual verification.
[0063] As an example of this invention, in the processing of main transformer protection circuit drawings for a 110kV substation, the severely faded original image was first subjected to grayscale normalization and median filtering to eliminate background noise caused by yellowing paper. After inputting the optimized U-Net model, the initial segmentation results showed multiple breaks in the relay contact area, multiple breaks in the connecting wires between the current transformer and the terminal block due to fading, and multiple overlapping fuse symbols were misidentified as single elements. Through morphological post-processing, the relay contact breaks were successfully repaired using the closing operation of 5×5 structural elements, and the wire breaks were completed using the expansion operation of 3×3 structural elements. Combined with the electrical rule that "the current transformer should be connected to the protection device," the adhesion boundary of the fuse symbol was identified in the probability map. The system achieved a high average recognition accuracy for 12 types of elements, including relays and wires, with a high proportion of high-confidence areas and low-confidence areas involving only a few complex connection points. These low-confidence areas are automatically marked as items for manual review, allowing engineers to complete the verification in a short time, saving a significant amount of time compared to traditional manual identification methods.
[0064] S12, Based on the segmentation mask and the preset primitive database, a structured topology table is generated through contour detection and electrical connection rule matching.
[0065] Specifically, it also includes denoising the primitive mask image to remove interfering contours; and judging and filtering primitive relationships with multiple possible connections based on preset electrical connection priority rules to ensure that the generated structured topology table conforms to the actual electrical connection logic.
[0066] First, the probability map output in step S115 is processed. Specifically, considering the stringent reliability requirements of actual engineering projects, this application sets 0.6 as the probability confidence threshold, retaining only high-confidence primitive regions with probability values greater than or equal to 0.6. This operation effectively filters out low-confidence predictions caused by issues such as drawing fading and primitive adhesion. Based on this, the category label of each pixel is extracted and converted into a single-channel mask image.
[0067] To further improve the quality of the masked image, noise reduction optimization was implemented on the output of the U-Net model. Specifically, Gaussian filtering was used to smooth primitive boundaries and eliminate the jagged effect caused by segmentation errors; morphological opening and closing operations were used to remove isolated noise points and ensure the integrity of the outlines of key primitives such as relays and terminal blocks.
[0068] After image preprocessing, contour detection algorithms (such as Canny edge detection combined with morphological dilation) are used to extract primitive boundary information, generating a set containing the contour coordinates of each primitive. The extracted contour features are matched against a pre-set primitive database, which stores geometric feature templates (such as contact spacing and terminal block arrangement rules) of standard electrical components such as relays and wires. To address the ambiguous connection issues in complex wiring scenarios, an electrical connection priority rule base is introduced for intelligent filtering. The rule base predefines logic such as "protection devices should be connected to trip circuits first" and "current transformer secondary side should be connected to measuring instruments first".
[0069] The resulting structured topology table is stored in a relational data structure, containing fields such as element ID, type, coordinate position, and connection relationships. For example, for a relay, the table records its unique identifier, model parameters, position coordinates in the drawing, and a list of connected wire IDs. This topology table preserves the spatial relationships of elements in the image while incorporating electrical expertise, providing an accurate structured data foundation for subsequent graph database construction.
[0070] As an example of this invention, in the processing of secondary circuit drawings for a 220kV substation, the system first performs threshold filtering on the probability map, filtering out areas with a confidence level below 0.6, and extracts and binarizes the category labels to form a mask image. After optimization through Gaussian filtering and morphological opening and closing operations, contour detection is used to extract the boundary of the graphic elements. The extracted contours are matched with a preset graphic element database to identify graphic elements such as relays and terminal blocks. When processing a section of conductor connection, if the system detects that it is close to the terminals of both the protection device and the monitoring and control device, it prioritizes establishing the connection between the conductor and the protection device according to the rule of "protection devices preferentially connecting to tripping circuits," and ensures its rationality through electrical connectivity verification. The final generated structured topology table clearly records the ID, type, coordinates, and connection relationship of each graphic element.
[0071] S13, convert the primitive symbols in the structured topology table into nodes with electrical attributes, convert the connection relationships into directed edges, and construct a queryable graph database that integrates a version management module, a rule checking engine, and a weighted directed layout optimization algorithm based on electrical attributes.
[0072] Specifically, a property graph data structure is used to map the primitive symbols in the topology table to node entities. Each node contains multi-dimensional attributes such as equipment type and model parameters (e.g., relay K1 is transformed into a node containing rated voltage 220V and operating time 50ms); the connection relationship is transformed into a directed edge with direction and electrical parameters (e.g., the relationship between conductor L1 connecting K1 and QF1 is transformed into a directed edge containing attributes such as cross-sectional area 1.5mm² and rated current 3A).
[0073] The version management module achieves full-process tracking of graph database changes by recording creation, modification, and deletion timestamps of nodes and edges, associating them with operator information, and storing different versions of the topology data structure. Specifically, the version management module implements full lifecycle traceability based on the MVCC (Multi-Version Concurrency Control) mechanism. The system automatically generates timestamps for each node and edge change operation, associates them with operator accounts, departments, and other metadata, and uses an incremental storage strategy to save historical versions. For example, when maintenance personnel adjust the relay action threshold, the system generates a new version while retaining the state before the change, clearly recording the change path through a version tree structure, and supporting time-based database backtracking queries.
[0074] Furthermore, the rule checking engine has a variety of built-in electrical specification rule templates and supports user-defined rule import and rule priority settings.
[0075] Specifically, the rule checking engine adopts a plug-in architecture, with built-in rule templates for electrical standards such as IEC61850 and GB / T50062, and supports user-defined rules through a visual interface. The engine performs real-time verification during the data writing phase, using a pattern matching algorithm to detect topology compliance. For example, when an open-circuit risk is detected on the secondary side of a current transformer, the system automatically triggers an early warning mechanism, marks the violation edge, and generates a detailed report containing the rule ID, violation location, and scope of impact.
[0076] Furthermore, the weighted directed layout optimization algorithm based on electrical attributes adopts a property graph data structure, which maps the primitive symbols in the topology table to node entities. Each node contains multi-dimensional attributes such as equipment type and model parameters; the connection relationship is transformed into directed edges with direction and electrical parameters.
[0077] The weighted guided layout optimization algorithm based on electrical attributes uses the electrical properties of nodes and edges as the core driving force. By transforming electrical parameters into mechanical parameters in the layout, it achieves a balance between the logical readability of the topology graph and space efficiency. The algorithm defines node weights based on the electrical attributes of nodes, using these weights as the fundamental parameters for attraction and repulsion in the layout. From the perspective of equipment importance, critical equipment has relatively high weights to enhance its anchoring role in the layout. Based on voltage levels, high-voltage nodes are assigned corresponding hierarchical coefficients; the higher the coefficient, the greater the basic repulsion with low-voltage nodes. For nodes that violate rules and are flagged by the rule checking engine, a highlighting coefficient is added for visual emphasis.
[0078] Meanwhile, the weighted guided layout optimization algorithm based on electrical properties transforms the electrical parameters of directed edges into tension coefficients and directional constraints to drive node arrangement. The tension coefficient is determined based on the current intensity; edges with higher current intensity have relatively higher tension coefficients to encourage nodes at both ends to move closer together. Directional thrust is applied to directed edges to allow nodes to naturally arrange themselves along the current flow direction, reducing reverse crossings. Appropriate constraints are set for wires of different specifications to avoid crossing chaos caused by differences in wire specifications.
[0079] As a preferred embodiment of the present invention, the loop current intensity I (unit: A) corresponding to the directed edge is first extracted from a preset primitive database, and then divided into 3 levels according to the current intensity range. Each level corresponds to a fixed base tensile force coefficient (T_base). The division rules are shown in Table 1 below: Table 1
[0080] As a preferred embodiment of the present invention, considering the differences in current-carrying capacity of conductors made of different materials (to avoid overly dense / sparse layouts due to material), a material coefficient (K_m) is introduced and multiplied by the base tensile coefficient to correct the base tensile coefficient, as shown in Table 2: Table 2
[0081] Furthermore, in order to set corresponding constraints for conductors of different specifications and avoid crossover confusion caused by differences in conductor specifications, as a preferred embodiment of the present invention, the cross-sectional area S (unit: mm²) of the conductors is extracted from a preset primitive database, and three levels are divided according to the cross-sectional area. Each level corresponds to a minimum safety distance (D_min), and the division rules are shown in Table 3 below: Table 3
[0082] Referring to the above, for example, during the layout optimization process, the distance (d) between two nodes corresponding to the wires is detected in real time. If d < D_min (the minimum safe distance is not met), the distance is forcibly increased by dynamically adjusting the repulsive force between the nodes to avoid crossing. The adjustment rules are as follows: When S≤1.5mm² and d<5mm: multiply the basic repulsive force (F_rep_base) between the two nodes by 1.5, that is, the adjusted repulsive force F_rep=F_rep_base×1.5; When 1.5 < S ≤ 4 mm² and d < 8 mm: multiply the basic repulsive force between the two nodes by 1.2, that is, the adjusted repulsive force F_rep = F_rep_base × 1.2; When S > 4mm² and d < 12mm: not only is the basic repulsive force multiplied by 1.8, but a system warning is also triggered (marked as "spacing violation" in the graph database rule checking engine), forcibly stopping the current layout until the node spacing is adjusted to ≥ 12mm.
[0083] It is understood that the above data is merely for the purpose of providing sufficient examples for public disclosure, and this application is not limited to the above data.
[0084] The weighted guided layout optimization algorithm based on electrical attributes employs an improved force-guided algorithm framework, transforming the weights mapped by electrical attributes into composite force fields between nodes. An incremental layout adjustment mechanism is designed in conjunction with the version management module, storing version coordinate snapshots for nodes. During version iteration, force field adjustments are applied only to changed nodes and their associated neighboring nodes. When node parameter modifications lead to weight changes, the tension coefficients of their associated edges are fine-tuned. When multiple versions are displayed in parallel, the core, unchanging node serves as the anchor point, and version differences are reflected through positional offsets.
[0085] Specifically, the incremental layout adjustment mechanism means that when the graph database version is iterated (such as node parameter modification, adding / deleting nodes, or edge attribute change), only the force field parameters of the "changed nodes" and their "directly associated nodes" (association depth = 1, i.e., nodes connected in one step) are adjusted, and the global layout calculation is not performed on all nodes, thereby reducing computing power consumption and ensuring the continuity of the layout after the version iteration.
[0086] For example, relying on the version management module integrated with the graph database, a version coordinate snapshot is stored for each node. The snapshot content includes: Node unique ID; Version number (e.g., V1.0, V1.1, corresponding to different operation records); The coordinates (x, y) of the node in this version; The node weights in this version (W_node, used for subsequent force field calculations); Snapshot generation timestamp and operator (associated with version management logs).
[0087] Specifically, the methods for applying force field adjustments to the changed node and its associated neighboring nodes include: Step 11: Locate the changed node and related nodes: Extract the "version iteration trigger event" from the operation log of the version management module, locate the change node (N_change), and clarify the change type (such as "node parameter modification", "node addition", "node deletion", with the most typical "node parameter modification" as an example). Traverse the graph database, filter the nodes that are directly connected to N_change through directed edges (i.e., associated nodes, denoted as N_relate), generate a set of associated nodes (Set_relate={N1,N2,...,Nn}), and retain only the nodes with "one-step connection" (association depth=1) to avoid adjusting the range too large.
[0088] Step 12: Calculate the force field adjustment increment (based on node weight changes): Extract the node weights before the change (W_old) and after the change (W_new) from the version coordinate snapshot (node weight calculation method: W_node = equipment importance base value × voltage level coefficient); Calculate the original force field (before the change) and the new force field (after the change) for the changed node (N_change) and each associated node (N_relate): Gravity calculation formula (based on the basic logic of the force-oriented algorithm, incorporating node weights): F_grav=(d² / k)×W1×W2, where d is the current distance between the two nodes, k is the layout coefficient (fixed value, k=√(drawing area / total number of nodes)), and W1 and W2 are the weights of the two nodes respectively. Repulsion calculation formula (incorporating node weights): F_rep=(k² / d) / (W1×W2); Calculate the force field adjustment: ΔF_grav=F_grav_new-F_grav_old, ΔF_rep=F_rep_new-F_rep_old.
[0089] Step 13: Execute force field adjustment (control the movement range to avoid layout fluctuations) Apply adjustment to the change node (N_change): Drive N_change to move along the direction of force field change according to ΔF_grav (gravitational change) and ΔF_rep (repulsive change), with a movement step size Δs=α×(ΔF_grav+ΔF_rep), where α is the step size coefficient (fixed value 0.2, balancing adjustment accuracy and efficiency). Apply adjustment amount to associated nodes (N_relate): To avoid drastic layout fluctuations, the adjustment range of associated nodes is 50% of that of the changed nodes, that is, apply ΔF_grav×0.5 and ΔF_rep×0.5, and the movement step size is also calculated as Δs×0.5; Verify the adjustment results: After adjustment, check whether the spacing between N_change and each N_relate meets the "wire specification constraint". If it does not meet the constraint, repeat steps 12-13 until the spacing is compliant.
[0090] Specific methods for fine-tuning the tension coefficient of the associated edge include: Step 21: Calculate the node weight change rate (the basis for triggering fine-tuning of the tension coefficient): Calculate the weight change rate based on the weight change of the changed node (N_change): ΔW=(W_new-W_old) / W_old. If W_old=0 (an extreme case, such as when the initial weight of a newly added node is 0), then ΔW is taken as 0.2 by default (to avoid the denominator being 0).
[0091] Step 22: Determine the fine-tuning coefficient (controlling the fine-tuning amplitude): Set the fine-tuning coefficient (β) based on the absolute value of ΔW to avoid excessive adjustment that could lead to layout chaos.
[0092] Step 23: Calculate the tension coefficient of the associated side after fine-tuning: Extract the original tension coefficient (T_old) of the associated edge (E_relate, i.e. the edge connecting N_change and N_relate) from the graph database. Calculate the new tensile force coefficient (T_new) based on the direction of weight change (W_new > W_old or W_new < W_old): If W_new > W_old (node weight increases, connection tightness needs to be strengthened): T_new = T_old × (1 + ΔW × β); If W_new < W_old (node weight decreases, connection tightness needs to be weakened): T_new = T_old × (1 - ΔW × β); Range check: If T_new < 0.8 or T_new > 2.0 (to avoid excessively extreme tensile force coefficients), then force clamping (set to 0.8 when T_new < 0.8, and set to 2.0 when T_new > 2.0); Update the graph database: update the tension coefficient of the associated edges from T_old to T_new, and record it synchronously in the version management log (associated with the current version number).
[0093] It should be further emphasized that all the specific data values mentioned above are merely reasonable data values set for the purpose of facilitating the understanding of the core concept of the present invention. The present invention is not limited to the examples of the above data, but focuses on the overall concept of the above content.
[0094] The weighted guided layout optimization algorithm based on electrical properties works in conjunction with the rule checking engine to transform the rule checking results into semantic constraints for the layout. For paths with risks, the logical chain is highlighted by adjusting the tension coefficient of the edges; according to relevant specifications, the safety distance requirements between devices are transformed into repulsive constraints in the layout; when generating violation reports, the layout automatically focuses on the violation nodes and reduces interference from unrelated nodes.
[0095] In this embodiment, the violation warning result is the "semantic constraint condition," from which three types of core information need to be extracted as the basis for adjusting the tensile coefficient: The set of edges corresponding to the risk path: clearly identify which edges (E_risk) belong to the risk path (e.g., mark "E001, E003, E005" as the "current transformer secondary side open circuit" associated edges); Risk Level: Based on the severity of the violation, the rule inspection engine divides the risk into 3 levels (implied in the document, combined with electrical specifications: high risk = may cause equipment damage / power outage, medium risk = affect operation and maintenance efficiency, low risk = only non-standard format). Types of violations: Focus on "path-related violations" (such as opening roads, incorrect connections, and chaotic intersections). These violations require adjustment of the tension coefficient to highlight the logical chain (non-path-related violations such as "missing node parameters" do not involve edge tension adjustment).
[0096] Specific methods for adjusting the edge tension coefficient in conjunction with semantic constraints include: Step 31: Semantic constraint classification and adjustment of direction mapping: Based on the extracted "risk level" and "violation type", the semantic constraints are classified, and the adjustment direction of the edge tension coefficient corresponding to each type of constraint is clarified. For example, see Table 4 below: Table 4
[0097] Step 32: Determine the "risk prominence coefficient" (the mapping from semantic constraints to the coefficient). To quantify the adjustment range, and in accordance with the "coefficient setting logic based on electrical attributes" in the document, a risk salience coefficient (γ) is set for different risk levels. The coefficient value is determined based on the principle that "the higher the risk, the larger γ," as detailed below: Step 33: Calculate the adjusted side tension coefficient: The original calculation method for the edge tensile coefficient (T_edge) is: T_edge = base tensile coefficient (T_base, based on current intensity) × material coefficient (K_m). In conjunction with semantic constraint adjustments, the original calculation result needs to be multiplied by the "risk prominence coefficient (γ)" to obtain the final adjusted tensile coefficient, as shown in the formula: T_edge_adjusted = T_edge_original × (1 + γ) Key points: T_edge_original: needs to be extracted from the graph database, that is, the tension coefficient of the edge when there are no semantic constraints (already calculated in combination with current intensity and wire material). Step 4: Visual Emphasis and Verification Closed Loop Visual enhancement: While adjusting the tension coefficient, set the edges of the risk path to a "warning style", such as: High-risk edge: solid red line + line width increased by 2px; Medium-risk edge: solid orange line + line width increased by 1px; Low-risk edge: solid yellow line (line width unchanged); Compliance verification iteration: After the adjustment is completed, the rule inspection engine is retried. If the risk path disappears (e.g., the number of wire crossings is reduced to ≤2 after adjustment): retain T_edge_ after adjustment and complete the layout; If the risk path still exists (e.g., the open circuit on the secondary side of the current transformer is not resolved): increase the risk prominence factor γ by 0.2 (maximum γ=1.5), and repeat steps 3-4 until the risk is mitigated or a "manual intervention prompt" is triggered (marked in the warning report as "manual correction of the topology is required, and it cannot be resolved by adjusting the tension factor").
[0098] For large-scale topology graphs, the weighted directed layout optimization algorithm based on electrical attributes adopts strategies such as hierarchical layout, parallel computing, and detail level adaptation. While ensuring layout efficiency, it also takes into account the detail display, and finally achieves topology layout optimization that combines electrical logic readability, dynamic adaptability, and rule constraints.
[0099] S14, parse the topology data of the graph database and generate a standard format secondary loop drawing file.
[0100] S141, according to the preset drawing layout rules, perform visual layout of nodes and directed edges in the graph database.
[0101] Specifically, a hierarchical force-guided layout algorithm is used to functionally partition nodes (such as protection device areas and measuring instrument areas). The optimal spacing between nodes is calculated through a physics engine to ensure that devices with the same functional modules are arranged in a cluster. The system uses an orthogonal routing algorithm to plan the direction of connecting edges, uses RGB color space and line type to visually distinguish loop types, and uses a grid constraint mechanism to ensure the geometric regularity of the layout.
[0102] S142, mark the electrical attribute information of the nodes in the corresponding positions on the drawing using standardized labels.
[0103] Specifically, in accordance with the GB / T4728 electrical drawing standard, key attributes such as equipment model and rated parameters are extracted to generate standardized labels. For complex secondary equipment, a layered labeling strategy is adopted: the main drawing displays the equipment symbol, and parameter appendices are linked through leader lines. The labeling positions are optimized using a heuristic layout algorithm to ensure balanced information density on the drawing and no obstruction of important elements.
[0104] S143 performs format verification on the generated drawing file. If it does not conform to the standard format, it automatically performs format conversion and error correction.
[0105] Specifically, the generated data is semantically compared with standard templates such as IEC61082 and GB / T6988, and the verification content covers multiple format indicators such as drawing size, line type, and text height. For detected non-standard elements, style conversion is automatically performed, and topological logic errors are identified through a rule engine and intelligent completion is performed based on graph database association information.
[0106] As an example of this invention, during the drawing generation process of a 220kV substation, the node cluster arrangement of the protection device area is automatically completed, with red solid lines representing current loops and blue dashed lines representing signal loops. A standardized appendix containing 12 technical parameters is generated for the measurement and control devices using a layered annotation strategy. After the format verification module automatically corrects two line type deviations, the final output DWG file conforms to the GB / T4728-2008 full-item drawing specification.
[0107] This invention combines deep learning semantic segmentation technology with graph database modeling methods to construct a closed-loop processing system of "intelligent image parsing - automatic topology generation - structured data management". The U-Net network achieves pixel-level segmentation of primitives such as relays and wires in secondary loop images through an encoder-decoder structure, while graph database technology transforms the segmentation results into structured data with electrical attributes. However, traditional image segmentation faces problems such as noise interference caused by fading of the image and primitive adhesion, and the directly generated mask images are difficult to meet the needs of topology analysis; at the same time, simple geometric topology lacks electrical rule constraints, which cannot guarantee the engineering standardization of the data. Therefore, this application optimizes the mask quality through morphological post-processing and introduces an electrical rule engine to achieve intelligent verification of topological relationships.
[0108] To resolve topological ambiguities, this invention embeds an electrical connection priority rule base, covering engineering specifications such as protection device connection logic and loop closure constraints. When there are connection ambiguities in the conductor layout, the system automatically selects the optimal path according to the rules, ensuring that the topological relationships conform to electrical principles.
[0109] By integrating the above technologies, this invention effectively solves the problems of low efficiency of manual digitization, large noise impact of drawings, and lack of logical verification of topological relationships in the prior art.
[0110] Example 2 In practical implementation, the improved U-Net network can be applied to quadratic loop image segmentation. Feature extraction capabilities are enhanced by embedding residual modules in the encoder, and skip connections are used to fuse multi-scale features from the decoder. During training, the batch size and learning rate can be flexibly adjusted based on the dataset size and hardware performance. If the data volume is small, mini-batch training combined with a learning rate decay strategy can be used. Binary cross-entropy and Dice loss are used as optimization objectives, and their weights can be dynamically adjusted according to the degree of primitive class imbalance. In the preprocessing stage, in addition to grayscale normalization and median filtering, histogram equalization or homomorphic filtering can be used if the image has significant uneven illumination. If there is a tilt problem, image correction is also required. When processing the segmentation mask, if the primitive edges are blurred, broken primitives can be repaired by adjusting the number of iterations of morphological operations or selecting structuring elements of different shapes (such as circles or rhombuses instead of squares). In the contour detection stage, in addition to the Canny algorithm, the Sobel operator combined with threshold segmentation can also be used to extract contours. When matching with a pre-defined primitive database, if non-standard equipment is encountered, 3D reconstruction technology can be used to obtain its geometric features and expand the template library. During the generation of the topology table, if complex connections exist, the shortest path algorithm from graph theory can be introduced to assist in analysis. When constructing nodes and edges using attribute graphs, electrical attribute fields can be added or removed according to engineering requirements. In addition to multi-version control, the version management mechanism can also incorporate blockchain technology to ensure data immutability. When the rule engine verifies topology compliance, it can combine with an expert system to achieve dynamic rule updates. In the final drawing generation stage, if compatibility with different drafting standards is required, a multi-template switching function can be developed to generate compliant drawings with hierarchical layout and differentiated line types. Automated verification tools can then be used to check sheet size, annotation standardization, etc.
[0111] For example, taking the secondary circuit drawing processing of a 110kV substation renovation project as an example: First, the scanned drawing image containing faded elements is preprocessed. Due to uneven local lighting, histogram equalization is used to improve contrast, and perspective correction is used to solve image tilt. The preprocessed image is input into an improved U-Net network. Considering the computing power limitations of the edge server, the BatchSize is set to 16 and a learning rate decay strategy is enabled. To address the class imbalance between relays and wires, the weights of binary cross-entropy and Dice loss are set to 2:3. Some wires in the segmented mask have broken or adhered parts. A 5×5 rhombus structuring element is used for two closing operations to repair them. After extracting the contour using the Sobel operator, when matching with the standard relay template in the database, it is found that the contact spacing of a non-standard relay exceeds the preset range. The template parameters for this model are supplemented by manual annotation. When generating the topology table, a certain section of wire connection involves both protection devices and measurement and control devices. The system determines the connection path according to the "protection circuit priority" rule. When constructing the database using attribute graphs, extended attributes such as "sampling rate" and "communication protocol" were added for the smart terminals specific to this project. The version management module automatically records the timestamps and operators of relay parameter modifications. When finally generating drawings, the GB / T4728-2008 template was switched, and current loops were represented by 0.5mm red solid lines. Automated verification revealed three instances of non-standard text height in the annotations, which were automatically adjusted to the standard 3.5mm value before outputting the DWG file. The manual review time was significantly reduced compared to traditional methods.
[0112] Example 3 This invention also proposes an intelligent processing system for substation secondary circuit drawings, comprising: The image segmentation module is configured to preprocess the acquired substation secondary circuit images, call the pre-trained U-Net network to extract multi-scale features through an encoder-decoder structure. The encoding part uses convolutional and pooling layers to capture primitive contours and background information, while the decoding part recovers detailed features through upsampling and skip connections, and finally generates a segmentation mask to achieve accurate separation of primitives and background.
[0113] The topology table generation module is configured to receive the segmentation mask, call the contour detection algorithm to extract the shape parameters, size information and contour complexity of each graphic element, and match the edge contour features with the standard templates in the preset graphic element database. Combined with electrical connection rules, the candidate matching results are verified to eliminate illogical matching items. After determining the specific type and attributes of each graphic element, a structured topology table containing graphic element ID, equipment type, model parameters, connection node number and associated graphic element ID is automatically generated to completely record the secondary circuit topology relationship.
[0114] The graph database construction module is configured to take a structured topology table as input and use an attribute graph data structure to map graph symbols into node entities containing multi-dimensional electrical parameters such as equipment type, rated voltage, and operating time. It transforms connection relationships into directed edges with electrical parameters such as conductor cross-sectional area, rated current, and current direction. It integrates version management functionality, automatically generating timestamps for node and edge creation, modification, and deletion operations through an MVCC mechanism and associating them with metadata such as operator account and department. An incremental storage strategy is used to save historical versions to support time-point-based backtracking and version comparison. A built-in rule checking engine is configured to load electrical standard templates such as IEC61850 and GB / T50062, verifying topology compliance in real time during data writing. When violations such as open circuits on the secondary side of current transformers are detected, it automatically marks them and generates a warning report containing the rule ID and violation location. An embedded weighted guided layout optimization algorithm based on electrical attributes is configured to convert attributes such as node voltage level and equipment importance into layout force field parameters, dynamically adjusting node arrangement in conjunction with edge current intensity to optimize the logical readability and space efficiency of the topology graph.
[0115] The drawing file generation module is configured to analyze the node attributes, edge connection relationships, and layout optimization results in the graph database, call the graphics rendering engine to convert the analyzed data into visual graphic elements, and generate standard secondary circuit drawing files that support multiple formats, ensuring that the output files meet the standardization requirements of the power industry.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for intelligent processing of secondary circuit drawings in substations, characterized in that, include: S11. Collect images of actual secondary circuit diagrams of substations at different voltage levels, perform image preprocessing, add primitive annotations and equipment attribute labels to generate a dataset; use the dataset to train the segmentation network, use the trained segmentation network to segment the images of the substation secondary circuits to be segmented, and generate a segmentation mask through post-processing. S12, based on the segmentation mask and the preset primitive database, a structured topology table is generated by contour detection and matching based on electrical connection priority rules; the structured topology table is stored in a relational data structure and contains field information such as primitive ID, type, coordinate position and connection relationship. S13, convert each element symbol in the structured topology table into a node with electrical attributes, convert the connection relationship in the element information into directed edges, and construct a queryable graph database that integrates a version management module, a rule checking engine, and a weighted directed layout optimization algorithm based on electrical attributes; S14, parse the topology data of the queryable graph database and generate a standard format secondary loop drawing file.
2. The intelligent processing method for substation secondary circuit drawings according to claim 1, characterized in that: In S12, the segmentation mask is binarized, the category label of each pixel in the segmentation mask is extracted, and it is converted into a single-channel mask image; the single-channel mask image is then denoised and optimized to remove interfering contours. The contour detection algorithm is used to extract the primitive boundary information of the denoised single-channel mask image, and a set containing the contour coordinates of each primitive is generated. The extracted contour coordinates of each primitive are matched with a preset primitive database, and the wiring between primitives is filtered in combination with electrical connection priority rules to generate a structured topology table.
3. The intelligent processing method for substation secondary circuit drawings according to claim 1, characterized in that: In S13, the weighted guided layout optimization algorithm based on electrical attributes transforms the node weights mapped by electrical attributes into a composite force field between nodes, calculating the basic attraction and basic repulsion forces. The version management module records the operation records of nodes and edges, and uses an incremental storage strategy to save the topology data structure of different versions generated under different operation records. During version iteration, force field adjustments are only applied to the changed nodes and their associated nodes, and it is determined whether the safety distance constraint is met during the adjustment. When the node parameters are modified, causing a change in node weight, the tension coefficient of the associated edge is fine-tuned. The rule checking engine has multiple built-in electrical specification rule templates, which are validated when the node and edge information of the structured topology table is written into the queryable graph database to detect the compliance of the topology structure. If any non-compliance occurs, an alert will be triggered, and the non-compliant edge and node will be marked, generating an alert report containing the non-compliant ID and location. Based on the early warning report, the tension coefficient of the non-compliant side will be adjusted.
4. The intelligent processing method for substation secondary circuit drawings according to claim 1, characterized in that: In S13, the weighted guided layout optimization algorithm based on electrical attributes defines node weights based on the electrical attributes of the nodes, and uses the node weights as the basic parameters of attraction and repulsion in the layout; the node weights are the product of the basic value of equipment importance and the voltage level coefficient; Based on the fundamental logic of the force-directed algorithm, the gravity calculation formula is multiplied by the product of the node weights of the two nodes to obtain the weighted fundamental gravity calculation result; based on the fundamental logic of the force-directed algorithm, the repulsion calculation formula is divided by the product of the node weights of the two nodes to obtain the weighted fundamental repulsion calculation result. The weighted guided layout optimization algorithm based on electrical properties transforms the electrical parameters of directed edges into tension coefficients and directional constraints to drive the arrangement of nodes. Based on the preset primitive database, the current intensity corresponding to the directed edge is obtained, the tension coefficient is determined according to the current intensity, and a directional thrust is applied to the directed edge so that the nodes are naturally arranged along the current flow direction. Safety distance constraints are set for conductors of different specifications.
5. The intelligent processing method for substation secondary circuit drawings according to claim 4, characterized in that: The current intensity range is divided into several levels, and a fixed basic tensile force coefficient is set for each level; the basic tensile force coefficient is corrected by multiplying the material coefficient of the conductor of different materials by the basic tensile force coefficient. Extract the cross-sectional area of the conductor from the preset primitive database, divide it into several levels according to the cross-sectional area, and set a corresponding minimum safety distance for each level; When arranging nodes, the distance between two nodes corresponding to the conductor is detected in real time. If the distance between the two nodes does not meet the minimum safe distance, the basic repulsive force between the nodes is adjusted to forcibly increase the distance. When the alarm condition is met, the system alarm is triggered.
6. The intelligent processing method for substation secondary circuit drawings according to claim 3, characterized in that: In S13, the specific methods for locating changed nodes and associated nodes include: During version iteration, version iteration trigger events are extracted from the operation logs of the version management module to locate change nodes and identify change types; the change types include node parameter modification, node addition, and node deletion. Traverse the graph database, filter and change nodes that are directly connected by directed edges, i.e., associated nodes, and generate a set of associated nodes.
7. As described in claim 3, characterized in that: In S13, the weighted guided layout optimization algorithm based on electrical attributes transforms the node weights mapped by electrical attributes into a composite force field between nodes, and calculates the basic attraction and basic repulsion. The version management module records the operation records of nodes and edges, and uses an incremental storage strategy to save the topology data structure of different versions generated under different operation records. During version iteration, force field adjustments are only applied to the changed nodes and their associated nodes. When the node parameters are modified, causing changes in node weights, the tension coefficient of the associated edges is fine-tuned. In S13, the method for applying force field adjustment to the changed node and its associated nodes specifically includes: Extract the version coordinate snapshot of the node in the version management module, and obtain the node weight before the change and the node weight after the change from the version coordinate snapshot; Calculate the original force field and the new force field of the changed node and each associated node to obtain the changes in gravitational force and repulsive force; The sum of the changes in gravity and repulsion is multiplied by a step size coefficient to obtain the movement step size of the changed node; the step size coefficient is set according to the actual situation; a proportional value is set, and the changes in gravity, repulsion, and movement step size of the changed node are multiplied by the proportional value to obtain the changes in gravity, repulsion, and movement step size of the associated node. After adjustment, check whether the distance between the changed node and each associated node meets the safe distance constraint. If not, repeat the above steps until the requirement is met.
8. The intelligent processing method for substation secondary circuit drawings according to claim 3, characterized in that: In step 13, the specific method for fine-tuning the pull coefficient of the associated edge when the node weight changes due to the modification of the node parameters includes: Calculate the node weight change rate and use the absolute value of the node weight change rate as the fine-tuning coefficient; Extract the original tension coefficient of the associated edges from the graph database; the associated edges are the edges connecting the changed node and the associated node. The product of the fine-tuning coefficient and the rate of change of weight is used as the coefficient adjustment ratio. Based on the direction of weight change, the new tension coefficient is calculated: When the node weight increases, the new tension coefficient is increased by the coefficient adjustment ratio based on the original tension coefficient; When the node weight decreases, the new tension coefficient is reduced by the coefficient adjustment ratio based on the original tension coefficient; The adjusted new tensile coefficient must not exceed the set range.
9. The intelligent processing method for substation secondary circuit drawings according to claim 3, characterized in that: In S13, the warning report is used as a semantic constraint to extract the set of violation edges, risk level, and violation type; The semantic constraints are classified according to risk level and violation type, and the adjustment direction of the edge tension coefficient corresponding to each type of constraint is clarified. A risk prominence coefficient is set for different risk levels. The original tensile coefficient is multiplied by the risk prominence coefficient to obtain the adjusted tensile coefficient. If the risk path still exists, increase the risk prominence coefficient, while setting the risk prominence coefficient to not exceed the maximum threshold, until the risk is mitigated; If the risk cannot be mitigated, a manual intervention prompt will be triggered.
10. The intelligent processing method for substation secondary circuit drawings according to claim 1, characterized in that: In S14, the nodes and directed edges in the queryable graph database are visualized and laid out according to the preset drawing layout rules. The electrical attribute information of the nodes is labeled in a standardized format at the corresponding location on the drawing; The generated drawing files are format-checked, and if they do not conform to the standard format, the format is automatically converted and errors are corrected.
11. A substation secondary circuit drawing intelligent processing system, comprising an image segmentation module, a topology table generation module, a graph database construction module, and a drawing file generation module, characterized in that: The image segmentation module is configured to segment the acquired substation secondary circuit image based on the U-Net network and generate a segmentation mask; The topology table generation module is configured to generate a structured topology table based on the segmentation mask and a preset primitive database, through contour detection and electrical connection rule matching. The graph database construction module is configured to convert the graph primitives in the structured topology table into nodes with electrical attributes and the connection relationships into directed edges, and to build a queryable graph database that integrates a version management module, a rule checking engine, and a weighted directed layout optimization algorithm based on electrical attributes. The drawing file generation module is configured to parse the topology data of the graph database and generate standard format secondary loop drawing files.
Citation Information
Patent Citations
A recognition method for two-dimensional drawings of substations
CN119027970B
Secondary circuit intelligent modeling method and system based on visual language model
CN119622994A
Cited By
Intelligent display and interaction method, system and device for drawings based on content analysis
CN122200725A