A text and topology cross-modal alignment method and device
By extracting features of power grid nodes using graph encoders and text encoders and performing weighted fusion, the graph structure and text information of power grid nodes are aligned, solving the problem of inconsistent topological representation in large-scale power grids, improving cross-modal understanding and discrimination capabilities, and reducing the risk of misjudgment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID INFORMATION & TELECOMM BRANCH
- Filing Date
- 2026-03-12
- Publication Date
- 2026-06-26
AI Technical Summary
In large-scale power grids, existing technologies struggle to effectively combine prior textual information to aid topology reasoning, resulting in inconsistent topology representations. This makes it difficult to accurately depict the interconnections and power transmission paths of complex power grids, and also leads to insufficient cross-modal understanding and discrimination capabilities.
A graph encoder and a text encoder are used to extract the graph structure features and text features of power grid nodes. The graph structure features and text features are then fused by an attention mechanism layer. The graph structure information and text information of power grid nodes are aligned based on similarity. Topology-guided hard negative sample mining is introduced to enhance the alignment quality.
It achieves accurate alignment between text and topology, enhances the ability to capture critical path information in complex power grids, reduces the risk of misjudgment in topology reasoning, and improves alignment quality and the ability to distinguish similar nodes.
Smart Images

Figure CN122287589A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of big data analytics, specifically to a method and apparatus for cross-modal alignment of text and topology. Background Technology
[0002] Cross-modal alignment of power grid text and topology is used to characterize the connection relationships, connectivity partitions, and power transmission paths between electrical devices. It serves as a prerequisite for advanced applications such as state estimation, power flow and security verification, fault diagnosis, and load forecasting.
[0003] With the development of new power system technologies such as ultra-high voltage transmission, distributed renewable energy, and flexible DC transmission, the scale of the power grid is rapidly expanding, with the number of nodes and edges reaching the millions. The long-range impact of topology and its associations is becoming more prominent. For large-scale power grids, the topology not only changes frequently with switching operations, maintenance arrangements, and fault isolation, but also exhibits a significant hierarchical structure: there are voltage level nesting and cross-regional coupling relationships between substation bays, substations, regional grids, and the main power grid. For example, cross-voltage level cascading effects, long-distance power transmission channels, and protection coordination linkage areas often require 4 to 8 hops of topological information to be fully characterized, exceeding the traditional graph network modeling capabilities based on 3-hop neighborhoods.
[0004] In real-world applications, rule-based topology processing relies on the integrity of remote signaling and the coverage of rules. When switch statuses are missing, delayed, or falsely reported, it can easily lead to errors in bus segment identification and misjudgment of connectivity partitions, thus affecting the stability of subsequent applications. If a learning method based solely on structure / measurement is used, it cannot fully utilize text priors to assist topology reasoning. On the other hand, simply concatenating text vectors into node attributes cannot guarantee that the "text representation of the same device" and its "topology representation" are consistent in the representation space. Furthermore, it is difficult to reliably distinguish between a large number of devices with similar names, types, and numbers, resulting in insufficient cross-modal understanding and discrimination capabilities.
[0005] Cross-modal alignment and contrastive learning have demonstrated the effectiveness of mapping different modalities to a unified semantic space. However, in power grid topology scenarios, it is necessary to further integrate topological priors: on the one hand, to avoid contrastive learning "pulling" physically unconnectable nodes closer together; on the other hand, to establish sufficient spacing between a large number of nodes that are "semantically similar but not the same device / functional role". To this end, it is necessary to introduce topology-guided hard negative sample mining and semantic enhancement strategies that give text representations neighborhood context during the alignment process, thereby improving alignment quality and the ability to distinguish similar nodes in complex scenarios. Summary of the Invention
[0006] To overcome the above-mentioned shortcomings, this invention proposes a method and apparatus for cross-modal alignment of text and topology.
[0007] Firstly, a method for cross-modal alignment of text and topology is provided, the method comprising: The graph structure information of the power grid nodes is used to extract the graph structure features of the power grid nodes through a graph encoder; The text features of the power grid nodes are extracted using a text encoder. Alignment operation is performed on the graph structure information and text information of the power grid nodes based on the graph structure features and text features of the power grid nodes.
[0008] Preferably, the graph encoder includes: a position encoding layer, used to encode the shortest distance between a node and the root node using sine and cosine encoding and then embed and splice it with the voltage level.
[0009] Preferably, the graph encoder includes: multiple attention mechanism layers, wherein the normalized exponential function of the attention mechanism layer is as follows:
[0010] In the above formula, For query vector, For key vectors, It is the transpose symbol. For feature dimension, To pre-set the adjacent mask matrix, It is a value vector.
[0011] Preferably, the text encoder includes: a pre-trained language model, a first attention mechanism layer, and a second attention mechanism layer; The pre-trained language model is used to extract classification label vectors from the text of power grid nodes; The first attention mechanism layer is used to perform weighted fusion of the classification label vectors to obtain the initial enhanced text; The second attention mechanism layer is used to perform weighted fusion of the initial enhanced text with the text of the neighboring nodes of the power grid node to obtain the text features of the power grid node.
[0012] Preferably, the alignment operation between the graph structure information and text information of the power grid nodes based on the graph structure features and text features of the power grid nodes includes: The similarity between the graph structure features and text features of the power grid nodes is determined based on the graph structure features and text features. Align the graph structure information of the power grid nodes with the text information corresponding to the graph structure features with the highest similarity to the text features.
[0013] Furthermore, the similarity between the graph structure features and the text features is as follows:
[0014] In the above formula, Let be the similarity between the graph structure features of power grid node i and the text features of power grid node j. Let i be the graph structure feature of the power grid node. It is the transpose symbol. The text features of power grid node j are given.
[0015] Secondly, a cross-modal alignment device for text and topology is provided, the cross-modal alignment device for text and topology comprising: The first extraction module is used to extract the graph structure features of the power grid nodes by passing the graph encoder through the graph structure information of the power grid nodes; The second extraction module is used to extract the text features of the power grid nodes by using a text encoder; The operation module is used to align the graph structure information and text information of the power grid node based on the graph structure features and text features of the power grid node.
[0016] Thirdly, a computer device is provided, comprising: one or more processors; The processor is used to store one or more programs; When the one or more programs are executed by the one or more processors, the cross-modal alignment method for text and topology is implemented.
[0017] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, wherein when the computer program is executed, it implements the cross-modal alignment method for text and topology.
[0018] The above-described technical solutions of the present invention have at least one or more of the following beneficial effects: This invention provides a method and apparatus for cross-modal alignment of text and topology, comprising: extracting graph structure features of power grid nodes from graph structure information of power grid nodes using a graph encoder; extracting text features of power grid nodes from text information of power grid nodes using a text encoder; and performing alignment operations on the graph structure information and text information of power grid nodes based on the graph structure features and text features of the power grid nodes. The technical solution provided by this invention can accurately achieve cross-modal alignment of text and topology, thereby enabling more reliable capture of critical path information and enhancing the ability to characterize complex connectivity relationships. It can provide supplementary constraints for topology reasoning and reduce the risk of misjudgment. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the main steps of the cross-modal alignment method for text and topology according to an embodiment of the present invention. Detailed Implementation
[0020] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] Example 1 See appendix Figure 1 , Figure 1 This is a schematic flowchart illustrating the main steps of a cross-modal alignment method for text and topology according to an embodiment of the present invention. Figure 1 As shown, the cross-modal alignment method for text and topology in this embodiment of the invention mainly includes the following steps: Step S101: Extract the graph structure features of the power grid nodes by using a graph encoder to obtain the graph structure information of the power grid nodes; Step S102: Extract the text features of the power grid nodes by using a text encoder; Step S103: Align the graph structure information and text information of the power grid node based on the graph structure features and text features of the power grid node.
[0023] In this embodiment, the graph encoder includes a position encoding layer, which is used to encode the shortest distance between a node and the root node using sine and cosine encoding and then embed and splice it with the voltage level.
[0024] In this embodiment, the graph encoder includes multiple attention mechanism layers, wherein the normalized exponential function of the attention mechanism layer is as follows:
[0025] In the above formula, For query vector, For key vectors, It is the transpose symbol. For feature dimension, To pre-set the adjacent mask matrix, It is a value vector.
[0026] In this embodiment, the text encoder includes: a pre-trained language model, a first attention mechanism layer, and a second attention mechanism layer; The pre-trained language model is used to extract classification label vectors for power grid node text, wherein each node text contains a name field (including voltage level / type), a parameter field (capacity, transformation ratio, etc.) and a status field (operation / maintenance, etc.).
[0027] The first attention mechanism layer is used to perform weighted fusion of the classification label vectors to obtain the initial enhanced text; The second attention mechanism layer is used to perform weighted fusion of the initial enhanced text with the text of the neighboring nodes of the power grid node to obtain the text features of the power grid node.
[0028] In this embodiment, the alignment operation between the graph structure information and text information of the power grid node based on the graph structure features and text features of the power grid node includes: The similarity between the graph structure features and text features of the power grid nodes is determined based on the graph structure features and text features. Align the graph structure information of the power grid nodes with the text information corresponding to the graph structure features with the highest similarity to the text features.
[0029] In one implementation, the similarity between the graph structure features and the text features is as follows:
[0030] In the above formula, Let be the similarity between the graph structure features of power grid node i and the text features of power grid node j. Let i be the graph structure feature of the power grid node. It is the transpose symbol. The text features of power grid node j are given.
[0031] Example 2 Based on the same inventive concept, the present invention also provides a cross-modal alignment device for text and topology, the cross-modal alignment device for text and topology comprising: The first extraction module is used to extract the graph structure features of the power grid nodes by passing the graph encoder through the graph structure information of the power grid nodes; The second extraction module is used to extract the text features of the power grid nodes by using a text encoder; The operation module is used to align the graph structure information and text information of the power grid node based on the graph structure features and text features of the power grid node.
[0032] Preferably, the graph encoder includes: a position encoding layer, used to encode the shortest distance between a node and the root node using sine and cosine encoding and then embed and splice it with the voltage level.
[0033] Preferably, the graph encoder includes: multiple attention mechanism layers, wherein the normalized exponential function of the attention mechanism layer is as follows:
[0034] In the above formula, For query vector, For key vectors, It is the transpose symbol. For feature dimension, To pre-set the adjacent mask matrix, It is a value vector.
[0035] Preferably, the text encoder includes: a pre-trained language model, a first attention mechanism layer, and a second attention mechanism layer; The pre-trained language model is used to extract classification label vectors from the text of power grid nodes; The first attention mechanism layer is used to perform weighted fusion of the classification label vectors to obtain the initial enhanced text; The second attention mechanism layer is used to perform weighted fusion of the initial enhanced text with the text of the neighboring nodes of the power grid node to obtain the text features of the power grid node.
[0036] Preferably, the alignment operation between the graph structure information and text information of the power grid nodes based on the graph structure features and text features of the power grid nodes includes: The similarity between the graph structure features and text features of the power grid nodes is determined based on the graph structure features and text features. Align the graph structure information of the power grid nodes with the text information corresponding to the graph structure features with the highest similarity to the text features.
[0037] Furthermore, the similarity between the graph structure features and the text features is as follows:
[0038] In the above formula, Let be the similarity between the graph structure features of power grid node i and the text features of power grid node j. Let i be the graph structure feature of the power grid node. It is the transpose symbol. The text features of power grid node j are given.
[0039] Example 3 Based on the same inventive concept, this invention also provides a computer device, which includes a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement corresponding method flows or corresponding functions, thereby implementing the steps of a cross-modal alignment method for text and topology in the above embodiments.
[0040] Example 4 Based on the same inventive concept, this invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of the cross-modal alignment method for text and topology in the above embodiments.
[0041] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0042] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0043] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0044] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0045] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for cross-modal alignment of text and topology, characterized in that, The method includes: The graph structure information of the power grid nodes is used to extract the graph structure features of the power grid nodes through a graph encoder; The text features of the power grid nodes are extracted using a text encoder. Alignment operation is performed on the graph structure information and text information of the power grid nodes based on the graph structure features and text features of the power grid nodes.
2. The method as described in claim 1, characterized in that, The graph encoder includes a position encoding layer, which is used to encode the shortest distance between a node and the root node using sine and cosine encoding and then embed and splice it with the voltage level.
3. The method as described in claim 1, characterized in that, The graph encoder includes multiple attention mechanism layers, wherein the normalized exponential function of the attention mechanism layer is as follows: In the above formula, For query vector, For key vectors, It is the transpose symbol. For feature dimension, To pre-set the adjacent mask matrix, It is a value vector.
4. The method as described in claim 1, characterized in that, The text encoder includes: a pre-trained language model, a first attention mechanism layer, and a second attention mechanism layer; The pre-trained language model is used to extract classification label vectors from the text of power grid nodes; The first attention mechanism layer is used to perform weighted fusion of the classification label vectors to obtain the initial enhanced text; The second attention mechanism layer is used to perform weighted fusion of the initial enhanced text with the text of the neighboring nodes of the power grid node to obtain the text features of the power grid node.
5. The method as described in claim 1, characterized in that, The alignment operation between the graph structure information and text information of the power grid nodes based on their graph structure features and text features includes: The similarity between the graph structure features and text features of the power grid nodes is determined based on the graph structure features and text features. Align the graph structure information of the power grid nodes with the text information corresponding to the graph structure features with the highest similarity to the text features.
6. The method as described in claim 5, characterized in that, The similarity between the graph structure features and the text features is as follows: In the above formula, Let be the similarity between the graph structure features of power grid node i and the text features of power grid node j. Let i be the graph structure feature of the power grid node. It is the transpose symbol. The text features of power grid node j are given.
7. A cross-modal alignment device for text and topology, characterized in that, The device includes: The first extraction module is used to extract the graph structure features of the power grid nodes by passing the graph encoder through the graph structure information of the power grid nodes; The second extraction module is used to extract the text features of the power grid nodes by using a text encoder; The operation module is used to align the graph structure information and text information of the power grid node based on the graph structure features and text features of the power grid node.
8. A computer device, characterized in that, include: One or more processors; The processor is used to execute one or more programs; When the one or more programs are executed by the one or more processors, the cross-modal alignment method for text and topology as described in any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that, It contains a computer program that, when executed, implements the cross-modal alignment method for text and topology as described in any one of claims 1 to 6.