Power grid dynamic knowledge graph link prediction method based on quantum migration and quantum thermodynamics
The power grid dynamic knowledge graph link prediction method based on quantum walks and quantum thermodynamics solves the problem of insufficient utilization of temporal information in defect diagnosis of main equipment in the power system, achieves more accurate and real-time fault prediction, and improves the stability of power grid equipment. and security.
Patent Information
- Application Number
- CN202411132667.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-08-19
AI Technical Summary
The existing technology is difficult to effectively capture the complex environment and fault correlation of the equipment in power system main equipment defect diagnosis, and fails to effectively use dynamic graphs to depict temporal information, resulting in inaccurate and real-time diagnosis.
The power grid dynamic knowledge graph link prediction method using quantum walks and quantum thermodynamics is used to construct a dynamic knowledge graph model through a quantum migration aware encoder and a temperature-aware hybrid expert model decoder, and quantum walks are used to calculate node bias values and graph attention. The network aggregates information, calculates global evolution characteristics combined with quantum thermodynamic temperature, and predicts possible edges in the future.
This method not only considers the current status of the equipment, but also effectively depicts temporal information, improves the ability to capture dynamic changes in the relationship between power grid equipment, and achieves more accurate fault prediction and improvement of power grid stability.
Smart Images

Figure CN118657256A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system main equipment defect diagnosis and dynamic graph representation learning, and in particular to a quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method. Background Art
[0002] The power system is the key to maintaining modern production and life, and its stable operation is directly related to the normal operation of society and economic development. Main equipment defects are one of the main factors threatening the stable operation of the power system. Once key equipment such as transformers, generators, and reactors fail, it will not only cause power supply interruptions, but may also cause more serious secondary disasters. Therefore, timely and accurate diagnosis of main equipment defects is particularly important. However, main equipment often has complex structures, many components, and cumbersome inspection and daily maintenance work. Its defect analysis and diagnosis are not only affected by the current status of the equipment, but also need to consider the equipment's operation and maintenance records and other temporal information. Although the existing main equipment defect diagnosis methods have achieved certain results, they often only rely on the current status of the equipment, ignoring the complex environment in which the equipment is located and the correlation between faults, and it is difficult to cope with more complex situations. In addition, quantum walks are a simulation of a quantum state of random walks, which are often used to measure the relationship between static graph nodes, but have not been used to characterize dynamic graphs before. These problems limit the reliability and safety of the power system, and new technologies and methods are urgently needed to improve the effectiveness and accuracy of main equipment defect diagnosis.
[0003] A dynamic graph is a graph model used to describe the changes of nodes and edges in a dynamic system over time. Unlike traditional static graphs, temporal graphs introduce a time dimension into the structure of the graph, which can reflect the topological changes and relationship evolution of the system at different time points. Typical dynamic graphs include social networks, citation networks, transportation networks, disease transmission networks, etc. There are natural topological relationships between power grid devices. Converting power equipment into graphs can effectively capture the associations between devices, help analyze the defect associations between different devices, identify whether certain defects are propagable or whether they will cause failures in other devices, and improve the overall fault prediction ability of the system. The introduction of timing information can accurately track the occurrence time of each defect, help analyze the time distribution and evolution of faults, identify potential periodic problems or high-incidence defects in a specific time period, reflect the dynamic changes of defects in the power system, provide a basis for real-time monitoring and analysis, and help operation and maintenance personnel take preventive and repair measures in time to avoid further expansion of faults.
[0004] Graph neural networks and structural learning are the two basic methods of dynamic graph representation learning: the former is based on graph neural networks and models node representation through neighbor node aggregation and temporal encoding; the latter focuses on learning the temporal structure of the network, which can achieve better representation results, but because the random walk process is difficult to accelerate, it often leads to higher time overhead. In actual production, the operation of the power system is a long-term process. As time goes by, the amount of data in the dynamic graph will grow rapidly, causing a surge in the number of neighbor nodes, making the training and operation of traditional graph neural networks face greater pressure. In addition, the power scenario requires real-time defect analysis and diagnosis, making the structural learning method based on temporal random walk unsustainable. How to deal with the problem of data expansion and ensure the real-time and effectiveness of defect diagnosis is the key to using dynamic graph representation learning to realize main equipment defect diagnosis. Summary of the invention
[0005] To this end, an embodiment of the present invention provides a method and system for predicting links in a power grid dynamic knowledge graph based on quantum walks and quantum thermodynamics, which is used to solve the problems in the prior art that the current state of the device is only relied on, the device environment and fault association are ignored, it is difficult to deal with complex situations, and dynamic graphs are not effectively used to characterize temporal information.
[0006] In order to solve the above problems, an embodiment of the present invention provides a quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method, the method comprising: Collect relevant data of the power grid dynamic knowledge graph, including the status, connection relationship, and timestamp of power grid equipment, build a data set, and divide the data set into a training set and a test set; Constructing a power grid dynamic knowledge graph link prediction model based on quantum walk and quantum thermodynamics, the model includes a quantum migration-aware encoder and a temperature-aware hybrid expert model decoder; The quantum migration-aware encoder is used to perform subgraph sampling based on a dynamic knowledge graph with the node to be inferred as the central node to obtain a subgraph structure centered on the central node; based on the subgraph structure, quantum walks are performed on the subgraph to calculate the quantum bias value from the central node to each node; based on the subgraph structure and the quantum bias value, a graph attention network is used to aggregate information from neighboring nodes, and quantum bias is introduced to adjust the attention weight to obtain an updated embedding of the central node; The temperature-aware hybrid expert model decoder is used to calculate the global evolution characteristics of the dynamic knowledge graph based on the continuous time data of the dynamic knowledge graph; based on the embedding of the central node, the edge time, and the global evolution characteristics, the prediction results of the edges that may exist in the future are obtained; Use the training set data to train the model, optimize the model parameters through the back propagation algorithm, and obtain the trained model; Use the test set to evaluate the trained model.
[0007] Preferably, the dynamic knowledge graph is a quadruple arranged in chronological order, and the form of the quadruple includes a head entity, a relationship, a tail entity, and time; the entities are power grid equipment and faults, the edges are between the power grid equipment and the faults, and the quadruple represents that a certain fault occurred in a certain power grid equipment at a certain time.
[0008] Preferably, the method for performing subgraph sampling based on the dynamic knowledge graph and taking the node to be inferred currently as the central node is: Based on the dynamic knowledge graph, subgraph sampling is performed with the node to be inferred as the central node. The sampling range is within the k-step range of the central node. The sampling has a fixed upper limit, and edges that appear later are prioritized.
[0009] Preferably, the quantum walk is performed on the subgraph based on the subgraph structure to calculate the quantum bias value from the central node to each node, specifically including: Based on the subgraph structure, a virtual self-loop is added to the sampled subgraph to calculate the quantum bias value from the central node to other sampled nodes. The virtual self-loop means that when inferring possible edges, an edge pointing to the central node is added to the central node, and the time is the inference time. The quantum bias value is defined as the average probability that the quantum can be observed at each node of the subgraph after a sufficiently long time from the central node. The calculation formula is: ; ; in, is the system Hamiltonian matrix, and , is the Hamiltonian matrix Different eigenvalues, is the sum of eigenvalue matrices with the same eigenvalue; It is the time limit; It is not a specific time; and It's time The quantum conjugate matrix when ; It's in time When , the probability matrix of quantum starting from different nodes being observed at the node; Calculate the quantum bias matrix Afterwards, the quantum bias value of the central node relative to other nodes can be obtained based on the serial number of the central node.
[0010] Preferably, based on the subgraph structure and the quantum bias value, the graph attention network is used to aggregate information from neighbor nodes, and the quantum bias is introduced to adjust the attention weight to obtain the updated embedding of the central node, which specifically includes: Based on the subgraph structure, the attention value of the central node compared to the neighboring nodes is calculated. First, the original feature-based attention value is calculated by the graph attention network method, and then the quantum bias value calculated in the previous step is added to calculate it by the following formula: ; in, is the matrix transpose symbol; is the quantum bias value; Is a node Relative Node The quantum bias value of It's in time by The subgraph obtained by sampling the central node; is the value after the embedding of the central node changes linearly; is the embedding dimension, which is used to scale the attention value so that it is not too sparse; and It is the value after the linear change of the embedding of the central node, neighboring nodes and edges connecting the central node. The calculation process is as follows: ; ; in, It is a concatenation operation that combines multiple vectors into a longer vector; It is a time coding model based on trigonometric functions; is time, and The total number of edges between ; It is Node embedding of layers; is the time when reasoning takes place; is the timestamp of the selected edge, that is, the time when the corresponding event occurs; and is the parameter projection matrix; Nodes aggregate neighbor information, the formula is as follows: ; in, is the embedding of the edges connecting the neighbor nodes to the central node; is the softmax activation function; It is Node embedding after layer update; Represents the central node The set of neighbor nodes of Finally, a multi-layer perceptron network is used to fuse the aggregation of neighbor information and the historical embedding of the node itself to generate the final node embedding. The formula is as follows: ; in, It is a multi-layer perceptron; It is Node embedding of the layer.
[0011] Preferably, the continuous time data of the dynamic knowledge graph is used to calculate the global evolution characteristics of the dynamic knowledge graph, specifically including: Assuming that the dynamic knowledge graph system is a system with constant volume, we get ,in is the temperature, represents the energy of the system, Represents the entropy of the system; von Neumann entropy is used as the entropy of the system, and the von Neumann entropy is calculated using an approximate calculation method. The calculation formula is as follows: ; in, is the number of nodes; is the von Neumann entropy; , Respectively represent nodes , degree, that is, the degree of the node , Number of connected edges; represents all the edges contained in the dynamic knowledge graph at the current moment; it is roughly considered that the scale of the dynamic knowledge graph represents the energy of the graph, expressed as ,in is a constant; determine two moments and calculate the quantum thermodynamic temperature by calculating the changes in entropy and energy at the two moments ; By using different times, multiple quantum thermodynamic temperatures are obtained. They reflect the changing trend of the current network state compared with the previous network state from different angles, and constitute the global evolution characteristics of the dynamic knowledge graph at the current moment, which are expressed as follows: ; in, is a global evolution feature, Represents the temperature values at different angles.
[0012] Preferably, the prediction results of possible future edges are obtained based on the embedding of the central node, the edge connection time, and the global evolution characteristics, and specifically include: A multi-layer perceptron is selected as the sub-decoder. Based on the embedding of the central node and the edge time, the sub-decoder predicts whether a given node will have a corresponding connection with the head node at this time. Based on the global evolution characteristics, the expert mixture model is used to generate corresponding weights for different sub-decoders. Finally, the weighted sum of the results of all sub-decoders is used to obtain the prediction results of the edges that may exist in the future. The decoding process is expressed as follows: ; ; in, A score indicating the likelihood of a connection existing; , Represents the central node , Embedding is the number of experts; It is a global evolutionary feature; is the projection parameter matrix; is the normalized weight, which represents the importance of the corresponding expert in judging whether this connection exists or not; It is a multi-layer perceptron; is the softmax activation function.
[0013] The embodiment of the present invention further provides a quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction system, which is used to implement the quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method described above, specifically including: The data collection and division module is used to collect relevant data of the power grid dynamic knowledge graph, including the status, connection relationship, and timestamp of power grid equipment, build a data set, and divide the data set into a training set and a test set; A model building module, used to build a power grid dynamic knowledge graph link prediction model based on quantum walk and quantum thermodynamics, wherein the model includes a quantum migration-aware encoder and a temperature-aware hybrid expert model decoder; The quantum migration-aware encoder is used to perform subgraph sampling based on a dynamic knowledge graph with the node to be inferred as the central node to obtain a subgraph structure centered on the central node; based on the subgraph structure, quantum walks are performed on the subgraph to calculate the quantum bias value from the central node to each node; based on the subgraph structure and the quantum bias value, a graph attention network is used to aggregate information from neighboring nodes, and quantum bias is introduced to adjust the attention weight to obtain an updated embedding of the central node; The temperature-aware hybrid expert model decoder is used to calculate the global evolution characteristics of the dynamic knowledge graph based on the continuous time data of the dynamic knowledge graph; based on the embedding of the central node, the edge time, and the global evolution characteristics, the prediction results of the edges that may exist in the future are obtained; The model training module is used to train the model using the training set data and optimize the model parameters through the back propagation algorithm to obtain a trained model; The model evaluation module is used to evaluate the trained model using the test set.
[0014] An embodiment of the present invention also provides an electronic device, comprising a processor, a memory and a bus system, wherein the processor and the memory are connected through the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the above-mentioned quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method.
[0015] An embodiment of the present invention also provides a computer storage medium, which stores a computer software product. The computer software product includes several instructions for enabling a computer device to execute the above-mentioned quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method.
[0016] It can be seen from the above technical solutions that the present invention has the following beneficial effects: (1) The present invention not only considers the current status of power grid equipment, but also effectively characterizes temporal information through dynamic knowledge graphs, including the connection relationship and timestamp of the equipment, so that the model can capture the dynamic change characteristics of the power grid.
[0017] (2) This paper uses quantum walks to calculate the degree of association between a node and its neighboring nodes in the graph topology, providing a new method for measuring the relationship between nodes in a dynamic knowledge graph. At the same time, the introduction of quantum thermodynamic temperature as a dynamic knowledge graph evolution feature provides a new perspective for dynamic knowledge graph link prediction.
[0018] (3) The present invention builds a prediction model based on the encoder-decoder structure. The encoder effectively extracts and aggregates information from the subgraph through quantum walks and graph attention networks to obtain updated embeddings of the central nodes. The decoder uses global evolution features and the embeddings of the central nodes to accurately predict possible future edges and achieve efficient link prediction.
[0019] (4) The present invention is particularly suitable for predicting possible future failures of power grid equipment, which helps power grid workers to check the status of equipment in a timely manner, take preventive measures, and improve the stability and safety of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the implementation cases of the present invention or the technical solutions in the prior art, the following is a brief description of the drawings required for use in the embodiments. By referring to the drawings, the features and advantages of the present invention will be more clearly understood. The drawings are schematic and should not be understood as limiting the present invention in any way. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them: Figure 1 A flowchart of a method for predicting links in a power grid dynamic knowledge graph of quantum walk and quantum thermodynamics provided in an embodiment; Figure 2 A model architecture diagram based on an encoder-decoder structure in an embodiment; Figure 3 The link prediction accuracy of the present invention on four knowledge graphs in the embodiment and the comparison with other methods; Figure 4 A block diagram of a quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction system provided in an embodiment. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Embodiment 1
[0022] like Figure 1 As shown, an embodiment of the present invention proposes a quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method, the method comprising: Step S1: Collect relevant data of the power grid dynamic knowledge graph, including the status, connection relationship, and timestamp of power grid equipment, construct a data set, and divide the data set into a training set and a test set; Step S2: constructing a power grid dynamic knowledge graph link prediction model based on quantum walk and quantum thermodynamics, wherein the model includes a quantum migration-aware encoder and a temperature-aware hybrid expert model decoder; The quantum migration-aware encoder is used to sample subgraphs based on the dynamic knowledge graph with the node to be inferred as the central node to obtain a subgraph structure centered on the central node. Based on the subgraph structure, quantum walks are performed on the subgraph to calculate the quantum bias value from the central node to each node. Based on the subgraph structure and the quantum bias value, the graph attention network is used to aggregate information from neighboring nodes, and the quantum bias is introduced to adjust the attention weight to obtain the updated embedding of the central node. The temperature-aware hybrid expert model decoder is used to calculate the global evolution characteristics of the dynamic knowledge graph based on the continuous moment data of the dynamic knowledge graph; based on the embedding of the central node, the edge time, and the global evolution characteristics, the prediction results of the edges that may exist in the future are obtained; Step S3: Use the training set data to train the model, optimize the model parameters through the back propagation algorithm, and obtain a trained model; Step S4: Use the test set to evaluate the trained model.
[0023] It can be seen from the above technical scheme that the present invention provides a quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method. First, by collecting relevant data of the power grid dynamic knowledge graph and constructing a data set, the present invention can comprehensively capture the status, connection relationship and timestamp information of the power grid equipment, providing a rich and accurate data basis for subsequent predictions. Secondly, by constructing a power grid dynamic knowledge graph link prediction model based on quantum walk and quantum thermodynamics, the present invention adopts an innovative method to measure the relationship between nodes and introduces global evolution characteristics, thereby improving the accuracy of the prediction. Then, in the model training process, the back propagation algorithm is used to optimize the model parameters to ensure that the model can learn the deep laws in the data. Finally, by evaluating the trained model, the present invention not only verifies its prediction performance, but also demonstrates its potential and value in practical applications. In summary, the present invention provides an efficient and accurate new method for link prediction of the power grid dynamic knowledge graph through the comprehensive application of four steps, which helps to improve the fault prediction and prevention capabilities of power grid equipment.
[0024] In this embodiment, in step S1, relevant data of the power grid dynamic knowledge graph is collected, including the status, connection relationship, and timestamp of the power grid equipment, a data set is constructed, and the data set is divided into a training set and a test set. The dynamic knowledge graph is defined as: the dynamic knowledge graph is a knowledge graph with time on the edge, which represents that a certain event occurred between nodes at a certain time, a certain interaction occurred, or a certain relationship was generated. In this embodiment, the dynamic knowledge graph is a quadruple arranged in chronological order, and the form of the quadruple is (head entity, relationship, tail entity, time). The entity is the power grid equipment and fault, the edge is between the power grid equipment and the fault, and the quadruple represents that a certain fault occurred in a certain power grid equipment at a certain time. The method of data collection is to collect the fault data of power grid operation and maintenance, extract the equipment and fault events and their occurrence time, (appropriately abstract the fault event) and arrange them by time to obtain the original data.
[0025] In this embodiment, in step S2, a power grid dynamic knowledge graph link prediction model based on quantum walk and quantum thermodynamics is constructed. Figure 2 As shown, the model includes a quantum migration-aware encoder and a temperature-aware hybrid expert model decoder. The quantum migration-aware encoder is used to sample subgraphs based on the dynamic knowledge graph with the node to be inferred as the central node to obtain a subgraph structure centered on the central node; based on the subgraph structure, quantum walks are performed on the subgraph to calculate the quantum bias value from the central node to each node; based on the subgraph structure and the quantum bias value, the graph attention network is used to aggregate information from neighboring nodes, and the quantum bias is introduced to adjust the attention weight to obtain the updated embedding of the central node. The temperature-aware hybrid expert model decoder is used to calculate the global evolution characteristics of the dynamic knowledge graph based on the continuous moment data of the dynamic knowledge graph; based on the embedding of the central node, the edge time, and the global evolution characteristics, the prediction results of the edges that may exist in the future are obtained.
[0026] Specifically, based on the dynamic knowledge graph, subgraph sampling is performed with the node to be inferred as the central node. As the basic local structure of quantum walks, subgraphs can reduce time complexity. The sampling range is within the k-step range of the central node (k-step node means that the central node can reach the node through at most k walks on the edge. For example, in a relationship ABC, A is the center and can reach C after two steps of walks (A->B; B->C), so C is within the 2-step range of A), and the sampling has a fixed upper limit. At the same time, edges that appear later are sampled first, and more consideration of recently added edges can allow the model to consider the recent topological structure of the dynamic knowledge graph.
[0027] Furthermore, based on the subgraph structure, quantum walks are performed on the subgraph to calculate the quantum bias values from the central node to each node, specifically including: Based on the subgraph structure, a virtual self-loop is added to the sampled subgraph to calculate the quantum bias value from the central node to other sampled nodes. The virtual self-loop means that when inferring possible edges, an edge pointing to the central node is added to the central node, and the time is the inference time (that is, now). The quantum bias value is defined as the average probability that the quantum can be observed at each node of the subgraph after a sufficiently long time from the central node. The calculation formula is: ; ; in, is the system Hamiltonian matrix, and , is the Hamiltonian matrix Different eigenvalues, is the sum of eigenvalue matrices with the same eigenvalue; It is the time limit; It is not a specific time; and It's time The quantum conjugate matrix when ; It's in time The probability matrix of quantum starting from different nodes being observed at the node.
[0028] Calculate the quantum bias matrix Afterwards, the quantum bias value of the central node relative to other nodes can be obtained based on the serial number of the central node.
[0029] Furthermore, based on the subgraph structure and quantum bias value, the Graph Attention Network (GAT) is used to aggregate information from neighboring nodes, and the quantum bias is introduced to adjust the attention weight to obtain the updated embedding of the central node, including: Based on the subgraph structure, the attention value of the central node compared to the neighboring nodes is calculated. First, the original feature-based attention value is calculated by the graph attention network method, and then the quantum bias value calculated in the previous step is added to calculate it by the following formula: ; in, is the matrix transpose symbol; is the quantum bias value; Is a node Relative Node The quantum bias value of It's in time by The subgraph obtained by sampling the central node; is the value after the embedding of the central node changes linearly; is the embedding dimension, which is used to scale the attention value so that it is not too sparse; and It is the value after the linear change of the embedding of the central node, neighboring nodes and edges connecting the central node. The calculation process is as follows: ; ; in, It is a concatenation operation that combines multiple vectors into a longer vector; It is a time coding model based on trigonometric functions; is time, and The total number of edges between ; It is Node embedding of layers; is the time when reasoning takes place; is the timestamp of the selected edge, that is, the time when the corresponding event occurs; and is the parameter projection matrix.
[0030] Nodes aggregate neighbor information, the formula is as follows: ; in, is the embedding of the edges connecting the neighbor nodes to the central node; is the softmax activation function; It is Node embedding after layer update; Represents the central node The set of neighbor nodes.
[0031] Finally, a multi-layer perceptron network is used to fuse the aggregation of neighbor information and the historical embedding of the node itself to generate the final node embedding. The formula is as follows: ; in, It is a multi-layer perceptron; It is Node embedding of the layer.
[0032] Furthermore, based on the continuous time data of the dynamic knowledge graph, the global evolution characteristics of the dynamic knowledge graph are calculated, including: The present invention represents the global evolution state of the dynamic knowledge graph by calculating the quantum thermodynamic temperature on the graph. First, assuming that the dynamic knowledge graph system is a system with constant volume, we get ,in is the temperature, represents the energy of the system, Represents the entropy of the system. The present invention adopts von Neumann entropy as the entropy of the system, and uses an approximate calculation method to calculate the von Neumann entropy. The calculation formula is as follows: ; in, is the number of nodes; is the von Neumann entropy; , Respectively represent nodes , degree, that is, the degree of the node , Number of connected edges; represents all the edges contained in the dynamic knowledge graph at the current moment; it is roughly considered that the scale of the dynamic knowledge graph represents the energy of the graph, expressed as ,in is a constant; determine two moments and calculate the quantum thermodynamic temperature by calculating the changes in entropy and energy at the two moments .
[0033] Finally, by using different times, multiple quantum thermodynamic temperatures are obtained. They reflect the changing trend of the current network state compared with the previous network state from different angles, and constitute the global evolution characteristics of the dynamic knowledge graph at the current moment, which are expressed as follows: ; in, is a global evolution feature, Represents the temperature values at different angles.
[0034] Furthermore, based on the embedding of the central node, the edge connection time, and the global evolution characteristics, the prediction results of the edges that may exist in the future are obtained, including: A multi-layer perceptron is selected as the sub-decoder. Based on the embedding of the central node and the edge time, the sub-decoder predicts whether a given node will have a corresponding connection with the head node at this time. Based on the global evolution characteristics, the Mixture of Experts (MOE) model is used to generate corresponding weights for different sub-decoders. Finally, the weighted sum of the results of all sub-decoders is used to obtain the prediction results of the edges that may exist in the future. The decoding process is expressed as follows: ; ; in, A score indicating the likelihood of a connection existing; , Represents the central node , Embedding is the number of experts; It is a global evolutionary feature; is the projection parameter matrix; is the normalized weight, which represents the importance of the corresponding expert in judging whether this connection exists or not; It is a multi-layer perceptron; is the softmax activation function.
[0035] In this embodiment, in step S3, the model is trained using the training set data, and the model parameters are optimized by the back propagation algorithm to obtain a trained model.
[0036] In this embodiment, in step S4, the trained model is evaluated using the test set. Figure 3 As shown, this implementation verifies the method of the present invention on 4 data, among which Wikipedia and MathOverflow are data sets containing corresponding data of power grids. We evaluate the accuracy of the model from two aspects. The derivation formula represents that in the process of connecting between reasoning nodes, both the head node and the tail node have appeared in the training stage, while the induction formula represents that at least one of the head node and the tail node has not appeared in the training stage. In short, the induction formula is a more stringent reasoning condition than the derivation formula, because at least one node has not appeared in the training stage, and information such as node embedding is in the initial state and has not been adjusted, which tests the generalization ability of the model even more. The experimental results show that the model constructed by the present invention surpasses all other methods in the derivation formula setting, with accuracy rates of 94.67, 93.50, 94.91, and 98.78, respectively, and also exceeds or is comparable to other methods in the induction formula setting. Embodiment 2
[0037] like Figure 4 As shown, the present invention provides a quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction system, which is used to implement the quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method of the above-mentioned embodiment 1, specifically comprising: The data collection and division module 100 is used to collect relevant data of the power grid dynamic knowledge graph, including the status, connection relationship, and timestamp of power grid equipment, construct a data set, and divide the data set into a training set and a test set; A model building module 200 is used to build a power grid dynamic knowledge graph link prediction model based on quantum walk and quantum thermodynamics, the model includes a quantum migration perception encoder and a temperature perception hybrid expert model decoder; The quantum migration-aware encoder is used to sample subgraphs based on the dynamic knowledge graph with the node to be inferred as the central node to obtain a subgraph structure centered on the central node. Based on the subgraph structure, quantum walks are performed on the subgraph to calculate the quantum bias value from the central node to each node. Based on the subgraph structure and the quantum bias value, the graph attention network is used to aggregate information from neighboring nodes, and the quantum bias is introduced to adjust the attention weight to obtain the updated embedding of the central node. The temperature-aware hybrid expert model decoder is used to calculate the global evolution characteristics of the dynamic knowledge graph based on the continuous moment data of the dynamic knowledge graph; based on the embedding of the central node, the edge time, and the global evolution characteristics, the prediction results of the edges that may exist in the future are obtained; The model training module 300 is used to train the model using the training set data, optimize the model parameters through the back propagation algorithm, and obtain the trained model; The model evaluation module 400 is used to evaluate the trained model using a test set.
[0038] A quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction system of the present embodiment is used to implement the aforementioned quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method. Therefore, the specific implementation method of the quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction system can be seen in the embodiment part of the quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method in the previous text. For example, the data collection and division module 100, the model construction module 200, the model training module 300, and the model evaluation module 400 are respectively used to implement steps S1, S2, S3, and S4 in the aforementioned quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method. Therefore, its specific implementation method can refer to the description of the corresponding various parts of the embodiment. In order to avoid redundancy, it will not be repeated here. Embodiment 3
[0039] An embodiment of the present invention provides an electronic device, which includes a processor, a memory and a bus system. The processor and the memory are connected through the bus system. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the above-mentioned quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method. Embodiment 4
[0040] An embodiment of the present invention provides a computer storage medium, which stores a computer software product. The computer software product includes several instructions for enabling a computer device to execute the above-mentioned quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method.
[0041] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0042] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0043] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0044] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from them are still within the protection scope of the invention.
Claims
1. A quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method, characterized in that: include: Collect relevant data of the power grid dynamic knowledge graph, including the status, connection relationship, and timestamp of power grid equipment, build a data set, and divide the data set into a training set and a test set; Constructing a power grid dynamic knowledge graph link prediction model based on quantum walk and quantum thermodynamics, the model includes a quantum migration-aware encoder and a temperature-aware hybrid expert model decoder; The quantum migration perception encoder is used to perform subgraph sampling based on a dynamic knowledge graph with the node to be inferred currently as the central node to obtain a subgraph structure centered on the central node; Based on the subgraph structure, quantum walks are performed on the subgraph to calculate the quantum bias value from the central node to each node. Based on the subgraph structure and quantum bias value, a graph attention network is used to aggregate information from neighboring nodes, and quantum bias is introduced to adjust the attention weight to obtain the updated embedding of the central node. The temperature-aware hybrid expert model decoder is used to calculate the global evolution characteristics of the dynamic knowledge graph based on the continuous moment data of the dynamic knowledge graph; Based on the embedding of the central node, the edge time, and the global evolution characteristics, the prediction results of the edges that may exist in the future are obtained; Use the training set data to train the model, optimize the model parameters through the back propagation algorithm, and obtain the trained model; Use the test set to evaluate the trained model.
2. The method for predicting power grid dynamic knowledge graph links based on quantum walk and quantum thermodynamics according to claim 1 is characterized in that: The dynamic knowledge graph is a quadruple arranged in chronological order, and the quadruple includes a head entity, a relationship, a tail entity, and time; The entities are power grid equipment and faults, the edges are between power grid equipment and faults, and the quadruple represents that a certain fault occurred in a certain power grid equipment at a certain time.
3. The method for predicting power grid dynamic knowledge graph links based on quantum walk and quantum thermodynamics according to claim 1, characterized in that: The method for performing subgraph sampling based on the dynamic knowledge graph and taking the node to be inferred as the central node is as follows: Based on the dynamic knowledge graph, subgraph sampling is performed with the node to be inferred as the central node. The sampling range is within the k-step range of the central node, where K is the number of walks. The sampling has a fixed upper limit, and edges that appear later are prioritized.
4. The method for predicting power grid dynamic knowledge graph links based on quantum walk and quantum thermodynamics according to claim 1, characterized in that: Based on the subgraph structure, quantum walking is performed on the subgraph to calculate the quantum bias value from the central node to each node, specifically including: Based on the subgraph structure, a virtual self-loop is added to the sampled subgraph to calculate the quantum bias value from the central node to other sampled nodes. The virtual self-loop means that when inferring possible edges, an edge pointing to the central node is added to the central node, and the time is the inference time. The quantum bias value is defined as the average probability that the quantum can be observed at each node of the subgraph after a sufficiently long time from the central node. The calculation formula is: ; ; in, is the system Hamiltonian matrix, and , is the Hamiltonian matrix Different eigenvalues, is the sum of eigenvalue matrices with the same eigenvalue; It is the time limit; It is not a specific time; and It's time The quantum conjugate matrix when ; It's in time When , the probability matrix of quantum starting from different nodes being observed at the node; Calculate the quantum bias matrix Afterwards, the quantum bias value of the central node relative to other nodes can be obtained based on the serial number of the central node.
5. The method for predicting power grid dynamic knowledge graph links based on quantum walk and quantum thermodynamics according to claim 1, characterized in that: Based on the subgraph structure and quantum bias value, the graph attention network is used to aggregate information from neighboring nodes, and the quantum bias is introduced to adjust the attention weight to obtain the updated embedding of the central node, which specifically includes: Based on the subgraph structure, the attention value of the central node compared to the neighboring nodes is calculated. First, the original feature-based attention value is calculated by the graph attention network method, and then the quantum bias value calculated in the previous step is added to calculate it by the following formula: ; in, is the matrix transpose symbol; is the quantum bias value; Is a node Relative Node The quantum bias value of It's in time by The subgraph obtained by sampling the central node; is the value after the embedding of the central node changes linearly; is the embedding dimension, which is used to scale the attention value so that it is not too sparse; and It is the value after the linear change of the embedding of the central node, neighboring nodes and edges connecting the central node. The calculation process is as follows: ; ; in, It is a concatenation operation that combines multiple vectors into a longer vector; It is a time coding model based on trigonometric functions; is time, and The total number of edges between ; It is Node embedding of layers; is the time when reasoning takes place; is the timestamp of the selected edge, that is, the time when the corresponding event occurs; and is the parameter projection matrix; Nodes aggregate neighbor information, the formula is as follows: ; in, is the embedding of the edges connecting the neighbor nodes to the central node; is the softmax activation function; It is Node embedding after layer update; Represents the central node The set of neighbor nodes of Finally, a multi-layer perceptron network is used to fuse the aggregation of neighbor information and the historical embedding of the node itself to generate the final node embedding. The formula is as follows: ; in, It is a multi-layer perceptron; It is Node embedding of the layer.
6. The method for predicting links in a power grid dynamic knowledge graph of quantum walk and quantum thermodynamics according to claim 1, characterized in that: The continuous time data of the dynamic knowledge graph is used to calculate the global evolution characteristics of the dynamic knowledge graph, which specifically includes: Assuming that the dynamic knowledge graph system is a system with constant volume, we get ,in is the temperature, represents the energy of the system, Represents the entropy of the system; von Neumann entropy is used as the entropy of the system, and the von Neumann entropy is calculated using an approximate calculation method. The calculation formula is as follows: ; in, is the number of nodes; is the von Neumann entropy; , Respectively represent nodes , degree, that is, the degree of the node , Number of connected edges; represents all the edges contained in the dynamic knowledge graph at the current moment; it is roughly considered that the scale of the dynamic knowledge graph represents the energy of the graph, expressed as ,in is a constant; determine two moments and calculate the quantum thermodynamic temperature by calculating the changes in entropy and energy at the two moments ; By using different times, multiple quantum thermodynamic temperatures are obtained. They reflect the changing trend of the current network state compared with the previous network state from different angles, and constitute the global evolution characteristics of the dynamic knowledge graph at the current moment, which are expressed as follows: ; in, is a global evolution feature, Represents the temperature values at different angles.
7. The method for predicting power grid dynamic knowledge graph links based on quantum walk and quantum thermodynamics according to claim 1, characterized in that: The prediction results of possible edges in the future are obtained based on the embedding of the central node, the edge connection time, and the global evolution characteristics, which specifically include: A multi-layer perceptron is selected as the sub-decoder. Based on the embedding of the central node and the edge time, the sub-decoder predicts whether a given node will have a corresponding connection with the head node at this time. Based on the global evolution characteristics, the expert mixture model is used to generate corresponding weights for different sub-decoders. Finally, the weighted sum of the results of all sub-decoders is used to obtain the prediction results of the edges that may exist in the future. The decoding process is expressed as follows: ; ; in, A score indicating the likelihood of a connection existing; , Represents the central node , Embedding is the number of experts; It is a global evolutionary feature; is the projection parameter matrix; is the normalized weight, which represents the importance of the corresponding expert in judging whether this connection exists or not; It is a multi-layer perceptron; is the softmax activation function.
8. A quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction system, characterized in that: The system is used to implement the quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method according to any one of claims 1 to 7, specifically comprising: The data collection and division module is used to collect relevant data of the power grid dynamic knowledge graph, including the status, connection relationship, and timestamp of power grid equipment, build a data set, and divide the data set into a training set and a test set; A model building module, used to build a power grid dynamic knowledge graph link prediction model based on quantum walk and quantum thermodynamics, wherein the model includes a quantum migration-aware encoder and a temperature-aware hybrid expert model decoder; The quantum migration-aware encoder is used to perform subgraph sampling based on a dynamic knowledge graph with the node to be inferred as the central node to obtain a subgraph structure centered on the central node; based on the subgraph structure, quantum walks are performed on the subgraph to calculate the quantum bias value from the central node to each node; based on the subgraph structure and the quantum bias value, a graph attention network is used to aggregate information from neighboring nodes, and quantum bias is introduced to adjust the attention weight to obtain an updated embedding of the central node; The temperature-aware hybrid expert model decoder is used to calculate the global evolution characteristics of the dynamic knowledge graph based on the continuous time data of the dynamic knowledge graph; based on the embedding of the central node, the edge time, and the global evolution characteristics, the prediction results of the edges that may exist in the future are obtained; The model training module is used to train the model using the training set data and optimize the model parameters through the back propagation algorithm to obtain a trained model; The model evaluation module is used to evaluate the trained model using the test set.
9. An electronic device, characterized in that: The electronic device includes a processor, a memory and a bus system, the processor and the memory are connected through the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer software product, which includes several instructions for enabling a computer device to execute the quantum walk and quantum thermodynamics power grid dynamic knowledge graph link prediction method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Power grid fault processing knowledge graph completion method based on multi-task learning
CN115238086A
Time sequence knowledge graph embedding representation method
CN117725265A
Industrial knowledge graph and contextualization
US20230195095A1
Cited By
Relay protection device defect intelligent positioning method based on knowledge graph
CN119377757A
Large-scale knowledge graph construction system based on graph neural network
CN120598015A
A large-scale knowledge graph construction system based on a graph neural network
CN120598015B
Wireless communication physical isolation method and system based on 6G spatial multiplexing
CN121772011A
Wireless communication physical isolation method and system based on 6g spatial multiplexing
CN121772011B
