An energy data intelligent analysis and prediction method based on a large language model
The energy data intelligent analysis and prediction method driven by a large language model solves the problems of low interactivity, low model adaptability and low automation in existing technologies, and realizes user-friendly, adaptive and high-precision energy data analysis and prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI ELECTRIC POWER DESIGN INST CEEC
- Filing Date
- 2026-02-27
- Publication Date
- 2026-06-19
AI Technical Summary
Existing energy data analysis technologies suffer from high data access barriers, insufficient model adaptability, lack of interpretability of results, and fragmented technical architecture, resulting in poor interactivity, low prediction accuracy, and low degree of automation.
We employ an intelligent analysis and prediction method for energy data based on a large language model. We generate structured query commands through natural language parsing, perform multi-model collaborative prediction, interpret and visualize the results, and combine self-learning to iteratively optimize model parameters.
It features a user-friendly interface, highly adaptable models, highly interpretable results, and fully automated processes, thereby improving prediction accuracy and decision support capabilities.
Smart Images

Figure CN122240765A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy big data processing and artificial intelligence application technology, and in particular to an intelligent analysis and prediction method for energy data based on a large language model. Background Technology
[0002] Under the "dual-carbon strategy," the digital and intelligent transformation of the energy system has become a core path to ensure energy security and green, low-carbon development. Energy data is characterized by multiple energy categories, multiple time scales, and strong nonlinearity and seasonality. Accurate analysis and forecasting of energy data are key supports for energy policy formulation, regional scheduling, and supply-demand balance.
[0003] However, existing energy data analysis technologies still have the following technical shortcomings in practical applications:
[0004] First, data access is difficult and inefficient: existing technologies heavily rely on professionals writing SQL statements or program scripts for data extraction, lacking natural language interaction capabilities for non-technical users. This results in poor query flexibility when dealing with high-dimensional, heterogeneous energy databases, and due to excessive human intervention, it is difficult to achieve fast and accurate retrieval of large-scale energy data.
[0005] Second, the model has insufficient adaptability and weak generalization ability: most mainstream methods currently use fixed algorithms such as ARIMA, single LSTM, or regression models. Because energy data exhibits significant differences in characteristics under different scenarios, a single static model is difficult to take into account multiple time series features, resulting in limited prediction accuracy under complex working conditions and a lack of adaptive matching mechanism for data features;
[0006] Third, the results lack interpretability: Although deep learning models have advantages in numerical fitting, their "black box" nature makes the prediction results lack physical meaning and logical basis; in decision-making scenarios involving energy policy demonstration and cross-regional dispatch, they cannot provide transparent and verifiable decision support information.
[0007] Fourth, the technical architecture is fragmented and the degree of automation is low: existing language model applications, database management and time series prediction tools often operate independently and lack deep collaborative logic; the entire process from data query, preprocessing to feature recognition, model selection and result visualization has not formed an automated closed loop, resulting in low system integration and slow response when handling complex tasks.
[0008] Therefore, there is an urgent need for an intelligent energy data analysis method that can deeply integrate natural language processing and multi-model dynamic scheduling to improve the efficiency of digital energy governance. Summary of the Invention
[0009] To address the significant bottlenecks in existing technologies regarding interactivity, model adaptability, result interpretability, and end-to-end collaboration, this invention aims to provide an intelligent energy data analysis and prediction method based on a large language model, characterized by convenient interaction, intelligent scheduling, high result reliability, and in-depth decision support.
[0010] To achieve the above objectives, the present invention adopts the following technical solution: an intelligent analysis and prediction method for energy data based on a large language model, the method comprising the following sequential steps:
[0011] (1) Natural language parsing and instruction generation: Receive natural language requests input by users, extract semantics through a large language model, obtain semantic feature vectors, and generate structured query instructions;
[0012] (2) Energy data retrieval and preprocessing: The raw data is retrieved from the energy database according to the structured query instructions, and missing value repair and normalization are performed to generate a standard time series;
[0013] (3) Automated feature diagnosis: Multi-dimensional feature extraction is performed on standard time series sequences, and feature vectors reflecting time series features are calculated;
[0014] (4) Multi-model collaborative prediction: Based on the feature vector, the optimal model or combined model is matched from the preset model library, parallel computing is performed and the results are fused to obtain the prediction result. ;
[0015] (5) Result Interpretation and Visualization: Interpretation of Prediction Results Perform semantic interpretation and risk identification, and generate graphical reports;
[0016] (6) Self-learning iteration: Monitor prediction deviation and automatically update model parameters or fusion weights based on error feedback.
[0017] In step (1), the large language model adopts the domain-adaptive optimized Transformer architecture and extracts semantic feature vectors through an attention mechanism. :
[0018] ;
[0019] Where Q, K, and V are the query matrix, key matrix, and value matrix obtained after linear transformation of the user input request, respectively. is the scaling factor; softmax is the softmax function;
[0020] The system combines an energy knowledge graph to perform semantic verification and map energy database structure fields, ultimately generating structured query instructions. The energy knowledge graph includes energy categories, indicators, and spatiotemporal ranges.
[0021] In step (2), the normalization process uses the Min-Max scaling method to map the original data x to the [0,1] interval:
[0022] ;
[0023] Where X is the historical dataset of the corresponding indicator in the energy database, and the historical dataset is a collection that stores the original data; min(X) and max(X) are the minimum and maximum values of the historical dataset, respectively; This is the normalized data.
[0024] Step (3) specifically includes the following steps in sequence:
[0025] (3a) Time series structure decomposition: Using moving average or seasonal decomposition algorithms, the standard time series is decomposed into trend components, periodic components and residual components;
[0026] (3b) Multidimensional feature extraction: Calculate the mean, variance and autocorrelation coefficient of each component respectively, and perform linear regression fitting on the mean and variance of the components. Use the slope of the fitted curve as the trend strength value; extract the peak points in the autocorrelation coefficient sequence, and convert the lag time interval corresponding to the peak points into the main period frequency of the sequence.
[0027] (3c) Sequence complexity quantification: Calculate sample entropy for residual components. To assess the nonlinearity and uncertainty of the data:
[0028] ;
[0029] in, is the sample entropy; m is the embedding dimension; r is the similarity tolerance; N is the data length; and These correspond to the matching probabilities of the (m+1)-dimensional and m-dimensional embedding vectors, respectively; the system based on... The numerical value automatically triggers a stationary sequence model or a nonlinear deep learning model;
[0030] (3d) Model-triggered decision: A feature vector is constructed by combining trend strength, main cycle frequency, and sample entropy. The sequence type is automatically determined based on the indicator values in the feature vector. When the value is below a threshold, the sequence is determined to be strongly linear or stationary, triggering the statistical model; when When the threshold is exceeded, the sequence is determined to be a high-complexity or non-linear sequence, triggering a deep learning model or a large-scale time series model.
[0031] In step (4), the multi-model collaborative prediction uses a weighted fusion strategy to generate prediction results. :
[0032] ;
[0033] Where n is the number of prediction models invoked. The output of the i-th prediction model. The fusion weights of the called prediction model, and satisfying... ;
[0034] Fusion weights The initial value is determined by the reciprocal of the root mean square error of the called prediction model on the validation set:
[0035] ;
[0036] ;
[0037] in, To verify the sample size, and Let represent the root mean square errors of the prediction results of the i-th and j-th prediction models, respectively. Indicates the actual value. The model predicts the value. The validation set is a subset of the historical dataset used to validate the prediction results and calculate the difference between the prediction results.
[0038] In step (4), the model library includes statistical models, deep learning models, time series large models, and specialized physical mechanism models.
[0039] Step (5) specifically refers to: converting the prediction results into natural language text through a large language model to complete semantic interpretation; simultaneously calculating the prediction interval and quantifying the uncertainty of the prediction in the form of [L, U]; combining the prediction results and the prediction interval to conduct risk identification and obtain risk identification results; and finally integrating the natural language interpretation content, prediction interval, and risk identification results to generate a graphical report; wherein the calculation formula for the prediction interval [L, U] is:
[0040] ;
[0041] In the formula, z is the critical value at the confidence level. The standard deviation of historical prediction errors. This indicates the lower limit of the reliable range of the prediction results. This indicates the upper limit of the reliable range of the prediction result. This is the predicted result.
[0042] Step (6) specifically refers to: when the average absolute percentage error monitored in real time exceeds the threshold for T consecutive periods. When the model retraining task is triggered, the MAPE calculation formula is:
[0043] ;
[0044] In the formula, Indicates the actual value. Indicates the predicted value. denoted as mean absolute percentage error, and s represents the number of predicted values.
[0045] As can be seen from the above technical solution, the beneficial effects of this invention are as follows: First, convenient interaction: By using a large language model, complex energy analysis needs are transformed into automated instruction generation, eliminating the technical barriers between users and professional databases; Second, intelligent scheduling: By introducing quantitative diagnostic indicators such as sample entropy, the invention achieves a shift from "manual model selection" to "data feature-driven model selection," significantly improving the matching degree between the prediction model and data features; Third, high reliability of results: By adopting a multi-model fusion mechanism based on error weighting, compared with a single prediction model, its prediction accuracy and robustness are significantly improved in complex energy fluctuation scenarios; Fourth, in-depth decision support: In addition to providing numerical predictions, it also outputs readable risk analysis reports through semantic enhancement technology, enhancing the interpretability and practical value of the analysis results. Attached Figure Description
[0046] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0047] like Figure 1 As shown, an intelligent analysis and prediction method for energy data based on a large language model is proposed. This method includes the following sequential steps:
[0048] (1) Natural language parsing and instruction generation: Receive natural language requests input by users, extract semantics through a large language model, obtain semantic feature vectors, and generate structured query instructions;
[0049] (2) Energy data retrieval and preprocessing: The raw data is retrieved from the energy database according to the structured query instructions, and missing value repair and normalization are performed to generate a standard time series;
[0050] (3) Automated feature diagnosis: Multi-dimensional feature extraction is performed on standard time series sequences, and feature vectors reflecting time series features are calculated;
[0051] (4) Multi-model collaborative prediction: Based on the feature vector, the optimal model or combined model is matched from the preset model library, parallel computing is performed and the results are fused to obtain the prediction result. ;
[0052] (5) Result Interpretation and Visualization: Interpretation of Prediction Results Perform semantic interpretation and risk identification, and generate graphical reports;
[0053] (6) Self-learning iteration: Monitor prediction deviation and automatically update model parameters or fusion weights based on error feedback.
[0054] In step (1), the large language model adopts the domain-adaptive optimized Transformer architecture and extracts semantic feature vectors through an attention mechanism. :
[0055] ;
[0056] Where Q, K, and V are the query matrix, key matrix, and value matrix obtained after linear transformation of the user input request, respectively. is the scaling factor; softmax is the softmax function;
[0057] The system combines an energy knowledge graph to perform semantic verification and map energy database structure fields, ultimately generating structured query instructions. The energy knowledge graph includes energy categories, indicators, and spatiotemporal ranges.
[0058] In step (2), the normalization process uses the Min-Max scaling method to map the original data x to the [0,1] interval:
[0059] ;
[0060] Where X is the historical dataset of the corresponding indicator in the energy database, and the historical dataset is a collection that stores the original data; min(X) and max(X) are the minimum and maximum values of the historical dataset, respectively; This is the normalized data.
[0061] To address potential statistical omissions or anomalies in the original data, execute the following logic:
[0062] When missing values exhibit random, short-term characteristics, linear interpolation is used to fill them in.
[0063] When the number of missing values exceeds 3 consecutive observation points, the time series model is invoked for fitting and imputation.
[0064] For identified outliers that deviate from the physical boundaries, a smooth correction is performed.
[0065] Step (3) specifically includes the following steps in sequence:
[0066] (3a) Time series structure decomposition: Using moving average or seasonal decomposition algorithms, the standard time series is decomposed into trend components, periodic components and residual components;
[0067] (3b) Multidimensional feature extraction: Calculate the mean, variance and autocorrelation coefficient of each component respectively, and perform linear regression fitting on the mean and variance of the components. Use the slope of the fitted curve as the trend strength value; extract the peak points in the autocorrelation coefficient sequence, and convert the lag time interval corresponding to the peak points into the main period frequency of the sequence.
[0068] (3c) Sequence complexity quantification: Calculate sample entropy for residual components. To assess the nonlinearity and uncertainty of the data:
[0069] ;
[0070] in, is the sample entropy; m is the embedding dimension; r is the similarity tolerance; N is the data length; and These correspond to the matching probabilities of the (m+1)-dimensional and m-dimensional embedding vectors, respectively; the system based on... The numerical value automatically triggers a stationary sequence model or a nonlinear deep learning model;
[0071] (3d) Model-triggered decision: A feature vector is constructed by combining trend strength, main cycle frequency, and sample entropy. The sequence type is automatically determined based on the indicator values in the feature vector. When the value is below a threshold, the sequence is determined to be strongly linear or stationary, triggering the statistical model; when When the threshold is exceeded, the sequence is determined to be a high-complexity or non-linear sequence, triggering a deep learning model or a large-scale time series model.
[0072] In step (4), the multi-model collaborative prediction uses a weighted fusion strategy to generate prediction results. :
[0073] ;
[0074] Where n is the number of prediction models invoked. The output of the i-th prediction model. The fusion weights of the called prediction model, and satisfying... ;
[0075] Fusion weights The initial value is determined by the reciprocal of the root mean square error of the called prediction model on the validation set:
[0076] ;
[0077] ;
[0078] in, To verify the sample size, and Let represent the root mean square errors of the prediction results of the i-th and j-th prediction models, respectively. Indicates the actual value. The model predicts the value; the validation set is a subset of the historical dataset used to validate the prediction results and calculate the difference between the prediction results.
[0079] In step (4), the model library includes statistical models, deep learning models, time series large models, and specialized physical mechanism models.
[0080] Statistical models, including ARIMA and Prophet, are suitable for handling stationary energy sequences below a preset threshold. They fit historical data patterns through parametric modeling, balancing the accuracy and interpretability of short-term forecasts.
[0081] Deep learning models encompass Long Short-Term Memory Networks, Temporal Convolutional Networks, and Chronos, focusing on processing complex fluctuating energy data with long-term dependencies and nonlinear characteristics, and relying on multi-layer neural network structures to capture deep data correlations.
[0082] Large-scale time series models, represented by TimesFM, have the advantages of long-term time series prediction capabilities and small sample adaptation. They can cope with high-dimensional and highly dynamic energy time series data and make up for the limitations of traditional models in long-term prediction.
[0083] Professional physical mechanism models, including GCAM-China, are built based on the energy flow balance equation of the energy system. They can provide physical constraints and mechanism descriptions for the entire process of production, conversion, and consumption of specific energy categories, and are suitable for medium- and long-term energy structure analysis scenarios.
[0084] Step (5) specifically refers to: converting the prediction results into natural language text through a large language model to complete semantic interpretation; simultaneously calculating the prediction interval and quantifying the uncertainty of the prediction in the form of [L, U]; combining the prediction results and the prediction interval to conduct risk identification and obtain risk identification results; and finally integrating the natural language interpretation content, prediction interval, and risk identification results to generate a graphical report; wherein the calculation formula for the prediction interval [L, U] is:
[0085] ;
[0086] In the formula, z is the critical value at the confidence level. The standard deviation of historical prediction errors. This indicates the lower limit of the reliable range of the prediction results. This indicates the upper limit of the reliable range of the prediction result. This is the predicted result.
[0087] Step (6) specifically refers to: when the average absolute percentage error monitored in real time exceeds the threshold for T consecutive periods. When the model retraining task is triggered, the MAPE calculation formula is:
[0088] ;
[0089] In the formula, Indicates the actual value. Indicates the predicted value. denoted as mean absolute percentage error, and s represents the number of predicted values.
[0090] When the monitored MAPE exceeds the preset warning value for three consecutive observation periods... When the percentage reaches 10%, the following self-learning process will be automatically triggered:
[0091] Weight Adjustment: Re-evaluate the RMSE performance of each model in the model library and update the fusion weights. ;
[0092] Parameter evolution: Fine-tuning the parameters of deep learning models (such as LSTM) using incremental data;
[0093] Rule Revision: Amendments based on Model selection threshold This makes the decision-making logic more adaptable to the current energy fluctuation pattern.
[0094] In summary, this invention transforms complex energy analysis needs into automated instruction generation through a large language model, eliminating the technical barriers between users and professional databases; it introduces quantitative diagnostic indicators such as sample entropy, realizing a shift from "manual model selection" to "data feature-driven model selection," significantly improving the matching degree between the prediction model and data features; it adopts a multi-model fusion mechanism based on error weighting, which significantly improves prediction accuracy and robustness in complex energy fluctuation scenarios compared to a single prediction model; and it not only provides numerical predictions but also outputs readable risk analysis reports through semantic enhancement technology, enhancing the interpretability and practical value of the analysis results.
[0095] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A large language model-based energy data intelligent analysis and prediction method, characterized in that: The method includes the following steps in sequence: (1) Natural language parsing and instruction generation: Receive natural language requests input by users, extract semantics through a large language model, obtain semantic feature vectors, and generate structured query instructions; (2) Energy data retrieval and preprocessing: The raw data is retrieved from the energy database according to the structured query instructions, and missing value repair and normalization are performed to generate a standard time series; (3) Automated feature diagnosis: Multi-dimensional feature extraction is performed on standard time series sequences, and feature vectors reflecting time series features are calculated; (4) Multi-model collaborative prediction: According to the characteristic vector, the optimal model or combined model is matched from the preset model library, parallel calculation is performed, the results are fused, and the prediction result is obtained ; (5) Result Interpretation and Visualization: Interpretation of Prediction Results Perform semantic interpretation and risk identification, and generate graphical reports; (6) Self-learning iteration: Monitor prediction deviation and automatically update model parameters or fusion weights based on error feedback.
2. The intelligent analysis and prediction method for energy data based on a large language model according to claim 1, characterized in that: In step (1), the large language model adopts the domain-adaptive optimized Transformer architecture and extracts semantic feature vectors through an attention mechanism. : ; Where Q, K, and V are the query matrix, key matrix, and value matrix obtained after linear transformation of the user input request, respectively. is the scaling factor; softmax is the softmax function; The system combines an energy knowledge graph to perform semantic verification and map energy database structure fields, ultimately generating structured query instructions. The energy knowledge graph includes energy categories, indicators, and spatiotemporal ranges.
3. The intelligent analysis and prediction method for energy data based on a large language model according to claim 1, characterized in that: In step (2), the normalization process uses the Min-Max scaling method to map the original data x to the [0,1] interval: ; Where X is the historical dataset of the corresponding indicator in the energy database, and the historical dataset is a collection that stores the original data; min(X) and max(X) are the minimum and maximum values of the historical dataset, respectively; This is the normalized data.
4. The intelligent analysis and prediction method for energy data based on a large language model according to claim 1, characterized in that: Step (3) specifically includes the following steps in sequence: (3a) Time series structure decomposition: Using moving average or seasonal decomposition algorithms, the standard time series is decomposed into trend components, periodic components and residual components; (3b) Multidimensional feature extraction: Calculate the mean, variance and autocorrelation coefficient of each component respectively, and perform linear regression fitting on the mean and variance of the components. Use the slope of the fitted curve as the trend strength value; extract the peak points in the autocorrelation coefficient sequence, and convert the lag time interval corresponding to the peak points into the main period frequency of the sequence. (3c) Sequence complexity quantification: Calculate sample entropy for residual components. To assess the nonlinearity and uncertainty of the data: ; in, is the sample entropy; m is the embedding dimension; r is the similarity tolerance; N is the data length; and These correspond to the matching probabilities of the (m+1)-dimensional and m-dimensional embedding vectors, respectively; the system based on... The numerical value automatically triggers a stationary sequence model or a nonlinear deep learning model; (3d) Model-triggered decision: A feature vector is constructed by combining trend strength, main cycle frequency, and sample entropy. The sequence type is automatically determined based on the indicator values in the feature vector. When the value is below a threshold, the sequence is determined to be strongly linear or stationary, triggering the statistical model; when When the threshold is exceeded, the sequence is determined to be a high-complexity or non-linear sequence, triggering a deep learning model or a large-scale time series model.
5. The intelligent analysis and prediction method for energy data based on a large language model according to claim 1, characterized in that: In step (4), the multi-model collaborative prediction uses a weighted fusion strategy to generate prediction results. : ; Where n is the number of prediction models invoked. The output of the i-th prediction model. The fusion weights of the called prediction model, and satisfying... ; Fusion weights The initial value is determined by the reciprocal of the root mean square error of the called prediction model on the validation set: ; ; in, To verify the sample size, and Let represent the root mean square errors of the prediction results of the i-th and j-th prediction models, respectively. Indicates the actual value. The model predicts the value. The validation set is a subset of the historical dataset used to validate the prediction results and calculate the difference between the prediction results.
6. The intelligent analysis and prediction method for energy data based on a large language model according to claim 1, characterized in that: In step (4), the model library includes statistical models, deep learning models, Large-scale temporal models and specialized physical mechanism models.
7. The intelligent analysis and prediction method for energy data based on a large language model according to claim 1, characterized in that: Step (5) specifically refers to: converting the prediction results into natural language text through a large language model to complete semantic interpretation, calculating the prediction interval in the form of [L, U] to quantify the uncertainty of the prediction, and combining the prediction results and the prediction interval to carry out risk identification, obtaining the risk identification results, and finally integrating the natural language interpretation content, prediction interval, and risk identification results to generate a graphical report. The formula for calculating the prediction interval [L, U] is as follows: ; In the formula, z is the critical value at the confidence level. The standard deviation of historical prediction errors. This indicates the lower limit of the reliable range of the prediction results. This indicates the upper limit of the reliable range of the prediction result. This is the predicted result.
8. The intelligent analysis and prediction method for energy data based on a large language model according to claim 1, characterized in that: Step (6) specifically refers to: when the average absolute percentage error monitored in real time exceeds the threshold for T consecutive periods. When the model retraining task is triggered, the MAPE calculation formula is: ; In the formula, Indicates the actual value. Indicates the predicted value. denoted as mean absolute percentage error, and s represents the number of predicted values.