A secondary circuit intelligent modeling method and system based on a visual language model
By using visual language models for primitive recognition and deep learning, a digital model of the secondary circuit of a substation is constructed, which solves the problems of insufficient recognition capability and low automation in existing technologies, and realizes efficient and accurate secondary circuit modeling and visualization.
Patent Information
- Application Number
- CN202411430337.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-10-14
AI Technical Summary
Existing technologies lack the application of deep learning in substation secondary circuit modeling, resulting in limited recognition capabilities, a lack of unified modeling tools, low automation, and difficulty in accurately recognizing complex graphics and text and effectively integrating data.
A visual language model-based approach is adopted to construct a primitive library through primitive recognition and classification, deep learning and feature extraction, perform context analysis and entity recognition, generate a digital model of a secondary loop, and then visualize it.
It improves the efficiency and accuracy of secondary circuit design, reduces human error, enables rapid analysis of drawings and automated modeling, and promotes the automation and intelligence of power system design.
Smart Images

Figure CN119622994B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system automation technology, specifically to a method and system for intelligent modeling of secondary circuits based on a visual language model. Background Technology
[0002] In the recognition of engineering drawings, traditional techniques mainly rely on the three-point method to distinguish between straight lines, circles, and arcs, along with refinement algorithms. While equipment based on these principles has been developed, such as existing engineering drawing scanning and automatic recognition systems, these systems lack general modeling tools for substation secondary circuit model files and fail to fully utilize deep learning technology to achieve highly intelligent engineering drawing recognition. Furthermore, their correlation with the scheme for constructing line models is weak. This limits the system's application in the recognition and modeling of complex power system drawings.
[0003] In large-scale, diverse engineering drawing recognition tasks, the generalization ability of BPNN is limited, making it difficult to meet the requirements of efficient and accurate recognition. Contour-based methods have been studied for image-text separation, but their effectiveness is limited when characters and graphics are overlapping. Engineering drawings often contain complex overlapping graphics and text, which traditional contour-based separation methods struggle to distinguish accurately, leading to decreased recognition accuracy. Improved thinning algorithms and the Hilditch algorithm were attempted to address the shortcomings encountered during the thinning process. However, some graphics in engineering drawings are not suitable for thinning; thinning algorithms may cause shape distortion when processing these graphics, affecting subsequent recognition and analysis. A model combining Radial Basis Probabilistic Neural Network (RBPNN) and multi-input convolutional transform with RBPNN was adopted to recognize segmented engineering drawing graphic symbols. While these methods achieved certain results in specific situations, they require pre-segmentation of image symbols, increasing workload. Furthermore, for images with complex backgrounds and noise, the segmentation process may introduce errors, affecting overall recognition performance. A BPNN structure model was trained using MATLAB function libraries to classify electrical graphic symbols. However, experimental results show that image noise significantly affects the model's recognition accuracy. In practical applications, engineering drawings often contain various noises and interferences, and improving the robustness of the model remains a challenge.
[0004] The proposed multi-dimensional information section decoupling technology for intelligent substation configuration description models is mainly applied to the construction, renovation, and expansion of substations, but lacks in-depth research on information management during the operation and maintenance phase. This results in insufficient dynamic updates and management of secondary system models throughout the substation's entire lifecycle, impacting operation and maintenance efficiency. While visualization studies of the SCL language information model have been conducted, the complexity of the SCL language itself makes the model difficult to understand. This increases the difficulty of understanding and operation for operation and maintenance personnel and non-technical professionals, hindering the maintenance and management of substation systems. In research on unified databases for large power grids, the inefficiency of relational databases in executing complex joins and nested queries is becoming increasingly prominent. When processing large-scale, highly complex power grid data, the performance bottlenecks of traditional relational databases limit real-time performance and data processing capabilities.
[0005] However, existing engineering drawing recognition and substation secondary circuit modeling technologies have many limitations, mainly reflected in the following aspects: (1) Insufficient application of deep learning technology: Traditional engineering drawing recognition methods mainly rely on rule-based image processing and pattern recognition technology, lacking the application of deep learning, especially visual language models, resulting in limited recognition capabilities for complex graphics and text; (2) Lack of unified secondary circuit modeling tools: There are currently no general modeling tools for substation secondary circuit model files, resulting in a lack of uniformity in model establishment and management, isolated information, and difficulty in achieving effective data integration and sharing; (3) Low degree of automation and intelligence: Existing methods require a lot of manual intervention in the process of drawing recognition and modeling, such as manual segmentation of image symbols and feature extraction, which is labor-intensive and prone to errors, and cannot meet the needs of modern power systems for efficient and accurate automated modeling. Summary of the Invention
[0006] In view of the aforementioned existing problems, this invention aims to solve the problem of automatically recognizing elements and symbols in CAD drawings, accurately parsing information such as electrical components, connecting lines, and text annotations. It fully utilizes a visual language pre-trained model to propose an effective method for understanding elements in substation CAD drawings, thereby achieving the task of understanding substation CAD drawing elements. Addressing the issue that existing information related to substation secondary circuits is mainly carried in the form of graphics and text within CAD drawings, which cannot effectively realize the carrying and application of data information, this invention models the information in CAD drawings. It uses a visual language model method to extract substation secondary circuit information contained in CAD drawings, realizes digital modeling of substation secondary circuits based on a digital model framework of substation secondary systems, and uses the digital model for advanced engineering applications such as secondary circuit display and auxiliary safety measures.
[0007] To address the aforementioned technical problems, a method for intelligent modeling of quadratic circuits based on a visual language model is proposed, including:
[0008] The system identifies and extracts graphic elements and symbols from the secondary circuit of the substation and constructs a graphic element library; it obtains the corresponding first visual language data from the graphic element library through a graphic element recognition and classification module; it performs further deep learning recognition on the first visual language data to obtain second visual language data; and it models the secondary circuit and visualizes it using the second visual language data.
[0009] As a preferred embodiment of the intelligent modeling method for secondary loops based on visual language models described in this invention, the first visual language data includes a primitive library that summarizes and completes a first predefined template through a visual language model and provides textual and visual cues.
[0010] The similarity between text and image features is calculated through feature adaptation;
[0011] Calculate the image category probability of image features and combine it with the similarity score to obtain the target classification score;
[0012] When the score of the template category with the highest target classification score is greater than the threshold, the model is considered to be matched, and the classification result is output as the first visual language data.
[0013] As a preferred embodiment of the intelligent modeling method for secondary circuits based on visual language models described in this invention, the second visual language data includes inputting the first visual language data into the electrical system after overall context analysis and entity recognition;
[0014] Determine the specific information and role of the first visual language data in the system, and output the correctly predicted result as the second visual language data;
[0015] The second visual language data is input into the CAD drawing for feature modeling and attribute definition. The entire secondary circuit is modeled by the defined node types.
[0016] Feature extraction and parsing are performed on the loops connecting each power node in the model file.
[0017] As a preferred embodiment of the intelligent modeling method for secondary circuits based on visual language models described in this invention, the context analysis includes: obtaining equipment information through a rectangular area, marking the location by matching the nearest text information, locating the equipment area where the electrical symbol is located, and sequentially matching the nearest text information;
[0018] Based on the graph theory depth-first search algorithm, the connection information is obtained, the equipment area of the smallest rectangle where the electrical symbol is located is located, and the connection relationship of the substation image is obtained by taking the electrical symbol as the starting point and the path ending at the electrical symbol or the labeled terminal equipment information. The text information is matched sequentially according to the nearest text information.
[0019] Repeat the matching process until all rectangular regions have been traversed, resulting in an undirected connected topology graph.
[0020] Information containing physical devices and their interconnections via regular expressions is matched and identified, and parsed into a digital description of the substation image in XML format based on the Document Object Model, generating an IMCD file corresponding to a single drawing.
[0021] As a preferred embodiment of the intelligent modeling method for secondary loops based on visual language models described in this invention, the entity recognition includes recognizing entities in the drawings after context analysis, including equipment names, models, and parameters. Entity recognition is divided into text region localization based on CTPN multi-scale feature extraction and content recognition of text regions using CRNN technology.
[0022] The text region localization based on CTPN multi-scale feature extraction includes: extracting image features using VGG-16, connecting it to a max pooling layer, scaling the input image and inputting it into the model, performing pooling operations using the first four convolutional layers and three max pooling layers of VGG-16 to obtain three feature maps, feeding the features into a bidirectional LSTM to continue learning the sequence features of the image, connecting it to a fully connected layer FC to output predicted parameters including foreground and background scores, position and horizontal corrections, performing region localization on text annotations of different sizes in the drawing, and cropping text regions one by one and feeding them into the CRNN model to recognize the annotation content;
[0023] The content recognition of text regions using CRNN technology includes: after determining the location of the labeled text in the drawing, adjusting the input image to a fixed height, scaling the image width proportionally, inputting it into a convolutional layer to extract feature maps containing only image spatial features, using a recurrent layer-bidirectional LSTM network to learn the sequence features of the image, with each column of the feature map as a time slice input into the LSTM, and setting the LSTM input sequence as x and the character sequence to be recognized as l through the improved CTC β transform, where the sequence represents the predicted character sequence transformed from β to l, then the maximum CTC probability sum is:
[0024] p(l|x)=∑ π.β(π)=l p(π|x)
[0025] For any predicted sequence, p(π|x) represents the probability that sequence x is identified as the character at position t in path π at position t:
[0026]
[0027] The gradient adjusts the parameters w of the LSTM so that p(π|x) is maximized for input samples of π (β(π)=l):
[0028]
[0029] A forward-backward algorithm is used to find all correct prediction sequences, reducing the time complexity of finding correct prediction sequences. After finding the correct sequences, gradient optimization of LSTM parameters w is performed again. After LSTM transformation, the correctly predicted results are output as second visual language data.
[0030] As a preferred embodiment of the intelligent modeling method for secondary circuits based on visual language models described in this invention, the secondary circuit modeling includes, when establishing the model file, the secondary circuit modeling module assigns a power node as the starting point for each circuit and determines the type of each sub-node, including input, output, analog input and power supply, to form a complete circuit, and completes the modeling of the entire secondary circuit through the defined node types.
[0031] The feature modeling and attribute definition include: establishing cabinet and device models for cabinets and devices in the substation according to the SPCD modeling specification; and establishing component models based on the components configured in the cabinets.
[0032] Establishing a terminal model based on the number of terminals of the device and components includes distinguishing between board components and not distinguishing between board components. For distinguishing between board components, corresponding board information is established, including power supply, input, output, sampling, and terminal segment boards. For not distinguishing between board components, a default of one board is established, and then a terminal model is established on the board, defining the terminal name and serial number attributes.
[0033] Establish a node model based on the internal connection relationship of the terminals. When there is an internal circuit or relay between two terminals that causes the terminals to be disconnected or closed, the two terminals are defined as a node. When m terminals need to be defined as nodes with the same common terminal, m node information is created in the model.
[0034] The secondary circuit modeling involves selecting a power node at a starting point, starting from the positive terminal of the selected power node, and sequentially connecting the terminals that the entire circuit passes through. Based on the cable type used between the two terminals, in-panel wiring and short connecting pieces, inter-panel cables and fiber cores are created respectively. In-panel wiring, short connecting pieces or cable fiber cores are used to connect the terminals on both sides.
[0035] When the connection is to a terminal in a sub-node on one side, select the other terminal of the current sub-node to continue modeling the remaining connections in the current circuit.
[0036] When the connected terminal is the negative terminal in the starting power node, the modeling of the entire electrical circuit is completed;
[0037] If there are n paths in the electrical loop between a power supply node, repeat the previous operation until all electrical loop models are established.
[0038] As a preferred embodiment of the intelligent modeling method for secondary loops based on visual language models described in this invention, the feature extraction and parsing includes: identifying and extracting primitive symbols through a visual language model, performing feature modeling on CAD graphics, extracting graphic features using image processing technology, and automatically matching them with a predefined model.
[0039] The automatic matching process involves selecting a subset of elements from any feature element in the feature element library as a key value, matching all element attributes in the identified CAD drawing using the key value's key attributes, and then matching the remaining attributes sequentially. When all attributes match, the key value element is matched; if any attribute fails to match, the next feature element is selected from the feature element library, and all feature elements in the feature element library are matched with the graphics in the CAD drawing.
[0040] When the elements contained in the feature primitive are successfully matched, primitive replacement is performed, and the coordinates of the current graphic in the CAD drawing are extracted. The feature primitive containing the successfully matched elements is moved to the coordinate position of the CAD graphic to be identified. Key-value attribute matching is repeated to determine whether the attributes of the remaining elements of the CAD graphic within the current primitive coverage area are consistent with the attributes of all elements of the feature primitive. When the key-value elements are matched, the successfully matched CAD graphics are merged into a block, the text information is extracted, and the SLCD attribute corresponding to the text is matched according to the definition of the feature model.
[0041] When the automatically matched CAD drawing parts are not identified, the unidentified parts are selected as feature primitives using human-computer interaction, and feature recognition is performed again. The circuits connecting each power node in the model file are analyzed and retrieved, and the analysis results are used to generate intelligent substation secondary circuit information for visualization.
[0042] Another objective of this invention is to provide a secondary circuit intelligent modeling system based on a visual language model. This invention improves the efficiency and accuracy of secondary circuit design, reduces human error, enables rapid parsing and automated modeling of secondary circuit design drawings, and reduces reliance on professional personnel. Through intelligent means, it quickly generates secondary circuit models and provides visual display, facilitating the analysis, maintenance, and upgrading of power systems. It also promotes the automation and intelligence of power system design, and improves the safety and reliability of power systems.
[0043] As a preferred embodiment of the intelligent modeling system for secondary loops based on a visual language model according to the present invention, it is characterized by including a primitive and symbol collection and input module, a visual language module, and a secondary loop modeling module.
[0044] The graphic element and symbol collection input module is used to collect graphic elements and symbols in the CAD drawings of the secondary circuit of the substation, including circuit breakers, relays, cables, terminal electrical components and connection methods;
[0045] The visual language module includes a graphic element library construction module, a graphic element recognition and classification module, a context analysis module, and an entity recognition module. It uses a visual language model to automatically classify different graphic elements and symbols in drawings, and through context analysis and entity recognition, ensures that the meaning and function of each graphic element in the electrical system are correctly understood.
[0046] The secondary circuit modeling module includes a model attribute definition module, a feature extraction module, a node module, a circuit parsing and retrieval module, and a visualization generation module, which realizes a visual display diagram of secondary circuit information and completes the modeling and parsing of secondary circuits in intelligent substations.
[0047] A computer device includes a memory and a processor, the memory storing a computer program, characterized in that the processor executes the computer program to implement the steps of the intelligent modeling method for secondary circuits based on a visual language model.
[0048] A computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the intelligent modeling method for secondary circuits based on a visual language model.
[0049] The beneficial effects of this invention are as follows: To address the development of a universal modeling tool for substation secondary circuit model files, enabling automated identification of elements and symbols in CAD drawings and accurate parsing of information such as electrical components, connecting lines, and text annotations, this invention proposes an effective method for understanding elements based on substation CAD drawings. In the text encoding stage, multiple learnable text prompts are integrated to explore the impact of different element category labels in the CAD image on the model's generalization effect. Secondly, learnable visual prompts are introduced during CAD image encoding to better utilize image pre-trained parameters to represent substation secondary circuit elements. A feature adaptation module is added after CAD and text feature encoding, and the entire network is fine-tuned on a specific image classification dataset to enhance its performance in the substation CAD drawing element understanding task, achieving automated identification of elements and symbols in CAD drawings and accurate parsing of information such as electrical components, connecting lines, and text annotations.
[0050] Digital modeling of CAD drawing information is performed, and the substation secondary circuit information contained in the CAD drawing is extracted using the visual language model method. Based on the digital model framework of the substation secondary system, digital modeling of the substation secondary circuit is realized, and the digital model is used for advanced engineering applications such as secondary full circuit display and auxiliary safety measures. Attached Figure Description
[0051] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein:
[0052] Figure 1 This is an overall diagram of a secondary loop intelligent modeling method based on a visual language model, provided as an embodiment of the present invention.
[0053] Figure 2 The present invention provides a module flowchart of a secondary loop intelligent modeling method based on a visual language model, which is an embodiment of the present invention.
[0054] Figure 3 This is a schematic diagram of a modeling method for a secondary loop intelligent modeling method based on a visual language model, provided as an embodiment of the present invention.
[0055] Figure 4 This is an example diagram illustrating the extraction of primitives and identification of a secondary circuit intelligent modeling method based on a visual language model, provided as an embodiment of the present invention.
[0056] Figure 5 This is an example diagram illustrating the establishment of a primitive library for a secondary loop intelligent modeling method based on a visual language model, provided as an embodiment of the present invention.
[0057] Figure 6 This is an example diagram illustrating the experimental process of context analysis and entity recognition in a secondary loop intelligent modeling method based on a visual language model, provided as an embodiment of the present invention.
[0058] Figure 7 This is an example diagram illustrating the device attribute description in a model format for a secondary loop intelligent modeling method based on a visual language model, provided as an embodiment of the present invention.
[0059] Figure 8 This is a complete loop node definition and modeling example diagram of a secondary loop intelligent modeling method based on a visual language model provided in one embodiment of the present invention.
[0060] Figure 9This is an example diagram of loop information recording in a secondary loop intelligent modeling method based on a visual language model, provided as an embodiment of the present invention.
[0061] Figure 10 This is a visualization example of a secondary circuit intelligent modeling method based on a visual language model provided in one embodiment of the present invention.
[0062] Figure 11 This is a schematic diagram of the intelligent modeling terminal structure of a secondary loop intelligent modeling system based on a visual language model, provided as an embodiment of the present invention. Detailed Implementation
[0063] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0064] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0065] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it an embodiment that is mutually exclusive, either alone or selectively, with other embodiments.
[0066] This invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of this invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not be construed as limiting the scope of protection of this invention. In actual fabrication, the three-dimensional spatial dimensions of length, width, and depth should be included.
[0067] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used solely for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0068] Unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" in this invention should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; similarly, they can refer to mechanical connections, electrical connections, or direct connections, or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0069] Example 1, referring to Figures 1-10 This is the first embodiment of the present invention, which provides a method for intelligent modeling of secondary loops based on a visual language model, such as... Figure 1 As shown, it includes:
[0070] S1: Identify and extract graphic elements and symbols from the secondary circuit of the substation and construct a graphic element library.
[0071] like Figure 2 As shown: S10: The visual language module first identifies and extracts a series of key information from the CAD drawings of the substation's secondary circuits, such as graphic elements and symbols, etc. Figure 4 As shown.
[0072] S20: Using the primitives and symbols extensively collected in S10, the visual language module will establish a comprehensive primitive library, laying the data foundation for subsequent processes, such as... Figure 5 As shown.
[0073] S2: Obtain the corresponding first visual language data from the primitive library through the primitive recognition and classification module.
[0074] Furthermore, in step S30, the template matching strategy in the primitive recognition and classification module is used to automatically and correctly classify the various primitives and symbols in the primitive library established in step S20.
[0075] The main types of identification components include: coils, contacts, switches, windings, power supplies, cabinets, terminal boxes, buttons, terminals, contact terminals, pressure plates, indicator lights, black box components, motor components, etc.
[0076] like Figure 3 As shown, the template matching strategy is as follows:
[0077] The module receives CAD drawings as input, performs unified input format preprocessing on the drawings, and constructs a graphic element library: it summarizes and completes predefined templates from existing drawings and standard legends provided by equipment component manufacturers. It then designs a matching model between graphic elements and templates.
[0078] Extract a region of graphic elements from the drawing and retain the electrical elements within that region. In the text branch, construct learnable text cues using the image category at different positions (before, in, and after) within the text cues; in the image branch, incorporate the learnable vectors into the image encoder as visual cues.
[0079] Add feature adapters after the encoders for the image branch and the text branch, respectively.
[0080] The similarity between text features and image features is calculated by taking the dot product of their values and using it as the probability value for the corresponding category. For image features, an additional fully connected layer is added to represent the image category probability, which is then added to the image-text similarity score to obtain the final image classification score.
[0081] Logistic regression is used to obtain the probability of primitives belonging to each template. Cross-entropy loss is used for supervision and optimization of the entire network. For matching, the model trained with cross-entropy loss is only considered to have successfully matched a primitive group if the score of the template category with the highest score is greater than a given threshold. For primitive groups that do not belong to the defined templates, the original detected primitives are directly presented. Finally, based on the matching results, automatic primitive classification is achieved, and the classification results are output.
[0082] The feature adapter consists of an image encoder and a text encoder from the CLIP model; the image encoder maps a high-dimensional image to a low-dimensional embedding space. The text encoder generates text feature representations from natural language.
[0083] During the training phase, the input image and text data are encoded into image features and text features. Then, the cosine similarity between the image features and text features is calculated. Contrast loss is used to learn the joint embedding space of the two modalities. The trained model can be used for zero-shot recognition.
[0084] In the zero-shot inference phase, the text is set to use a prompt template in the form of "A photo of a [class]", where the [class] marker is filled with the class name. Then, a text encoder can generate a set of text feature vectors {w}. i}i=1K, where K represents the total number of categories, and each category corresponds to a text feature vector.
[0085] Given an image x, image features f extracted by the image encoder, and temperature parameters learned by the CLIP model, the predicted probability of the image category is calculated as follows:
[0086]
[0087] The graph meta-library summarizes and completes the first predefined template through a visual language model, and provides textual and visual cues:
[0088] Figure 3 Text prompt processing: For text prompts, the text prompts are constructed based on the image category and its different positions within the text prompt, in the following form:
[0089] t = [v]1[v]2…[v] M [class]
[0090] Where: each v m (m∈{1,2,…,M}) is a vector with the same dimension as the word embedding, and M is a hyperparameter for the number of context vectors, which is set to M=16; by inputting the prompt text t into the text encoder g(·), a set of text feature vectors can be obtained, and the image category prediction probability at this time is:
[0091]
[0092] Each text prompt t i The [class] marker in the text is replaced with the word embedding vector corresponding to the i-th category.
[0093] Place the category label at the end of the text prompt processing in the middle of the sequence, such as:
[0094]
[0095] Similarly, place the category label at the beginning of the cue sequence, such as:
[0096] t = [class][v]1[v]2…[v] M
[0097] This increases the flexibility of learning; the vector before the category label can be used to describe the category, while the vector after can be used to provide supplementary information. Therefore, text prompts with the three category labels at different positions are integrated. Specifically, the three sets of weights obtained from the three text prompts are merged into one set to fully explore the impact of the image category at different positions in the prompt text on the model's generalization performance.
[0098] Figure 3 Visual cue processing: First, utilize v i T divides the input CAD drawing into multiple small blocks; then passes them through a linear projection layer to obtain an image embedding representation; finally, these image embeddings are added with corresponding position codes and input into the Transformer encoder layer for computation. When the image encoder is v iAt time T, a method of adding the corresponding values of the visual cue and the image embedding is adopted: a visual cue vector P0 with the same dimension as the image embedding E0 is added element-wise to E0, and then the positional encoding is added before being input into the Transformer encoder layer for computation. Similarly, a visual cue vector is provided to the ResNet network. After passing through the stem block of the ResNet network, the image feature E0 is obtained. Then, E0 is added element-wise to the visual cue vector P0 with the same dimension before being input into the subsequent stages of the network for computation.
[0099] Calculate the similarity between text and image features through feature adaptation:
[0100] Figure 3 Chinese text feature adapter and image feature adapter: The adapter consists of a dimensionality-reduced fully connected layer, a non-linear activation function, a dimensionality-upgraded fully connected layer, and a residual connection. The adapter is applied to the image branch and the text branch respectively. The image features f and text features w extracted by the image encoder and text encoder of the CLIP method are respectively input into the corresponding image adapter A. v (·) and Text Adapter A t (·), The new image features f' and text features w' are obtained from the learnable parameters in the adapter, and are represented as follows:
[0101]
[0102] Figure 3 Image category probability embedding method: By using the stronger discriminative ability of traditional image classification training methods to assist in the training of image-text matching, the network has better generalization ability and improves classification accuracy.
[0103] Specifically, the image features f' and text features w' obtained after the feature adapter calculation are used to calculate the image category prediction probability using the image feature prediction probability formula. The similarity between the image features and text features is used as the classification prediction score s. Then, the image features f' are input into the fully connected layer to obtain the image category probability q. Let N be the total number of training samples and l be the label. The classification prediction score s is added to the image category probability q to calculate the cross-entropy loss, i.e.:
[0104]
[0105] The classification results are output as first visual language data.
[0106] This invention introduces a visual language pre-trained model to achieve highly intelligent CAD drawing recognition. It innovatively applies a visual language pre-trained model to the field of engineering drawing recognition, breaking through the limitations of traditional rule-based and template-matching methods. By integrating computer vision and natural language processing technologies, the model can simultaneously process graphic and textual information, automatically recognizing and accurately parsing graphic elements and symbols in CAD drawings. Theoretically, this method expands the application scope of visual language models, enhances their robustness to complex graphics, connected characters, and noise interference, and solves the problem that traditional methods cannot effectively handle complex engineering drawings.
[0107] S3: Perform further deep learning to identify and obtain second visual language data from the first visual language data.
[0108] S4: Model the secondary electrical circuit using second visual language data and visualize it.
[0109] The first visual language data is input into the electrical system after overall context analysis and entity recognition;
[0110] Determine the specific information and role of the first visual language data in the system, and output the correctly predicted result as the second visual language data;
[0111] The second visual language data is input into the CAD drawing for feature modeling and attribute definition. The entire secondary circuit is modeled by the defined node types.
[0112] Feature extraction and parsing are performed on the loops connecting each power node in the model file.
[0113] Example 2, refer to Figures 1-10 This is the first embodiment of the present invention, which provides a method for intelligent modeling of quadratic loops based on a visual language model, comprising:
[0114] S1: Identify and extract graphic elements and symbols from the secondary circuit of the substation and construct a graphic element library.
[0115] S2: Obtain the corresponding first visual language data from the primitive library through the primitive recognition and classification module.
[0116] The graph element library summarizes and completes the first predefined template through a visual language model and provides text and visual cues.
[0117] The similarity between text and image features is calculated through feature adaptation;
[0118] Calculate the image category probability of image features and combine it with the similarity score to obtain the target classification score;
[0119] When the score of the template category with the highest target classification score is greater than the threshold, the model is considered to be matched, and the classification result is output as the first visual language data.
[0120] S3: Perform further deep learning to identify and obtain second visual language data from the first visual language data.
[0121] The first visual language data is then input into the electrical system after overall context analysis and entity recognition:
[0122] S40. Through deep learning methods of the context analysis module 203 and the entity recognition module 204, the computer is ensured to correctly understand the meaning and function of each element in the primitive library within the electrical system, such as... Figure 6 As shown.
[0123] The specific execution flow of the context analysis module is as follows: The algorithm for parsing image topology information is designed to analyze the primitives and connecting lines in the image, parse and construct their topological relationships, thereby analyzing the contextual relationships of primitives in the drawing, understanding their position and role in the electrical circuit, and ensuring that the recognition of primitives is not only based on shape, but also considers their function and connection relationship in the circuit.
[0124] First, obtain the device information through rectangular regions: classify and sort the straight lines, extract the pairs of straight lines, and traverse the longest vertical and horizontal lines in a counterclockwise direction to find several closed and connected rectangular regions, which are the physical devices.
[0125] The location is marked by matching the nearest text information. The length and width ratio of the largest area rectangle is used to determine whether the substation image is a vertical or horizontal object. Then, the top left corner of each rectangular area is used as the origin of the coordinate system. The coordinates are traversed from small to large and from left to right. All the smallest rectangular areas with containment relationships are found. The equipment area where the electrical symbol is located is located, and the nearest text information is matched accordingly.
[0126] The model uses a graph theory-based depth-first search algorithm to obtain connectivity information: electrical symbols or terminal devices are treated as nodes, lines are used as edges, and an adjacency list is used to construct a topological graph. The model's connectivity consists of long straight lines that do not intersect with short straight lines, are complementary to each other, and do not contain diagonal lines.
[0127] Locate the equipment area of the smallest rectangle containing the electrical symbol. Starting from the electrical symbol, traverse all straight lines outside the rectangle area using graph theory depth-first search. Find the topological path using the nearest Euclidean distance. Then, traverse the long straight lines connected to it (excluding equipment lines) and match the text labels of nodes and edges. The path endpoint is the electrical symbol or the straight line labeled with terminal equipment information. Obtain the connection relationship of the substation image and match the text information of the nearest neighbor in turn.
[0128] Repeat the above process until all rectangular regions have been traversed, resulting in an undirected connected topology graph. Based on the attribute information of elements in the standard intelligent substation configuration file, perform regular expression matching and recognition on the information containing physical devices and the physical cable connections between them, judging and classifying them sequentially from level one to level two. Based on the document object model parsing scheme, parse it into a digital description of the substation image in XML format, generating an IMCD file corresponding to a single drawing.
[0129] The entity recognition module is divided into two modules: entity region detection and content recognition. First, in the text region detection module, a multi-scale feature extraction text region detection model is built based on CTPN to solve the problem of locating regions of text annotations of different sizes in the drawing. Then, in terms of text recognition, CRNN technology is used to process the detected text regions to obtain the content of the text annotations.
[0130] The text region detection method based on the CTPN model first uses VGG-16 to extract image features. Each convolutional model of VGG-16 first uses a 3*3 convolutional kernel with a stride of 1 to perform convolution, which can obtain a feature map with the same width and height as the input size. Then, a 2*2 max pooling layer with a stride of 2 is added to obtain a feature map with both width and height reduced to 1 / 2 of the input size.
[0131] The input image is scaled to 1920*1920 pixels and fed into the model. First, the first four convolutional layers of VGG-16 are used to obtain a feature map with a width and height of 1 / 8 of the input image size, which is 240*240. Then, three max pooling layers with sizes of 2*2, 3*3, and 4*4 are used to pool this feature map with strides of 2, 3, and 4, respectively. Finally, feature maps with widths and heights of 120*120, 80*80, and 60*60 are obtained. After obtaining the three feature maps, they are fed into a bidirectional LSTM to continue learning the sequence features of the image. Finally, a fully connected (FC) layer is added to output the predicted parameters, namely: foreground and background scores, position, and horizontal correction.
[0132] After determining the location of the annotation text in the drawing, the input image is adjusted to a fixed height, and the image width is scaled proportionally. It is then fed into a convolutional layer to extract feature maps containing only spatial image features. A recurrent layer-bidirectional LSTM network is used to learn the sequence features of the image. Each column of the feature map is input into the LSTM as a time slice. Using the improved CTC β transform, the LSTM input sequence is set to x, and the character sequence to be recognized is l. The sequence represents the predicted character sequence transformed from β to l. The maximum CTC probability sum is:
[0133] p(l|x)=∑ πβ(π)=l p(π|x)
[0134] For any predicted sequence, p(π|x) represents the probability that sequence x is identified as the character at position t in path π at position t:
[0135]
[0136] The gradient adjusts the parameters w of the LSTM so that p(π|x) is maximized for input samples of π (β(π)=l):
[0137]
[0138] A forward-backward algorithm is used to find all correct prediction sequences, reducing the time complexity of finding correct prediction sequences. After finding the correct sequences, gradient optimization of the LSTM parameters w is performed again.
[0139]
[0140] After transformation by LSTM, the correctly predicted results are output as second visual language data.
[0141] Determine the specific information and role of the first visual language data in the system, and output the correctly predicted result as the second visual language data.
[0142] S4: Model the secondary electrical circuit using second visual language data and visualize it.
[0143] The second visual language data is input into the CAD drawing for feature modeling and attribute definition. The entire secondary circuit is modeled using the defined node types.
[0144] S50: Defines the model format for various devices, components, terminals, nodes, and cables in the secondary electrical circuits of a substation. It performs feature modeling in CAD drawings, such as establishing attributes like equipment name, equipment description, equipment model, equipment identifier, and equipment batch. Figure 7 As shown.
[0145] S60: When creating the model file, the secondary circuit modeling module assigns a power node as the starting point for each electrical circuit and determines the type of each secondary node, including input, output, analog input, and power supply, forming a complete circuit. The entire secondary electrical circuit is modeled using the defined node types, such as... Figure 8 As shown.
[0146] Model the cabinets and devices in the substation according to the SPCD modeling specification, and define attributes including name and model.
[0147] Component models are created based on the components configured inside the cabinet, including cabinet terminal blocks, circuit breakers, pressure plates, power supplies, indicator lights, sensors, and changeover switches, and attributes such as name and model are defined.
[0148] Establishing a terminal model based on the number of terminals of the device and components includes distinguishing between board components and not distinguishing between board components. For distinguishing between board components, corresponding board information is established, including power supply, input, output, sampling, and terminal segment boards. For not distinguishing between board components, a default of one board is established, and then a terminal model is established on the board, defining the terminal name and serial number attributes.
[0149] Establish a node model based on the internal connection relationship of the terminals. When there is an internal circuit or relay between two terminals that causes the terminals to be disconnected or closed, the two terminals are defined as a node. When m terminals need to be defined as nodes with the same common terminal, m node information is created in the model.
[0150] The secondary circuit modeling involves selecting a power node at a starting point, starting from the positive terminal of the selected power node, and sequentially connecting the terminals that the entire circuit passes through. Based on the cable type used between the two terminals, in-panel wiring and short connecting pieces, inter-panel cables and fiber cores are created respectively. In-panel wiring, short connecting pieces or cable fiber cores are used to connect the terminals on both sides.
[0151] When the connection is to a terminal in a sub-node on one side, select the other terminal of the current sub-node to continue modeling the remaining connections in the current circuit.
[0152] When the connected terminal is the negative terminal in the starting power node, the modeling of the entire electrical circuit is completed;
[0153] If there are n paths in the electrical loop between a power supply node, repeat the previous operation until all electrical loop models are established.
[0154] Once each sub-model is established, it is saved as an XML file, thus completing the modeling of the entire secondary circuit.
[0155] Graphical symbols extracted using a visual language model 20 are used to perform feature modeling on CAD drawings. Image processing techniques are then used to extract graphic features, which are matched against a predefined model.
[0156] Automatic feature recognition is based on the comparison between a feature primitive library and CAD drawings. The recognition process is as follows: Select a portion of elements from any feature primitive in the feature primitive library, use this element as a key value, and then iterate through all element attributes in the identified CAD drawing for matching, and then match other attributes in turn. If all attributes match, then the key value element matches.
[0157] If a match fails, the next feature element is selected from the feature element library, and so on, matching all feature elements in the feature element library with the graphics in the CAD drawing.
[0158] If the elements contained in the feature primitive are successfully matched, primitive replacement is performed, and the coordinates of the graphic in the CAD drawing are extracted. The feature primitive containing this element is then moved to the coordinate position of the CAD drawing to be identified. This reduces the range of the traversed drawings and improves the efficiency of drawing recognition. Then, the key-value attribute matching method is repeated to determine whether the attributes of other elements in the CAD drawing within the area covered by this primitive are consistent with the attributes of all elements of the feature primitive. Finally, the successfully matched CAD drawings are grouped into a block, text information is extracted, and the SLCD attribute corresponding to the text is matched according to the definition of the feature model.
[0159] For identifying similar graphics within a CAD drawing, repeat the feature matching method described above, using feature primitives to match the entire drawing. A single feature primitive can be used to match and identify all similar graphics containing the same graphic and text positions. By using a single device graphic as a feature primitive, multiple device graphics can be identified simultaneously.
[0160] For any CAD drawing parts that are not automatically identified, a human-computer interaction-based feature recognition method is needed for re-identification. This involves selecting the unidentified parts as feature primitives and then performing feature recognition.
[0161] First, select CAD graphics and text to create feature primitives. The main parameters of the graphics are shape, size, and block attributes, while the main parameters of the text are its position relative to the graphics and its length. Use the CAD graphics as the first element and the text as the second element for identification and matching. Objects with the same CAD graphics but different text features can be identified using the same feature primitive.
[0162] Then, feature modeling is performed on the CAD drawings to establish attributes such as equipment name, equipment description, equipment model, equipment identifier, and equipment batch. Feature primitives are categorized and stored in a feature primitive library, and this library is continuously enriched to improve the automatic recognition rate. The subsequent image recognition process for human-computer interaction is the same as for automatic feature recognition.
[0163] Automatic feature recognition eliminates the need for manual intervention, reducing the workload of drawing interpretation. However, it involves significant computational demands. Classifying drawings and feature libraries reduces the number of matching attempts, thereby improving the efficiency of CAD drawing recognition. Furthermore, interactive feature recognition assists in identifying and filling in gaps in the recognition process. The two methods work together to ensure both efficiency and high accuracy in CAD drawing interpretation.
[0164] Step S70: By analyzing the circuits connecting each power node in the model file, the secondary circuit modeling module records relevant information for each circuit, such as current transmission paths and voltage relationships. Figure 9 As shown.
[0165] The analysis and retrieval process of a complete secondary electrical circuit is based on each power supply node as the starting point and end point of the circuit. That is, starting from the positive terminal of the power supply, the information of each connected terminal is identified and recorded in sequence until the negative terminal of the power supply is reached.
[0166] Parse electrical connection information. Parse the substation electrical circuit model file, iterate through all the cabinets, select each cabinet sequentially, and parse the electrical connection information for each cabinet. Based on the wiring and short connectors within each cabinet or the cables between cabinets and their fiber cores, record the terminal information on both sides of the wiring and short connectors within the cabinet and the cable fiber cores. Parse the cabinet terminal and node information.
[0167] Select each cabinet sequentially, iterate through all terminals within the selected cabinet, record their names, iterate through all node information within the cabinet, and record the type of each sub-node and the names of the two terminals within that node. Parse the electrical circuit information.
[0168] Each cabinet is selected sequentially. If a power node exists within the cabinet, the search begins from the positive terminal of that node. The information of the opposite terminal connected to the positive terminal is searched in the electrical connection information. If the opposite terminal does not belong to any node, the name of the opposite terminal is used to search for the next-level opposite terminal connected to it in the electrical connection information. If the opposite terminal belongs to a node, the name of the other terminal in the node is obtained based on the node information, and the name of the other terminal is used to search for the next-level opposite terminal connected to it in the electrical connection information. When the opposite terminal found in the electrical connection information is the negative terminal of the starting power node, the search for this circuit ends. The names of all terminals, nodes, wiring and short connectors within the cabinet, and the fiber cores of the cabinet cables traversed by this circuit are recorded to complete the circuit search.
[0169] After completing the circuit search for all power nodes in all cabinets and recording the names of all terminals, nodes, wiring and short connectors, and cable cores of each circuit, the analysis of the entire substation circuit model is completed.
[0170] Step S80: The secondary circuit modeling module generates a visual display diagram of the secondary electrical circuit information of the intelligent substation, intuitively presenting the structure, connections, and parameters of the electrical circuit, such as... Figure 10 As shown.
[0171] This invention develops a universal substation secondary circuit modeling tool to achieve information structuring and standardization. Based on the SDL (Substation Description Language) structured template, this invention defines the model formats for devices, components, terminals, nodes, and cables in the substation secondary circuits. By establishing a unified and standardized structured model of secondary circuit information, unified model management and effective data integration are achieved. This innovation theoretically provides a unified model framework, solving the problems of information silos and difficulty in data sharing, and laying the foundation for the development of digital asset management systems and the establishment of integrated application interfaces (APIs).
[0172] This invention achieves fully automated secondary circuit modeling, improving modeling efficiency and accuracy. Utilizing visual language models and deep learning technology, it automatically completes the identification, feature extraction, and model building of graphic elements in CAD drawings, reducing reliance on manual intervention. By designing modules for graphic element recognition and classification, context analysis, and entity recognition, it achieves accurate parsing of electrical components, connecting lines, and text annotations, automatically generating digital models of secondary circuits. This technical solution theoretically enhances the automation level of engineering drawing recognition and modeling, improving modeling efficiency and accuracy, and meeting the demands of modern power systems for efficient and accurate automated modeling.
[0173] Example 3, the third embodiment of the present invention, differs from the previous two embodiments in that:
[0174] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0175] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0176] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0177] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0178] Example 4, refer to Figure 11 This is the fourth embodiment of the present invention. This embodiment provides a secondary loop intelligent modeling system based on a visual language model, including a primitive and symbol collection and input module 10, a visual language module 20, and a secondary loop modeling module 30.
[0179] like Figure 11 As shown, the graphic element and symbol collection input module 10 is used to collect graphic elements and symbols in the CAD drawings of the substation secondary circuit, including circuit breakers, relays, cables, terminal electrical components and connection methods.
[0180] The visual language module 20 includes a graphic element library construction module 201, a graphic element recognition and classification module 202, a context analysis module 203, and an entity recognition module 204; it uses a visual language model to automatically classify different graphic elements and symbols in drawings, and through context analysis and entity recognition, ensures that the meaning and function of each graphic element in the electrical system are correctly understood;
[0181] The graphic elements and symbols collected by the graphic element and symbol collection input module 10 are classified and organized to build a comprehensive graphic element library. The graphic element library is used to store and manage all graphic elements that may appear in the drawing, providing basic data for subsequent identification and classification.
[0182] The graphic element recognition and classification module 202 can automatically recognize and classify graphic elements and symbols in CAD drawings. Using image processing and pattern recognition technology, it adopts a template matching strategy to match the recognized graphic elements with data in the graphic element library.
[0183] The context analysis module 203 designs an algorithm for parsing image topology information. That is, by analyzing the primitives and connecting lines in the image, it parses and constructs their topological relationships, thereby analyzing the contextual relationships of primitives in the drawing, understanding their position and role in the electrical circuit, and ensuring that the recognition of primitives is not only based on shape, but also considers their function and connection relationship in the circuit.
[0184] The entity recognition module 204 identifies entities in the drawings, such as equipment names, models, and parameters. Entity recognition allows for a more accurate understanding of the specific information of each element and its role in the system.
[0185] The secondary circuit modeling module 30 includes a model attribute definition module 301, a feature extraction module 302, a node module 303, a circuit parsing and retrieval module 304, and a visualization display generation module 305, which realizes a visualization display diagram of secondary electrical circuit information and completes the modeling and parsing work of secondary electrical circuits in intelligent substations.
[0186] Model attribute definition module 301 is used to define the model format of devices, components, terminals, nodes, and cables in the secondary circuits of the substation. Detailed attributes are established for each device, including device name, description, model number, identifier, and batch number. To facilitate the structured expression, flow, and management of design results, configuration files IDD, CDD, and SDD based on SDL are introduced. The SDD file is the substation design configuration description file, which should be unique across the entire substation. This file describes the complete physical configuration and connection topology of the secondary circuits of the substation, and its extension is .scd. The SDD contains information about the cabinet CDD, as well as connection information for cables, optical fibers, etc., between cabinets. The CDD file (Cubicle Design Description, cabinet white diagram, terminal block diagram) is used to describe the equipment configuration, schematic diagram, and wiring relationships of the secondary cabinets, and its extension is .cdd. The CDD file contains material information, connection information within the cabinet, and secondary equipment IDD information. IDD file: IED Design Description (Device Schematic) Device design description file, used to describe the equipment's boards, terminals, as well as equipment configuration diagrams, schematic diagrams, and wiring diagrams. The file extension is .idd.
[0187] The SDL structured template includes four levels of attributes: The Header element represents the SDL header information, specifying the SDL file version, configuration tool, and file CRC. The Substation element represents the substation, defining a complete substation secondary circuit entity. The Cubicle element represents the cabinet, containing information such as cabinet accessories (materials), cabinet assembly results, and internal wiring. The Device element represents secondary physical equipment, containing equipment information, boards, terminals, etc., where terminals use different type values depending on the modeling attributes. ModelTemplates: Model template information, optional, defaults to empty.
[0188] The feature extraction module 302 identifies the extracted graphic symbols through the visual language model 20 and performs feature modeling on the CAD drawing. Image processing techniques are used to extract graphic features and match them with a predefined model.
[0189] Node module 303 assigns a power node as the starting point for each electrical circuit;
[0190] The loop parsing and retrieval module 304 parses and retrieves the loops connecting each power node in the model file. It records relevant information for each loop, such as connection method, node type, and device attributes.
[0191] The visualization generation module 305 generates a visual representation of the secondary electrical circuit information based on the results parsed and retrieved by module 304. It provides an intuitive user interface, displaying the structure and attributes of the electrical circuit for easy user understanding and operation.
[0192] 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 preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for intelligent modeling of quadratic circuits based on a visual language model, characterized in that: include, The graphic elements and symbols in the secondary circuit of the substation are identified and extracted to construct a graphic element library; The first visual language data corresponding to the primitive library is obtained through the primitive recognition and classification module; Further deep learning is used to identify and obtain second visual language data from the first visual language data; Secondary electrical circuits are modeled and visualized using second visual language data; The first visual language data includes a primitive library that summarizes and completes a first predefined template through a visual language model and provides text and visual cues; The similarity between text and image features is calculated through feature adaptation; Calculate the image category probability of image features and combine it with the similarity score to obtain the target classification score; When the score of the template category with the highest target classification score is greater than the threshold, the template is considered to be matched, and the classification result is output as the first visual language data. The second visual language data includes inputting the first visual language data into the electrical system after overall context analysis and entity recognition; Determine the specific information and role of the first visual language data in the system, and output the correctly predicted result as the second visual language data; The second visual language data is input into the CAD drawing for feature modeling and attribute definition. The entire secondary circuit is modeled by the defined node types. Feature extraction and parsing are performed on the loops connecting each power node in the model file.
2. The intelligent modeling method for secondary circuits based on a visual language model as described in claim 1, characterized in that: The context analysis includes obtaining device information through a rectangular area, marking the location by matching the nearest text information, locating the device area where the electrical symbol is located, and then matching the nearest text information in sequence. Based on the graph theory depth-first search algorithm, the connection information is obtained, the equipment area of the smallest rectangle where the electrical symbol is located is located, and the connection relationship of the substation image is obtained by taking the electrical symbol as the starting point and the path ending at the electrical symbol or the labeled terminal equipment information. The text information is matched sequentially according to the nearest text information. Repeat the matching process until all rectangular regions have been traversed, resulting in an undirected connected topology graph. Information containing physical devices and their interconnections via regular expressions is matched and identified, and parsed into a digital description of the substation image in XML format based on the Document Object Model, generating an IMCD file corresponding to a single drawing.
3. The intelligent modeling method for secondary circuits based on a visual language model as described in claim 2, characterized in that: The entity recognition includes recognizing entities in the drawings after context analysis, including equipment names, models, and parameters. Entity recognition is divided into text region localization based on CTPN multi-scale feature extraction and content recognition of text regions using CRNN technology. The text region localization based on CTPN multi-scale feature extraction includes: extracting image features using VGG-16, connecting it to a max pooling layer, scaling the input image and inputting it into the model, performing pooling operations using the first four convolutional layers and three max pooling layers of VGG-16 to obtain three feature maps, feeding the features into a bidirectional LSTM to continue learning the sequence features of the image, connecting it to a fully connected layer FC to output predicted parameters including foreground and background scores, position and horizontal corrections, performing region localization on text annotations of different sizes in the drawing, and cropping text regions one by one and feeding them into the CRNN model to recognize the annotation content; The content recognition of text regions using CRNN technology includes: after determining the location of the labeled text in the drawing, adjusting the input image to a fixed height, scaling the image width proportionally, inputting it into a convolutional layer to extract feature maps containing only image spatial features, using a recurrent layer-bidirectional LSTM network to learn the sequence features of the image, with each column of the feature map as a time slice input into the LSTM, setting the LSTM input sequence and the character sequence to be recognized through the improved CTC β transform, the sequence representing the predicted character sequence transformed into the character sequence to be recognized, calculating the maximum sum of CTC probabilities, and simultaneously adjusting the LSTM parameters through gradient optimization, using a forward-backward algorithm to find all correct prediction sequences to reduce the time complexity of finding correct prediction sequences, and after finding the correct sequences, performing gradient optimization of the LSTM parameters again, and outputting the correctly predicted results as second visual language data after the LSTM transformation.
4. The intelligent modeling method for secondary circuits based on a visual language model as described in claim 3, characterized in that: The secondary circuit modeling includes, when creating the model file, the secondary circuit modeling module assigns a power node as the starting point for each circuit and determines the type of each sub-node, including input, output, analog input and power supply, to form a complete circuit. The entire secondary circuit modeling is completed through the defined node types. The feature modeling and attribute definition include: establishing cabinet and device models for cabinets and devices in the substation according to the SPCD modeling specification; and establishing component models based on the components configured in the cabinets. Establishing a terminal model based on the number of terminals of the device and components includes distinguishing between board components and not distinguishing between board components. For distinguishing between board components, corresponding board information is established, including power supply, input, output, sampling, and terminal segment boards. For not distinguishing between board components, a default of one board is established, and then a terminal model is established on the board, defining the terminal name and serial number attributes. Establish a node model based on the internal connection relationship of the terminals. When there is an internal circuit or relay between two terminals that causes the terminals to be disconnected or closed, the two terminals are defined as a node. When m terminals need to be defined as nodes with the same common terminal, m node information is created in the model. The secondary circuit modeling involves selecting a power node at a starting point, starting from the positive terminal of the selected power node, and sequentially connecting the terminals that the entire circuit passes through. Based on the cable type used between the two terminals, in-panel wiring and short connecting pieces, inter-panel cables and fiber cores are created respectively. In-panel wiring, short connecting pieces or cable fiber cores are used to connect the terminals on both sides. When the connection is to a terminal in a sub-node on one side, select the other terminal of the current sub-node to continue modeling the remaining connections in the current circuit. When the connected terminal is the negative terminal in the starting power node, the modeling of the entire electrical circuit is completed; If there are n paths in the electrical loop between a power supply node, repeat the previous operation until all electrical loop models are established.
5. The intelligent modeling method for secondary circuits based on a visual language model as described in claim 4, characterized in that: The feature extraction and parsing includes recognizing the extracted primitive symbols through a visual language model, performing feature modeling on the CAD graphics, extracting graphic features using image processing technology, and automatically matching them with a predefined model; The automatic matching process involves selecting a subset of elements from any feature element in the feature element library as a key value, matching all element attributes in the identified CAD drawing using the key value's key attributes, and then matching the remaining attributes sequentially. When all attributes match, the key value element is matched; if any attribute fails to match, the next feature element is selected from the feature element library, and all feature elements in the feature element library are matched with the graphics in the CAD drawing. When the elements contained in the feature primitive are successfully matched, primitive replacement is performed, and the coordinates of the current graphic in the CAD drawing are extracted. The feature primitive containing the successfully matched elements is moved to the coordinate position of the CAD graphic to be identified. Key-value attribute matching is repeated to determine whether the attributes of the remaining elements of the CAD graphic within the current primitive coverage area are consistent with the attributes of all elements of the feature primitive. When the key-value elements are matched, the successfully matched CAD graphics are merged into a block, the text information is extracted, and the SLCD attribute corresponding to the text is matched according to the definition of the feature model. When the automatically matched CAD drawing parts are not identified, the unidentified parts are selected as feature primitives using human-computer interaction, and feature recognition is performed again. The circuits connecting each power node in the model file are analyzed and retrieved, and the analysis results are used to generate intelligent substation secondary circuit information for visualization.
6. A system employing the intelligent modeling method for secondary loops based on a visual language model as described in any one of claims 1 to 5, characterized in that: It includes a primitive and symbol collection input module, a visual language module, and a secondary circuit modeling module; The graphic element and symbol collection input module is used to collect graphic elements and symbols in the CAD drawings of the secondary circuit of the substation, including circuit breakers, relays, cables, terminal electrical components and connection methods; The visual language module includes a graphic element library construction module, a graphic element recognition and classification module, a context analysis module, and an entity recognition module. It uses a visual language model to automatically classify different graphic elements and symbols in drawings, and through context analysis and entity recognition, ensures that the meaning and function of each graphic element in the electrical system are correctly understood. The secondary circuit modeling module includes a model attribute definition module, a feature extraction module, a node module, a circuit parsing and retrieval module, and a visualization generation module, which realizes a visual display diagram of secondary circuit information and completes the modeling and parsing of secondary circuits in intelligent substations.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the intelligent modeling method for secondary circuits based on a visual language model as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the intelligent modeling method for secondary circuits based on a visual language model as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Physical loop modeling method for intelligent substation drawing
CN114547968A
Substation secondary drawing visual editing and digital configuration device and method and application
CN115238428A