Electric power data prediction method based on large language model auxiliary knowledge graph construction

By using a large language model to assist in the construction of knowledge graphs and multi-path causal attribution mechanisms, and combining a temporally sparse hybrid spatiotemporal graph convolutional model, the problems of inaccurate spatial relationship modeling and insufficient integration of domain knowledge in power forecasting are solved, achieving high-precision power data forecasting and improving the stability and interpretability of the forecasting model.

CN121525932APending Publication Date: 2026-02-13STATE GRID FUJIAN ELECTRIC POWER CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511514562.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing power forecasting methods suffer from inaccurate spatial relationship modeling and insufficient integration of domain knowledge, resulting in limited forecasting accuracy and stability. Furthermore, traditional knowledge graph construction methods suffer from limited knowledge coverage, low update efficiency, and insufficient accuracy in semantic relationship recognition.

Method used

A knowledge graph is constructed with the assistance of a large language model. Through automated entity recognition, relation extraction and triple generation, combined with a multi-path causal attribution mechanism and a temporally sparse hybrid spatiotemporal graph convolution model, the deep integration of unstructured power document knowledge and structured time-series data is achieved.

Benefits of technology

It significantly improves the accuracy and interpretability of power data forecasting, solves the problems of low knowledge acquisition efficiency and insufficient accuracy of semantic relationship recognition in traditional methods, and provides technical support for the precise scheduling and optimized operation of smart grids.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121525932A_ABST
    Figure CN121525932A_ABST
Patent Text Reader

Abstract

According to the electric power data prediction method based on large language model auxiliary knowledge graph construction provided by the invention, a high-coverage electric power knowledge graph is automatically constructed through a large language model, so that the problems of low knowledge acquisition efficiency and insufficient semantic relationship recognition accuracy of a traditional method are solved; through a multi-path causal attribution mechanism, a multi-hop and multi-relation path in the knowledge graph is effectively converted into a prior adjacency matrix which can be utilized by a neural network, and structured fusion of domain knowledge is realized; through the synergistic effect of the time sparse attention and the mixed adjacency matrix, the modeling precision of the power data space-time dependency relationship is remarkably improved, and an important technical support is provided for precise scheduling and optimized operation of a smart power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power data analysis and prediction technology, and in particular to a power data prediction method based on the construction of a knowledge graph assisted by a large language model. Background Technology

[0002] With the rapid development of new power systems and smart grids, power data forecasting has become a key technology supporting grid operation status perception, dispatch optimization, and energy management. The power system operating environment is highly complex, with influencing factors spanning time, space, and multiple external conditions, including climate change, economic activities, industrial restructuring, and policy guidance. Accurately forecasting key indicators such as power load and generation is crucial for improving grid operating efficiency, reducing operating costs, and ensuring power supply security. However, power data exhibits significant nonlinear, time-varying, and regionally correlated characteristics. How to efficiently mine multi-dimensional correlation features and improve forecast accuracy and stability remains a core problem that urgently needs to be solved in this field.

[0003] Existing power forecasting methods are mainly divided into two categories: statistical modeling and machine learning. Early statistical modeling methods, such as time series analysis and regression analysis, while possessing a solid theoretical foundation, have limited performance in handling high-dimensional nonlinear relationships. In recent years, research focus has gradually shifted to machine learning methods, including traditional machine learning algorithms such as support vector machines and random forests, as well as deep learning methods. Deep learning technology has demonstrated strong potential in the field of power forecasting. Recurrent neural networks (RNNs) and their variants LSTM and GRU have natural advantages in time series modeling, effectively capturing long-term temporal dependencies; convolutional neural networks (CNNs) excel in spatial feature extraction, capable of uncovering spatial correlations between regions; and the introduction of attention mechanisms further enhances the model's feature representation capabilities, enabling it to adaptively focus on key spatiotemporal features. Given the significant regional correlations and network topology characteristics of power data, graph neural networks (GNNs) are widely used for spatiotemporal correlation modeling of power systems, effectively capturing complex interactions between nodes by constructing power network graph structures.

[0004] However, existing power forecasting methods generally suffer from two major shortcomings: First, spatial feature extraction is susceptible to noise interference and exhibits sparse correlations. Traditional graph structures built based on geographical proximity or simple statistical correlations are insufficient to characterize the complex and dynamic potential connections between regions, resulting in inadequate graph structure information to support high-precision forecasts. Second, relying solely on structured historical data for modeling makes it difficult to effectively incorporate domain knowledge reflecting the operating mechanisms of power systems. The vast amount of unstructured documents generated during power system operation, such as operation reports, accident analyses, dispatch notifications, and equipment maintenance records, contains rich information on causal relationships, correlation patterns, and anomalies. This information involves multi-dimensional semantic knowledge related to industrial structure, regional economy, load dynamics, and climate environment, revealing the deep correlations in power system operation. This valuable domain knowledge is largely wasted in traditional forecasting methods, severely limiting the potential for performance improvement in forecasting models.

[0005] Knowledge graphs, as a structured knowledge representation method, can effectively organize and integrate heterogeneous information from multiple sources, providing an effective approach for semantic modeling of complex information in the power industry. However, traditional knowledge graph construction methods often rely on manual rule design or small-scale relation extraction models, which suffer from limited knowledge coverage, low update efficiency, and insufficient accuracy in semantic relation recognition. This makes it difficult to efficiently and accurately identify implicit semantic relationships and cross-document entity associations from large-scale unstructured documents. Summary of the Invention

[0006] This invention addresses the problems of inaccurate spatial relationship modeling, insufficient integration of domain knowledge, and limited prediction accuracy and stability in existing power data prediction technologies. It proposes a power data prediction method based on knowledge graph construction assisted by a large language model. The breakthrough development of large language models has brought a new technological paradigm to knowledge acquisition and application. Their powerful language understanding and generation capabilities, through carefully designed prompting engineering, can efficiently identify entities, extract relationships, and construct high-quality domain knowledge graphs from unstructured documents. This injects rich semantic prior knowledge into power prediction models, becoming an important technological path to overcome the limitations of traditional methods.

[0007] This invention achieves deep integration of unstructured power document knowledge and structured time-series data by constructing an automated knowledge graph extraction module, a multi-path causal attribution mechanism, and a time-sparse hybrid spatiotemporal graph convolution model, significantly improving the accuracy and interpretability of power data prediction.

[0008] This invention provides a method for predicting power data based on knowledge graph construction assisted by a large language model, comprising the following steps:

[0009] Step 1: Automated construction of power knowledge graph based on large language model; Step 2: Multi-path causal attribution and prior adjacency matrix generation; Step 3: Construct a temporal sparse attention processing submodule to implement sparse attention processing of the input sequence and output the temporal features after sparse attention processing; Step 4: Construct a hybrid adaptive graph convolution submodule, and perform graph convolution operation between the hybrid adjacency matrix and the output of Step 3; Step 5: Construct a power data prediction network that includes multiple sparse hybrid spatiotemporal graph convolutional blocks (TSMSTs), and transform the output of the power data prediction network into the final prediction result through a prediction layer; each sparse hybrid spatiotemporal graph convolutional block (TSMST) includes a temporal sparse attention processing submodule, a hybrid adaptive graph convolutional submodule, and a temporal convolutional submodule. Step 6: Train the power data prediction network and use the trained network to predict power data.

[0010] Furthermore, the specific implementation method of step 1 is as follows: First, entity recognition and standardization are performed: a pre-trained large language model is used to perform deep semantic understanding on unstructured documents such as power system operation reports, fault analyses, and dispatch notifications. A designed prompt template guides the large language model to identify key entities in the power sector. Next, relation extraction and triple generation are performed: a task-oriented relation extraction prompt template is designed to guide the large language model to automatically identify complex causal relationships between entities, including direct causal relationships. Indirect causal relationship Time causality Finally, knowledge fusion and graph construction are performed: triple knowledge from multiple documents is fused and deduplicated, entity linking technology is used to unify different representations of the same entity, and a heterogeneous power knowledge graph is constructed. Entity set Includes device entities, geographic entities, time entities, parameter entities, and a set of relationships. It covers a variety of causal relationship types.

[0011] Furthermore, the specific implementation method of step 2 is as follows: Based on the predicted target power plant, extract relevant entity relationship subgraphs from the complete knowledge graph; For any pair of entities A multi-path search algorithm is used to identify all possible paths between two entities. And calculate the path confidence to determine which type of relationship the path belongs to; where, and They are all indexes; Indicates from index 1 The entity to the index is The set of all paths between entities; Subsequently, an adjacency matrix is ​​constructed to represent the relationships between entities. Finally, by fusing the adjacency weights of multiple relationships, the overall prior adjacency matrix is ​​obtained:

[0012] Where r is the relation type, It is a set of causal relationship types and relation weights. It consists of multiple factors, including the frequency of occurrence in the spectrum. Average confidence level :

[0013] in, and For weights.

[0014] Furthermore, path confidence is calculated using a multiplication method:

[0015] in, The semantic confidence of the edge is represented by a score from a large model or determined based on strong words in the sentence; The length of the current path. Indicates the first in the path The relationship type of the edge; then, through the matching degree function. Determine which type of relationship this path belongs to:

[0016] in, A set representing causal relationship types. It belongs to the optimal relation type. Minimum path confidence required; It refers to a specific path. , It is a path With relation type The degree of matching is based on word frequency statistics; if the match fails, the path is not counted in any relation. Matching function It should be defined as follows:

[0017] in: It is a path Length, It is a path The Middle The relationship type of the edge. It is an indicator function that returns 1 if the condition is true, and 0 otherwise; this function calculates the relation type in the path. Frequency of occurrence.

[0018] Furthermore, in step 3, a time-sparse attention mechanism is constructed to address the non-stationarity and local periodicity characteristics of power data:

[0019]

[0020] Where T is the time correlation matrix, and i and j are the indices of the time steps. , , , For sparsity threshold, As a dimension, , , For a learnable parameter matrix, through Implement input sequence Sparse attention processing.

[0021] Furthermore, in step 4, the hybrid adjacency matrix... Fusion weights Adopt a dynamic adjustment strategy. ,in For adaptive adjacency matrix, The prior adjacency matrix; Adaptive Adjacency Matrix The construction adopts an embedding-based learning approach:

[0022] Learnable parameter matrix In this context, d represents the matrix dimension, which is randomly initialized and then optimized through training. The matrix multiplication is then performed. After ReLU activation function The data is then processed and normalized using the softmax function.

[0023] Furthermore, in step 4, the graph convolution operation is represented as follows:

[0024] in, Output the graph convolution result. For spatial attention matrix, It is a hybrid adjacency matrix. The temporal features after sparse attention processing Let be the order of the Chebyshev graph convolution, and let be the Chebyshev coefficients. Obtained through backpropagation training.

[0025] Furthermore, in step 5, the processing procedure of the temporal convolution submodule is as follows:

[0026] in, It is the output of the temporal convolutional submodule of the Kth TSMST block. This represents the temporal convolution operation, which uses a one-dimensional convolution kernel; finally, the residual convolution module is used. To process input That is, the temporal features after sparse attention processing, and the residual convolution result and the temporal convolution result are matrix-added in the Kth TSMST block to obtain the output result. ;

[0027] in, For residual convolution modules, the following is adopted: Convolution adjusts the feature dimension. For layer normalization.

[0028] This invention provides a power data prediction system based on a large language model-assisted knowledge graph, comprising a processor and a memory. The memory stores program instructions, and the processor calls the program instructions in the memory to execute the power data prediction method based on a large language model-assisted knowledge graph as described in the above technical solution.

[0029] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the power data prediction method based on large language model-assisted knowledge graph construction as described in the above technical solution.

[0030] The power data prediction method based on large language model-assisted knowledge graph construction provided by this invention solves the problems of low knowledge acquisition efficiency and insufficient accuracy of semantic relationship recognition in traditional methods by automatically constructing a high-coverage power knowledge graph through a large language model. Through a multi-path causal attribution mechanism, it effectively transforms multi-hop and multi-relational paths in the knowledge graph into a prior adjacency matrix that can be used by neural networks, realizing the structured integration of domain knowledge. Through the synergistic effect of temporal sparse attention and hybrid adjacency matrix, it significantly improves the modeling accuracy of spatiotemporal dependencies in power data, providing important technical support for the precise scheduling and optimized operation of smart grids.

[0031] Furthermore, each technical aspect of this invention possesses independent innovative value: the knowledge graph construction method driven by the large language model breaks through the limitations of traditional rule templates and achieves efficient recognition of cross-document semantic relationships; the multi-path causal attribution mechanism innovatively solves the problem of integrating heterogeneous knowledge graphs and graph neural networks; and the temporal sparse attention mechanism effectively suppresses noise interference in power data, improving the robustness and generalization ability of the model. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in this invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0033] Figure 1 This is a diagram illustrating the overall framework of a power data prediction method based on a large language model-assisted knowledge graph. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0035] like Figure 1 As shown in the embodiments of the present invention, the LLM-KGAP power data prediction method based on large language model-assisted knowledge graph construction achieves high-precision power data prediction through the synergistic effect of large language model-driven knowledge graph construction, multi-path causal attribution mechanism, and temporally sparse hybrid spatiotemporal graph convolution. The following are the specific implementation details and key parameter settings for each step: Step 1: Automated Construction of Power Knowledge Graph Based on Large Language Model First, entity recognition and standardization are performed. A pre-trained large language model is used to perform deep semantic understanding on unstructured documents such as power system operation reports, fault analyses, and dispatch notifications. A specialized prompt template is designed to guide the large language model in recognizing key entities in the power sector, including power plants, transformers, transmission lines, switching equipment, fault events, climate conditions (temperature, humidity, wind speed), economic indicators (GDP, industrial electricity consumption), and policy measures (energy conservation and emission reduction policies, electricity price adjustments), among other entity types. The entity recognition prompt template is designed as follows: "Please identify all relevant entities from the following power system documents, including equipment names, geographical locations, time information, numerical parameters, etc., and classify and label them according to [Equipment], [Geographic], [Time], and [Parameter] categories."

[0036] Next, relation extraction and triple generation are performed. A task-oriented relation extraction prompt template is designed to guide the large language model to automatically identify complex causal relationships between entities. Direct causal relationships are also included. Direct causal effects refer to direct causal influences, such as "high temperatures → increased electricity load"; indirect causal relationships refer to indirect causal relationships. This refers to the impact generated through intermediary factors, such as "economic growth → industrial development → increased electricity demand"; a temporal causal relationship. This refers to relationships with a time delay effect, such as "typhoon warning → advance scheduling → load transfer". The prompt template for relationship extraction is: "Please analyze the causal relationships between entities in the following text and classify them according to direct causality, indirect causality, and time causality. The output format is <entity1, relation type, entity2, confidence level>".

[0037] Finally, knowledge fusion and graph construction are performed. Triple knowledge from multiple documents is merged and deduplicated. Entity linking technology is used to unify different representations of the same entity; for example, "power plant X" and "power station X" are merged when they refer to the same entity. A heterogeneous power knowledge graph is then constructed. Entity set Includes device entities, geographic entities, time entities, parameter entities, etc., and is a set of relationships. It covers various types of causal relationships. The knowledge graph is stored in the form of a graph database, which facilitates subsequent querying and reasoning.

[0038] Step 2: Multi-path causal attribution and prior adjacency matrix generation Based on the target power plant to be predicted, relevant entity relationship subgraphs are extracted from the complete knowledge graph. A breadth-first search algorithm is used, starting with the target power plant as the starting node, to search for all relevant entities and their connections within a 2-3 hop range, thus constructing a subgraph structure relevant to the prediction task.

[0039] From the complete knowledge graph In the middle, targeting the power plant The process of constructing a subgraph: a. Initialization: Add the target power plant to the node set. edge set ; b. Breadth-first search: Jump 1: Find all matching Directly connected entities, add Add corresponding edges ; Second hop: For each node in the first hop, find its neighboring nodes and add them. and

[0040] 3rd jump: Repeat the above process; c. Filtering: Remove isolated nodes with too low a degree (e.g., degree < 2); d. Finally, the subgraph is obtained. This is used for subsequent multi-path search; For any pair of entities A multi-path search algorithm is used to identify all possible paths between two entities. ,in, and As the index value, in the entity pair middle: Indicates the index of the source entity, the range of which is ; The index representing the target entity, the range of which is ; Indicates from index 1 The entity to the index is The set of all paths between entities. It refers to a specific path. The path length is limited to 5 hops or less to avoid noise interference from excessively long paths. Path confidence is calculated using a multiplication method:

[0041] in, The semantic confidence of the edge is represented by a score from a large model or determined based on strong words in the sentence; The length of the current path. Indicates the first in the path The relationship type of the edge. Next, through the matching degree function. Determine which type of relationship this path belongs to:

[0042] in, A set representing causal relationship types. It belongs to the optimal relation type. Minimum path confidence required; It is a path With relation type The degree of matching is based on word frequency statistics; if the matching fails (the confidence level is too low or the matching degree is too poor), the path is not counted in any relationship.

[0043] Matching function It should be defined as follows:

[0044] in: It is a path Length, It is a path The Middle The relationship type of the edge. It is an indicator function that returns 1 if the condition is true, and 0 otherwise; this function calculates the relation type in the path. Frequency of occurrence; Subsequently, the adjacency matrix of relationships between entities is constructed according to the following formula:

[0045] in This is a path length attenuation factor used to reduce the impact of long paths in structure perception. Finally, the overall prior adjacency matrix is ​​obtained by fusing the multi-relationship adjacency weights:

[0046] in, It is a set of causal relationship types and relation weights. It consists of multiple factors, including the frequency of occurrence in the spectrum. Average confidence level :

[0047] in, Representing relations Frequency normalization in knowledge graphs; Relationship type Number of times it appears in the knowledge graph The total number of edges in the knowledge graph; Representing relations The average confidence level indicates the relation type. The total number of occurrences in the knowledge graph is used to calculate the average confidence score. and The weights are set according to actual needs; in this embodiment of the invention, they are set as follows: .

[0048] Step 3: Detailed implementation of the temporal sparse attention mechanism Input sequence A linear transformation generates a query, key, and value matrix, where the input sequence... Data derived from historical power data (time-series data such as load and power generation). Number of nodes (number of power plants). Feature dimensions (such as load value, temperature, humidity, etc.) Historical time step length (e.g., the past 24 hours). Time correlation matrix. The calculation process is as follows: First, calculate key-value correlation: ,in , , The learnable parameter matrix is ​​initialized using Xavier.

[0049] Next, it is processed using a non-linear activation function: ,in It is the sigmoid activation function. , This is the bias parameter.

[0050] Sparse threshold Adaptive setting strategy adopted: ,in and These represent the mean and standard deviation of the time correlation matrix, respectively. This setup ensures that approximately 50% of attentional connections are preserved, effectively balancing computational efficiency with the need for information retention.

[0051] To address the non-stationarity and local periodicity of power data, a time-sparse attention mechanism is constructed, focusing only on highly correlated key time points at each time step to avoid low-correlation time points and noise interference.

[0052]

[0053] Here, i and j are both indices of time steps. i represents the current time step for which attention weights need to be calculated (usually called the "query point" or "target time step"), and j represents all possible time steps in the sequence that can be of interest (usually called the "key point" or "context time step"). j traverses the entire input time series to find other times that are most relevant to the current time i. , , , For sparsity threshold, As a dimension, , , For a learnable parameter matrix, through Implement input sequence Sparse attention processing.

[0054] Step 4: Hybrid Adaptive Graph Convolution with Hybrid Adjacency Matrix Adaptive Adjacency Matrix The construction employs an embedding-based learning approach. The learnable parameter matrix... In this context, d represents the matrix dimension, which is randomly initialized and then optimized through training. Matrix multiplication. After ReLU activation function Then, normalize using the softmax function:

[0055] Hybrid adjacency matrix Fusion weights Adopt a dynamic adjustment strategy. Early stages of training It relies more on prior knowledge; as training progresses, Gradually decrease the value to 0.3 to allow the model to learn more about data-driven relationships. Adjust the formula as follows: epoch: represents the current training epoch (e.g., counting from 0), maxepochs: represents the total number of training epochs (i.e., the total number of training cycles).

[0056] Spatial attention matrix The computation employs a self-attention mechanism:

[0057] in , , , , These are learnable parameters.

[0058] Step 3 outputs the temporal features after sparse attention processing. This feature is used as input to the graph convolution in step 4, along with the mixed adjacency matrix. Perform graph convolution operations: ; in, The order of Chebyshev graph convolution is used as the output of the graph convolution result. Chebyshev coefficient Obtained through backpropagation training. Step 5: Network architecture and training with multiple TSMST blocks. The overall network consists of four cascaded sparse hybrid spatiotemporal graph convolutional (TSMST) blocks, with output dimensions of 64, 128, 128, and 64 for each block, respectively. Each TMST block contains sub-modules such as temporal sparse attention processing, hybrid adaptive graph convolution, and temporal convolution. A residual connection mechanism is used to avoid the gradient vanishing problem and obtain the output results.

[0059] Once the adaptive graph convolution operation has collected information from neighboring nodes in the spatial dimension, it updates the signal of each entity by incorporating information from historical time slices through the temporal convolutional layer. The temporal convolution process can be represented as follows:

[0060] in, It is the output of the temporal convolutional submodule of the Kth TSMST block. This represents the temporal convolution operation, which uses a one-dimensional convolution kernel with a kernel size of 3, a stride of 1, and padding of 1. Finally, the residual convolution module is used. To handle In the Kth TSMST block, matrix addition is performed on the residual convolution result and the temporal convolution result to obtain the output result. .

[0061]

[0062] in, For residual convolution modules, the following is adopted: Convolution adjusts feature dimensions, layer normalization Applying this after each TSMST block effectively mitigates the vanishing gradient problem. A prediction output layer is set at the end to map the output to predictions for the next L time steps. The final prediction layer uses a fully connected network to map spatiotemporal features to the prediction output.

[0063] Step 6: Training the model requires a large number of historical data pairs, which are generated from historical time-series data using the sliding window technique. Finally, the trained network is used to predict power data. Data source: historical power data, such as hourly load values ​​and power generation recorded by each power station / substation, as well as related characteristic data (such as economic and meteorological indicators such as temperature and humidity).

[0064] Input sequence: For any given time point, take the data from the previous P consecutive hours as the model input.

[0065] Loss function: a weighted average of mean squared error and L2 regularization; Output ground truth: The data from the L hours immediately following the input sequence serves as the ground truth that the model needs to learn. Sliding window for sample construction: The model slides across the complete historical data in 1-hour increments, generating a large number of (input, ground truth) training sample pairs. For example, a dataset containing two years of data can generate tens of thousands of valid training samples using a sliding window.

[0066] Training process and parameter settings: The training process adopts the standard optimization strategy in deep learning, and the specific parameter settings are as follows: Optimizer: Adam. It is an adaptive learning rate optimization algorithm that converges quickly and performs stably. Learning rate: 0.001, which is a key hyperparameter controlling the step size for parameter updates.

[0067] Batch size: Each time the parameters are updated, the model processes 32 training samples at the same time, which helps to improve training efficiency and stabilize convergence.

[0068] Training rounds: The entire training dataset will be traversed 200 times.

[0069] Early stopping: To prevent overfitting, a separate validation set is used. If the loss on the validation set does not decrease for 20 consecutive epochs, training will be terminated early, even if epochs have not been reached, and the model parameters will be restored to the state where the loss on the validation set is minimized.

[0070] To verify the effectiveness of the proposed method, experimental evaluations were conducted on two datasets: Dataset A (Photovoltaic Power Generation Dataset): This dataset includes weather and temperature reports from corresponding stations, used to extract the relationship between meteorological factors and power generation to construct a knowledge graph. It also uses one month's historical power data to predict power output for a future period.

[0071] Dataset B (Electricity Consumption Dataset for a Certain Region): Electricity consumption data for 68 power zones in a certain region from 2022 to 2025, with a time resolution of 1 day and the unit being megawatt-hours (MWh). Combined with the region's monthly electricity operation reports, semantic information such as regional electricity consumption, industry status, and external environment is extracted to construct a power industry knowledge graph. Historical data from the past 30 days is used to predict regional power generation for a future period.

[0072] Both datasets underwent missing value imputation and outlier removal preprocessing, and were divided into training, validation, and test sets in a 7:1.5:1.5 ratio. The datasets provide the raw data for the prediction model, while the knowledge graph provides structured prior knowledge support for the prediction model.

[0073] To better evaluate the performance of the proposed LLM-KGAP, the evaluation metrics include Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and Mean Absolute Percent Error (MAPE). The baseline models used include CNN, Long Short-Term Memory (LSTM), CNN-LSTM, Temporal Convolutional Networks (TCN), GCN, and DEST-CNN. Multi-step prediction experiments were conducted on two datasets to verify the effectiveness and generalization ability of the proposed model. Dataset A focuses on power generation prediction for the next 15, 30, and 60 minutes, while dataset B focuses on regional power generation prediction for the next 3, 6, and 12 days. The experimental results are shown in Tables 1 and 2.

[0074] Table 1. Model performance at different time steps on dataset A.

[0075] Table 2. Model performance at different time steps on dataset B.

[0076] Overall, LLM-KGAP demonstrates significant advantages in prediction tasks across different time scales and data ranges while maintaining a moderate parameter size (199K and 104K). On dataset A, LLM-KGAP achieves the best results in short-term predictions: in the 15-minute prediction, its MAE, RMSE, and MAPE are 0.29 MW, 0.72 MW, and 0.32%, respectively, significantly outperforming smaller models like CNN and LSTM, and even surpassing the larger-parameter TCN. In the 30-minute prediction, LLM-KGAP's RMSE is only 1.18 MW, a 21.3% decrease compared to DEST-CNN, further validating its modeling accuracy. In the 60-minute prediction, despite the significantly increased prediction difficulty, LLM-KGAP maintains low MAE (0.77 MW), RMSE (1.69 MW), and MAPE (0.74%), showing strong long-term modeling capabilities. LLM-KGAP also performs well on dataset B. In 3-day predictions, its MAE and RMSE were 127.73 and 340.78 (10MWh), respectively, which were 38.4% and 20.5% lower than DEST-CNN. In 6-day predictions, its RMSE was 475.12 (10MWh), which was 16.6% lower than DEST-CNN, and it maintained the best performance in MAE and MAPE. In 12-day long-term predictions, LLM-KGAP still achieved MAE and RMSE of 190.57 / 477.37 (10MWh), which were significantly improved compared to traditional time series and graph models.

[0077] It is important to note that since the original dataset A lacks knowledge guidance, and environmental information such as site temperature and humidity is introduced into the model as prior knowledge, a certain systematic bias is introduced into the overall prediction. This contributes to an increase in MAPE, resulting in LLM-KGAP performing slightly worse than the state-of-the-art method DEST-CNN in terms of MAPE, thus affecting the model's stability. However, this prior knowledge plays a positive role in capturing extreme value changes in the data, significantly reducing RMSE, indicating that the model's prediction accuracy for abnormal fluctuations has been improved and the maximum prediction bias has been effectively controlled. Meanwhile, on dataset B, using real-generated power operation reports and corresponding data, LLM-KGAP achieves results in MAPE that match or even surpasses those of the comparative methods, further validating the effectiveness of the "data-knowledge dual-driven" mechanism.

[0078] In summary, LLM-KGAP achieved best or second-best results on both datasets and prediction tasks at different time scales, demonstrating its ability to effectively capture complex spatiotemporal dependencies and exhibiting strong cross-temporal generalization ability and stability under the guidance of causal knowledge.

[0079] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0080] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.

Claims

1. A power data prediction method based on large language model-assisted knowledge graph construction, characterized in that, Includes the following steps: Step 1: Automated construction of power knowledge graph based on large language model; Step 2: Multi-path causal attribution and prior adjacency matrix generation; Step 3: Construct a temporal sparse attention processing submodule to implement sparse attention processing of the input sequence and output the temporal features after sparse attention processing; Step 4: Construct a hybrid adaptive graph convolution submodule, and perform graph convolution operation between the hybrid adjacency matrix and the output of Step 3; Step 5: Construct a power data prediction network that includes multiple sparse hybrid spatiotemporal graph convolutional blocks (TSMST), and transform the output of the power data prediction network into the final prediction result through a prediction layer. Each sparse hybrid spatiotemporal graph convolutional block (TSMST) contains a temporal sparse attention processing submodule, a hybrid adaptive graph convolutional submodule, and a temporal convolutional submodule. Step 6: Train the power data prediction network and use the trained network to predict power data.

2. The power data prediction method based on large language model-assisted knowledge graph construction as described in claim 1, characterized in that: The specific implementation method of step 1 is as follows: First, entity recognition and standardization are performed: a pre-trained large language model is used to perform deep semantic understanding on unstructured documents such as power system operation reports, fault analyses, and dispatch notifications. A designed prompt template guides the large language model to identify key entities in the power sector. Next, relation extraction and triple generation are performed: a task-oriented relation extraction prompt template is designed to guide the large language model to automatically identify complex causal relationships between entities, including direct causal relationships. Indirect causal relationship Time causality Finally, knowledge fusion and graph construction are performed: triple knowledge from multiple documents is fused and deduplicated, entity linking technology is used to unify different representations of the same entity, and a heterogeneous power knowledge graph is constructed. Entity set Includes device entities, geographic entities, time entities, parameter entities, and a set of relationships. It covers a variety of causal relationship types.

3. The power data prediction method based on large language model-assisted knowledge graph construction as described in claim 1, characterized in that: The specific implementation method of step 2 is as follows: Based on the predicted target power plant, extract relevant entity relationship subgraphs from the complete knowledge graph; For any pair of entities A multi-path search algorithm is used to identify all possible paths between two entities. And calculate the path confidence to determine which type of relationship the path belongs to; where, and They are all indexes; Indicates from index 1 The entity to the index is The set of all paths between entities; Subsequently, an adjacency matrix is ​​constructed to represent the relationships between entities. Finally, by fusing the adjacency weights of multiple relationships, the overall prior adjacency matrix is ​​obtained: Where r is the relation type, It is a set of causal relationship types and relation weights. It consists of multiple factors, including the frequency of occurrence in the spectrum. Average confidence level : in, and For weights.

4. The power data prediction method based on large language model-assisted knowledge graph construction as described in claim 3, characterized in that: Path confidence is calculated using a multiplication method: in, The semantic confidence of the edge is represented by a score from a large model or determined based on strong words in the sentence; The length of the current path. Indicates the first in the path The relationship type of the edge; then, through the matching degree function. Determine which type of relationship this path belongs to: in, A set representing causal relationship types. It belongs to the optimal relation type. Minimum path confidence required; It refers to a specific path. , It is a path With relation type The degree of matching is based on word frequency statistics; if the match fails, the path is not counted in any relation. Matching function It should be defined as follows: in: It is a path Length, It is a path The Middle The relationship type of the edge. It is an indicator function that returns 1 if the condition is true, and 0 otherwise; this function calculates the relation type in the path. Frequency of occurrence.

5. The power data prediction method based on large language model-assisted knowledge graph construction as described in claim 1, characterized in that: In step 3, a time-sparse attention mechanism is constructed to address the non-stationarity and local periodicity of power data: Where T is the time correlation matrix, and i and j are the indices of the time steps. , , , For sparsity threshold, As a dimension, , , For a learnable parameter matrix, through Implement input sequence Sparse attention processing.

6. The power data prediction method based on large language model-assisted knowledge graph construction as described in claim 1, characterized in that: In step 4, the hybrid adjacency matrix is... Fusion weights Adopt a dynamic adjustment strategy. ,in For adaptive adjacency matrix, The prior adjacency matrix; Adaptive Adjacency Matrix The construction adopts an embedding-based learning approach: Learnable parameter matrix In this context, d represents the matrix dimension, which is randomly initialized and then optimized through training. The matrix multiplication is then performed. After ReLU activation function The data is then processed and normalized using the softmax function.

7. The power data prediction method based on large language model-assisted knowledge graph construction as described in claim 1, characterized in that: In step 4, the graph convolution operation is represented as follows: in, Output the graph convolution result. For spatial attention matrix, It is a hybrid adjacency matrix. The temporal features after sparse attention processing Let be the order of the Chebyshev graph convolution, and let be the Chebyshev coefficients. Obtained through backpropagation training.

8. The power data prediction method based on large language model-assisted knowledge graph construction as described in claim 1, characterized in that: In step 5, the processing procedure of the temporal convolution submodule is as follows: in, It is the output of the temporal convolutional submodule of the Kth TSMST block. This represents the temporal convolution operation, which uses a one-dimensional convolution kernel; finally, the residual convolution module is used. To process input That is, the temporal features after sparse attention processing, and the residual convolution result and the temporal convolution result are matrix-added in the Kth TSMST block to obtain the output result. ; in, For residual convolution modules, the following is adopted: Convolution adjusts the feature dimension. For layer normalization.

9. A power data prediction system based on a large language model-assisted knowledge graph, characterized in that: It includes a processor and a memory, the memory being used to store program instructions, and the processor being used to call the program instructions in the memory to execute the power data prediction method based on the construction of a large language model-assisted knowledge graph as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the power data prediction method based on the construction of a large language model-assisted knowledge graph as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Distribution transformer voltage prediction method and system based on multivariable space-time diagram neural network

    CN121840599A