Secondary circuit intelligent modeling method and system based on visual language model
The integration of visual language models for CAD graph analysis addresses the limitations of existing technologies by enabling accurate and automated recognition and modeling of secondary power station circuits, enhancing data management and system efficiency.
Patent Information
- Application Number
- CN202411430337.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-10-14
AI Technical Summary
Current engineering graph recognition technologies lack the application of deep learning, particularly visual language models, leading to limited recognition of complex graphics and text, and there is a lack of unified tools for secondary circuit modeling in power stations, resulting in inefficient and error-prone manual processes for graph analysis and data management.
A method utilizing visual language models to automatically identify and model CAD graph elements, extracting information from secondary circuit diagrams, and integrating it into a digital framework for enhanced visualization and management, employing techniques like feature adaptation and context analysis to improve recognition accuracy and robustness.
This approach significantly enhances the efficiency and accuracy of secondary circuit modeling, reducing human intervention and improving data integration, enabling more effective and automated management of power station systems.
Smart Images

Figure CN119622994A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system automation, and in particular to a secondary circuit intelligent modeling method and system based on a visual language model. Background Art
[0002] In terms of identifying engineering drawings, traditional engineering drawing recognition technology mainly uses the three-point method to distinguish straight lines, circles, and arcs, and the other is the refinement algorithm. In reality, equipment has been developed based on these principles. For example, existing technology has developed an engineering drawing scanning input and automatic recognition system. The system has not been developed for the general modeling tool of the substation secondary circuit model file, and has not fully utilized deep learning technology to achieve highly intelligent engineering drawing recognition. It has a weak correlation with the scheme for building line models. This limits the application of the system in complex power system drawing recognition and modeling.
[0003] In large-scale and diverse engineering drawing recognition tasks, the generalization ability of BPNN is limited, and it is difficult to meet the requirements of efficient and accurate recognition. The contour-based method has been used to study the separation of text and images, but the effectiveness of this method is limited when characters and graphics are stuck to each other. There are often complex overlapping graphics and text in engineering drawings, and traditional contour-based separation methods are difficult to accurately distinguish, resulting in a decrease in recognition accuracy. The refinement algorithm and Hilditch algorithm were improved to try to solve the defects in the refinement process. However, some graphics in engineering drawings are not suitable for refinement processing. The refinement algorithm may cause shape distortion when processing these graphics, affecting subsequent recognition and analysis. The radial basis probability neural network (RBPNN) and the multi-input convolution transform combined with the RBPNN model are used to recognize the segmented engineering drawing graphic symbols. Although these methods have achieved certain results in specific cases, they require the image symbols to be pre-segmented, which increases the workload. At the same time, for images with complex backgrounds and noise, the segmentation process may introduce errors, affecting the overall recognition performance. The BPNN structure model was trained using the MATLAB function library to classify electrical graphic symbols. However, its experimental results show that image noise has a significant impact on the recognition accuracy of the model. In practical applications, engineering drawings often contain various noises and interferences, and how to improve the robustness of the model remains a challenge.
[0004] The proposed multi-dimensional information section decoupling technology of the intelligent substation configuration description model is mainly used in the construction, reconstruction and expansion of substations, and lacks in-depth research on information management in the operation and maintenance stage. This leads to insufficient dynamic updating and management of the secondary system model throughout the life cycle of the substation, which affects the operation and maintenance efficiency; the information model of the SCL language has been visualized, but due to the complexity of the SCL language itself, the information model is still difficult to understand. This increases the difficulty of understanding and operation for operation and maintenance personnel and non-professional technicians, which is not conducive to the maintenance and management of the substation system; in the study of the unified database of large power grids, the problem of inefficiency of relational databases in executing complex connections and nested queries has become increasingly prominent. When processing large-scale, highly complex power grid data, the performance bottleneck of traditional relational databases limits real-time performance and data processing capabilities.
[0005] However, the existing engineering drawing recognition and substation secondary circuit modeling technologies have many limitations, which are 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, lack 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 is currently no universal modeling tool for substation secondary circuit model files, resulting in a lack of uniformity in model establishment and management, information isolation, and difficulty in achieving effective data integration and sharing; (3) Low degree of automation and intelligence: The existing methods require a lot of manual intervention in the recognition and modeling process of drawings, such as manual segmentation of image symbols, feature extraction, etc., which is labor-intensive and error-prone, and cannot meet the modern power system's demand for efficient and accurate automated modeling. Summary of the invention
[0006] In view of the above existing problems, in order to solve the problem of realizing automatic recognition of graphic elements and logos in CAD drawings, accurately analyzing information such as electrical components, connecting lines and text annotations, the present invention makes full use of the visual language pre-training model, and proposes a method for effectively solving the understanding of substation CAD drawing elements, thereby realizing the task of understanding substation CAD drawing elements; in view of the problem that the information related to the secondary circuit of the existing substation is mainly carried in the form of graphics and text in the CAD drawings, and the data information cannot be effectively carried and applied, the CAD drawing information is modeled. The substation secondary circuit information contained in the CAD drawing is extracted using the visual language model method, and the digital modeling of the substation secondary circuit is realized based on the digital model framework of the substation secondary system, and the digital model is used for advanced engineering applications such as secondary full circuit display and auxiliary measures.
[0007] In order to solve the above technical problems, a secondary circuit intelligent modeling method based on visual language model is proposed, including:
[0008] By identifying and extracting graphics and symbols from the secondary circuit of the substation and building a graphics library; obtaining the corresponding first visual language data in the graphics library through the graphics recognition and classification module; further deep learning and recognition of the first visual language data to obtain second visual language data; secondary electrical circuit modeling is carried out through the second visual language data and visual display is performed.
[0009] As a preferred solution of the secondary circuit intelligent modeling method based on the visual language model described in the present invention, wherein: the first visual language data includes, the graphic element library summarizes and completes the first predefined template through the visual language model and performs text and visual prompts;
[0010] Calculate the similarity of text and image features through feature adaptation;
[0011] Calculate the image category probability of the 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 a threshold, the model is considered to be matched, and the classification result is output as first visual language data.
[0013] As a preferred solution of the secondary circuit intelligent modeling method based on the visual language model described in the present invention, wherein: the second visual language data includes the first visual language data being input into the electrical system after being subjected to overall context analysis and entity recognition;
[0014] Determine the specific information of the first visual language data and its role in the system, and output the correct prediction result as the second visual language data;
[0015] Input the second visual language data into the CAD graphics for feature modeling and attribute definition, and complete the modeling of the entire secondary electrical circuit through the defined node types;
[0016] Extract and analyze the features of the circuits connecting the power nodes in the model file.
[0017] As a preferred solution of the secondary circuit intelligent modeling method based on the visual language model described in the present invention, the context analysis includes obtaining the information of the device through the rectangular area, matching the text information nearby to mark the position, locating the device area where the electrical symbol is located, and matching the text information nearby in turn;
[0018] Based on the graph theory deep traversal priority search algorithm, the connection relationship information is obtained, the equipment area with the smallest rectangle where the electrical symbol is located is located, the electrical symbol is used as the starting point, and the end point of the path is the electrical symbol or the straight line marked with the terminal equipment information, the connection relationship of the substation image is obtained, and the text information is matched in sequence;
[0019] Repeat the matching process until all rectangular areas are traversed and an undirected connected topological graph is obtained;
[0020] The information containing the physical equipment and the physical cable connection relationship between them is matched and identified by regular expressions, parsed into a digital description of the substation image in XML format based on the document object model, and the IMCD file corresponding to a single drawing is generated.
[0021] As a preferred solution of the secondary circuit intelligent modeling method based on the visual language model described in the present invention, the entity recognition includes identifying the entities in the drawings after context analysis, including the equipment name, model, and parameters, and the entity recognition is divided into text area positioning based on CTPN to construct multi-scale feature extraction and content recognition of the text area using CRNN technology;
[0022] The text area positioning based on CTPN for multi-scale feature extraction includes: using VGG-16 to extract picture features, connecting a maximum pooling layer, scaling the input picture and inputting it into the model, using the first four convolutional layers and three maximum pooling layers of VGG-16 to perform pooling operations, obtaining three feature maps, sending the features to the bidirectional LSTM to continue learning the sequence features of the picture, connecting to the parameters predicted by the output of the previous fully connected layer FC, including foreground and background scores, position and horizontal correction, performing area positioning on the annotated texts of different sizes in the drawings, and cutting the text areas one by one and sending them to the CRNN model to recognize the annotated content;
[0023] The method of using CRNN technology to perform content recognition on the text area includes: after determining the position of the annotated text in the drawing, adjusting the input image to a fixed height, scaling the image width in the same proportion, inputting it into the convolutional layer to extract a feature map containing only the image spatial features, using a recurrent layer-bidirectional LSTM network to learn the sequence features of the image, and inputting each column of the feature map into the LSTM as a time slice. The LSTM input sequence is set to x through the improved CTC β transformation, and the character sequence to be recognized is l. The sequence represents the predicted character sequence transformed from β to l, and the maximum CTC probability sum is:
[0024] p(l|x)=∑ π.β(π)=l p(π|x)
[0025] Among them, for any predicted sequence, p(π|x) represents the probability that sequence x is recognized as the character at position t in path π at position t:
[0026]
[0027] The gradient adjusts the LSTM parameter w so that p(π|x) is maximized when the input sample is π(β(π)=l):
[0028]
[0029] A forward-backward algorithm is used to find all correct prediction sequences to reduce the time complexity of finding the correct prediction sequence. After finding the correct sequence, the LSTM parameter w is gradient optimized again. After the LSTM transformation, the correct prediction result is output as the second visual language data.
[0030] As a preferred solution of the secondary circuit intelligent modeling method based on the visual language model described in the present invention, wherein: the secondary circuit modeling includes, when establishing the model file, the secondary circuit modeling module specifies a power supply node as a starting point for each circuit, and determines the type of each sub-node including open input, open output, modular input and power supply, forming a complete circuit, and completing the modeling of the entire secondary circuit through the defined node type;
[0031] The feature modeling and attribute definition includes establishing a panel cabinet and device model for the panel cabinet and device in the substation according to the SPCD modeling specification, and establishing a component model according to the components configured in the panel cabinet;
[0032] Establishing a terminal model according to the number of terminals of the device and components includes distinguishing board components and not distinguishing board components. The distinguishing board components establishes corresponding board information including power supply, input, output, sampling, and terminal segment boards. The not distinguishing board components establishes a terminal model on the board after establishing one board by default, and defines the terminal name and serial number attributes;
[0033] A node model is established based on the internal connection relationship of the terminals. When there is an internal loop or relay between two terminals to disconnect or close the terminals, the current two terminals are defined as a secondary 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 electrical circuit is modeled by selecting a power node at a starting point, starting from the positive terminal of the power node, connecting the terminals through which the entire electrical circuit passes in sequence, and creating in-panel wiring and short connectors, inter-panel cables and fiber cores according to the type of cable used between the two terminals, and using in-panel wiring, short connectors or cable cores to connect the terminals on both sides;
[0035] When the terminal on one side of the connection is a terminal in a sub-node, select the other terminal of the current sub-node to continue modeling the remaining connections in the current electrical circuit;
[0036] When the terminal connected to is the negative terminal in the power supply node at the starting point, the modeling of the entire electrical circuit is completed;
[0037] When there are n paths in the electrical circuit between one pair of power supply nodes, the previous operation is repeated until all electrical circuit models are established.
[0038] As a preferred solution of the secondary circuit intelligent modeling method based on the visual language model described in the present invention, the feature extraction and analysis includes: identifying the extracted graphic primitive symbols through the visual language model, performing feature modeling on the CAD graphics, extracting the graphic features using image processing technology, and automatically matching them with the predefined model;
[0039] The automatic matching includes selecting a part of the elements of any feature primitive in the feature primitive library as a key value, taking the key value key attribute to traverse all the element attributes in the identified CAD drawing for matching, and then matching the remaining attributes in turn. When all the attributes are matched, the key value elements are matched; when any attribute match is unsuccessful, the next feature primitive is selected in the feature primitive library, and all the feature primitives in the feature primitive library are matched with the graphics in the CAD drawing;
[0040] When the elements contained in the feature primitive are matched successfully, the primitive is replaced, 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, and the key value attribute matching is repeated to determine whether the attributes of the remaining elements of the CAD graphic in the area covered by the current primitive 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 attributes corresponding to the text are matched according to the definition of the feature model;
[0041] When the automatic matching finds unrecognized parts of the CAD drawings, human-computer interaction is used to select the unrecognized parts as feature graphics elements, and feature recognition is performed again. The circuits connecting the power nodes in the model file are analyzed and retrieved, and the analysis results are used to generate secondary power circuit information of the smart substation for visual display.
[0042] Another object of the present invention is to provide a secondary circuit intelligent modeling system based on a visual language model, which improves the efficiency and accuracy of secondary circuit design and reduces human errors; realizes rapid analysis and automatic modeling of secondary circuit design drawings and reduces dependence on professionals; quickly generates secondary circuit models through intelligent means and displays them visually, which facilitates the analysis, maintenance and upgrading of power systems; promotes the process of automation and intelligence in power system design and improves the safety and reliability of power systems.
[0043] As a preferred solution of the secondary circuit intelligent modeling system based on the visual language model described in the present invention, it is characterized by comprising a graphic element and symbol collection input module, a visual language module, and a secondary circuit 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 logos in the drawings, and ensures a correct understanding of the meaning and function of each graphic element in the electrical system through context analysis and entity recognition.
[0046] The secondary circuit modeling module includes a model attribute definition module, a feature extraction module, a node module, a circuit analysis and retrieval module, and a visualization display generation module, which realizes a visualization display diagram of secondary power circuit information and completes the modeling and analysis of the secondary power circuit of the smart substation.
[0047] A computer device includes a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of the secondary circuit intelligent modeling method based on a visual language model are implemented.
[0048] A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the secondary circuit intelligent modeling method based on a visual language model are implemented.
[0049] Beneficial effects of the present invention: In order to solve the development of a general modeling tool for substation secondary circuit model files, so as to realize automatic recognition of graphic elements and logos in CAD drawings, accurately parse information such as electrical components, connecting lines and text annotations, make full use of the visual language pre-training model, and propose an effective method for understanding elements based on substation CAD drawings. In the text encoding link, multiple learnable text prompts are integrated to explore the influence of the category labels of each element of the CAD image at different positions on the generalization effect of the model. Secondly, in the CAD image encoding process, learnable visual prompts are introduced to better utilize the image pre-training parameters to represent the substation secondary circuit elements. A feature adaptation module is added after the CAD and text feature encoding, and the entire network is fine-tuned on a specific image classification data set, so as to enhance its performance in the task of understanding elements of substation CAD drawings, realize automatic recognition of graphic elements and logos in CAD drawings, and accurately parse information such as electrical components, connecting lines and text annotations.
[0050] Digital modeling is performed on CAD drawing information. The substation secondary circuit information contained in the CAD drawing is extracted using the visual language model method. Digital modeling of the substation secondary circuit is achieved based on the substation secondary system digital model framework. The digital model is used for advanced engineering applications such as secondary full circuit display and auxiliary measures. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the 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 work, among which:
[0052] Figure 1 An overall diagram of a secondary circuit intelligent modeling method based on a visual language model provided by an embodiment of the present invention.
[0053] Figure 2 A module workflow diagram of a secondary circuit intelligent modeling method based on a visual language model is provided as an embodiment of the present invention.
[0054] Figure 3 A schematic diagram of a modeling method for a secondary circuit intelligent modeling method based on a visual language model is provided as an embodiment of the present invention.
[0055] Figure 4 An example diagram of extracted graphic elements and identification of a secondary circuit intelligent modeling method based on a visual language model is provided according to an embodiment of the present invention.
[0056] Figure 5 An example diagram of establishing a graphic primitive library for a secondary circuit intelligent modeling method based on a visual language model provided by an embodiment of the present invention.
[0057] Figure 6 An example diagram of the context analysis and entity recognition experimental process of a secondary loop intelligent modeling method based on a visual language model provided by an embodiment of the present invention.
[0058] Figure 7 An example diagram of device attribute description in a model format of a secondary circuit intelligent modeling method based on a visual language model is provided as an embodiment of the present invention.
[0059] Figure 8 An example diagram of complete loop node definition and modeling of a secondary loop intelligent modeling method based on a visual language model provided by an embodiment of the present invention.
[0060] Fig. 9An example diagram of loop information recording of a secondary loop intelligent modeling method based on a visual language model provided by an embodiment of the present invention.
[0061] Fig.10 An example diagram of a visualization display of a secondary circuit intelligent modeling method based on a visual language model provided by an embodiment of the present invention.
[0062] Fig.11 A schematic diagram of the structure of an intelligent modeling terminal of a secondary circuit intelligent modeling system based on a visual language model is provided as an embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0064] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0065] Secondly, the term "one 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 term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it an embodiment that is mutually exclusive with other embodiments, either individually or selectively.
[0066] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0067] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0068] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0069] Example 1, reference Figure 1-Figure 10 , which is the first embodiment of the present invention, and provides a secondary circuit intelligent modeling method based on a visual language model, such as Figure 1 As shown, including:
[0070] S1: Identify and extract graphics and symbols from the secondary circuit of the substation and build a graphics 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 secondary circuit, such as graphic elements and logos, etc. Figure 4 shown.
[0072] S20: Through the extensive collection of graphics and symbols in S10, the visual language module will establish a comprehensive graphics library to lay the data foundation for subsequent processes, such as Figure 5 shown.
[0073] S2: Acquire the corresponding first visual language data in the graphic element library through a graphic element recognition and classification module.
[0074] Furthermore, S30, the template matching strategy in the graphic element recognition and classification module is used to automatically and correctly classify various graphic elements and symbols in the graphic element library established in step S20.
[0075] The main types of identification components include: coils, contacts, switches, windings, power supplies, panel 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, preprocesses the drawings in a unified input format, and builds a graphic element library: summarizes and completes predefined templates from existing drawings and standard illustrations provided by equipment component manufacturers. Design matching models for graphic elements and templates.
[0078] The region of the primitive group is cut out from the drawing, and the electrical primitives in the region are retained. In the text branch, the image category is used in different positions (front, middle, and back) in the text prompt to construct a learnable text prompt; in the image branch, the learnable vector is added to the image encoder as a visual prompt.
[0079] Add feature adapters after the encoders of the image branch and text branch respectively.
[0080] The similarity between text features and image features is calculated by taking the dot product of them and used as the probability value of the corresponding category; for image features, an additional fully connected layer is added to represent the image category probability, which is added to the image-text similarity score as the final image classification score.
[0081] The probability that the primitive belongs to each template is obtained through Logistic regression, and the cross entropy loss function is used to supervise and optimize the entire network. Matching judgment: Using the model trained by the cross entropy loss function, in the prediction results of the primitive group, only when the score of the template category with the highest score is greater than the given threshold, the primitive group is considered to be successfully matched with the template; for the primitive group that does not belong to the defined template, the original detected primitives and other results are directly presented. Finally, according to the matching results, the primitives are automatically classified and the classification results are output.
[0082] The feature adapter consists of an image encoder and a text encoder of the CLIP model; the image encoder is used to map a high-dimensional image to a low-dimensional embedding space, and the text encoder is used to generate text feature representations from natural language.
[0083] In the training phase, the input image and text data are encoded into image features and text features, and then the cosine similarity between the image features and the text features is calculated. The 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] tag is filled with the class name, and then a text encoder is used to generate a set of text feature vectors {w i}i=1K, where K represents a total of K categories, and each category corresponds to a text feature vector.
[0085] Assume an image x, f is the image feature extracted by the image encoder, τ is the temperature parameter learned by the CLIP model, and the predicted probability of the image category is calculated as:
[0086]
[0087] The graphic library summarizes and completes the first predefined template through the visual language model and provides text and visual prompts:
[0088] Figure 3 Processing of text prompts: For text prompts, the text prompts are constructed at different positions in the text prompts according to the image category, in the form of:
[0089] t=[v]1[v]2…[v] M [class]
[0090] Among them: each v m (m∈{1,2,…,M}) is a vector with the same dimension as the word embedding, M is a hyperparameter for the number of context vectors, and M=16 is taken. By inputting the prompt text t into the text encoder g(·), a set of text feature vectors can be obtained. At this time, the image category prediction probability is:
[0091]
[0092] Each text prompt t i The [class] token in is replaced by the word embedding vector corresponding to the i-th category.
[0093] Place the category label at the end of the text prompt processing to the middle of the sequence, such as:
[0094]
[0095] Similarly, place the category label at the front of the prompt sequence, such as:
[0096] t=[class][v]1[v]2…[v] M
[0097] This increases the flexibility of learning. The vector before the category tag can be used to describe the category, and the vector after it can be used to supplement the category. Therefore, the text prompts of the three category tags at different positions are integrated. Specifically, the three groups of weights obtained from the three text prompts are fused into one group to fully explore the impact of the image category at different positions in the prompt sentence on the generalization performance of the model.
[0098] Figure 3 Visual cue processing: First, use v i T divides the input CAD drawing into multiple small blocks; then passes through a linear projection layer to obtain image embedding representation; finally, after adding the corresponding position encoding to these image embeddings, they are input into the Transformer encoder layer for calculation. iWhen T, the method of adding the visual cue to the corresponding value of the image embedding is adopted: a visual cue vector P0 with the same dimension as the image embedding E0 is added element by element to E0, and then input into the Transformer encoder layer for calculation after adding the position encoding. Similarly, a visual cue vector is provided to the ResNet network, and the image feature E0 is obtained after passing through the stem block of the ResNet network. Then E0 is added element by element to the visual cue vector P0 of the same dimension, and then input into the subsequent stages of the network for calculation.
[0099] Calculate the similarity of text and image features through feature adaptation:
[0100] Figure 3 Text feature adapter and image feature adapter: The adapter consists of a fully connected layer for dimensionality reduction, a nonlinear activation function, a fully connected layer for dimensionality increase, and a residual connection. The adapters are used for 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 input into the corresponding image adapter A respectively. v (·) and text adapter A t (·), are learnable parameters in the adapter, and the new image features f' and text features w' are obtained, which are expressed as:
[0101]
[0102] Figure 3 Image category probability embedding method: By using the stronger discrimination ability of the traditional image classification training method to assist the training of image-text matching, the network has better generalization ability and improves the classification accuracy.
[0103] Specifically, the image features f' and text features w' obtained after the feature adapter is calculated use the prediction probability calculation formula of the image category, and the similarity between the image features and the text features is used as the classification prediction score s; the image feature f' is then input into the fully connected layer to obtain the image category probability q; let N be the total number of training samples, l be the label, add the classification prediction score s to the image category probability q, and calculate the cross entropy loss, that is:
[0104]
[0105] The classification result is output as first visual language data.
[0106] The present invention introduces a visual language pre-training model to achieve highly intelligent CAD drawing recognition: The present invention innovatively applies the visual language pre-training model to the field of engineering drawing recognition, breaking through the traditional rule-based and template matching methods. By integrating computer vision and natural language processing technology, the model can process graphic and text information at the same time, and automatically recognize and accurately parse the graphics and logos in CAD drawings. This method theoretically expands the application scope of the visual language model, enhances the model's robustness to complex graphics, sticky characters and noise interference, and solves the problem that traditional methods cannot effectively process complex engineering drawings.
[0107] S3: Perform further deep learning recognition on the first visual language data to obtain second visual language data.
[0108] S4: Modeling of secondary electrical circuits and visualization of them using second visual language data.
[0109] The first visual language data is input into the electrical system after overall context analysis and entity recognition;
[0110] Determine the specific information of the first visual language data and its role in the system, and output the correct prediction result as the second visual language data;
[0111] Input the second visual language data into the CAD graphics for feature modeling and attribute definition, and complete the modeling of the entire secondary electrical circuit through the defined node types;
[0112] Extract and analyze the features of the circuits connecting the power nodes in the model file.
[0113] Example 2, reference Figure 1-Figure 10 , which is the first embodiment of the present invention, and provides a secondary circuit intelligent modeling method based on a visual language model, comprising:
[0114] S1: Identify and extract graphics and symbols from the secondary circuit of the substation and build a graphics library.
[0115] S2: Acquire the corresponding first visual language data in the graphic element library through a graphic element recognition and classification module.
[0116] The graphic library summarizes and completes the first predefined template through a visual language model and performs text and visual prompts;
[0117] Calculate the similarity of text and image features through feature adaptation;
[0118] Calculate the image category probability of the 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 a threshold, the model is considered to be matched, and the classification result is output as first visual language data.
[0120] S3: Perform further deep learning recognition on the first visual language data to obtain second visual language data.
[0121] The first visual language data is input into the electrical system after overall context analysis and entity recognition:
[0122] S40, through the deep learning method of the context analysis module 203 and the entity recognition module 204, ensure that the computer correctly understands the meaning and function of each element in the graphic element library in the electrical system, such as Figure 6 shown.
[0123] Specific execution process of the context analysis module: Design an image topology information parsing algorithm to analyze the graphics elements and connecting lines in the image, parse and construct their topological relationships, thereby analyzing the contextual relationships of the graphics elements in the drawing, understanding their positions and functions in the electrical circuit, and ensuring that the recognition of graphics elements is not only based on shape, but also considering their functions and connection relationships in the circuit.
[0124] First, obtain the device information through the rectangular area: classify and sort the straight lines, extract pairs of straight lines, and traverse the vertical and horizontal lines with the maximum length in a counterclockwise direction to find several closed and connected rectangular areas, i.e., physical devices;
[0125] The position is marked by matching the text information nearby, and the length and width ratio threshold of the maximum area rectangle is used to determine whether the substation image is a vertical object or a horizontal object. Then, the upper left corner of each rectangular area is used as the coordinate origin, and the coordinates are traversed from small to large, from left to right, in sequence in the straight lines and electrical symbols in the equipment area, and all the smallest rectangular areas with inclusion relationships are found. The equipment area where the electrical symbols are located is located, and the text information is matched nearby in sequence.
[0126] The information of connection relationship is obtained based on the graph theory deep traversal priority search algorithm: the electrical symbols or terminal devices are taken as nodes, the connecting lines are taken as edges, and the topology diagram is constructed using the adjacency table. The connection relationship of the model is a long straight line, which has no intersection with the short straight line, is complementary to each other, and there is no oblique line.
[0127] Locate the equipment area of the smallest rectangle where the electrical symbol is located, take the electrical symbol as the starting point, traverse all the straight lines outside the rectangular area, perform graph theory depth traversal priority search traversal, find the topological path with the nearest Euclidean distance, traverse the long straight lines connected to it in turn (excluding the straight lines of the equipment), and match the text annotations of the nodes and edges. The end point of the path is the electrical symbol or the straight line annotated with the terminal equipment information, obtain the connection relationship of the substation image, and match the text information in turn.
[0128] Repeat the above process until all rectangular areas are traversed and an undirected connected topology graph is obtained. According to the attribute information of the elements in the standard smart substation configuration file, the information containing the physical equipment and the physical cable connection relationship is matched and identified by regular expressions, and judged and classified from one level to the next level. Based on the parsing solution of the document object model, it is parsed into a digital description of the substation image in XML format, and the IMCD file corresponding to a single drawing is generated.
[0129] The entity recognition module is divided into two modules: entity region detection and content recognition. First, in the annotation text region detection module, a text region detection model with multi-scale feature extraction is constructed based on CTPN to solve the problem of regional positioning of annotation texts of different sizes in drawings; then, in terms of text recognition, CRNN technology is used to process the detected text region to obtain the content of the annotation text.
[0130] The improved text region detection method based on the CTPN model first uses VGG-16 to extract image features. Each convolution model of VGG-16 first uses a 3*3 convolution kernel with a step size of 1 for convolution to obtain a feature map with the same width and height as the input size. It is then connected to a 2*2 maximum pooling layer with a step size of 2 to obtain a feature map with a width and height that is 1 / 2 of the input size.
[0131] The input image is scaled to 1920*1920 pixels and input 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, that is, 240*240. Then three maximum pooling layers are used, with sizes of 2*2, 3*3, and 4*4, respectively. The feature map is pooled with steps of 2, 3, and 4, respectively. Finally, feature maps with widths and heights of 120*120, 80*80, and 60*60 can be obtained. After obtaining the three feature maps, the feature maps are sent to the bidirectional LSTM to continue learning the sequence features of the image. Finally, the predicted parameters are output by the next fully connected layer FC, namely: foreground and background scores, position, and horizontal correction.
[0132] After determining the position of the annotated text in the drawing, adjust the input image to a fixed height, scale the image width in the same proportion, and input it into the convolutional layer to extract the feature map containing only the image spatial features. Use the recurrent layer-bidirectional LSTM network to learn the sequence features of the image. Each column of the feature map is input into the LSTM as a time slice. Through the improved CTC β transformation, the LSTM input sequence is set to x, the character sequence to be recognized is l, and the sequence representation is transformed from β to l into the predicted character sequence. Then the maximum CTC probability sum is:
[0133] p(l|x)=∑ πβ(π)=l p(π|x)
[0134] Among them, for any predicted sequence, p(π|x) represents the probability that sequence x is recognized as the character at position t in path π at position t:
[0135]
[0136] The gradient adjusts the LSTM parameter w so that p(π|x) is maximized when the input sample is π(β(π)=l):
[0137]
[0138] The forward-backward algorithm is used to find all correct prediction sequences to reduce the time complexity of finding the correct prediction sequence. After finding the correct sequence, the LSTM parameter w is gradient optimized again:
[0139]
[0140] After transformation by LSTM, the correct prediction result is output as the second visual language data.
[0141] The specific information of the first visual language data and its role in the system are determined, and the correct prediction result is output as the second visual language data.
[0142] S4: Modeling of secondary electrical circuits and visualization of them using second visual language data.
[0143] Input the second visual language data into the CAD graphics for feature modeling and attribute definition, and complete the modeling of the entire secondary circuit through the defined node type:
[0144] S50: Define the model formats of various devices, components, terminals, nodes and cables in the secondary circuit of the substation, and perform feature modeling in CAD graphics, such as establishing attributes such as device name, device description, device model, device identification and device batch, such as Figure 7 shown.
[0145] S60: When establishing the model file, the secondary circuit modeling module specifies a power node as the starting point for each electrical circuit, and determines the type of each secondary node, including open input, open output, modular input and power supply, to form a complete circuit. The entire secondary electrical circuit modeling is completed through the defined node type, such as Figure 8 shown.
[0146] According to the SPCD modeling specification, the panel cabinet and device models are established for the panel cabinets and devices in the substation, and the attributes including name and model are defined.
[0147] Component models are established based on the components configured in the cabinet, including cabinet terminal blocks, circuit breakers, pressure plates, power supplies, indicator light sensors, and transfer switches, and attributes such as name and model are defined.
[0148] Establishing a terminal model according to the number of terminals of the device and components includes distinguishing board components and not distinguishing board components. The distinguishing board components establishes corresponding board information including power supply, input, output, sampling, and terminal segment boards. The not distinguishing board components establishes a terminal model on the board after establishing one board by default, and defines the terminal name and serial number attributes;
[0149] A node model is established based on the internal connection relationship between the terminals. When there is an internal loop or relay between two terminals to disconnect or close the terminals, the current two terminals are defined as a sub-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 electrical circuit is modeled by selecting a power node at a starting point, starting from the positive terminal of the power node, connecting the terminals through which the entire electrical circuit passes in sequence, and creating in-panel wiring and short connectors, inter-panel cables and fiber cores according to the type of cable used between the two terminals, and using in-panel wiring, short connectors or cable cores to connect the terminals on both sides;
[0151] When the terminal on one side of the connection is a terminal in a sub-node, select the other terminal of the current sub-node to continue modeling the remaining connections in the current electrical circuit;
[0152] When the terminal connected to is the negative terminal in the power supply node at the starting point, the modeling of the entire electrical circuit is completed;
[0153] When there are n paths in the electrical circuit between one pair of power supply nodes, the previous operation is repeated until all electrical circuit models are established.
[0154] When each sub-model is established, it is saved in XML file format, thus completing the modeling of the entire secondary electrical circuit.
[0155] The extracted graphic primitive symbols are identified by the visual language model 20, and feature modeling is performed on the CAD graphics. Graphic features are extracted using image processing technology and matched with predefined models.
[0156] Automatic feature recognition is based on the comparison between the feature primitive library and the CAD drawing. The recognition process is: select a certain part of the element of any feature primitive in the feature primitive library, use this element as the key value, take its key attribute to traverse all the element attributes in the recognized CAD drawing for matching, and then match other attributes in turn. If all attributes match, the key value element matches;
[0157] If the matching is unsuccessful, the next feature primitive is selected in the feature primitive library, and so on, and all the feature primitives in the feature primitive library are matched with the graphics in the CAD drawing.
[0158] If the elements contained in the feature primitive are matched successfully, the primitive is replaced, and the coordinates of the graphic in the CAD drawing are extracted, and the feature primitive containing this element is moved to the coordinate position of the CAD graphic to be identified. In this way, the range of traversal patterns is reduced and the efficiency of image recognition is improved. Then the key-value attribute matching method is repeatedly used to determine whether the attributes of other elements of the CAD graphic in the area covered by this primitive are consistent with the attributes of all elements of the feature primitive. The successfully matched CAD graphics are then merged into a block, the text information is extracted, and the SLCD attributes corresponding to the text are matched according to the definition of the feature model.
[0159] For the recognition of similar graphics contained in the CAD drawing, repeat the above feature matching method and use the feature primitive to match the entire drawing. One feature primitive can be used to match and recognize all similar graphics containing the same graphics and text positions. Using one device graphic as a feature primitive, multiple device graphics can be recognized at the same time.
[0160] For the CAD pattern parts that are not recognized by automatic matching, it is necessary to use the human-computer interactive feature recognition method to recognize them again, that is, select the unrecognized parts as feature primitives, and then perform feature recognition.
[0161] First, select CAD graphics and text and create them as feature primitives. The main parameters of graphics are the shape, size and block attributes of graphics, and the main parameters of text are the position of text relative to graphics, the length of text, etc. CAD graphics are used as the first element and 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 the CAD graphics are feature modeled to establish attributes such as device name, device description, device model, device identification and device batch. The feature primitives are classified and stored in the feature primitive library, and the feature primitive library is continuously enriched in this way to improve the automatic recognition rate. The subsequent image recognition process of human-computer interactive feature recognition is the same as automatic feature recognition.
[0163] Automatic feature recognition does not require manual intervention, which reduces the workload of image recognition, but the amount of calculation is relatively large. The images and feature libraries are classified to reduce the number of matches, thereby improving the efficiency of identifying CAD images. Interactive feature recognition is then used to check for omissions and fill in the gaps. The two recognition methods work together to ensure the efficiency and recognition rate of CAD image recognition.
[0164] Step S70: By analyzing the circuits connected between the power supply nodes in the model file, the secondary circuit modeling module will record the relevant information of each circuit, such as the current transmission path, voltage relationship, etc. Fig. 9 shown.
[0165] The analysis and retrieval process of a complete secondary electrical circuit takes each secondary power 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 it ends at the negative terminal of the power supply.
[0166] Analyze the electrical connection information. Analyze the substation electrical circuit model file, traverse all the panels, select each panel in turn, analyze the electrical connection information by panel, and record the terminal information of the panel wiring and short connector and the panel cable core on both sides according to each panel wiring and short connector or panel cable and its core. Analyze the panel terminal and node information.
[0167] Select each cabinet in turn, traverse all terminals in the selected cabinet, record their names, traverse all node information in the cabinet, record the type of each sub-node and the names of the two terminals in the node. Analyze the electrical circuit information.
[0168] Select each cabinet in turn. If there is a power node in the cabinet, start the search from the positive terminal of the node, and search for the opposite terminal information connected to the positive terminal in the electrical connection information. If the opposite terminal does not belong to any node, use the opposite terminal name to search for the next-level opposite terminal connected to it in the electrical connection information; if the opposite terminal belongs to the node, then according to the node information, get the name of another terminal in the node, and use the other terminal name to search for the next-level opposite terminal connected to it in the electrical connection information; when the opposite terminal searched in the electrical connection information is the negative terminal in the starting power node, the search for the electrical circuit ends; record the name information of all terminals, nodes, wiring and short connectors in the cabinet, and cable cores of the cabinet that the electrical circuit passes through to complete the electrical circuit search.
[0169] After completing the electrical circuit search for the power nodes in all the cabinets and recording the name information of all the terminals, nodes, wiring in the panel and short connectors, and cable cores of the cabinets through which each electrical circuit passes, the analysis of the electrical circuit model of the entire substation is completed.
[0170] Step S80: The secondary circuit modeling module generates a visual display diagram of the secondary circuit information of the smart substation, which intuitively presents the structure, connection and parameters of the circuit. Fig.10 shown.
[0171] The present invention develops a universal substation secondary circuit model file modeling tool to achieve information structuring and standardization: The present invention proposes a universal secondary circuit modeling tool, which is based on the SDL (Substation Description Language) structured template and defines the model formats of devices, components, terminals, nodes, cables, etc. in the substation secondary circuit. By establishing a unified and standardized secondary circuit information structured model, unified model management and effective data integration are achieved. This innovation theoretically provides a unified model framework, solves the problems of information isolation and difficulty in data sharing, and lays the foundation for the development of digital asset management systems and the establishment of integrated application interfaces (APIs).
[0172] Achieve fully automated secondary circuit modeling and improve modeling efficiency and accuracy: The present invention uses visual language models and deep learning technology to automatically complete the recognition of primitives, feature extraction and model building in CAD drawings, reducing reliance on manual intervention. By designing primitive recognition and classification, context analysis and entity recognition modules, accurate parsing of electrical components, connecting lines and text annotations is achieved, and a digital model of the secondary circuit is automatically generated. This technical solution theoretically improves the degree of automation of engineering drawing recognition and modeling, improves modeling efficiency and accuracy, and meets the needs of modern power systems for efficient and accurate automated modeling.
[0173] Embodiment 3, the third embodiment of the present invention, is different from the first two embodiments in that:
[0174] If the functions are implemented in the form of 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 the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0175] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0176] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0177] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0178] Example 4, reference Fig.11 , which is the fourth embodiment of the present invention, provides a secondary circuit intelligent modeling system based on a visual language model, including a graphic element and symbol collection input module 10, a visual language module 20, and a secondary circuit modeling module 30.
[0179] like Fig.11 As shown, the graphic element and symbol collection and input module 10 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.
[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; the visual language model is used to automatically classify different graphic elements and logos in the drawings, and through context analysis and entity recognition, the meaning and function of each graphic element in the electrical system are correctly understood;
[0181] Classify and sort the graphic elements and symbols collected by the graphic element and symbol collection input module 10 to build a comprehensive graphic element library, which is used to store and manage all graphic elements that may appear in the drawings and provide basic data for subsequent recognition and classification;
[0182] The graphic element recognition and classification module 202 can automatically recognize and classify graphic elements and symbols in CAD drawings, and use image processing and pattern recognition technology to adopt a template matching strategy to match the recognized graphic elements with the data in the graphic element library;
[0183] The context analysis module 203 designs an analysis algorithm for image topology information, that is, by analyzing the graphic elements and connecting lines in the image, analyzing and constructing their topological relationships, thereby analyzing the contextual relationships of the graphic elements in the drawing, understanding their positions and functions in the electrical circuit, and ensuring that the recognition of the graphic elements is not only based on the shape, but also considering their functions and connection relationships in the circuit;
[0184] The entity recognition module 204 recognizes entities in the drawings, such as device names, models, parameters, etc. Through entity recognition, the specific information of each graphic element and its role in the system can be understood more accurately.
[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 analysis and retrieval module 304, and a visualization display generation module 305, which realizes a visualization display diagram of the secondary circuit information and completes the modeling and analysis of the secondary circuit of the smart substation;
[0186] Model attribute definition module 301, model attribute definition module 301, is used to define the model format of devices, components, terminals, nodes and cables in the secondary electrical circuit of the substation. Detailed attributes are established for each device, including device name, device description, device model, device identification and equipment batch. In order to structure the expression of design results, facilitate circulation and management, the configuration files IDD, CDD and SDD based on SDL are introduced. SDD file substation design configuration description file should be unique throughout the station. This file describes the complete secondary circuit physical configuration and connection topology of the substation, and the extension name is .scd. SDD contains the information of the panel cabinet CDD, as well as the connection information of cables, optical cables, etc. between the panel cabinets. CDD file: Cubicle Design Description (panel cabinet white map, terminal strip map) panel cabinet design description file, used to describe the equipment configuration, schematic diagram, and wiring relationship of the secondary panel cabinet, and the extension name is .cdd. The CDD file contains the material information, connection information, and secondary equipment IDD information in the panel cabinet. IDD file: IED Design Description (device schematic diagram) device design description file, used to describe the device board, terminals, device configuration diagram, schematic diagram, wiring diagram, the extension is .idd;
[0187] The SDL structured template includes four hierarchical attributes: Header element, which represents the SDL header information and specifies the version, configuration tool, and file CRC of the SDL file. Substation element, which represents the substation and defines a complete substation secondary circuit entity. Cubicle element, which represents the panel cabinet, contains information such as panel cabinet accessories (materials), panel assembly results, and internal wiring. Device element, which represents the secondary physical device, contains device information, boards, terminals, etc., where the terminals use different type values according to different modeling attributes. ModelTemplates: Model template information, optional, empty by default.
[0188] The feature extraction module 302 recognizes the extracted graphic primitive symbols through the visual language model 20 and performs feature modeling on the CAD graphics. The graphic features are extracted using image processing technology and matched with the predefined model;
[0189] A node module 303 specifies a power node as a starting point for each electrical circuit;
[0190] The circuit analysis and retrieval module 304 analyzes and retrieves the circuits connected between the power supply nodes in the model file, and records the relevant information of each circuit, such as connection mode, node type and device attributes;
[0191] The visualization generation module 305 generates a visualization diagram of the secondary electrical circuit information based on the results of the analysis and retrieval of the module 304. It provides an intuitive user interface to display the structure and properties of the electrical circuit, which is convenient for users to understand and operate.
[0192] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A secondary circuit intelligent modeling method based on a visual language model, characterized by: include, Identify and extract graphics and symbols from the secondary circuit of the substation and build a graphics library; Acquire the first visual language data corresponding to the graphic element library through a graphic element recognition and classification module; Performing further deep learning recognition on the first visual language data to obtain second visual language data; Secondary electrical circuits are modeled and visualized using second visual language data.
2. The method for intelligent modeling of secondary circuits based on a visual language model as claimed in claim 1, characterized in that: The first visual language data includes that the graphic primitive library summarizes and completes the first predefined template through the visual language model and performs text and visual prompts; Calculate the similarity of text and image features through feature adaptation; Calculate the image category probability of the 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 a threshold, the model is considered to be matched, and the classification result is output as first visual language data.
3. The method for intelligent modeling of secondary circuits based on a visual language model as claimed in claim 2, characterized in that: The second visual language data includes the first visual language data being input into the electrical system after being subjected to overall context analysis and entity recognition; Determine the specific information of the first visual language data and its role in the system, and output the correct prediction result as the second visual language data; Input the second visual language data into the CAD graphics for feature modeling and attribute definition, and complete the modeling of the entire secondary electrical circuit through the defined node types; Extract and analyze the features of the circuits connecting the power nodes in the model file.
4. The method for intelligent modeling of secondary circuits based on a visual language model as claimed in claim 3, characterized in that: The context analysis includes obtaining device information through a rectangular area, matching text information nearby to mark the location, locating the device area where the electrical symbol is located, and matching text information nearby in sequence; Based on the graph theory deep traversal priority search algorithm, the connection relationship information is obtained, the equipment area with the smallest rectangle where the electrical symbol is located is located, the electrical symbol is used as the starting point, and the end point of the path is the electrical symbol or the straight line marked with the terminal equipment information, the connection relationship of the substation image is obtained, and the text information is matched in sequence; Repeat the matching process until all rectangular areas are traversed and an undirected connected topological graph is obtained; The information containing the physical equipment and the physical cable connection relationship between them is matched and identified by regular expressions, parsed into a digital description of the substation image in XML format based on the document object model, and the IMCD file corresponding to a single drawing is generated.
5. The method for intelligent modeling of secondary circuits based on a visual language model as claimed in claim 4, characterized in that: The entity recognition includes identifying entities in drawings after context analysis, including equipment names, models, and parameters. Entity recognition is divided into text area positioning based on CTPN to construct multi-scale feature extraction and content recognition of text areas using CRNN technology; The text area positioning based on CTPN for multi-scale feature extraction includes: using VGG-16 to extract picture features, connecting a maximum pooling layer, scaling the input picture and inputting it into the model, using the first four convolutional layers and three maximum pooling layers of VGG-16 to perform pooling operations, obtaining three feature maps, sending the features to the bidirectional LSTM to continue learning the sequence features of the picture, connecting to the parameters predicted by the output of the previous fully connected layer FC, including foreground and background scores, position and horizontal correction, performing area positioning on the annotated texts of different sizes in the drawings, and cutting the text areas one by one and sending them to the CRNN model to recognize the annotated content; The method of using CRNN technology to perform content recognition on the text area includes: after determining the position of the annotated text in the drawing, adjusting the input image to a fixed height, scaling the image width in the same proportion, inputting it into the convolutional layer to extract a feature map containing only the image spatial features, using a recurrent layer-bidirectional LSTM network to learn the sequence features of the image, and inputting each column of the feature map into the LSTM as a time slice. The LSTM input sequence is set to x through the improved CTC β transformation, and the character sequence to be recognized is l. The sequence represents the predicted character sequence transformed from β to l, and the maximum CTC probability sum is: p(l|x)=∑ π.β(π)=l P(π|x) Among them, for any predicted sequence, p(π|x) represents the probability that sequence x is recognized as the character at position t in path π at position t: The gradient adjusts the LSTM parameter w so that p(π|x) is maximized when the input sample is π(β(π)=l): A forward-backward algorithm is used to find all correct prediction sequences to reduce the time complexity of finding the correct prediction sequence. After finding the correct sequence, the LSTM parameter w is gradient optimized again. After the LSTM transformation, the correct prediction result is output as the second visual language data.
6. A secondary circuit intelligent modeling method based on a visual language model as claimed in claim 5, characterized in that: The secondary electrical circuit modeling includes, when establishing a model file, the secondary circuit modeling module specifies a power supply node as a starting point for each electrical circuit, and determines the type of each secondary node including open input, open output, modular input and power supply to form a complete circuit, and completes the modeling of the entire secondary electrical circuit through the defined node type; The feature modeling and attribute definition includes establishing a panel cabinet and device model for the panel cabinet and device in the substation according to the SPCD modeling specification, and establishing a component model according to the components configured in the panel cabinet; Establishing a terminal model according to the number of terminals of the device and components includes distinguishing board components and not distinguishing board components. The distinguishing board components establishes corresponding board information including power supply, input, output, sampling, and terminal segment boards. The not distinguishing board components establishes a terminal model on the board after establishing one board by default, and defines the terminal name and serial number attributes; A node model is established based on the internal connection relationship of the terminals. When there is an internal loop or relay between two terminals to disconnect or close the terminals, the current two terminals are defined as a secondary 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 electrical circuit is modeled by selecting a power node at a starting point, starting from the positive terminal of the power node, connecting the terminals through which the entire electrical circuit passes in sequence, and creating in-panel wiring and short connectors, inter-panel cables and fiber cores according to the type of cable used between the two terminals, and using in-panel wiring, short connectors or cable cores to connect the terminals on both sides; When the terminal on one side of the connection is a terminal in a sub-node, select the other terminal of the current sub-node to continue modeling the remaining connections in the current electrical circuit; When the terminal connected to is the negative terminal in the power supply node at the starting point, the modeling of the entire electrical circuit is completed; When there are n paths in the electrical circuit between one pair of power supply nodes, the previous operation is repeated until all electrical circuit models are established.
7. A secondary circuit intelligent modeling method based on a visual language model as claimed in claim 6, characterized in that: The feature extraction and analysis includes identifying the extracted graphic primitive symbols through the visual language model, performing feature modeling on the CAD graphics, extracting graphic features using image processing technology, and automatically matching them with predefined models; The automatic matching includes selecting a part of the elements of any feature primitive in the feature primitive library as a key value, taking the key value key attribute to traverse all the element attributes in the identified CAD drawing for matching, and then matching the remaining attributes in turn. When all the attributes are matched, the key value elements are matched; when any attribute match is unsuccessful, the next feature primitive is selected in the feature primitive library, and all the feature primitives in the feature primitive library are matched with the graphics in the CAD drawing; When the elements contained in the feature primitive are matched successfully, the primitive is replaced, 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, and the key value attribute matching is repeated to determine whether the attributes of the remaining elements of the CAD graphic in the area covered by the current primitive 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 attributes corresponding to the text are matched according to the definition of the feature model; When the automatic matching finds unrecognized parts of the CAD drawings, human-computer interaction is used to select the unrecognized parts as feature graphics elements, and feature recognition is performed again. The circuits connecting the power nodes in the model file are analyzed and retrieved, and the analysis results are used to generate secondary power circuit information of the smart substation for visual display.
8. A system using a secondary circuit intelligent modeling method based on a visual language model as claimed in any one of claims 1 to 7, characterized in that: It includes graphic element and symbol collection input module, visual language module, and 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 substation secondary circuit, 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 logos in the drawings, and ensures a correct understanding of the meaning and function of each graphic element in the electrical system through context analysis and entity recognition. The secondary circuit modeling module includes a model attribute definition module, a feature extraction module, a node module, a circuit analysis and retrieval module, and a visualization display generation module, which realizes a visualization display diagram of secondary power circuit information and completes the modeling and analysis of the secondary power circuit of the smart substation.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of a secondary circuit intelligent modeling method based on a visual language model as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a secondary circuit intelligent modeling method based on a visual language model as described in any one of claims 1 to 7 are implemented.
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
Methods and Systems for Determining Image Processing Operations Relevant to Particular Imagery
US20110244919A1
Cited By
Substation secondary principle drawing intelligent identification method based on deep learning
CN119851304A
Intelligent processing method and system for transformer substation secondary circuit drawing
CN121904210A