Wind-solar-storage scheduling knowledge graph reasoning method and system based on local and global information
Patent Information
- Application Number
- CN202411439061.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2044-10-15
AI Technical Summary
然而,目前大多数技术仅建模单个实体邻域的局部信息,忽略了整个调度知识图谱的全局语义,这可能导致推理能力受限,无法捕捉风光储调度系统中各种资源、策略和管理措施节点之间的广泛关联特征,影响推理的准确性
[0073] Beneficial Effects: Compared with existing technologies, this invention combines global and local information to jointly influence the entity embedding representation in the wind-solar-storage scheduling knowledge graph. A KNN graph is constructed to capture the semantic similarity between entities (such as wind farms, photovoltaic power stations, and energy storage facilities) in the wind-solar-storage scheduling system, and this similarity is combined with the original graph to enrich the representation of relationships between entities. Local entity importance is constructed by cascading the output of a multi-head attention mechanism, which helps stabilize the self-attention learning process and encapsulates more information about neighboring entities in the wind-solar-storage scheduling system. An attention-based biased random walk algorithm, combined with DFS and BFS, is employed to collect global information, accurately assess the importance of each entity in the wind-solar-storage scheduling knowledge graph, and reduce information silos caused by local attention and isolation in the graph. Global entity importance is converted into attention weights and integrated into local entity importance, ensuring the accuracy and completeness of reasoning in the wind-solar-storage scheduling knowledge graph, thereby optimizing energy scheduling strategies.
Smart Images

Figure CN119294492B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a knowledge graph reasoning method and system for wind, solar and energy storage scheduling based on local and global information, belonging to the field of knowledge engineering technology, and is used for intelligent scheduling of wind, solar and energy storage systems. Background Technology
[0002] By utilizing wind, solar, and energy storage dispatch, the power system can effectively address the uncertainties of new energy generation, reduce dependence on fossil fuels, improve the utilization rate of new energy sources, and enhance system stability and reliability. However, traditional dispatch schemes often rely on the experience and knowledge of dispatchers, which not only places extremely high demands on the professional skills of dispatchers but also poses a serious challenge to human resource management.
[0003] To provide more systematic support for dispatching, a knowledge graph for wind, solar, and energy storage dispatching becomes crucial. A knowledge graph is a semantic network that connects information such as wind power, solar power, energy storage facilities, and dispatching strategies through nodes and edges, forming a comprehensive knowledge base. Knowledge graph reasoning further endows the system with intelligent decision-making capabilities. The reasoning process automatically generates and optimizes dispatching strategies by analyzing nodes and relationships within the knowledge graph. This reasoning technology can comprehensively consider information such as grid load and energy storage status, helping to propose better dispatching schemes.
[0004] Knowledge representation learning, through machine learning and artificial intelligence techniques, transforms knowledge in the wind-solar-storage scheduling knowledge graph into computer-understandable vector or matrix representations, thereby capturing the semantic and structural information between different entities (such as energy storage devices) and relationships (such as scheduling strategies). This representation method can better support reasoning on the wind-solar-storage scheduling knowledge graph, helping to discover and generate implicit new knowledge, and providing important support for optimizing scheduling. However, most current technologies only model the local information of the neighborhood of a single entity, ignoring the global semantics of the entire scheduling knowledge graph. This may lead to limited reasoning capabilities, failing to capture the extensive correlation features between various resource, strategy, and management measure nodes in the wind-solar-storage scheduling system, thus affecting the accuracy of reasoning. Summary of the Invention
[0005] Objective: To address the problems and shortcomings of existing technologies, this invention provides a reasoning method and system for wind, solar, and energy storage scheduling based on a knowledge graph of local and global information. By combining local and global information from the graph for reasoning and analysis, dynamic updates of wind, solar, and energy storage scheduling knowledge are achieved.
[0006] New knowledge is integrated into the existing knowledge graph. The updated knowledge graph is used to adjust reasoning, ensuring the system uses the latest information. Relevant information can be extracted from the knowledge graph based on scenario characteristics. For example, information on scheduling during peak load periods can be obtained from the wind, solar, and energy storage scheduling knowledge graph, thus assisting in scheduling. The system can provide dispatchers with basic knowledge related to wind, solar, and energy storage, conduct in-depth analysis and provide professional answers to different scheduling scenarios, thereby assisting dispatchers in formulating scheduling plans that balance system safety and stability with energy efficiency.
[0007] Technical solution: A knowledge graph reasoning method for wind-solar-storage scheduling based on local and global information, comprising the following steps:
[0008] (1) KNN graph combined with the original graph: Generate the initial entity (such as wind farm, photovoltaic power station) and relation (such as power supply, scheduling) embeddings of the wind, solar and energy storage scheduling knowledge graph. Construct the KNN (K-Nearest Neighbors) graph based on the entity embedding vectors. Add the edges of the KNN graph to the original knowledge graph to enhance the correlation between different entities in the graph, thereby enriching the original graph structure.
[0009] (2) Local Entity Importance Extraction: The relative attention values of triples in the wind-solar-storage scheduling knowledge graph are calculated using an attention mechanism. Each triple representation is then weighted and summed according to its relative attention value to obtain a new entity embedding representation. In the wind-solar-storage scheduling system, the attention mechanism can measure the relative importance among entities such as wind farms, photovoltaic power plants, and energy storage facilities. The results obtained from multi-head attention are concatenated to obtain the local entity importance.
[0010] (3) Global entity importance extraction: An attention-based biased random walk algorithm is introduced to extract global information from the wind, solar and energy storage scheduling knowledge graph. This algorithm uses non-normalized transition probability to control the random walk process, balancing the in-depth exploration capability of depth-first search (DFS) and the broad coverage characteristic of breadth-first search (BFS), effectively obtaining the complex relationships between various power resources, scheduling strategies and other entities from a global perspective. Then, combined with attention weight information, a global entity importance score is calculated for each entity.
[0011] (4) Entity importance fusion: The global entity importance score is weighted and fused with the local entity importance score. This fusion process makes the embedded representation of each entity contain both local and global information, forming a comprehensive expression of the entire wind, solar and energy storage scheduling system, thereby helping to better perform knowledge graph reasoning for wind, solar and energy storage scheduling.
[0012] Further, the specific steps of constructing the KNN graph and combining the wind-PV-storage scheduling knowledge graph in said step (1) are as follows:
[0013] (1.1) Generate entities and relation embeddings for the graph. Based on the similarity of entity embedding vectors, find the K most similar neighbor nodes for each entity and connect them via directed edges to construct a KNN (K-Nearest Neighbors) graph, wherein nodes represent entities and edges represent the similarity between entities. The specific construction formula is as follows:
[0014]
[0015] Wherein, Sim(i,j) represents the entity embedding and cosine similarity between, vector and represent the embeddings of entity e i and e j respectively, A ij represents the KNN graph structure, S ij >θ∧rank(S ij ,S i )<k means only retaining the k edges with similarity greater than the threshold θ and the highest connection values with the entity.
[0016] (1.2) Merge the edges of the KNN graph into the original wind-PV-storage scheduling knowledge graph. These edges represent the semantic similarity between entities, the relation types in the original graph are retained, and the edges in the KNN graph are defined as the "similar" relation type to distinguish original relations from similarity-based connections.
[0017] Further, the specific steps of extracting local entity importance in said step (2) are as follows:
[0018] (2.1) Perform linear transformation on the concatenation of entity and relation embeddings generated in step (1) to obtain the embedding representation of the corresponding triplet, the formula is as follows:
[0019]
[0020] Wherein, is the vector representation of the triplet , W1 represents a parameterized linear transformation matrix, which can map input features to an output feature space of higher dimension, vector and represent the embeddings of entity e i , e j and relation r k respectively, ∥ represents concatenation.
[0021] (2.2) For Then perform a linear transformation and a nonlinear transformation to obtain the absolute attention value b of the triple. ikj , representing a triple The importance of this was then assessed using softmax to obtain the triplet. Relative attention value α ikj The formula is as follows:
[0022]
[0023] Where W2 represents the linear transformation matrix, Represents entity e i The set of neighboring entities that it points to. Indicates the connection entity e i and e n A set of relationships.
[0024] (2.3) Entity e i The new embedding representation is the weighted sum of each triple representation according to its relative attention value. To stabilize the self-attention learning process and encapsulate more information about the neighborhood entities, a multi-head attention mechanism is used. The new embedding representations of M independent attention mechanisms are calculated separately and then concatenated, as shown in the following formula:
[0025]
[0026] Where σ is an arbitrary nonlinear function, Represents entity e i The embedding vector is generated after the l-th graph attention layer. For a model with n graph attention layers, feature information is accumulated in the n-th order neighborhood. Therefore, All entities e have been aggregated i The feature information of the l-th order neighboring entities of the head entity is used to obtain entity e. i The importance of local entities.
[0027] Furthermore, the specific steps for extracting global entity importance in step (3) are as follows:
[0028] (3.1) Given a source entity c0, simulate a random walk of fixed length n, let c i Let c represent the i-th entity traversed during the random walk. i It is generated by the following formula:
[0029]
[0030] Where, π vxZ1 and Z2 are the non-normalized transition probabilities between entities v and x, where (v,x)∈E indicates that entities v and x are adjacent in the knowledge graph E. Z1 and Z2 are normalization constants. d is a hyperparameter representing the probability of randomly moving to an adjacent entity. (1-d) represents the probability of randomly moving to any other entity.
[0031] (3.2) To effectively combine depth-first search (DFS) and breadth-first search (BFS), the formula for calculating the non-normalized transition probability is as follows:
[0032] π vx =α q (t,x)·ω vx
[0033]
[0034] Here, t represents the previously visited node, v represents the current node, and x represents the next node to be selected; all of these are entities within the knowledge graph. tx ω represents the shortest path distance between nodes t and x. vx This represents the weight of the edge between nodes v and x. q is a hyperparameter used to control the random walk. When q > 1, the random walk favors nodes closer to node t. In this case, for a node t that has already been visited, such a traversal approximates BFS. Conversely, when q < 1, the random walk favors nodes farther from node t, which approximates DFS.
[0035] (3.3) In summary, the formula for the attention-based biased random walk algorithm is as follows:
[0036]
[0037] in, Indicates the connection entity e i and e m Relationship set; In(e m ) indicates pointing to entity e m The set of neighboring entities. Indicates the connection entity e n and e m The set of relationships between GI(e) m ) t-1 Represents entity e m The global entity importance score in the (t-1)th iteration. The iteration number t∈(1,L×C) encoder The random walk distance, or ], depends on the number of attention layers L and the training period C. encoder Attention weight birm b nr′m It is the absolute attention value.
[0038] Furthermore, the specific steps for fusing the importance of local and global entities in step (4) are as follows:
[0039] (4.1) The global entity importance score for each entity is obtained through step (3), reflecting the global importance of the entity in the entire wind-solar-storage scheduling knowledge graph. In order to integrate global information into local attention calculation, the global entity importance score is converted into attention weights by applying the softmax function, thus obtaining the global relative entity importance RGI. ei (e j The formula is as follows:
[0040]
[0041] (4.2) In generating entity e i The output embedding of layer l When this is done, the global relative entity importance is incorporated as an attention coefficient into the local entity importance, as shown in the following formula:
[0042]
[0043] Among them, utilizing Introducing entity e i Global relative entity importance of different tail entities By assigning more weights to important adjacent entities in the global context, entity e can be obtained. i Better knowledge representation.
[0044] (4.3) Embedding the input relations in the l-th layer Perform a linear transformation, as shown in the following formula:
[0045]
[0046] in, It is the weight matrix, P l-1 and P l These are the input and output dimensions of relation embedding, respectively. This represents the embedding of the output relationship of the l-th layer.
[0047] (4.4) In the final L-th layer, the final embedding vector of the entity is obtained by averaging, as shown in the following formula:
[0048]
[0049] (4.5) In order to preserve the initial entity feature information in the final embedding vector, the initial entity is embedded... and entity embedding of the Lth layer output Combining these elements yields the final entity embedding. The formula is as follows:
[0050]
[0051] in, It is the projection matrix, T L and T 0 These are the entity embedding dimension output from layer L and the initial entity embedding dimension, respectively.
[0052] A system for reasoning based on a knowledge graph of wind, solar, and energy storage scheduling using local and global information employs the following encoder-decoder framework:
[0053] (1) The encoder part includes L graph attention layers, where L = 2;
[0054] (2) The decoder part provides a scoring function to calculate the score of a given triple and determine the validity of the triple;
[0055] The specific design details of the encoder are as follows:
[0056] The initial entity embeddings and initial relation embeddings are pre-trained using TransE. TransE minimizes the L1 norm dissimilarity metric. To learn entity and relation embeddings. This allows for the learning of a given triple. condition Established, i.e., e j Through relation r k Connect to e i The nearest neighbor entities. Finally, the encoder model is trained by minimizing the hinge-loss function, as shown in the following formula:
[0057]
[0058] Where γ>0 is a marginal hyperparameter, S is the set of valid triples, and S′ is the set of invalid triples. Invalid triples are identified by each head entity e. i or tail entity e j Replace with other entity e i ′∈(E\e i ) or e j ′∈(E\e j This generates a set of invalid triples for the entity. Therefore, the set of invalid triples S′ can be represented as...
[0059] The specific design details of the decoder section are as follows:
[0060] (2.1) ConvKB is used as the decoder model. The ConvKB model uses CNN to model entities and relationships in the wind-solar-storage scheduling knowledge graph, and the convolutional layers can analyze triples. Globally embedding feature information across each dimension captures global relationships and transitional features between entities and relations in the knowledge graph. Given a triple... The scoring function formula is as follows:
[0061]
[0062] Where Ω is a hyperparameter representing the number of filters. ReLU(·) represents the nonlinear activation function. * represents the convolution operator. ω m This represents the m-th convolutional filter. This represents the linear transformation matrix used to calculate the final score of the triplet. β represents the dimensions of the entity embedding and relation embedding, set to β = T. L =P L ;
[0063] (2.2) Minimize the soft-margin loss function to train the decoder model, as shown in the following formula:
[0064]
[0065] A system for reasoning based on a knowledge graph of wind, solar, and energy storage scheduling using local and global information includes the following modules:
[0066] (1) KNN graph combined with the original knowledge graph module: Generate the initial entity and relation embeddings of the wind-solar-storage scheduling knowledge graph, and create a KNN graph using the entity embedding vectors. Integrate the edges in the KNN graph into the original knowledge graph to enhance the semantic connections between different entities in the graph;
[0067] (2) Local Entity Importance Extraction Module: The attention mechanism is used to calculate the relative attention value for triples in the wind-solar-storage scheduling knowledge graph. Based on these weights, the triple representations are weighted and summed to generate updated entity embeddings. To enhance learning stability and integrate more neighborhood entity information, the results obtained from multi-head attention are concatenated to obtain the local importance of entities reflecting various power resources, scheduling strategies, etc.
[0068] (3) Global Entity Importance Extraction Module: A biased random walk algorithm based on attention is used to extract global information from the wind-solar-storage scheduling knowledge graph. This algorithm guides the random walk process through non-normalized transition probabilities, achieving a balance between the in-depth exploration of DFS and the broad coverage of BFS, thereby capturing global information more efficiently. Subsequently, the attention weights are combined with the walk results to calculate a score reflecting the global importance of each entity, ensuring that the global connections between entities in the wind-solar-storage scheduling knowledge graph are taken into account during the reasoning process.
[0069] (4) Entity Importance Fusion Module: Based on the global entity importance score, the global relative entity importance is calculated, which reflects the attention weight of an entity in the local context after integrating global information. Subsequently, this weight is weighted and aggregated with the local entity importance. This ensures that each entity in the wind, solar, and energy storage scheduling can combine local and global information to comprehensively express its importance in the scheduling system;
[0070] The implementation process of the system and method is the same, and will not be described again.
[0071] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the wind-solar-storage scheduling knowledge graph reasoning method based on local and global information as described above.
[0072] A computer-readable storage medium storing a computer program that performs the wind-solar-storage scheduling knowledge graph reasoning method described above based on local and global information.
[0073] Beneficial Effects: Compared with existing technologies, this invention combines global and local information to jointly influence the entity embedding representation in the wind-solar-storage scheduling knowledge graph. A KNN graph is constructed to capture the semantic similarity between entities (such as wind farms, photovoltaic power stations, and energy storage facilities) in the wind-solar-storage scheduling system, and this similarity is combined with the original graph to enrich the representation of relationships between entities. Local entity importance is constructed by cascading the output of a multi-head attention mechanism, which helps stabilize the self-attention learning process and encapsulates more information about neighboring entities in the wind-solar-storage scheduling system. An attention-based biased random walk algorithm, combined with DFS and BFS, is employed to collect global information, accurately assess the importance of each entity in the wind-solar-storage scheduling knowledge graph, and reduce information silos caused by local attention and isolation in the graph. Global entity importance is converted into attention weights and integrated into local entity importance, ensuring the accuracy and completeness of reasoning in the wind-solar-storage scheduling knowledge graph, thereby optimizing energy scheduling strategies. Attached Figure Description
[0074] Figure 1is a flow chart of the method according to the embodiment of the present invention;
[0075] Figure 2 is an example diagram of the KNN graph combining the knowledge graph of wind-solar-storage dispatching according to the embodiment of the present invention;
[0076] Figure 3 is an overall framework diagram of knowledge graph reasoning for wind-solar-storage dispatching based on local and global information according to the embodiment of the present invention. Detailed Description of the Preferred Embodiments
[0077] The present invention will be further clarified below with reference to specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and not to limit the scope of the present invention. After reading the present invention, modifications to various equivalent forms of the present invention made by those skilled in the art all fall within the scope defined by the claims appended to the present application.
[0078] As shown in Figure 1 , a knowledge graph reasoning method for wind-solar-storage dispatching based on local and global information specifically comprises the following steps:
[0079] Step (1) Combining KNN graph with original graph: generating initial entities and relation embeddings of the wind-solar-storage dispatching knowledge graph, constructing a KNN graph based on entity embedding vectors, adding edges of the KNN graph to the original knowledge graph to enhance the correlation between entities (such as intraday measures and day-ahead measures) in the graph, and the specific example is shown in Figure 2 ;
[0080] (1.1) TransE is used to generate entity and relation embeddings. Based on the cosine similarity of entity embedding vectors, for each entity (such as wind farms, photovoltaic power stations, energy storage facilities, etc.), the K most similar neighbor nodes are found and pointed to by directed edges, thereby constructing a KNN graph, where nodes represent entities and edges represent the similarity between entities. The specific construction formula is as follows:
[0081]
[0082]
[0083] wherein, Sim(i,j) represents entity embedding and the cosine similarity between S ij >θ∧rank(S ij ,S i )<k means that only k edges with similarity greater than the threshold θ and the highest connection value with the entity are retained. In this embodiment, the cosine similarity threshold θ between entities is set to 0.7, and only 1 (k=1) edge with the highest similarity to the entity is retained. For example, in Figure 2 , "energy storage charging and discharging strategy" and "executing energy storage charging and discharging" are the most similar entities to each other;
[0084] (1.2) The edges of the KNN graph are merged into the original knowledge graph. These edges represent the semantic similarity between entities. The edges in the KNN graph are defined as "similar" relation types to distinguish the original relations from similarity-based connections.
[0085] Step (2) Local Entity Importance Extraction: The relative attention value of the input triples of the wind-solar-storage scheduling knowledge graph is calculated through an attention mechanism. The weighted sum of each triple representation according to its relative attention value is used to obtain a new entity embedding representation. The results obtained from the multi-head attention are concatenated to obtain the local entity importance, such as... Figure 3 As shown in (a);
[0086] (2.1) Perform a linear transformation on the embedded concatenation generated in step (1) for entities and relationships such as “grid, energy storage facilities, wind farm, and photovoltaic power station in area A” to obtain the embedded representation of the corresponding triples, as shown in the following formula:
[0087]
[0088] in, It is a triplet For example, the vector representation of ("intraday measures", "including", "implementation of energy regulation measures"), where W1 represents the parameterized linear transformation matrix, can map input features to a higher-dimensional output feature space, vector. and Representing entity e respectively i e j and relation r k The embedding of , ∥ indicates concatenation;
[0089] (2.2) For Then perform a linear transformation and use the LeakyReLU nonlinear transformation to obtain the absolute attention value b of the triple. ikj , representing a triple The importance of this was then assessed using softmax to obtain the triplet. Relative attention value α ikj The formula is as follows:
[0090]
[0091]
[0092] Where W2 represents the linear transformation matrix, Represents entity e i The set of neighboring entities pointed to, such as Figure 2 The set of entities referred to by "energy storage dispatch" in the text includes "grid-based energy storage," "grid-side energy storage," and "energy storage charging and discharging strategies." Indicates the connection entity e i and e n A set of relationships, such as a set of relationships ("use", "formulate");
[0093] (2.3) Entity e i The new embedding representation is the weighted sum of each triple representation according to its relative attention value. To stabilize the self-attention learning process and encapsulate more information about the neighborhood entities, a multi-head attention mechanism is used. The new embedding representations of M independent attention mechanisms are calculated separately and then concatenated, as shown in the following formula:
[0094]
[0095] Where σ is an arbitrary nonlinear function, Represents entity e i The embedding vector is generated after the l-th graph attention layer. For a model with n graph attention layers, feature information is accumulated in the n-th order neighborhood. Therefore, All entities e have been aggregated i The feature information of the l-th order neighboring entities of the head entity is used to obtain entity e. i The importance of local entities;
[0096] Step (3) Global Entity Importance Extraction: An attention-based biased random walk algorithm is introduced to extract global information from the wind, solar, and energy storage scheduling knowledge graph. This algorithm uses non-normalized transition probabilities to control the random walk process, balancing the in-depth exploration capability of DFS with the broad coverage characteristic of BFS, in order to collect global information more effectively. Then, combined with attention weight information, a global entity importance score is calculated for each entity, such as... Figure 3 As shown in (b);
[0097] (3.1) with Figure 2 Taking "energy storage scheduling" as an example of source entity c0, it simulates a random walk of fixed length n=3, let c i Let c represent the i-th entity traversed during the random walk. i It is generated by the following formula:
[0098]
[0099] Where, π vx Z1 and Z2 are the non-normalized transition probabilities between entities v and x, and Z1 and Z2 are normalization constants. Setting d = 0.7 represents the probability of randomly moving to an adjacent entity. (1-d) represents the probability of randomly moving to any other entity.
[0100] (3.2) To effectively combine DFS and BFS, the formula for calculating the non-normalized transition probability is as follows:
[0101] π vx =α q (t,x)·ω vx
[0102]
[0103] Where t represents the last visited node, v represents the current node, and x represents the next node to be selected. d tx ω represents the shortest path distance between nodes t and x. vx This represents the weight of the edge between nodes v and x, indicating the scheduling importance of "energy storage scheduling" compared to other resources ("grid-based energy storage", "grid-side energy storage", and "energy storage charging and discharging strategy"). Setting q = 1.5 biases towards BFS. The route for one random walk is: "energy storage scheduling" → "energy storage charging and discharging strategy" → "execute energy storage charging and discharging" → "intraday measures".
[0104] (3.3) In summary, the formula for the attention-based biased random walk algorithm is as follows:
[0105]
[0106] Among them, In(e m ) indicates pointing to entity e m The set of neighboring entities of GI(e). m ) t-1 Represents entity e m The global entity importance score in the (t-1)th iteration. The iteration number t∈(1,L×C) encoder The random walk distance, or ], depends on the number of attention layers L and the training period C. encoder Attention weight b irm b nr′m It is the absolute attention value;
[0107] Step (4) Entity Importance Fusion: Calculate the global relative entity importance based on the global entity importance score, representing the attention weight of an entity after incorporating global information within its local context. Then, weighted aggregate this weight with the local entity importance score. This fusion process ensures that the entity's embedded representation contains comprehensive information from the entire wind-solar-storage scheduling knowledge graph. At the output of the final graph attention layer, an averaging method is used to obtain the entity's embedding vector, such as... Figure 3 As shown in (c);
[0108] (4.1) The global entity importance score for each entity is obtained through step (3), reflecting the global importance of the entity in the entire wind-solar-storage scheduling knowledge graph. In order to integrate global information into local attention calculation, the global entity importance score is converted into attention weights by applying the softmax function, thus obtaining the global relative entity importance RGI. ei (e j The formula is as follows:
[0109]
[0110] (4.2) In generating entity e i The output embedding of layer l When this is done, the global relative entity importance is incorporated as an attention coefficient into the local entity importance, as shown in the following formula:
[0111]
[0112] Among them, utilizing Introducing entity e i Global relative entity importance of different tail entities By assigning more weights to important adjacent entities in the global context, entity e can be obtained. i Better knowledge representation;
[0113] (4.3) Embedding the input relations in the l-th layer Perform a linear transformation, as shown in the following formula:
[0114]
[0115] in, It is the weight matrix, P l-1 and P l These are the input and output dimensions of relation embedding, respectively. This represents the embedding of the output relationship of the l-th layer;
[0116] (4.4) In the final L-th layer, the final embedding vector of the entity is obtained by averaging, as shown in the following formula:
[0117]
[0118] (4.5) In order to preserve the initial entity feature information in the final embedding vector, the initial entity is embedded... and entity embedding of the Lth layer output Combining these elements yields the final entity embedding. The formula is as follows:
[0119]
[0120] in, It is the projection matrix, T L and T 0 These are the entity embedding dimension output from layer L and the initial entity embedding dimension, respectively.
[0121] By fully learning the rich semantic and structural information of the wind-solar-storage scheduling knowledge graph through the above steps, a better embedded representation can be constructed to aid in reasoning and the discovery and generation of new knowledge (such as new scheduling strategies) implicit in the knowledge graph. This embedded representation can capture the complex relationships between different energy nodes (such as wind farms, photovoltaic power plants, and energy storage facilities), as well as the interaction between scheduling strategy nodes and control measure nodes, thereby optimizing wind-solar-storage scheduling strategies.
[0122] by Figure 2 For example, the tail entity prediction results are shown in Table 1.
[0123] Table 1. Tail Entity Prediction Results
[0124]
[0125] by Figure 2 For example, the relationship prediction results are shown in Table 2.
[0126] Table 2 Relationship Prediction Results
[0127]
[0128] A knowledge graph reasoning system for wind-solar-storage scheduling based on local and global information includes the following modules:
[0129] (1) KNN graph combined with the original knowledge graph module: Generate the initial entity and relation embeddings of the wind-solar-storage scheduling knowledge graph, and create a KNN graph using the entity embedding vectors. Integrate the edges in the KNN graph into the original knowledge graph to enhance the semantic connections between entities in the knowledge graph;
[0130] (2) Local Entity Importance Extraction Module: The module uses an attention mechanism to calculate relative attention values for triples in the wind-solar-storage scheduling knowledge graph. Based on these attention values, the triple representations are weighted and summed to generate new entity embedding representations. To enhance learning stability and integrate more neighborhood entity information, the results obtained from multi-head attention are concatenated to obtain the local importance of entities such as various power resources and scheduling strategies.
[0131] (3) Global Entity Importance Extraction Module: A biased random walk algorithm based on attention is used to extract global information from the wind-solar-storage scheduling knowledge graph. This algorithm guides the random walk process through non-normalized transition probabilities, achieving a balance between the in-depth exploration of DFS and the broad coverage of BFS, thereby capturing global information more efficiently. Subsequently, the attention weights are combined with the walk results to calculate a score reflecting the global importance of each entity, ensuring that the global connections between entities in the wind-solar-storage scheduling knowledge graph are taken into account during the reasoning process.
[0132] (4) Entity Importance Fusion Module: Based on the global entity importance score, the global relative entity importance is calculated, which reflects the attention weight of an entity in the local context after integrating global information. Subsequently, this weight is weighted and aggregated with the local entity importance. This ensures that each entity in the wind, solar, and energy storage scheduling can combine local and global information to comprehensively express its importance in the scheduling system.
[0133] Obviously, those skilled in the art should understand that the steps of the wind-solar-storage scheduling knowledge graph reasoning method based on local and global information, or the modules of the wind-solar-storage scheduling knowledge graph reasoning system based on local and global information, as described in the above embodiments of the present invention, can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of the present invention are not limited to any particular hardware and software combination.
Claims
1. A knowledge graph reasoning method for wind-solar-storage scheduling based on local and global information, characterized in that, Includes the following steps: (1) KNN graph combined with the original graph: generate initial entity and relation embeddings for wind, solar and energy storage scheduling knowledge graph, construct a KNN graph based on the entity embedding vectors, and add the edges of the KNN graph to the original knowledge graph; the entities include wind farms, photovoltaic power plants and energy storage facilities; the relations include power supply and scheduling; The specific steps for constructing the KNN graph and combining it with the wind, solar, and energy storage scheduling knowledge graph in step (1) are as follows: (1.1) Generate entity and relation embeddings for the graph. Based on the similarity of entity embedding vectors, find the K most similar neighbor nodes for each entity and construct a KNN graph by pointing to them with directed edges, where nodes represent entities and edges represent the similarity between entities; (1.2) The edges of the KNN graph are merged into the original wind, solar and energy storage scheduling knowledge graph. These edges represent the semantic similarity between entities and retain the relation types in the original graph. The edges in the KNN graph are defined as "similar" relation types to distinguish the original relations from similarity-based connections. (2) Local entity importance extraction: The relative attention value of triples in the wind-solar-storage scheduling knowledge graph is calculated through the attention mechanism. The new entity embedding representation is obtained by weighting and summing the representations of each triple according to its relative attention value. The results obtained by multi-head attention are concatenated to obtain the local entity importance. (3) Global entity importance extraction: An attention-based biased random walk algorithm is introduced to extract global information from the wind, solar and energy storage scheduling knowledge graph. Combined with attention weight information, a global entity importance score is calculated for each entity. (4) Entity importance fusion: The global entity importance score is weighted and fused with the local entity importance score; Through the above steps, the semantic and structural information of the wind, solar and energy storage scheduling knowledge graph is learned, and an embedded representation is constructed to assist in reasoning, discover and generate new scheduling strategies hidden in the knowledge graph. The embedded representation can capture the correlation between different energy nodes, as well as the interaction between scheduling strategy nodes and control measure nodes, thereby optimizing the wind, solar and energy storage scheduling strategy. The specific steps for extracting global entity importance in step (3) are as follows: (3.1) Given the source entity Simulated fixed length is The random walk makes This represents the th iteration traversed during a random walk. An entity; an entity It is generated by the following formula: in, It is a physical entity and entity The non-normalized transition probabilities between them In knowledge graph medium entity and entity There is a relationship between them; they are adjacent. and It is a normalization constant; It is a hyperparameter representing the probability of randomly moving to an adjacent entity; This represents the probability of randomly moving to any other entity; (3.2) To effectively combine depth-first search and breadth-first search, the formula for calculating the non-normalized transition probability is as follows: in, This represents the last visited node. Indicates the current node, This indicates the next node to be selected, which is an entity in the knowledge graph. Represents a node and The shortest path distance between them; Represents a node and The weight of the edges between them; These are hyperparameters used to control the random walk; when At that time, random walks tend to move closer to nodes. At this point, for the nodes that have already been visited... For example, such a traversal is similar to BFS; conversely, when At that time, random walks tend to go to nodes farther away. The nodes are then approximated by DFS; (3.3) In summary, the formula for the attention-based biased random walk algorithm is as follows: in, Represents the connection entity and A set of relationships; Indicates pointing to an entity The set of neighboring entities; Represents the connection entity and A set of relationships; Representing entities In the Global entity importance score in the next iteration; number of iterations That is, the random walk distance, which depends on the number of attention layers. and training cycle Attention weights , It is the absolute attention value. Representing entities The set of neighboring entities it points to.
2. The wind-solar-storage scheduling knowledge graph reasoning method based on local and global information as described in claim 1, characterized in that, The specific steps for extracting the importance of local entities in step (2) are as follows: (2.1) Perform a linear transformation on the concatenation of entity and relation embeddings to obtain the embedding representation of the corresponding triples; (2.2) Perform a linear transformation on the embedding representation of the triples and use a nonlinear transformation to obtain the absolute attention value of the triples, which represents the importance of the triples. Then, use softmax to evaluate and obtain the relative attention value of the triples. (2.3) The new embedding representation of an entity is the weighted sum of the representations of each triple according to their relative attention values. Using a multi-head attention mechanism, the sums are calculated separately. A new embedding representation of an independent attention mechanism is obtained, and then these are concatenated to obtain the local entity importance of the entity.
3. The wind-solar-storage scheduling knowledge graph reasoning method based on local and global information as described in claim 1, characterized in that, The specific steps for integrating the importance of local and global entities in step (4) are as follows: (4.1) The global entity importance score of each entity reflects the global importance of the entity in the entire wind-solar-storage scheduling knowledge graph. The global entity importance score is converted into attention weights by applying the softmax function to obtain the global relative entity importance. (4.2) In generating entities No. Layer output embedding hour, Representing entities After the first The embedding vector generated by the graph attention layer incorporates the global relative entity importance as an attention coefficient into the local entity importance, as shown in the following formula: in, It is a triplet The relative attention value, It is a triplet The vector representation of , using Introduce entities Global relative entity importance of different tail entities By assigning more weights to important adjacent entities in the global context, the entity can be obtained. Better knowledge representation; (4.3) Regarding the first Input relation embedding in layers Perform a linear transformation, as shown in the following formula: in, It is a weight matrix. and These are the input and output dimensions of relation embedding, respectively. Indicates the first Layer output relationship embedding; (4.4) In the last... In the layer, the final embedding vector of the entity is obtained by averaging. (4.5) In order to preserve the initial entity feature information in the final embedding vector, the initial entity embedding is... and the Entity embedding of layer output Combining these elements yields the final entity embedding. The formula is as follows: in, It is a projection matrix. and They are the first The entity embedding dimension and the initial entity embedding dimension output by the layer.
4. A system for implementing the wind-solar-storage scheduling knowledge graph reasoning method based on local and global information as described in claim 1, characterized in that, The system adopts the following encoder-decoder framework: (1) The encoder part includes Each graph attention layer; (2) The decoder part provides a scoring function to calculate the score of a given triple and determine the validity of the triple; The specific design details of the encoder are as follows: The initial entity embeddings and initial relation embeddings are pre-trained by TransE; TransE minimizes the L1 norm dissimilarity measure. To learn entity and relation embeddings; so that for a given triple ,condition Established, that is Through relationships Connected to Find the nearest neighbor entities; finally, minimize the hinge-loss function to train the encoder model; The specific design details of the decoder section are as follows: (2.1) ConvKB is used as the decoder model; the ConvKB model uses CNN to model the entities and relationships in the wind-solar-storage scheduling knowledge graph, and the convolutional layer analyzes the triples. Globally embedding feature information in each dimension captures global relationships and transitional features between entities and relations in the knowledge graph; given a triplet The scoring function formula is as follows: in, These are hyperparameters that represent the number of filters; Represents a nonlinear activation function; This represents the convolution operator; Indicates the first One convolutional filter; This represents the linear transformation matrix used to calculate the final score of the triplet; The dimensions representing entity embedding and relation embedding are set to... ; (2.2) Minimize the soft-margin loss function to train the decoder model.
5. A system for reasoning based on a knowledge graph of wind, solar, and energy storage scheduling using local and global information, characterized in that... Includes the following modules: (1) KNN graph combined with the original graph module: generate the initial entity and relation embedding of the wind, solar and energy storage scheduling knowledge graph, and create a KNN graph using the entity embedding vectors; integrate the edges in the KNN graph into the original knowledge graph; the entities include wind farms, photovoltaic power plants and energy storage facilities; the relations include power supply and scheduling; The implementation process of combining the KNN graph with the original graph module is as follows: (1.1) Generate entity and relation embeddings for the graph. Based on the similarity of entity embedding vectors, find the K most similar neighbor nodes for each entity and construct a KNN graph by pointing to them with directed edges, where nodes represent entities and edges represent the similarity between entities; (1.2) The edges of the KNN graph are merged into the original wind, solar and energy storage scheduling knowledge graph. These edges represent the semantic similarity between entities and retain the relation types in the original graph. The edges in the KNN graph are defined as "similar" relation types to distinguish the original relations from similarity-based connections. (2) Local entity importance extraction module: The attention mechanism is used to calculate the relative attention value for the triples in the wind-solar-storage scheduling knowledge graph. The representation of each triple is weighted and summed according to its relative attention value to obtain the new entity embedding representation. The results obtained by multi-head attention are concatenated to obtain the local entity importance. (3) Global entity importance extraction module: The attention-based biased random walk algorithm is used to extract global information in the wind, solar and energy storage scheduling knowledge graph. Then, the attention weights are combined with the walk results to calculate a score reflecting the global importance of each entity. The specific steps of the global entity importance extraction module are as follows: (3.1) Given the source entity Simulated fixed length is The random walk makes This represents the th iteration traversed during a random walk. An entity; an entity It is generated by the following formula: in, It is a physical entity and entity The non-normalized transition probabilities between them In knowledge graph medium entity and entity There is a relationship between them; they are adjacent. and It is a normalization constant; It is a hyperparameter representing the probability of randomly moving to an adjacent entity; This represents the probability of randomly moving to any other entity; (3.2) To effectively combine depth-first search and breadth-first search, the formula for calculating the non-normalized transition probability is as follows: in, This represents the last visited node. Indicates the current node, This indicates the next node to be selected, which is an entity in the knowledge graph. Represents a node and The shortest path distance between them; Represents a node and The weight of the edges between them; These are hyperparameters used to control the random walk; when At that time, random walks tend to move closer to nodes. At this point, for the nodes that have already been visited... For example, such a traversal is similar to BFS; conversely, when At that time, random walks tend to go to nodes farther away. The nodes are then approximated by DFS; (3.3) In summary, the formula for the attention-based biased random walk algorithm is as follows: in, Represents the connection entity and A set of relationships; Indicates pointing to an entity The set of neighboring entities; Represents the connection entity and A set of relationships; Representing entities In the Global entity importance score in the next iteration; number of iterations That is, the random walk distance, which depends on the number of attention layers. and training cycle Attention weights , It is the absolute attention value. Representing entities The set of neighboring entities it points to; (4) Entity Importance Fusion Module: The global entity importance score is weighted and fused with the local entity importance score; The system adopts an encoder-decoder framework: the encoder part includes... The encoder part includes an attention layer; the decoder part provides a scoring function to calculate the score of a given triplet and determine the validity of the triplet; the specific design details of the encoder part are as follows: The initial entity embeddings and initial relation embeddings are pre-trained by TransE; TransE minimizes the L1 norm dissimilarity measure. To learn entity and relation embeddings; so that for a given triple ,condition Established, that is Through relationships Connected to Find the nearest neighbor entities; finally, minimize the hinge-loss function to train the encoder model; The specific design details of the decoder section are as follows: (2.1) ConvKB is used as the decoder model; the ConvKB model uses CNN to model the entities and relationships in the wind-solar-storage scheduling knowledge graph, and the convolutional layer analyzes the triples. Globally embedding feature information in each dimension captures global relationships and transitional features between entities and relations in the knowledge graph; (2.2) Minimize the soft-margin loss function to train the decoder model; The system learns the semantic and structural information of the wind, solar and energy storage scheduling knowledge graph through each module, constructs an embedded representation, assists in reasoning, and discovers and generates new scheduling strategies hidden in the knowledge graph. The embedded representation can capture the correlation between different energy nodes, as well as the interaction between scheduling strategy nodes and control measure nodes, thereby optimizing the wind, solar and energy storage scheduling strategy.
6. A computer device, characterized in that: The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the wind-solar-storage scheduling knowledge graph reasoning method based on local and global information as described in any one of claims 1-3.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that performs the wind, solar, and energy storage scheduling knowledge graph reasoning method based on local and global information as described in any one of claims 1-3.
Citation Information
Patent Citations
Knowledge reasoning method based on graph attention network
CN115879551A