Power emergency resource allocation method and system based on knowledge graph and improved graph neural network
By building a knowledge graph model of multi-source data and an improved relationship graph convolution network, the problems of insufficient data utilization and low intelligence in the traditional power emergency resource allocation method are solved, efficient and accurate allocation of power emergency resources are achieved, and emergency response capabilities and recovery efficiency are improved.
Patent Information
- Application Number
- CN202510283103.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-03-11
AI Technical Summary
Traditional power emergency resource allocation methods rely on a single data source, fail to make full use of multi-source data, have limited knowledge representation capabilities, low intelligence level, and are difficult to generate optimal allocation solutions.
Build a multi-source data model based on knowledge graphs, use an improved relationship graph convolution network for knowledge reasoning, and generate the optimal resource allocation plan.
It has achieved efficient and precise allocation of power emergency resources, and improved emergency response capabilities and recovery efficiency.
Smart Images

Figure CN120218504B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power system emergency management and intelligent decision-making technology, and in particular to a power emergency resource allocation method based on knowledge graph and improved graph neural network. Background Art
[0002] The power system is an important infrastructure in modern society, and its stable operation is directly related to the normal operation of the national economy and people's lives.
[0003] However, during operation, the power system may face various emergencies such as natural disasters (such as typhoons, earthquakes, and floods), equipment failures, and human damage. These events may cause large-scale power outages, resulting in serious economic losses and social impacts.
[0004] Therefore, how to quickly and accurately deploy emergency resources and restore power supply when an emergency occurs is the core issue of emergency management in the power system.
[0005] However, traditional power emergency resource allocation methods mainly rely on manual experience and rule bases, and have the following limitations: First, insufficient data utilization. Traditional methods usually rely on only a single data source (such as power grid operation data) and fail to fully utilize multi-source data such as historical cases, meteorological information, and resource distribution, resulting in incomplete decision-making basis; Second, limited knowledge representation capabilities. Emergency resource allocation involves complex entity relationships (such as equipment, personnel, materials, disaster types, etc.). Traditional methods find it difficult to effectively represent and utilize these relationships, resulting in low decision-making accuracy; Third, the level of intelligence is low. Traditional methods lack intelligent reasoning and optimization capabilities, making it difficult to extract effective information from massive data and generate optimal allocation plans.
[0006] Glossary:
[0007] Self-loop: Self-loop connection refers to a mechanism in which each node retains and processes its own information during the feature update process. Summary of the Invention
[0008] The technical problem to be solved by the present invention is to propose a method and system for power emergency resource allocation based on knowledge graph and improved graph neural network in response to the shortcomings of the existing technology.
[0009] In order to solve the above technical problems, the technical solutions of the present invention are as follows:
[0010] A method for power emergency resource allocation based on knowledge graph and improved graph neural network includes the following steps:
[0011] S1, extracting entities and relationships between entities from multi-source data to build a knowledge graph;
[0012] S2, mapping the constructed knowledge graph to the vector space, generating vectorized representations for each entity and relationship in the knowledge graph, and obtaining vectorized data of the knowledge graph;
[0013] S3, dividing the vectorized data of the knowledge graph into a training set, a validation set, and a test set; constructing an improved relational graph convolutional network model, and training the improved relational graph convolutional network model through the training set, adjusting the hyperparameters of the improved relational graph convolutional network model through the validation set, and evaluating the generalization ability of the improved relational graph convolutional network model through the test set, thereby obtaining a trained improved relational graph convolutional network model;
[0014] S4, updating the newly occurred emergency event information in the knowledge graph, expanding the faulty equipment, impact range and emergency resource information to obtain an updated knowledge graph; mapping the updated knowledge graph to the vector space to obtain vectorized data of the updated knowledge graph;
[0015] S5, extracting the subgraph corresponding to the newly occurred emergency event from the updated knowledge graph, generating a vectorized representation for the subgraph, inputting the trained improved relational graph convolutional network model for knowledge reasoning, and generating the optimal resource allocation plan.
[0016] In a further improvement, the multi-source data includes a historical emergency case database, an emergency resource management system, and a meteorological monitoring system;
[0017] The entities include the affected object, fault type, maintenance personnel, emergency supplies and disaster type;
[0018] The relationships between the entities include equipment-fault relationship, personnel-equipment relationship and material-equipment relationship;
[0019] The knowledge graph is a power emergency resource allocation graph;
[0020] In the second step, the same or similar entities from different data sources are aligned, redundant information is merged, and a consistent power emergency knowledge system is formed. The extracted entities and relationships are stored in the Neo4j graph database in the form of triples to form a knowledge graph and realize the visualization of the knowledge graph; each triple is represented as (h, r, t), where h and t represent the head entity and tail entity respectively, and r represents the relationship.
[0021] For further improvement, the specific steps of step 2 are as follows:
[0022] Initialize each entity e i and relationship r j The vector representation of entities and relations is randomly assigned to a low-dimensional vector space. The vector representation of entities and relations is generated by the following formula:
[0023]
[0024] d is the vector dimension, ranging from 50 to 300; e i is the i-th entity; r j is the jth relationship, represents a d-dimensional vector in the real number field;
[0025] The rationality of the triple is measured by calculating the distance between the sum of the head entity vector and the relationship vector in the triple and the tail entity vector through the scoring function f(h,r,t):
[0026] f(h,r,t)=||h+rt||
[0027] h, r, and t represent the vector representations of the head entity, relation, and tail entity, respectively;
[0028] The smaller the value of f(h,r,t), the more reasonable the triple is;
[0029] Then extract all positive sample triplets from the knowledge graph Then generate a negative sample triple for each positive sample triple;
[0030] Construct the loss function L for positive sample triplets and negative sample triplets:
[0031]
[0032] (h′, r, t′) is a negative sample triplet; γ is a margin parameter, set to 1-2; max means taking the maximum value;
[0033] Use stochastic gradient descent or the Adam optimizer to gradually adjust the vector representations of entities and relationships. In each round of training, randomly sample a batch of positive samples and corresponding negative samples, calculate the value of the loss function, calculate the gradient through the backpropagation algorithm, and update the vector representations of entities and relationships.
[0034] After training, each entity and relation is mapped into a low-dimensional vector space to generate an embedding representation.
[0035] Further improvement, in step three:
[0036] For each relationship type r, construct an adjacency matrix A r , where A r [i,j]=1 means there is a relationship r between entity i and entity j, otherwise it is 0;
[0037] Then construct the node feature matrix Each row corresponds to the embedding representation of an entity, N represents the number of entities, and d represents the vector dimension;
[0038] The node feature matrix and the adjacency matrix are used as inputs of the graph convolutional network model;
[0039] The graph convolutional network model includes an input layer, a graph convolution layer, a graph pooling layer, and a fully connected layer in the order of data processing. The multi-layer graph convolution layer includes three RGCN layers, and the output of the previous RGCN layer is used as the input of the next RGCN layer. The first RGCN layer is used to learn direct associations, the second RGCN layer is used to capture indirect associations, and the third RGCN layer is used to integrate global information to generate the final feature representation of the node.
[0040] The data processing flow of each RGCN layer in the multi-layer relational graph convolutional network is as follows:
[0041] 3.1 Introducing dynamic weight calculation module: The multi-layer relationship graph convolutional network introduces a dynamic weight calculation module for each relationship type r. The dynamic weight calculation module generates a dynamic weight α based on the context information of the current event. r :α r =softmax(W c c+b r )
[0042] Among them, c is the context vector of the current event, W c and b r is a learnable parameter, and softmax represents a normalized exponential function;
[0043] 3.2 Message Generation: For each neighbor node u of node v, generate a message under the relationship r
[0044] Among them, W r ′=α r W r , W r is the weight matrix corresponding to the relationship r, h u is the current feature representation of neighbor node u;
[0045] 3.3 Neighbor aggregation: Aggregate all neighbor messages under the same relationship r and calculate
[0046] Among them, c v,r is the normalization coefficient, usually Represents the set of neighbor nodes of node v under relationship r;
[0047] 3.4 Cross-relationship aggregation: aggregation results of all relationship types Add and superimpose the self-loop connection W0h to preserve the node's own characteristics. W0 is the weight matrix of the self-loop, and h is the feature representation of the current node.
[0048] 3.5 Feature Update: Update node features through nonlinear activation function σ:
[0049]
[0050] in, represents the feature representation of node v at layer l, R represents the set of relationship types, W' r and W0 are the weight matrices of relation r and self-loop respectively; Represents the feature representation of node u at layer l.
[0051] As a further improvement, the loss function of the improved graph convolutional network model during training is as follows:
[0052]
[0053] Among them, y i represents the true label, Represents the model prediction value; N represents the total number of samples, that is, the number of samples contained in the current training batch or dataset.
[0054] For further improvement, the specific steps of step 4 are as follows:
[0055] When a new power emergency occurs, the latest data is first obtained from relevant data sources in real time. Then, natural language processing technology is used to automatically extract entities and their relationships from the latest data. Incremental learning technology is used to integrate the newly extracted entities and relationships into the existing knowledge graph in the form of triples to obtain an updated knowledge graph.
[0056] For further improvement, the specific steps of step five are as follows:
[0057] The knowledge graph subgraph related to the current event is extracted from the updated knowledge graph, a vectorized representation is generated for the knowledge graph subgraph related to the event, and the trained improved relational graph convolutional network model is input. The trained improved relational graph convolutional network model generates multiple resource allocation plans, and sorts the resource allocation plans according to the success rate or execution time; the resource allocation plans other than the optimal plan are used as backup plans; when the optimal plan cannot be executed, the backup plans are selected in order for execution.
[0058] For further improvement, the actual effect of the resource allocation plan is recorded after execution and integrated into the knowledge graph as new knowledge.
[0059] A power emergency resource allocation system based on a knowledge graph and an improved graph neural network includes a memory and a processor. The memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the power emergency resource allocation method based on a knowledge graph and an improved graph neural network.
[0060] Compared with the prior art, the present invention has the following beneficial effects:
[0061] The present invention introduces a dynamic relationship weight mechanism into the classic relationship graph convolutional network, dynamically adjusts the relationship weight for different situations, accurately identifies entity information, realizes efficient and accurate deployment of personnel and emergency materials, and improves the emergency response capability and recovery efficiency of the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 Schematic diagram of the basic process of the method of the embodiment of the present invention.
[0063] Figure 2 A flow chart is constructed for the knowledge graph of the method according to the embodiment of the present invention.
[0064] Figure 3 This is a computational graph for updating the R-GCN model nodes in the method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0065] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 making creative efforts shall fall within the scope of protection of the present invention.
[0066] like Figure 1 As shown, the present invention proposes a method for power emergency resource allocation based on knowledge graph and improved graph neural network, which includes the following steps:
[0067] Step S1: Extract key entities and their relationships from multi-source data to construct a knowledge graph for power emergency resource allocation, such as Figure 2 As shown, specifically including:
[0068] First, we obtain raw data from multiple data sources, such as the historical emergency case database, emergency resource management system, and meteorological monitoring system. The data content includes:
[0069] Historical emergency cases: disaster location, affected objects, fault type, impact range, response plan, etc.;
[0070] Emergency resource data: maintenance personnel, emergency supplies, vehicles and equipment, etc.;
[0071] Meteorological data: typhoon path, rainfall, wind speed, etc.;
[0072] Then, natural language processing (NLP) techniques (such as named entity recognition and relation extraction) and rule matching methods are used to extract key entities and their relations from the text data.
[0073] Extractable entities include, but are not limited to:
[0074] Affected objects: transformers, transmission lines, distribution cabinets, etc.
[0075] Fault type: short circuit, disconnection, overload, etc.
[0076] Maintenance personnel: engineers, technicians, etc.;
[0077] Emergency supplies: generators, cables, insulation equipment, etc.;
[0078] Disaster type: typhoon, earthquake, flood, etc.;
[0079] Relationships that can be extracted include but are not limited to:
[0080] Equipment-fault relationship: a certain equipment has a certain fault;
[0081] Personnel-equipment relationship: a person is responsible for maintaining a certain equipment;
[0082] Material-equipment relationship: a material is used to repair a certain equipment;
[0083] Then, knowledge fusion is performed to integrate data from different sources, eliminate redundancy and ensure data consistency, including:
[0084] Entity alignment technology is used to process different names or attributes representing the same entity from different data sources to ensure unified representation of the same entity;
[0085] Resolve polysemous and ambiguous words in relationship extraction to make the meaning of each relationship in the graph clear;
[0086] For multiple data sources of the same type, information is merged, such as integrating data obtained from different equipment status sources to ensure the integrity of the status and attribute information of power equipment.
[0087] The extracted entities and relationships are then stored as triples in a Neo4j graph database, with appropriate attributes added to them. Neo4j is a high-performance graph database widely used in recommendation systems, knowledge graphs, and other fields. Other graph databases can also be used to store knowledge graphs. Neo4j's visualization capabilities are used to display the structure and content of the knowledge graph.
[0088] Each triple is represented as (h, r, t), where h and t represent the head entity and tail entity respectively, and r represents the relationship. For example: (Team A, responsible for maintenance, transformer B).
[0089] Step S2: Map the constructed knowledge graph to the vector space and generate an embedded representation for each entity in the knowledge graph, specifically including:
[0090] Initialize each entity e i and relationship r j The vector representation of entities and relationships is randomly assigned to a low-dimensional vector space. The vector representation of entities and relationships is generated by the following formula:
[0091]
[0092] d is the vector dimension, usually between 50 and 300;
[0093] Define a scoring function to measure the rationality of a triple (head entity, relationship, tail entity) in the knowledge graph. In TransE, the scoring function measures the rationality of a triple by calculating the distance between the sum of the head entity vector and the relationship vector and the tail entity vector. The formula is as follows:
[0094] f(h,r,t)=||h+rt||
[0095] Among them, h, r, and t represent the vector representations of the head entity, relation, and tail entity respectively;
[0096] The smaller the value of the scoring function, the more reasonable the triple is.
[0097] Then extract all positive sample triplets from the knowledge graph
[0098] Generate a negative sample triple for each positive sample triple. The generation method of negative samples includes: randomly replacing the head entity or tail entity; randomly replacing the relationship.
[0099] For example, for a positive sample (transformer A, faulty, short-circuited), the generated negative sample may be (transformer A, faulty, overloaded) or (transformer B, faulty, short-circuited).
[0100] In order to optimize the embedding of the knowledge graph, it is necessary to minimize the loss function, which is usually composed of positive examples and negative examples. The goal of the loss function is to adjust the vectors of entities and relations so that the score of the positive triple is smaller and the score of the negative triple is larger. Common loss functions are:
[0101]
[0102] in, represents the set of positive sample triplets; (h′, r, t′) is the negative sample triplet; γ is the margin parameter (usually set to 1-2); the goal of the loss function is to make the score of positive samples as low as possible and the score of negative samples as high as possible.
[0103] Use stochastic gradient descent (SGD) or Adam optimizer to gradually adjust the vector representations of entities and relations;
[0104] In each round of training: a batch of positive samples and corresponding negative samples are randomly sampled from the training data; the value of the loss function is calculated; the gradient is calculated through the backpropagation algorithm, and the vector representation of entities and relations is updated.
[0105] After training, each entity and relation is mapped into a low-dimensional vector space to generate its embedding representation.
[0106] Step S3: Build an improved graph convolutional network model, using the vectorized data of the knowledge graph as input to learn the deep relationships between entities, specifically including:
[0107] First, the embedded representations of entities and relations generated in step S2 are taken as input. The embedding vector of each entity e is The embedding vector of each relation r is
[0108] Next, we construct an adjacency matrix based on the entities and relationships in the knowledge graph. For each relationship type r, we construct an adjacency matrix A r , where A r [i,j]=1 means there is a relationship r between entity i and entity j, otherwise it is 0;
[0109] Then, construct the node feature matrix Each row corresponds to the embedding representation of an entity. The node feature matrix and adjacency matrix will be used as input to the graph convolutional network model;
[0110] A multi-layer relational graph convolutional network (RGCN) is designed, where each layer aggregates information about neighboring nodes through a message passing mechanism. Figure 3 As shown, the specific process is as follows:
[0111] (1) Introducing a dynamic weight calculation module: A dynamic weight calculation module is introduced for each relationship type r. This module generates a dynamic weight α based on the context information of the current event (such as event type, severity, and impact range). r , and its calculation formula is:
[0112] α r =softmax(W c c+b r )
[0113] Among them, c is the context vector of the current event, W c and b r is a learnable parameter;
[0114] (2) Message generation: For each neighbor node u of node v, a message is generated under the relationship r.
[0115] Among them, W′ r =α r W r , W r is the weight matrix corresponding to the relationship r, h u is the current feature representation of neighbor node u;
[0116] (3) Neighbor aggregation: Aggregate all neighbor messages under the same relationship r and calculate
[0117] Among them, c v,r is the normalization coefficient, usually
[0118] (4) Cross-relationship aggregation: Add the aggregation results of all relationship types and superimpose the self-loop connection W0h v (Retain the node's own characteristics);
[0119] (5) Feature update: Update node features through nonlinear activation function σ (such as ReLU):
[0120]
[0121] in, represents the feature representation of node v at layer l, R represents the set of relationship types, Represents the set of neighbor nodes of node v under relationship r, W' r and W0 are the weight matrices of relation r and self-loop respectively.
[0122] Through multi-layer graph convolution operations, high-level relationships between entities are gradually extracted. For example, 2-3 layers of RGCN are used, and the output of each layer is used as the input of the next layer.
[0123] First level: learning direct associations (e.g., “Transformer A - fault - short circuit”);
[0124] The second layer: captures indirect associations (e.g., the association between "short circuit-affected area-area B" and "area B-needs deployment-generator C");
[0125] The third layer: integrates global information and generates the final feature representation of the node;
[0126] The historical power emergency cases were divided into a training set (70%), a validation set (15%), and a test set (15%); the training set was used to train the model parameters, the validation set was used to adjust the hyperparameters (such as learning rate and number of layers), and the test set was used to evaluate the model's generalization ability;
[0127] Define the loss function based on the task requirements. For example, for the resource allocation plan generation task, the mean square error (MSE) loss function can be used:
[0128]
[0129] Among them, y i represents the true label (such as the effect score of the resource allocation plan), represents the model prediction value;
[0130] Use stochastic gradient descent (SGD) or the Adam optimizer to gradually adjust the model parameters. In each round of training, a batch of data is randomly sampled from the training set, the model output and loss function values are calculated, the gradient is calculated through the backpropagation algorithm, and the model parameters are updated. During the training process, an early stopping strategy can be used to prevent overfitting.
[0131] Adjust hyperparameters (such as learning rate, number of RGCN layers, etc.) on the validation set to select the optimal model configuration.
[0132] Step S4: Update the newly occurred emergency event information in the knowledge graph, expand the fault equipment, impact range and emergency resource information, specifically including:
[0133] When a new power emergency occurs, the system first obtains the latest data in real time from relevant data sources (such as power grid monitoring systems, meteorological warning systems, and emergency resource management systems). This data includes faulty equipment information (such as faulty equipment name, fault type, and fault location), impact range data (such as power outage area and number of affected users), and emergency resource status (such as maintenance personnel location, material inventory, and vehicle availability).
[0134] Leveraging natural language processing (NLP) technology, we automatically extract key entities and their relationships from new data. For example, from a fault report, we can extract "transformer A" as the faulty device, "short circuit" as the fault type, "region B" as the affected area, "engineer C" as the maintenance personnel, and "generator D" as the emergency supplies.
[0135] Semantically align and fuse the extracted entities and relationships. For example, if the "transformer A" in the new data is the same entity as the "transformer A" already in the knowledge graph, their attributes are merged; if it is a new entity (such as "generator D"), it is added as a new node to the knowledge graph;
[0136] Integrate the newly extracted entities and relations into the existing knowledge graph in the form of triples. For example, add the triples (transformer A, fault, short circuit), (short circuit, affected area, area B), (engineer C, responsible for repairing transformer A), and (generator D, can be used to repair transformer A).
[0137] Dynamically update the knowledge graph to ensure it contains the latest environmental information and emergency resource distribution. For example, update the status of "Transformer A" to "fault", update the number of power outage users in "Area B", and update the inventory quantity of "Generator D";
[0138] Mark the time attribute of the relevant information of the new emergency event to distinguish whether it is the information of the current emergency event, and also facilitate the extraction of the subgraph related to the current event in the knowledge graph as the input of knowledge reasoning;
[0139] During the update process, incremental learning techniques are used to avoid rebuilding the entire knowledge graph. For example, embedding representations are trained only for newly added entities and relationships, while the embedding representations of existing entities and relationships related to them are adjusted.
[0140] The visualization capabilities of the Neo4j graph database allow for real-time display of updated knowledge graphs. For example, newly added faulty equipment, impacted areas, and emergency resources are displayed as nodes of different colors or shapes in the visualization interface, allowing decision makers to intuitively understand the latest situation.
[0141] The updated knowledge graph will serve as input to the relational graph convolutional network model for subsequent knowledge reasoning and resource allocation plan generation. For example, the model can use the latest fault information of "Transformer A" and the available information of "Generator D" to generate a more accurate emergency resource allocation plan.
[0142] Step S5: Use the relational graph convolutional network model to perform knowledge reasoning and generate the optimal resource allocation plan, which specifically includes:
[0143] Extract the subgraph related to the current event from the updated knowledge graph;
[0144] The updated knowledge graph includes information such as the faulty equipment, impact range, available resources, etc. of the current emergency event, as well as historical event information directly related to the current event;
[0145] Input the extracted knowledge graph subgraph into the trained relational graph convolutional network (RGCN) model;
[0146] The model uses a message passing mechanism to perform multi-hop reasoning in the knowledge graph, capturing the deep relationships between entities. For example, starting from the faulty device "Transformer A", the model can infer the following path:
[0147] Transformer A → fault → short circuit;
[0148] Short circuit → affected area → area B;
[0149] Area B → Need to deploy → Generator D;
[0150] Generator D → availability → sufficient stock;
[0151] Based on the inference results, the model generates multiple resource allocation plans. Each plan includes the following information:
[0152] Deployed maintenance personnel (e.g. Engineer C, Engineer G);
[0153] Deployed emergency supplies (such as generator D and generator H);
[0154] Estimated execution time (e.g., 3 hours, 4.5 hours);
[0155] Success rate assessment (e.g., 90%, 85%);
[0156] The generated solutions are scored and sorted. The scoring takes into account both execution time and success rate. When the preferred solution cannot be executed, alternative solutions can be used for resource allocation.
[0157] The finalized resource allocation plan is submitted to the emergency dispatch system. After the plan is executed, the actual results (such as actual time consumption, actual cost, and repair success rate) are recorded and integrated into the knowledge graph as new knowledge. For example, the triples (engineer C, repair successful, transformer A) and (generator D, usage status, inventory reduction) are added.
[0158] Highly rated alternatives to the optimal resource allocation plan are stored as backup plans in the emergency dispatch system. If the optimal resource allocation plan cannot be executed due to road congestion, weather conditions, or other factors, the backup plan selection mechanism is automatically triggered. During the execution of the backup plan, changes in the external environment are continuously monitored. If the backup plan also fails to execute, the knowledge inference process is restarted to generate a new resource allocation plan, ensuring the continuity and reliability of the emergency response.
[0159] It should be understood that although the steps in the flowcharts of the above embodiments are shown in the order indicated by the arrows, these steps do not necessarily have to be performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict limitation on the order in which these steps are performed and they may be performed in other orders. In addition, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or stages, which do not have to be completed simultaneously, and their execution order may also be discontinuous, and they may be performed alternately with other steps or steps or stages in other embodiments.
[0160] The various technical features in the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the various technical features in the above embodiments are described in detail. As long as the combination of these technical features is not contradictory, it should be considered within the scope of this specification.
[0161] In addition, the functional modules in each embodiment of the present invention can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it 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 and includes several instructions for enabling 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 of each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0162] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A method for power emergency resource allocation based on knowledge graph and improved graph neural network, characterized in that: The steps include: Step 1: Extract entities and relationships between entities from multi-source data to build a knowledge graph; Step 2: Map the constructed knowledge graph to the vector space, generate vectorized representations for each entity and relationship in the knowledge graph, and obtain the vectorized data of the knowledge graph: Initialize each entity and relationships The vector representation of entities and relations is randomly assigned to a low-dimensional vector space. The vector representation of entities and relations is generated by the following formula: ; is the vector dimension, ranging from 50 to 300; For the Entity For the A relationship, Represents the real number field dimensional vector; Through the scoring function The rationality of the triple is measured by calculating the distance between the sum of the head entity vector and the relationship vector in the triple and the tail entity vector: ; The vector representations of the head entity, relation, and tail entity respectively; The smaller the value of , the more reasonable the triple is; Then extract all positive sample triplets from the knowledge graph , and then generate a negative sample triple for each positive sample triple; Construct a loss function for positive and negative sample triplets : ; is a negative sample triplet; is the marginal parameter, set to 1-2; max means taking the maximum value; Use stochastic gradient descent or the Adam optimizer to gradually adjust the vector representations of entities and relations. In each round of training, randomly sample a batch of positive samples and corresponding negative samples and calculate the value of the loss function. Calculate the gradient through the back-propagation algorithm and update the vector representation of entities and relations; After training, each entity and relation is mapped to a low-dimensional vector space to generate an embedded representation; Step 3: Divide the vectorized data of the knowledge graph into a training set, a validation set, and a test set; construct an improved relational graph convolutional network model, and train the improved relational graph convolutional network model through the training set, adjust the hyperparameters of the improved relational graph convolutional network model through the validation set, and evaluate the generalization ability of the improved relational graph convolutional network model through the test set to obtain a trained improved relational graph convolutional network model: For each relationship type , construct an adjacency matrix ,in Representing an entity and entities There is a relationship between , otherwise 0; Then construct the node feature matrix , where each row corresponds to the embedding representation of an entity, N represents the number of entities, Represents vector dimension; The node feature matrix and the adjacency matrix are used as inputs of the graph convolutional network model; The graph convolutional network model includes multiple layers of graph convolutional layers, each of which includes three RGCN layers. The output of the previous RGCN layer serves as the input of the next RGCN layer. The first RGCN layer is used to learn direct associations, the second RGCN layer is used to capture indirect associations, and the third RGCN layer is used to integrate global information to generate the final feature representation of the node. The data processing flow of each RGCN layer in the multi-layer relational graph convolutional network is as follows: 3.1 Introducing dynamic weight calculation module: multi-layer relationship graph convolution network for each relationship type r Introduce a dynamic weight calculation module, which generates dynamic weights based on the context information of the current event : ; in, is the context vector of the current event, and is a learnable parameter, and softmax represents a normalized exponential function; 3.2 Message Generation: For each node Neighbor nodes , in the relationship Generate message ; in, , It's a relationship The corresponding weight matrix, Is a neighbor node The current feature representation of 3.3 Neighbor Aggregation: For the Same Relationship Aggregate all neighbor messages under ; in, is the normalization coefficient, usually Indicates that in the relationship Next node The set of neighbor nodes of 3.4 Cross-relationship aggregation: aggregation results of all relationship types Addition, superposition, self-loop connection , thereby retaining the node's own characteristics, is the weight matrix of the self-loop, is the feature representation of the current node; 3.5 Feature Update: Through Non-Linear Activation Function Update node characteristics: ; in, Representation node In the The feature representation of the layer, Represents a collection of relationship types, and Respectively and the weight matrix of the self-loop; Representation node In the Feature representation of the layer; Step 4: Update the newly occurred emergency event information in the knowledge graph, expand the fault equipment, impact range and emergency resource information to obtain an updated knowledge graph; map the updated knowledge graph to the vector space to obtain vectorized data of the updated knowledge graph; Step 5: Extract the subgraph corresponding to the newly occurred emergency event from the updated knowledge graph, generate a vectorized representation for the subgraph, input the trained improved relational graph convolutional network model for knowledge reasoning, and generate the optimal resource allocation plan.
2. The power emergency resource allocation method based on knowledge graph and improved graph neural network according to claim 1 is characterized in that: The multi-source data includes a historical emergency case database, an emergency resource management system, and a meteorological monitoring system; The entities include the affected object, fault type, maintenance personnel, emergency supplies and disaster type; The relationships between the entities include equipment-fault relationship, personnel-equipment relationship and material-equipment relationship; The knowledge graph is a power emergency resource allocation graph; In the second step, the same or similar entities from different data sources are aligned and redundant information is merged to form a consistent power emergency knowledge system. The extracted entities and relationships are stored in the form of triples in the Neo4j graph database to form a knowledge graph and realize the visualization of the knowledge graph; each triple is represented as ( h , r , t ),in h and t Represent the head entity and the tail entity respectively, r Indicates a relationship.
3. The power emergency resource allocation method based on knowledge graph and improved graph neural network according to claim 1 is characterized in that: The loss function of the improved graph convolutional network model during training is as follows: ; in, represents the true label, Represents the model prediction value; N represents the total number of samples, that is, the number of samples contained in the current training batch or dataset.
4. The power emergency resource allocation method based on knowledge graph and improved graph neural network according to claim 1 is characterized in that: The specific steps of step 4 are as follows: When a new power emergency occurs, the latest data is first obtained from relevant data sources in real time. Then, natural language processing technology is used to automatically extract entities and their relationships from the latest data. Incremental learning technology is used to integrate the newly extracted entities and relationships into the existing knowledge graph in the form of triples to obtain an updated knowledge graph.
5. The power emergency resource allocation method based on knowledge graph and improved graph neural network according to claim 1 is characterized in that: The specific steps of step five are as follows: The knowledge graph subgraph related to the current event is extracted from the updated knowledge graph, a vectorized representation is generated for the knowledge graph subgraph related to the event, and the trained improved relational graph convolutional network model is input. The trained improved relational graph convolutional network model generates multiple resource allocation plans, and sorts the resource allocation plans according to the success rate or execution time; the resource allocation plans other than the optimal plan are used as backup plans; when the optimal plan cannot be executed, the backup plans are selected in order for execution.
6. The power emergency resource allocation method based on knowledge graph and improved graph neural network according to claim 5 is characterized in that: After the resource allocation plan is executed, the actual effect is recorded and integrated into the knowledge graph as new knowledge.
7. A power emergency resource allocation system based on knowledge graph and improved graph neural network, characterized in that: It includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the power emergency resource allocation method based on the knowledge graph and the improved graph neural network as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Power grid fault plan generation method and system based on knowledge graph, and storage medium
CN116680417A
Power grid operation and maintenance deployment method and system based on knowledge graph
CN119396993A