Interactive load prediction method based on fusion of prior knowledge and data driving
By constructing a prior knowledge base through modal decomposition and labeling, and combining it with an improved Transformer model, the accuracy and stability issues of traditional load forecasting methods under new loads and complex scenarios are solved, achieving adaptive and high-precision load forecasting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional power load forecasting methods struggle to maintain high accuracy and stability when faced with new loads and complex scenarios. In particular, deep learning models perform poorly in the absence of training data or under extreme conditions, while methods based on expert experience lack data-driven universality and accuracy.
An interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches is adopted. A prior knowledge base is constructed through modal decomposition, labeling, and SHAP interpretability analysis. Combined with an improved Transformer model, a prior knowledge matrix and ARD-SHAP mechanism are introduced to perform feature selection and weight adjustment, forming a closed-loop mechanism of prediction-interpretation-update.
It significantly improves the accuracy and stability of load forecasting, especially in abnormal and complex scenarios. The model can adaptively adjust, improving robustness and interpretability, and solving the semantic gap between expert experience and data-driven methods.
Smart Images

Figure CN121860129A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of load forecasting technology, specifically relating to an interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches. Background Technology
[0002] With the accelerated construction of new power systems and the large-scale integration of new loads such as electric vehicles and distributed photovoltaic power, the nonlinear, sudden, and diverse characteristics of power loads are becoming increasingly apparent. Traditional power load forecasting methods often struggle to maintain forecast accuracy and stability when faced with the impact of these new loads. Power load is not only affected by factors such as weather conditions, holidays, and economic activities, but its coupling relationship with various factors such as electricity prices and equipment operating status has also become more complex and closer. Therefore, traditional data-driven load forecasting methods face challenges of declining accuracy and insufficient stability, urgently requiring new technological solutions to address these complex and dynamically changing scenarios.
[0003] Existing load forecasting methods can be mainly classified into the following categories: (1) Based on expert experience, this method mainly relies on the long-term experience of dispatchers or experts in the operation characteristics of the power grid, and makes judgments and corrections in combination with weather, holidays and socio-economic factors. It has advantages such as flexibility in extreme scenarios and during major events, but it relies on subjective judgment, and the prediction results are unstable, difficult to quantify and promote. (2) Pure data-driven prediction based on deep learning (such as CNN, LSTM, Transformer, etc.). For example, in the prior art, CN118940919A discloses a load prediction method that integrates spatiotemporal features with attention mechanism. In this method, the power load dataset is obtained and divided into training set and test set; weather data is collected and sorted according to importance using the random forest algorithm, and the top three significant features of the weather data are selected as model input; the power load data is decomposed by applying VMD, which decomposes it into multiple local components. Each component corresponds to a vibration mode in a frequency range, and the parameters in VMD are iteratively optimized using the RIME algorithm to obtain the subsequence component with the least complexity; based on the decomposed subsequence components, combined with the selected top three meteorological features as model input, an energy consumption prediction model that integrates spatiotemporal features with attention mechanism is constructed. The parallel mechanism of BiTCN model and BiGRU model is used to process time series data at the same time. After passing through the cross attention layer, feature enhancement is performed to obtain the prediction result. While this method demonstrates high prediction accuracy and stability in conventional scenarios, the prediction performance of deep learning models often drops sharply when faced with novel loads or abnormal situations lacking training data. This is especially true in special scenarios such as extreme weather and sudden events, where the model fails to adequately handle complex power load changes. Furthermore, this method neglects crucial prior knowledge. This limitation of lacking prior knowledge significantly reduces the model's predictive ability and stability when dealing with complex situations.
[0004] Therefore, how to effectively combine expert experience and data-driven methods in load forecasting, and how to introduce prior knowledge into the model, have become the core technical challenges in improving the accuracy and stability of load forecasting. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the existing technology and provide an interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches.
[0006] The objective of this invention can be achieved through the following technical solutions: This invention provides an interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches, comprising the following steps: Obtain the original power load sequence and its corresponding temporal, meteorological, and economic characteristics; The original power load sequence is decomposed into modes, and the original power load sequence is reconstructed into trend load sequence and disturbance load sequence based on the decomposition results; A prior knowledge base of label-feature weights is constructed based on labeling and SHAP interpretability analysis for time series, meteorological and economic characteristics. Based on the prior knowledge base and feature contribution analysis, low-contribution features are eliminated, and channel-level weight learning is performed on the retained features through the automatic correlation determination module to obtain key input features with adaptive weights. The reconstructed trend load sequence, disturbance load sequence, and key input features with adaptive weights are input into the improved Transformer model for encoding. The prior knowledge base is mapped into a prior knowledge matrix and embedded into the improved Transformer model to correct the model attention weights and generate load prediction results. The generated load forecast results are analyzed for interpretability, the actual contribution of each input feature is quantified, and the analysis results are fed back to update the prior knowledge base.
[0007] Furthermore, the time series, meteorological, and economic characteristics include multiple related indicators, which include time series characteristics, meteorological characteristics, and economic characteristics; The temporal features include time information such as hours, days of the week, and months, as well as their periodic coding features; The meteorological characteristics include temperature, humidity, wind speed, and precipitation; The economic characteristics include the year-on-year growth rate of electricity consumption, the month-on-month growth rate, and rolling statistical characteristics.
[0008] Furthermore, the step of performing mode decomposition on the original power load sequence and reconstructing the original power load sequence into a trend load sequence and a disturbance load sequence based on the decomposition results specifically includes: Variational Mode Decomposition (VMD) is used to transform the original power load sequence Decomposed into a set of Intrinsic Mode Function (IMF) components Each IMF component has a finite bandwidth and a controllable center frequency, and each IMF component and its center frequency are continuously updated iteratively until the convergence condition is met: in, The number of decomposition layers; For each IMF component Calculate its relationship with the original power load sequence correlation coefficient ; Based on the correlation coefficients of each IMF component The correlation coefficient IMF components with correlation coefficients below a preset threshold are discarded as noise to obtain the effective IMF set. ; For each valid IMF component in the valid IMF set, calculate the corresponding sample entropy; Effective IMF components with sample entropy greater than a preset entropy threshold are classified as high-frequency components, and the effective IMF components classified as high-frequency components are reconstructed into a disturbance load sequence. Effective IMF components with sample entropy less than or equal to a preset entropy threshold are classified as low-frequency components, and the effective IMF components classified as low-frequency components are reconstructed into a trend load sequence.
[0009] Furthermore, the correlation coefficient The formula is: in, , They are respectively and The mean; This represents the total number of samples in the original payload sequence; Indicates the original load sequence and the first k The correlation coefficients of the IMF components.
[0010] Furthermore, the sample entropy is given by the formula: in, Indicates the first The sample entropy of each effective IMF component; Indicates the first One effective IMF component In the middle, the first i The matching probability of a sample template; the sample template is obtained by matching effective IMF components. A series of sub-sequence templates obtained by slicing, wherein the matching probability is represented in the entire effective IMF component. In the middle, the first i The similarity between a sample template and all other sample templates.
[0011] Furthermore, the construction of a prior knowledge base of label-feature weights based on labeling and SHAP interpretability analysis for time series, meteorological, and economic characteristics specifically includes: Semantic enhancement and structuring are performed on various related features of time series, meteorological and economic characteristics, and the original features are mapped into feature labels with clear business meaning and scenario indication, generating labeled features that correspond one-to-one with each related feature; Based on the aforementioned labeling features, the load forecasting dataset is divided into multiple sample subsets with specific scenario semantics according to different label combinations, with each sample subset corresponding to a label combination; the load forecasting dataset includes historical power load data and time-series features, meteorological features, and economic features aligned with the historical power load data in the time dimension; For each sample subset, the marginal contribution of each relevant feature to load forecasting is calculated using the SHAP interpretability Analysis method. The absolute values of the marginal contributions of corresponding features for each sample under the same label combination are averaged to obtain the feature importance weights for each relevant feature under the label combination. The calculation method is as follows: in, Indicates the first l The first tag combination j The feature importance weights of each relevant feature; Indicates the first l Number of samples under each label combination; Indicates the first i In the nth sample j SHAP values corresponding to each relevant feature; The feature importance weights corresponding to each label combination are normalized, and a structured mapping relationship is established between the label combination and its corresponding normalized feature importance weight vector to form a prior knowledge base of label-feature weights.
[0012] Furthermore, based on the prior knowledge base and feature contribution analysis, low-contribution features are eliminated, and the retained features are subjected to channel-level weight learning through an automatic relevance determination module to obtain key input features with adaptive weights, specifically including: Based on the constructed prior knowledge base of label-feature weights, the feature importance weights corresponding to each label combination are sorted. Based on the preset importance threshold, for the label combination corresponding to the current load prediction task, relevant features whose feature importance weight is lower than the importance threshold under the label combination are removed, and only high-confidence features with high feature contribution under the label combination scenario are retained to form a candidate key feature set. The candidate key feature set is input into the ARD module, and channel-level weight modeling is performed on each candidate key feature by introducing learnable channel weight parameters during model training. The channel-level weight parameters are adaptively updated through backpropagation during model training, enabling the channel weights corresponding to different features to be dynamically adjusted according to their actual contribution to the load prediction results, thus obtaining key input features with adaptive weights.
[0013] Furthermore, the improved Transformer model is the KI-iTransformer model, which includes an encoder module and an attention calculation module. The encoder module is used to learn joint feature representations of the trend load sequence, the perturbation load sequence, and key input features with adaptive weights. Based on the multi-head self-attention mechanism, the attention calculation module introduces a prior knowledge matrix obtained by mapping the prior knowledge base of label-feature weights, and embeds the prior knowledge matrix into the attention weight calculation process to guide and constrain the correlation between different input features.
[0014] Furthermore, the reconstructed trend load sequence, disturbance load sequence, and key input features with adaptive weights are encoded into the improved Transformer model, and the prior knowledge base is mapped into a prior knowledge matrix and embedded into the improved Transformer model. This process corrects the model's attention weights and generates load prediction results. Specifically, this includes: The reconstructed trend load sequence, disturbance load sequence, and key input features with adaptive weights are vectorized to form a unified serialized input feature, which is then input into the improved Transformer model. The serialized input features are encoded using the multi-layer attention encoding module in the improved Transformer model, and temporal correlation representations between different time steps and different features are extracted. Based on the constructed prior knowledge base of label-feature weights, a prior knowledge matrix is defined. M Based on the tag combination corresponding to the current load prediction task, a normalized feature weight vector is obtained from the prior knowledge base to construct the prior knowledge matrix. M ; The improved Transformer model generates a matrix based on the temporal characteristics of the input and the prior knowledge matrix. M Dimensionally consistent attention weight matrix G And in the attention calculation process of the improved Transformer model, the prior knowledge matrix is used. M With the attention weight matrix G By fusing the data, the model's attention allocation to key features and key time periods can be corrected. In the training process of the improved Transformer model, Kullback–Leibler divergence is introduced as a regularization loss term to constrain the weight distribution between different attention layers. The calculation expression is as follows: in, Indicates the first l The weight distribution generated by the layer attention module, when Time represents the initial weight distribution after being constrained by the prior knowledge matrix; Indicates the first Layer and First Kullback–Leibler divergence between layer attention weight distributions; By using prior knowledge matrix constraints and attention weight correction mechanisms, the improved Transformer model can balance data-driven learning results and prior knowledge guidance during the load forecasting process, and output load forecasting results.
[0015] Furthermore, the process of performing interpretability analysis on the generated load forecast results, quantifying the actual contribution of each input feature, and feeding the analysis results back to update the prior knowledge base specifically includes: After the improved Transformer model outputs load forecast results, the SHAP interpretability analysis method is used to calculate the marginal contribution value of each input feature to the current forecast result. Based on the label combination corresponding to the current predicted sample, the calculated sample-level SHAP value is classified into the corresponding label combination subset; under each label combination subset, the average of the feature SHAP values of all samples is calculated to obtain the actual feature importance vector under that label combination scenario; The obtained actual feature importance vector is updated with the corresponding feature weight vector in the original prior knowledge base using an exponential moving average strategy. The calculation method is as follows: in, This is the calculated vector of actual feature importance for the current sample; This is the weight vector of the corresponding feature in the original prior knowledge base; To update the coefficients; This is the updated feature weight vector.
[0016] Compared with the prior art, the present invention has the following advantages: (1) In the prior art, load forecasting methods struggle to maintain high accuracy and stability when faced with novel loads (such as electric vehicles and distributed photovoltaics) and their complex nonlinear and sudden characteristics. Especially in the absence of sufficient training data, traditional deep learning models are prone to failure in novel loads or abnormal scenarios such as extreme weather and major events. Although traditional prediction methods based on expert experience are flexible in abnormal situations, they are highly subjective, difficult to generalize and quantify, and lack the universality and accuracy of data-driven models. This invention solves the problem of existing methods being unable to effectively combine expert experience and data-driven models by integrating prior knowledge with data-driven methods and constructing a prior knowledge base of label-feature weights using label processing and SHAP interpretability analysis. Specifically, this invention improves the interpretability of the model and enhances the prediction stability and accuracy of the model in complex scenarios by transforming expert experience into structured and operable prior knowledge.
[0017] (2) Existing data-driven models, such as CNN, LSTM, and Transformer, while achieving good prediction results in conventional scenarios, often exhibit poor predictive ability when faced with novel loads or abnormal scenarios lacking training data. This is because these models primarily rely on historical data for training and cannot fully capture complex power load variation patterns, especially in sudden situations such as extreme weather or major events. This invention introduces the KI-iTransformer model, in which the prior knowledge matrix is combined with the ARD-SHAP mechanism to guide the model to focus on key features and correct the model's attention weights, enabling the model to handle complex scenarios such as holidays and extreme weather more accurately. Through this technical feature, this invention significantly improves the accuracy and stability of load forecasting, especially under abnormal loads and complex situations, effectively enhancing the model's robustness.
[0018] (3) Existing load forecasting methods typically rely on static expert knowledge or data-driven models. Their inherent knowledge structures cannot be dynamically adjusted with changes in time and scenarios, making them difficult to adapt to complex changes and new loads. This invention forms a closed-loop mechanism of prediction-interpretation-update by updating the output of the prediction model with the original prior knowledge base. This mechanism can automatically adjust the prior knowledge base according to the actual situation of each prediction, so that the model can be continuously optimized after each prediction, thus forming a self-learning, adaptive, and dynamic update process. This technical feature solves the problem that prior knowledge cannot be dynamically updated and co-evolved in existing methods, realizing the leap from "static knowledge injection" to "dynamic knowledge co-evolution," enabling the model to continuously improve according to the actual operation, forming a closed-loop intelligence of "human in the loop," which greatly improves the interactivity and self-learning ability of the system.
[0019] (4) Existing load forecasting methods mostly rely on manually designed features, which cannot automatically optimize feature selection and weighting based on changes in actual data. This invention uses an Automatic Relevance Determination (ARD) module to learn channel-level weights for retained features, enabling the model to adaptively adjust the weight of each feature during training. This technical feature allows the model to dynamically adjust based on the actual contribution of each feature to load forecasting, thereby improving the model's prediction accuracy in diverse load scenarios, especially demonstrating stronger adaptability and accuracy when dealing with novel or abnormal loads.
[0020] (5) In existing technologies, there is often a significant semantic gap between expert experience and data-driven methods, making it difficult to directly integrate expert experience into the model and thus affecting the model's predictive performance. Through labeling and SHAP interpretability analysis, this invention successfully transforms expert experience into a structured "label-feature weight" prior knowledge base and applies it directly to the model. This technical feature effectively solves the problems of difficulty in quantifying expert experience and difficulty in utilizing the model, realizes the structuring and modeling of prior knowledge, improves the interpretability and credibility of the load forecasting model, and provides clearer and more accurate support for decision-making in practical applications. Attached Figure Description
[0021] Figure 1 This is a flowchart of the load forecasting method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the method flow according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the feature enhancement prior knowledge quantification process in an embodiment of the present invention; Figure 4 This is a schematic diagram of the Automatic Correlation Determination (ARD) network in an embodiment of the present invention; Figure 5 This is a schematic diagram of an interactive load forecasting system based on the fusion of prior knowledge and data-driven approaches in an embodiment of the present invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present 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 the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0023] Example 1: This embodiment provides a novel load forecasting method based on human-in-the-loop. This method is based on the concept of human-computer interaction and constructs a closed-loop mechanism of "analysis-modeling prediction-analysis", which enhances the interpretability of the model structure, realizes the effective injection of domain knowledge, and can maintain the prediction accuracy.
[0024] In this embodiment, the interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches is based on the following principle: In terms of data preprocessing, traditional empirical mode decomposition (EMD) has poor mathematical controllability and noise robustness, making it unsuitable for processing multi-scale non-stationary signals. In view of the non-stationary and highly volatile characteristics of load sequences, this invention proposes a decomposition-reconstruction strategy based on variational mode decomposition (VMD) and sample entropy criteria to distinguish between trend and disturbance load components, providing clean input for feature modeling.
[0025] Regarding the construction of the prior knowledge base, this invention proposes to combine the business logic of the power industry with typical electricity consumption scenarios, integrate domain knowledge in power load forecasting through feature labeling processing, enhance the expressive power of features, and construct a "label-feature weight" knowledge base with SHAP analysis to realize the transformation of domain experience into structured prior knowledge.
[0026] Regarding the prediction model, this invention proposes a knowledge interaction load prediction model based on the KI (knowledge interaction)-iTransformer load prediction model. The key is to build a deep coupling mechanism between the knowledge base and the prediction model. On the one hand, a prior knowledge matrix is introduced and embedded into the iTtransformer structure to guide the model to focus on key feature channels. On the other hand, an interpretation-driven knowledge update module is designed to realize the reverse correction of the knowledge base by the model prediction output, thereby constructing a closed-loop collaborative system of "knowledge-driven – prediction modeling – interpretation optimization".
[0027] This embodiment specifically provides an interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches, such as... Figure 1 , Figure 2 As shown, it includes the following steps: Step S1: Obtain the original power load sequence and its corresponding time series, meteorological and economic characteristics; like Figure 3 As shown, the time series, meteorological and economic characteristics include multiple related indicators, which include time series characteristics, meteorological characteristics and economic characteristics; Temporal features include time information such as hours, days of the week, and months, as well as their periodic coding features; Meteorological characteristics include temperature, humidity, wind speed, and precipitation; Economic characteristics include the year-on-year growth rate of electricity consumption, the month-on-month growth rate, and rolling statistical characteristics.
[0028] Step S2: Perform modal decomposition on the original power load sequence, and reconstruct the original power load sequence into a trend load sequence and a disturbance load sequence based on the decomposition results; In this embodiment, VMD is used to decompose the original load sequence into multiple modal components, and then the sequence is reconstructed into a perturbation and trend load sequence by combining sample entropy. Specifically, it includes the following sub-steps: S21. The original load sequence is decomposed into a set of IMFs with limited bandwidth and controllable center frequency using VMD; in this embodiment, the optimal number of decomposition layers K=5. The S22 and VMD models continuously update each IMF component and its corresponding center frequency during the iteration process until the convergence condition is met, and finally obtain a set of non-overlapping modal components with clear frequency domain. S23. Discard the noise component from the IMF component obtained in S22 using the correlation coefficient method and calculate its sample entropy; S24. Based on the sample entropy value, the remaining IMF components after removing the noise components are divided into high-frequency and low-frequency components, which are then reconstructed into disturbance load sequences and trend load sequences, respectively. In this embodiment, IMF1 and IMF2, whose sample entropy values are lower than those of the original sequences, are reconstructed into stationary trend sequences, while IMF3, IMF4, and IMF5 are reconstructed into disturbance load sequences.
[0029] Step S3: Construct a prior knowledge base of label-feature weights based on labeling and SHAP interpretability analysis for time series, meteorological and economic characteristics; Specifically, this embodiment transforms periodic time series features from discrete jumps to continuous smooth changes by using sine / cosine encoding for hourly and weekly time series features. It also introduces lagged load and moving average features, which helps the neural network capture the periodic patterns of load, aids the model in remembering short-term fluctuations and long-term trends, and enhances the model's ability to model long-term changes. This embodiment uses the baseline period method recommended by the World Meteorological Organization (WMO) to bin temperature data, calculating the monthly average temperature and standard deviation using 30 years of historical data, dividing the temperature into five levels. This significantly improves the model's ability to identify load anomalies under extreme temperatures and enhances its robustness to noisy data. To measure the volatility of economic indicators, this embodiment introduces year-on-year growth rate (YoY), month-on-month growth rate (MoM), and rolling standard deviation. The processed economic data is transformed from raw static values into dynamic features reflecting trends and stability, which is beneficial for identifying potential patterns such as cyclical load increases and industry changes. This embodiment divides the dataset into subsets based on label combinations such as "high temperature + weekend" and "cold wave + weekday". An XGBoost model is trained on each subset, and the global average SHAP value of each feature is calculated, normalized, and stored in a knowledge base. The specific implementation includes the following steps: S31. Perform semantic enhancement and structuring processing on time series, meteorological and economic features to generate interpretable feature labels; S32. Based on the labeling results of S31, the load forecasting dataset is divided into multiple sample subsets with specific meanings, and each subset corresponds to a type of label combination. S33. Quantify the average marginal contribution of each feature in the label combination to the output of the prediction model using the SHAP value, and take the absolute average to obtain the global importance of the features of the label combination. The expression for calculating the SHAP value is as follows: in, Indicates the first l The first tag combination j The feature importance weights of each relevant feature; Indicates the first l Number of samples under each label combination; Indicates the first i In the nth sample j SHAP values corresponding to each relevant feature; S34. Combine the label combinations with their corresponding normalized weight vectors to form a structured mapping, creating a "label-feature weight" mapping table.
[0030] Step S4: Based on the prior knowledge base and feature contribution analysis, low-contribution features are eliminated, and the retained features are subjected to channel-level weight learning through the automatic relevance determination module to obtain key input features with adaptive weights. The specific implementation steps include: S41. Sort the average marginal contribution values obtained in S33, and remove low contribution features by SHAP, retaining only high confidence variables that are above the importance threshold; in this embodiment, the 25% of features with the lowest contribution are filtered out. S42. The ARD module is introduced to learn channel-level weights for the retained variables. All parameters are automatically updated during model training via backpropagation, forming adaptive weights for the input variables. The ARD module is as follows: Figure 4 As shown.
[0031] Step S5: Encode the reconstructed trend load sequence, disturbance load sequence, and key input features with adaptive weights into the improved Transformer model, map the prior knowledge base into a prior knowledge matrix and embed it into the improved Transformer model, correct the model attention weights, and generate load prediction results. The specific implementation includes the following steps: S51, iTransformer maps historical loads, meteorological and economic indicators and labeled features into vectorized sequence representations; in this embodiment, the reconstructed trend / disturbance sequence and labeled meteorological / economic features are input into the trained KI-iTransformer model; S52. Encode the vectorized sequence obtained in S51 using a multi-layer improved attention module; S53. Define the prior knowledge matrix M, and obtain the corresponding normalized feature weight vector from the "label-feature weight" prior knowledge base. Artificially increase the weight of factors that have a significant impact on the final load value, and normalize the matrix using the softmax function. The S54 and KI-iTransformer models automatically generate a neural network weight matrix G with the same dimensions as the prior knowledge matrix M based on the temporal characteristics of the input. S55. Based on the encoder, calculate the temporal features and replace the neural network weights G in the time period with significant influencing factors with the prior knowledge weights M. S56. Introduce Kullback-Leibler (KL) divergence as a regularization loss to correct the first... Block and the first The weight of a block is calculated using the following expression: In the formula: For the first The weights generated by the block represent The prior weight distribution at time.
[0032] In this embodiment, a prior knowledge matrix is defined. , interval is ,in Let be the number of time steps. The prior probability weights can be defined as: In the first layer attention calculation of the iTransformer model, the prior matrix M is combined with the network-generated weights G, and the influence weights of subsequent layer influencing factors are constrained by KL divergence loss to ensure that they do not deviate significantly from the knowledge.
[0033] Step S6: Perform interpretability analysis on the generated load forecast results, quantify the actual contribution of each input feature, and feed the analysis results back to update the prior knowledge base. Specific implementation steps include: S51. After the model outputs the prediction results, calculate the SHAP value corresponding to each input feature to quantify the marginal contribution of each feature to the prediction results. S52. Based on the label combination corresponding to the current predicted sample, classify the sample-level SHAP value calculated in S51 into its respective label combination subset. Under each subset, calculate the average of the SHAP values of all sample features to obtain the actual feature importance ranking in this scenario; S53. The feature importance vector obtained in S52 is fused and updated with the feature weights in the original knowledge base. To ensure the stability and coherence of the update, an exponential moving average strategy is adopted: In the formula: The feature weights obtained from the current SHAP analysis are... The original weights in the knowledge base, To update coefficients and The fusion ratio between control model-driven and experience-based priors.
[0034] In this embodiment, to verify the effectiveness, the KI-iTransformer model used in this embodiment is compared with benchmark models such as Prophet-XGBoost, CNN-GRU, and iTransformer. The results show that under various scenarios including normal workdays, weekends, holidays, cold waves, and sustained high temperatures, the MAE, RMSE, and MAPE metrics of the method of this invention are significantly better than the comparative models. Especially under extreme scenarios such as cold waves and sustained high temperatures, the prediction accuracy is improved by more than 50%. The ablation experiments in this embodiment further confirm that removing the prior knowledge matrix or the SHAP feedback mechanism leads to a significant decrease in model performance, demonstrating the effectiveness of each core module of this invention.
[0035] Example 2: This embodiment provides an interactive load forecasting system based on the fusion of prior knowledge and data-driven approaches, such as... Figure 5 As shown, the system for implementing the load forecasting method of Embodiment 1 includes: (1) Load sequence processing module, used to obtain the original load sequence, obtain the intrinsic mode components through variational mode decomposition, update each intrinsic mode component and its corresponding center frequency during the iteration process until the convergence condition is met. After discarding the noise component by the correlation coefficient method, the sample entropy of each intrinsic mode component is calculated and reconstructed into the disturbance load sequence and the trend load sequence.
[0036] (2) Prior knowledge base construction module: Based on label processing and SHAP interpretability analysis, a "label-feature weight" prior knowledge base is constructed. Low contribution features are eliminated through SHAP, and an automatic correlation determination module is introduced for dynamic screening and channel-level weight learning. All parameters are automatically updated during model training through backpropagation mechanism to form adaptive weights of input variables.
[0037] (3) Model building module: The input features are mapped to vectorized sequence representations using iTransformer and encoded through a multi-layer improved attention module. The joint modeling capability of local patterns and long-distance dependencies of time series data is enhanced by deformable attention mechanism, and the KI-iTransformer model is built.
[0038] (4) Weight correction module: The prior knowledge base of “label-feature weight” is mapped to a prior knowledge matrix. The weights of factors that have a significant impact on the final load value are artificially increased. After matrix normalization, the weights of the neural network in the time period of the factors with significant impact are replaced by the prior knowledge weights M. The influence weights of the factors in the subsequent layers are constrained by KL divergence loss so that they do not deviate significantly from the knowledge.
[0039] (5) Knowledge feedback mechanism module: After the model outputs the prediction results, it calculates the SHAP value corresponding to each input feature and classifies it into the corresponding label combination subset. It calculates the average value of all sample feature SHAP values in each subset to obtain the actual feature importance ranking in this scenario. The obtained feature importance vector is fused and updated with the feature weights in the original knowledge base using an exponential moving average strategy.
[0040] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0041] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches, characterized in that, Includes the following steps: Obtain the original power load sequence and its corresponding temporal, meteorological, and economic characteristics; The original power load sequence is decomposed into modes, and the original power load sequence is reconstructed into trend load sequence and disturbance load sequence based on the decomposition results; A prior knowledge base of label-feature weights is constructed based on labeling and SHAP interpretability analysis for time series, meteorological and economic characteristics. Based on the prior knowledge base and feature contribution analysis, low-contribution features are eliminated, and channel-level weight learning is performed on the retained features through the automatic correlation determination module to obtain key input features with adaptive weights. The reconstructed trend load sequence, disturbance load sequence, and key input features with adaptive weights are input into the improved Transformer model for encoding. The prior knowledge base is mapped into a prior knowledge matrix and embedded into the improved Transformer model to correct the model attention weights and generate load prediction results. The generated load forecast results are analyzed for interpretability, the actual contribution of each input feature is quantified, and the analysis results are fed back to update the prior knowledge base.
2. The interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches according to claim 1, characterized in that, The time series, meteorological, and economic characteristics include multiple related indicators, which include time series characteristics, meteorological characteristics, and economic characteristics. The temporal features include time information such as hours, days of the week, and months, as well as their periodic coding features; The meteorological characteristics include temperature, humidity, wind speed, and precipitation; The economic characteristics include the year-on-year growth rate of electricity consumption, the month-on-month growth rate, and rolling statistical characteristics.
3. The interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches according to claim 1, characterized in that, The process of performing mode decomposition on the original power load sequence and reconstructing the original power load sequence into a trend load sequence and a disturbance load sequence based on the decomposition results specifically includes: Variational Mode Decomposition (VMD) is used to transform the original power load sequence Decomposed into a set of Intrinsic Mode Function (IMF) components Each IMF component has a finite bandwidth and a controllable center frequency, and each IMF component and its center frequency are continuously updated iteratively until the convergence condition is met: in, The number of decomposition layers; For each IMF component Calculate its relationship with the original power load sequence correlation coefficient ; Based on the correlation coefficients of each IMF component The correlation coefficient IMF components with correlation coefficients below a preset threshold are discarded as noise to obtain the effective IMF set. ; For each valid IMF component in the valid IMF set, calculate the corresponding sample entropy; Effective IMF components with sample entropy greater than a preset entropy threshold are classified as high-frequency components, and the effective IMF components classified as high-frequency components are reconstructed into a disturbance load sequence. Effective IMF components with sample entropy less than or equal to a preset entropy threshold are classified as low-frequency components, and the effective IMF components classified as low-frequency components are reconstructed into a trend load sequence.
4. The interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches according to claim 3, characterized in that, The correlation coefficient The formula is: in, , They are respectively and The mean; This represents the total number of samples in the original payload sequence; Indicates the original load sequence and the first k The correlation coefficients of the IMF components.
5. The interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches according to claim 3, characterized in that, The sample entropy is given by the formula: in, Indicates the first The sample entropy of each effective IMF component; Indicates the first One effective IMF component In the middle, the first i The matching probability of a sample template; the sample template is obtained by matching effective IMF components. A series of sub-sequence templates obtained by slicing, wherein the matching probability is represented in the entire effective IMF component. In the middle, the first i The similarity between a sample template and all other sample templates.
6. The interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches according to claim 1, characterized in that, The prior knowledge base for label-feature weights, constructed based on labeling and SHAP interpretability analysis for time series, meteorological, and economic characteristics, specifically includes: Semantic enhancement and structuring are performed on various related features of time series, meteorological and economic characteristics, and the original features are mapped into feature labels with clear business meaning and scenario indication, generating labeled features that correspond one-to-one with each related feature; Based on the aforementioned labeling features, the load forecasting dataset is divided into multiple sample subsets with specific scenario semantics according to different label combinations, with each sample subset corresponding to a label combination; the load forecasting dataset includes historical power load data and time-series features, meteorological features, and economic features aligned with the historical power load data in the time dimension; For each sample subset, the marginal contribution of each relevant feature to load forecasting is calculated using the SHAP interpretability Analysis method. The absolute values of the marginal contributions of corresponding features for each sample under the same label combination are averaged to obtain the feature importance weights for each relevant feature under the label combination. The calculation method is as follows: in, Indicates the first l The first tag combination j The feature importance weights of each relevant feature; Indicates the first l Number of samples under each label combination; Indicates the first i In the nth sample j SHAP values corresponding to each relevant feature; The feature importance weights corresponding to each label combination are normalized, and a structured mapping relationship is established between the label combination and its corresponding normalized feature importance weight vector to form a prior knowledge base of label-feature weights.
7. The interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches according to claim 1, characterized in that, The process involves eliminating low-contribution features based on a prior knowledge base and feature contribution analysis, and then using an automatic relevance determination module to learn channel-level weights for the retained features to obtain key input features with adaptive weights. Specifically, this includes: Based on the constructed prior knowledge base of label-feature weights, the feature importance weights corresponding to each label combination are sorted. Based on the preset importance threshold, for the label combination corresponding to the current load prediction task, relevant features whose feature importance weight is lower than the importance threshold under the label combination are removed, and only high-confidence features with high feature contribution under the label combination scenario are retained to form a candidate key feature set. The candidate key feature set is input into the ARD module, and channel-level weight modeling is performed on each candidate key feature by introducing learnable channel weight parameters during model training. The channel-level weight parameters are adaptively updated through backpropagation during model training, enabling the channel weights corresponding to different features to be dynamically adjusted according to their actual contribution to the load prediction results, thus obtaining key input features with adaptive weights.
8. The interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches according to claim 1, characterized in that, The improved Transformer model is the KI-iTransformer model, which includes an encoder module and an attention calculation module. The encoder module is used to learn joint feature representations of the trend load sequence, the perturbation load sequence, and key input features with adaptive weights. Based on the multi-head self-attention mechanism, the attention calculation module introduces a prior knowledge matrix obtained by mapping the prior knowledge base of label-feature weights, and embeds the prior knowledge matrix into the attention weight calculation process to guide and constrain the correlation between different input features.
9. The interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches according to claim 1, characterized in that, The process involves encoding the reconstructed trend load sequence, disturbance load sequence, and key input features with adaptive weights into an improved Transformer model, mapping the prior knowledge base into a prior knowledge matrix, embedding it into the improved Transformer model, correcting the model's attention weights, and generating load prediction results. Specifically, this includes: The reconstructed trend load sequence, disturbance load sequence, and key input features with adaptive weights are vectorized to form a unified serialized input feature, which is then input into the improved Transformer model. The serialized input features are encoded using the multi-layer attention encoding module in the improved Transformer model, and temporal correlation representations between different time steps and different features are extracted. Based on the constructed prior knowledge base of label-feature weights, a prior knowledge matrix is defined. M Based on the tag combination corresponding to the current load prediction task, a normalized feature weight vector is obtained from the prior knowledge base to construct the prior knowledge matrix. M ; The improved Transformer model generates a matrix based on the temporal characteristics of the input and the prior knowledge matrix. M Dimensionally consistent attention weight matrix G And in the attention calculation process of the improved Transformer model, the prior knowledge matrix is used. M With the attention weight matrix G By fusing the data, the model's attention allocation to key features and key time periods can be corrected. In the training process of the improved Transformer model, Kullback–Leibler divergence is introduced as a regularization loss term to constrain the weight distribution between different attention layers. The calculation expression is as follows: in, Indicates the first l The weight distribution generated by the layer attention module, when Time represents the initial weight distribution after being constrained by the prior knowledge matrix; Indicates the first Layer and First Kullback–Leibler divergence between layer attention weight distributions; By using prior knowledge matrix constraints and attention weight correction mechanisms, the improved Transformer model can balance data-driven learning results and prior knowledge guidance during the load forecasting process, and output load forecasting results.
10. The interactive load forecasting method based on the fusion of prior knowledge and data-driven approaches according to claim 1, characterized in that, The process of performing interpretability analysis on the generated load forecast results, quantifying the actual contribution of each input feature, and feeding the analysis results back to update the prior knowledge base specifically includes: After the improved Transformer model outputs load forecast results, the SHAP interpretability analysis method is used to calculate the marginal contribution value of each input feature to the current forecast result. Based on the label combination corresponding to the current predicted sample, the calculated sample-level SHAP value is classified into the corresponding label combination subset; under each label combination subset, the average of the feature SHAP values of all samples is calculated to obtain the actual feature importance vector under that label combination scenario; The obtained actual feature importance vector is updated with the corresponding feature weight vector in the original prior knowledge base using an exponential moving average strategy. The calculation method is as follows: in, This is the calculated vector of actual feature importance for the current sample; This is the weight vector of the corresponding feature in the original prior knowledge base; To update the coefficients; This is the updated feature weight vector.
Citation Information
Cited By
Multi-factor spatio-temporal power load prediction method and system based on deep learning
CN122153815A