Load prediction method, apparatus and device, and readable storage medium
Through causal intervention, the generation of power consumption habits that have no causal relationship with historical load sequences, and combining multi-dimensional data to predict loads, the problem of insufficient generalization ability of existing models is solved, and higher prediction accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202510699803.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-26
AI Technical Summary
The generalization ability of existing load prediction models is poor, resulting in low load prediction accuracy, mainly because the non-causal relationship between historical load and future load limits the generalization ability of the model.
By generating electricity consumption habits after causal intervention, removing its causal relationship with historical load sequences, combining historical load sequences, predicting environmental sequences and predicting time characteristics, load prediction models are used to predict loads, and feature fusion modules connected by attention mechanisms and residuals are used to perform feature fusion, and converters are used to predict.
It improves the generalization ability and accuracy of the load prediction model, reduces the risk of overfitting, enhances the fitness for different scenarios, and improves the reliability of load prediction.
Smart Images

Figure CN120542663A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power grid technology, and more specifically, to a load forecasting method, apparatus, device, and readable storage medium. Background Art
[0002] In the field of power systems, load forecasting has been a research hotspot for many years. Accurate load forecasting is crucial to the stable operation of power systems and the optimal allocation of resources.
[0003] In existing research, the input features of short-term load forecasting models mainly fall into three categories: time, weather, and power characteristics. Time and weather characteristics have an intuitive causal relationship with future load, and their changes directly affect user electricity consumption behavior, which in turn affects future load.
[0004] However, the historical load and future load in power characteristics are statistically correlated, not causally related. This correlation limits the generalization ability of the model and leads to low load forecasting accuracy.
[0005] Therefore, how to improve the generalization ability of the load forecasting model has become a focus of attention for those skilled in the art. Summary of the Invention
[0006] In view of this, the present application provides a load forecasting method, apparatus, device and readable storage medium to address the shortcomings of the existing load forecasting model, which has poor generalization capability.
[0007] In order to achieve the above objectives, the following solutions are proposed:
[0008] A load forecasting method, comprising:
[0009] Obtain load forecasting models, historical load series, forecast environment series and forecast time characteristics;
[0010] Generate electricity consumption habits that have no causal relationship with historical load series after causal intervention;
[0011] The load forecasting model is used to perform load forecasting based on the power usage habits, the historical load sequence, the forecast environment sequence, and the forecast time characteristics to generate a load forecasting result.
[0012] Optionally, obtain the load forecast model, including:
[0013] Build an initial prediction model;
[0014] Acquire multiple load prediction samples, each load prediction sample including a first load training sequence and a second load training sequence corresponding to two consecutive historical periods, and an environment training sequence, training habits, and time training characteristics corresponding to the second load training sequence with a subsequent historical period;
[0015] Using each load forecast sample to train the initial forecast model, and generating a load training result for each load forecast sample;
[0016] The parameters of the initial prediction model are adjusted based on each load training result and its corresponding second load training sequence until the initial prediction model reaches a training stop condition, and the final initial prediction model is used as the load prediction model.
[0017] Optionally, the adjusting parameters of the initial prediction model based on each load training result and its corresponding second load training sequence includes:
[0018] For each load training result, a prediction curve is constructed based on the load training result, and a training curve is constructed based on the second load training sequence corresponding to the load training result; based on the similarity between the prediction curve and the training curve, the loss value corresponding to the load training result is calculated; based on the loss value, the parameters of the initial prediction model are adjusted.
[0019] Optionally, generating electricity usage habits that have no causal relationship with historical load sequences after causal intervention includes:
[0020] Combined with the feature extraction model, feature extraction is performed on historical load data, and the extracted features are integrated to form a load feature pool;
[0021] Approximate processing is performed on each feature in the load feature pool to remove the causal relationship between each feature and the historical load sequence, thereby generating the electricity usage habit.
[0022] Optionally, performing approximate processing on each feature in the load feature pool to remove the causal relationship between each feature and the historical load sequence to generate the electricity usage habit includes:
[0023] Approximately processing each feature in the load feature pool to remove the causal relationship between each feature and the historical load sequence, and obtain the power consumption pattern after the removal;
[0024] evaluating the accuracy of the power consumption pattern based on the historical load sequence;
[0025] If the accuracy meets the preset accuracy requirement, the power usage pattern is the power usage habit.
[0026] Optionally, the evaluating the accuracy of the power usage pattern based on the historical load sequence includes:
[0027] generating, using a load recovery model and based on the power usage pattern, a load curve matching the power usage pattern;
[0028] When the matching degree between the load curve and the historical load sequence exceeds a preset matching threshold, it is determined that the accuracy of the power usage pattern meets a preset accuracy requirement.
[0029] Optionally, the using the load forecasting model to perform load forecasting based on the power usage habits, the historical load sequence, the forecast environment sequence, and the forecast time characteristics to generate a load forecast result includes:
[0030] Performing embedding transformation on the historical load sequence, the predicted environment sequence, and the predicted time feature to generate an embedding vector;
[0031] Using a fusion module that combines an attention mechanism and a residual connection, the embedding vector and the power usage habit are fused to generate a fusion feature;
[0032] The transformer is used to perform load forecasting based on the fusion features to generate a load forecast result.
[0033] A load forecasting device, comprising:
[0034] Acquisition module, used to obtain load forecasting model, historical load series, forecast environment series and forecast time characteristics;
[0035] A generation module is used to generate electricity consumption habits that have no causal relationship with historical load sequences after causal intervention;
[0036] The prediction module is used to use the load prediction model to perform load prediction based on the power consumption habits, the historical load sequence, the predicted environment sequence and the predicted time characteristics, and generate a load prediction result.
[0037] A load forecasting device comprising a memory and a processor;
[0038] The memory is used to store programs;
[0039] The processor is used to execute the program to implement each step of the above-mentioned load forecasting method.
[0040] A readable storage medium stores a computer program, which, when executed by a processor, implements the various steps of the above-mentioned load forecasting method.
[0041] It can be seen from the above technical solutions that the load forecasting method provided by the present application can obtain a load forecasting model, a historical load sequence, a forecasted environment sequence and a forecasted time characteristic; generate electricity usage habits that have no causal relationship with the historical load sequence after causal intervention; utilize the load forecasting model to perform load forecasting based on the electricity usage habits, the historical load sequence, the forecasted environment sequence and the forecasted time characteristic to generate a load forecasting result; based on this, the present application can integrate the correlation between the historical load sequence and the future load, the causality between the forecasted environment sequence, the electricity usage habits and the forecasted time characteristic and the future load, so that the load forecasting model can learn complex and real load change laws, enhance the adaptability of the present application to different scenarios, and improve the generalization ability of the load forecasting model of the present application, thereby improving the reliability of the load forecasting model.
[0042] At the same time, the present application takes into account that if there is a causal relationship between electricity usage habits and historical load sequences, a sub-process will be generated in the load forecasting process to generate historical load sequences based on electricity usage habits and perform load forecasting based on historical load sequences. However, in essence, the load forecasting model uses historical load sequences, predicted environment sequences, predicted time characteristics and electricity usage habits to perform load forecasting. The historical load sequence has become one of the reference dimensions. The emergence of the above sub-process has invisibly enhanced the reference weight of the historical load sequence, excessively strengthened the correlation between the historical load sequence and the load forecasting results, and caused the load forecasting results to be overly affected by the historical load sequence, thereby causing the forecasting results to be inaccurate. In order to solve the above problems, the electricity usage habits of the present application are subjected to causal intervention to solve the problem that the load forecasting results are overly affected by the historical load sequence due to the causal relationship between electricity usage habits and historical load sequences, thereby improving the accuracy of load forecasting and reducing the risk of overfitting.
[0043] It can be seen that this application can integrate data from multiple dimensions and electricity usage habits after causal intervention to improve the accuracy of load forecasting results. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0045] Figure 1 A flow chart of a load forecasting method disclosed in an embodiment of the present application;
[0046] Figure 2 (a) is a schematic diagram showing the causal relationship between electricity consumption habits, load forecast results, historical load series, forecast environment series, and forecast time characteristics;
[0047] Figure 2(b) is a diagram showing the causal relationship among electricity usage habits, load forecast results, historical load series, forecast environment series, and forecast time characteristics, while removing the causal relationship between electricity usage habits and historical load series;
[0048] Figure 3 It is an optional organizational structure for a load forecasting model;
[0049] Figure 4 This is a structural block diagram of a load forecasting device disclosed in an embodiment of the present application;
[0050] Figure 5 This is a hardware structure block diagram of a load forecasting device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0052] An embodiment of the present application provides a load forecasting method, which can be applied to various power grid dispatching systems or load forecasting systems, and can also be applied to various computer terminals or smart terminals. The execution subject can be the processor or server of the computer terminal or smart terminal.
[0053] Next, combine Figure 1 The load forecasting method of this application is introduced in detail, including the following steps:
[0054] Step S1: Obtain a load forecasting model, a historical load sequence, a forecasting environment sequence, and forecasting time characteristics.
[0055] Specifically, Figure 2(a) is a schematic diagram showing the causal relationship among electricity usage habits, load forecast results, historical load series, forecast environment series, and forecast time characteristics.
[0056] FIG2( b ) is a schematic diagram showing the causal relationship among electricity usage habits, load forecast results, historical load series, forecast environment series, and forecast time characteristics, while removing the causal relationship between electricity usage habits and historical load series.
[0057] Among them, node T represents the forecast time characteristics, including the hour, date and day of the week corresponding to the load forecast result.
[0058] Node W represents the predicted environment sequence, including the temperature and humidity corresponding to the load forecast results.
[0059] Node H represents the historical load sequence, including the load records N days before the load forecast result.
[0060] Node Z represents electricity usage habits;
[0061] Node Y represents the load forecast result.
[0062] Specifically, the prediction time characteristics and prediction environment series can be obtained from public data on the Internet, and the historical load series can be obtained based on the power consumption data recorded by smart meters.
[0063] Figure 2(a) shows that electricity usage habits are a confounding factor that can affect both historical load series and load forecasting results. Specifically, historical load series can be generated based on electricity usage habits, and load forecasting can be performed based on these historical load series. However, this process creates an additional causal effect on the load forecast results due to the historical load series.
[0064] The load forecasting method in Figure 2(a) can be formalized as a conditional probability , derived through the following steps:
[0065]
[0066] Here, z represents the sample space of electricity usage habits; (1) follows the law of total probability; (2) and (4) follow Bayes' theorem; and because T and W are independent of Z, (3) holds. According to causal theory, Z will cause a spurious correlation between H and Y. This spurious correlation will weaken the stability of the model performance.
[0067] In order to eliminate the pseudo-correlation, do-calculus can be used to eliminate the influence of node H, that is, cut off the directed edge between node z and node b as shown in Figure 2 (b). At this time, the conditional probability It can be visualized as:
[0068]
[0069] Where do(H) denotes severing the causal relationship between node z and node b. G and G' denote the causal graphs in Figure 2(a) and Figure 2(b), respectively. Indicates The probability of the load forecast result is obtained from the above. It represents the conditional probability of outcome Y given T, W, H, and z under G'. It represents the conditional probability of outcome Y given T, W, and H under G'. It represents the conditional probability of the outcome z given T, W, and H under G'. represents the marginal probability of z under G'. represents the marginal probability of z under G.
[0070] Step S2: Generate electricity usage habits that have no causal relationship with the historical load sequence after causal intervention.
[0071] Specifically, electricity consumption habits that have undergone causal intervention and have no causal relationship with the historical load sequence can be generated based on a large amount of historical loads.
[0072] Electricity usage habits can be captured in a variety of ways.
[0073] For example, the electricity usage habits of different entities may be stored in advance, and when it is determined that load forecasting is required for a target entity, the electricity usage habits of the target entity may be retrieved.
[0074] It is also possible to generate electricity usage habits based on a large number of historical loads of the target entity.
[0075] Step S3: Utilize the load forecasting model to perform load forecasting based on the electricity usage habits, the historical load sequence, the forecast environment sequence, and the forecast time characteristics, and generate a load forecasting result.
[0076] Specifically, considering that the extracted electricity usage habits will inevitably suffer from information loss, and the historical load series may also contain other causal information that is beneficial to load forecasting in addition to electricity usage habits, electricity usage habits, historical load series, predicted environment series and predicted time characteristics can be used as inputs to the load forecasting model to obtain the load forecast results output by the load forecasting model.
[0077] The load forecasting model can be Figure 3 shown.
[0078] Figure 3In the figure, Forecasted Load represents load forecasting; Forecasting Module represents forecasting module; Transformer Encoder represents Transformer encoder; Transformer Decoder represents Transformer decoder; FC represents fully connected layer; Position Encoding represents position encoding; Fusion Module represents fusion module; Fusion Block represents fusion block; Embedding Module represents embedding module; Embedding represents embedding; Time Feature represents predicted time feature; Weather Feature represents predicted weather feature; Historical Load represents historical load sequence; Load Characteristic represents electricity consumption habit; Multi-head Self-attention represents multi-head self-attention; Concatenate represents concatenation.
[0079] It can be seen from the above technical solutions that the load forecasting method provided by the present application can obtain a load forecasting model, a historical load sequence, a forecasted environment sequence and a forecasted time characteristic; generate electricity usage habits that have no causal relationship with the historical load sequence after causal intervention; utilize the load forecasting model to perform load forecasting based on the electricity usage habits, the historical load sequence, the forecasted environment sequence and the forecasted time characteristic to generate a load forecasting result; based on this, the present application can integrate the correlation between the historical load sequence and the future load, the causality between the forecasted environment sequence, the electricity usage habits and the forecasted time characteristic and the future load, so that the load forecasting model can learn complex and real load change laws, enhance the adaptability of the present application to different scenarios, and improve the generalization ability of the load forecasting model of the present application, thereby improving the reliability of the load forecasting model.
[0080] At the same time, the present application takes into account that if there is a causal relationship between electricity usage habits and historical load sequences, a sub-process will be generated in the load forecasting process to generate historical load sequences based on electricity usage habits and perform load forecasting based on historical load sequences. However, in essence, the load forecasting model uses historical load sequences, predicted environment sequences, predicted time characteristics and electricity usage habits to perform load forecasting. The historical load sequence has become one of the reference dimensions. The emergence of the above sub-process has invisibly enhanced the reference weight of the historical load sequence, excessively strengthened the correlation between the historical load sequence and the load forecasting results, and caused the load forecasting results to be overly affected by the historical load sequence, thereby causing the forecasting results to be inaccurate. In order to solve the above problems, the electricity usage habits of the present application are subjected to causal intervention to solve the problem that the load forecasting results are overly affected by the historical load sequence due to the causal relationship between electricity usage habits and historical load sequences, thereby improving the accuracy of load forecasting and reducing the risk of overfitting.
[0081] It can be seen that this application can integrate data from multiple dimensions and electricity usage habits after causal intervention to improve the accuracy of load forecasting results.
[0082] In some embodiments of the present application, the process of obtaining the load forecasting model in step S1 is described in detail, and the steps are as follows:
[0083] S10. Build an initial prediction model.
[0084] Specifically, an initial prediction model including an embedding model, a fusion module, and a prediction module can be constructed.
[0085] S11. Obtain multiple load prediction samples, each load prediction sample includes a first load training sequence and a second load training sequence corresponding to two consecutive historical periods, as well as an environmental training sequence, training habits and time training characteristics corresponding to the second load training sequence after the historical period.
[0086] Specifically, load training sequences of two consecutive historical cycles may be obtained, and the load training sequence with the earlier historical cycle may be used as the first load training sequence, and the load training sequence with the later historical cycle may be used as the second load training sequence.
[0087] The environmental training sequence, training habits and time training characteristics of the corresponding historical period are marked on the second load training sequence to form a load prediction sample.
[0088] S12. Utilize each load forecast sample to train the initial forecast model, and generate a load training result for each load forecast sample.
[0089] Specifically, each load prediction sample may be input into the initial prediction model in sequence to obtain a load training result corresponding to each load prediction sample.
[0090] S13. Adjust parameters of the initial prediction model based on each load training result and its corresponding second load training sequence until the initial prediction model reaches a training stop condition, and use the final initial prediction model as the load prediction model.
[0091] Specifically, the loss value can be calculated based on each load training result and the corresponding second load training sequence, and the parameters of the initial prediction model can be adjusted based on the loss value until the initial prediction model converges, and the final initial prediction model is used as the load prediction model.
[0092] It can be seen from the above technical solution that this embodiment provides an optional method for obtaining a load forecasting model. Through the above method, the load forecasting model can be obtained by training multiple load forecasting samples, further improving the robustness of the load forecasting model.
[0093] In some embodiments of the present application, step S13, the process of adjusting the parameters of the initial prediction model based on each load training result and its corresponding second load training sequence, is described in detail. The steps are as follows:
[0094] S130. For each load training result, a prediction curve is constructed based on the load training result, and a training curve is constructed based on the second load training sequence corresponding to the load training result; based on the similarity between the prediction curve and the training curve, a loss value corresponding to the load training result is calculated; based on the loss value, parameters of the initial prediction model are adjusted.
[0095] Specifically, a prediction curve corresponding to each load training result and a training curve corresponding to each second load training sequence can be constructed.
[0096] The cosine distance is used to calculate the similarity between the prediction curve and the training curve corresponding to the same second load training sequence, and the similarity is processed to calculate the loss value. The parameters of the initial prediction model are adjusted based on each loss value.
[0097] It can be seen from the above technical solution that this embodiment provides an optional method for adjusting the parameters of the initial prediction model based on each load training result and its corresponding second load training sequence. Through the above method, the loss value calculation can be completed by constructing a curve, further quantifying the parameter adjustment process and improving training efficiency.
[0098] In some embodiments of the present application, the process of step S2, generating electricity usage habits that have no causal relationship with the historical load sequence after causal intervention, is described in detail. The steps are as follows:
[0099] S20. Combine the feature extraction model to extract features from the historical load data, and integrate the extracted features to form a load feature pool.
[0100] Specifically, the goals are:
[0101]
[0102] in, and Denote feature extraction and load recovery, respectively; h represents the load value of the historical load series; and z represents the sample space of electricity usage habits. The noise ϵ is used to prevent feature extraction and load recovery from degenerating into linear models. An encoder-decoder architecture can be used, where the encoder extracts features and the decoder recovers the load profile based on them.
[0103] Specifically, feature extraction may be performed on historical load data containing a large amount of load data, and the historical load data may contain historical load sequences.
[0104] The extracted features can be aggregated to form a load feature pool.
[0105] S21. Approximately process each feature in the load feature pool, remove the causal relationship between each feature and the historical load sequence, and generate the electricity usage habit.
[0106] Specifically, the various features in the load feature pool can be processed through dimensionality reduction algorithms and mathematical approximation methods to compress high-dimensional features and simplify nonlinear features;
[0107] Granger causality test is used to identify the causal relationship between each processed feature and the historical load series, and the difference method is used to remove the causal relationship between each feature and the historical load series, retaining the user's active electricity consumption characteristics;
[0108] The remaining features are processed through clustering algorithm classification, and based on the processing results, electricity usage habits are generated.
[0109] It can be seen from the above technical solution that this embodiment provides an optional method for generating electricity usage habits that have no causal relationship with historical load sequences after causal intervention. The above method can generate electricity usage habits through feature aggregation and approximate processing, which simplifies the processing difficulty.
[0110] In some embodiments of the present application, the process of performing approximate processing on each feature in the load feature pool, removing the causal relationship between each feature and the historical load sequence, and generating the power usage habit in step S21 is described in detail, and the steps are as follows:
[0111] S210 , performing approximate processing on each feature in the load feature pool, removing the causal relationship between each feature and the historical load sequence, and obtaining a power consumption pattern after the removal.
[0112] Specifically, each feature in the load feature pool can be processed through dimensionality reduction algorithm, mathematical approximation method, Granger causality test identification, difference method and clustering algorithm, and the power consumption pattern can be obtained after processing.
[0113] S211 . Evaluate the accuracy of the power usage pattern based on the historical load sequence.
[0114] Specifically, the power consumption pattern can be analyzed based on the historical load sequence to evaluate the accuracy of the power consumption pattern.
[0115] S212: If the accuracy meets the preset accuracy requirement, the power usage pattern is the power usage habit.
[0116] Specifically, when the accuracy meets a preset accuracy requirement, the power usage pattern may be used as the power usage habit.
[0117] When the accuracy does not meet the preset accuracy requirement, the process returns to step S210 .
[0118] It can be seen from the above technical solution that this embodiment provides an optional method for approximating the various features in the load feature pool, removing the causal relationship between each feature and the historical load sequence, and generating the electricity usage habits. Through the above method, the accuracy of electricity usage habits can be evaluated to improve the reliability of load forecasting.
[0119] In some embodiments of the present application, step S211, the process of evaluating the accuracy of the power usage pattern based on the historical load sequence, is described in detail. The steps are as follows:
[0120] S2110 : Generate a load curve matching the power usage pattern based on the power usage pattern using a load recovery model.
[0121] Specifically, the power consumption pattern can be input into the load recovery model, and the load recovery model can be used to restore the load curve under the corresponding period.
[0122] S2111. When the degree of matching between the load curve and the historical load sequence exceeds a preset matching threshold, determine whether the accuracy of the power usage pattern meets a preset accuracy requirement.
[0123] Specifically, a matching degree is calculated for the load curve and the historical load sequence corresponding to the same period. When the matching degree exceeds a matching threshold, it is determined that the accuracy of the power consumption pattern meets a preset accuracy requirement.
[0124] It can be seen from the above technical solution that this embodiment provides an optional method for evaluating the accuracy of the power consumption pattern based on the historical load sequence. Through the above method, this application can further use the historical load sequence as a reference to evaluate the reliability of power consumption habits after causal intervention, thereby ensuring the reliability of load forecasting.
[0125] In some embodiments of the present application, step S3, using the load forecasting model to perform load forecasting based on the power usage habits, the historical load sequence, the predicted environment sequence, and the predicted time characteristics, and generating a load forecast result is described in detail. The steps are as follows:
[0126] S30: Perform embedding transformation on the historical load sequence, the predicted environment sequence, and the predicted time feature to generate an embedding vector.
[0127] Specifically, since the predicted time feature t is qualitative, it can be converted into a computable vector x by the one-hot encoding function t :
[0128]
[0129] The predicted environment sequence w can be converted into a computable vector x t :
[0130]
[0131] Since the historical load series has only one value h at each time point, a fully connected layer can be used for data embedding:
[0132]
[0133] in, represents a fully connected layer. Represents a position encoding function that provides relative sequence information.
[0134] The vector of historical load series, the predicted environment series, and the computable vector of predicted time characteristics can form an embedding vector.
[0135] S31. Utilize a fusion module that combines an attention mechanism and a residual connection to fuse the embedding vector and the power usage habit to generate a fusion feature.
[0136] Specifically, the fusion module can use attention mechanism and residual connection to achieve better feature fusion:
[0137]
[0138] in, represents the multi-head self-attention function; and Represents the vector concatenation and element-wise addition operators. and are two example features that need to be fused. Based on the feature type, the model input can be divided into load-related (H and Z) and load-independent (T and W). In order to better mine feature information and combine them, a Layered routes.
[0139] Specifically, the load-related features and the load-independent features are first merged internally, respectively, and then they are integrated to obtain the final fused features. :
[0140]
[0141] in, 、 、 There are three fusion blocks with different parameters.
[0142] The predicted environment sequence and the computable vector corresponding to the predicted time feature can be input together , and the vector corresponding to the historical load sequence and the electricity consumption habits are input together .
[0143] S32. Using a transformer, perform load forecasting based on the fusion features to generate a load forecast result.
[0144] Specifically, in order to process the time series relationship, Transformer can be used, where the encoder obtains valuable information from it and the decoder reconstructs it into the target load. Therefore, the load forecast result y can be written as:
[0145]
[0146] in, and It is the encoder and decoder of Transformer.
[0147] It can be seen from the above technical solution that this embodiment provides an optional method for generating load forecast results. Through the above method, embedded transformation, feature fusion and converter can be combined to analyze power consumption habits, historical load sequences, predicted environment sequences and predicted time characteristics to complete load forecasting.
[0148] Next, we will combine Figure 4 The load forecasting device provided in this application is introduced in detail. The load forecasting device provided below can be compared with the load forecasting method provided above.
[0149] See also Figure 4 It can be found that the load forecasting device may include:
[0150] An acquisition module 10 is used to obtain a load forecasting model, a historical load sequence, a forecasting environment sequence, and forecasting time characteristics;
[0151] A generating module 20 is used to generate electricity usage habits that have no causal relationship with the historical load sequence after causal intervention;
[0152] The prediction module 30 is configured to utilize the load prediction model to perform load prediction based on the power usage habits, the historical load sequence, the predicted environment sequence, and the predicted time characteristics, and generate a load prediction result.
[0153] Furthermore, the acquisition module 10 may include:
[0154] An initial prediction model building unit, used for building an initial prediction model;
[0155] A load forecast sample acquisition unit is used to acquire multiple load forecast samples, each load forecast sample includes a first load training sequence and a second load training sequence corresponding to two consecutive historical periods, and an environment training sequence, training habits, and time training characteristics corresponding to the second load training sequence with a later historical period;
[0156] A load training result generating unit, configured to train the initial prediction model using each load prediction sample and generate a load training result for each load prediction sample;
[0157] The parameter adjustment unit is used to adjust the parameters of the initial prediction model based on each load training result and its corresponding second load training sequence until the initial prediction model reaches the training stop condition, and the final initial prediction model is used as the load prediction model.
[0158] Furthermore, the parameter adjustment unit may include:
[0159] The loss value calculation subunit is used to construct a prediction curve based on each load training result, and to construct a training curve based on the second load training sequence corresponding to the load training result; based on the similarity between the prediction curve and the training curve, calculate the loss value corresponding to the load training result; and based on the loss value, adjust the parameters of the initial prediction model.
[0160] Furthermore, the generating module 20 may include:
[0161] The load feature pool construction unit is used to extract features from historical load data in combination with the feature extraction model, and integrate the extracted features to form a load feature pool;
[0162] The power usage habit generating unit is configured to perform approximate processing on each feature in the load feature pool, remove the causal relationship between each feature and the historical load sequence, and generate the power usage habit.
[0163] Furthermore, the electricity usage habit generating unit may include:
[0164] A power consumption pattern generating subunit is used to perform approximate processing on each feature in the load feature pool, remove the causal relationship between each feature and the historical load sequence, and obtain the power consumption pattern after the removal;
[0165] a power consumption pattern evaluation subunit, configured to evaluate the accuracy of the power consumption pattern based on the historical load sequence;
[0166] The accuracy comparison subunit is configured to determine that the power usage pattern is the power usage habit if the accuracy meets a preset accuracy requirement.
[0167] Furthermore, the power consumption pattern evaluation subunit may include:
[0168] a load curve generating component, configured to generate a load curve matching the power usage pattern based on the power usage pattern using a load recovery model;
[0169] The accuracy determination component is used to determine whether the accuracy of the power usage pattern meets a preset accuracy requirement when the matching degree between the load curve and the historical load sequence exceeds a preset matching threshold.
[0170] Furthermore, the prediction module 30 may include:
[0171] An embedding vector generating unit, configured to perform embedding transformation on the historical load sequence, the predicted environment sequence, and the predicted time feature to generate an embedding vector;
[0172] a fusion feature generation unit, configured to fuse the embedding vector and the power usage habit using a fusion module combining an attention mechanism and a residual connection to generate a fusion feature;
[0173] The load prediction result generating unit is used to use a transformer to perform load prediction based on the fusion features and generate a load prediction result.
[0174] The load forecasting device provided in the embodiment of the present application can be applied to load forecasting equipment, such as PC terminals, cloud platforms, servers and server clusters. Figure 5 The hardware structure diagram of the load forecasting equipment is shown in Figure 5,The hardware structure of the load forecasting device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0175] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0176] The processor 1 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;
[0177] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory;
[0178] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:
[0179] Obtain load forecasting models, historical load series, forecast environment series and forecast time characteristics;
[0180] Generate electricity consumption habits that have no causal relationship with historical load series after causal intervention;
[0181] The load forecasting model is used to perform load forecasting based on the power usage habits, the historical load sequence, the forecast environment sequence, and the forecast time characteristics to generate a load forecasting result.
[0182] Optionally, the refined functions and extended functions of the program may refer to the above description.
[0183] The present application also provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:
[0184] Obtain load forecasting models, historical load series, forecast environment series and forecast time characteristics;
[0185] Generate electricity consumption habits that have no causal relationship with historical load series after causal intervention;
[0186] The load forecasting model is used to perform load forecasting based on the power usage habits, the historical load sequence, the forecast environment sequence, and the forecast time characteristics to generate a load forecasting result.
[0187] Optionally, the refined functions and extended functions of the program may refer to the above description.
[0188] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0189] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0190] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. The various embodiments of the present application may be combined with each other. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A load forecasting method, characterized in that: include: Obtain load forecasting models, historical load series, forecast environment series and forecast time characteristics; Generate electricity consumption habits that have no causal relationship with historical load series after causal intervention; The load forecasting model is used to perform load forecasting based on the power usage habits, the historical load sequence, the forecast environment sequence, and the forecast time characteristics to generate a load forecasting result.
2. The load forecasting method according to claim 1, characterized in that: Obtain load forecasting models, including: Build an initial prediction model; Acquire multiple load prediction samples, each load prediction sample including a first load training sequence and a second load training sequence corresponding to two consecutive historical periods, and an environment training sequence, training habits, and time training characteristics corresponding to the second load training sequence with a subsequent historical period; Using each load forecast sample to train the initial forecast model, and generating a load training result for each load forecast sample; The parameters of the initial prediction model are adjusted based on each load training result and its corresponding second load training sequence until the initial prediction model reaches a training stop condition, and the final initial prediction model is used as the load prediction model.
3. The load forecasting method according to claim 2, characterized in that: The adjusting parameters of the initial prediction model based on each load training result and its corresponding second load training sequence includes: For each load training result, a prediction curve is constructed based on the load training result, and a training curve is constructed based on the second load training sequence corresponding to the load training result; based on the similarity between the prediction curve and the training curve, the loss value corresponding to the load training result is calculated; based on the loss value, the parameters of the initial prediction model are adjusted.
4. The load forecasting method according to claim 1, characterized in that: The generation of electricity usage habits that have no causal relationship with the historical load sequence after causal intervention includes: Combined with the feature extraction model, feature extraction is performed on historical load data, and the extracted features are integrated to form a load feature pool; Approximate processing is performed on each feature in the load feature pool to remove the causal relationship between each feature and the historical load sequence, thereby generating the electricity usage habit.
5. The load forecasting method according to claim 4, characterized in that: The approximate processing of each feature in the load feature pool, removing the causal relationship between each feature and the historical load sequence, and generating the power usage habit includes: Approximately processing each feature in the load feature pool to remove the causal relationship between each feature and the historical load sequence, and obtain the power consumption pattern after the removal; evaluating the accuracy of the power consumption pattern based on the historical load sequence; If the accuracy meets the preset accuracy requirement, the power usage pattern is the power usage habit.
6. The load forecasting method according to claim 5, characterized in that: The evaluating the accuracy of the power usage pattern based on the historical load sequence includes: generating, using a load recovery model and based on the power usage pattern, a load curve matching the power usage pattern; When the matching degree between the load curve and the historical load sequence exceeds a preset matching threshold, it is determined that the accuracy of the power usage pattern meets a preset accuracy requirement.
7. The load forecasting method according to claim 1, characterized in that: The utilizing the load forecasting model to perform load forecasting based on the power usage habits, the historical load sequence, the forecast environment sequence, and the forecast time characteristics to generate a load forecast result includes: Performing embedding transformation on the historical load sequence, the predicted environment sequence, and the predicted time feature to generate an embedding vector; Using a fusion module that combines an attention mechanism and a residual connection, the embedding vector and the power usage habit are fused to generate a fusion feature; The transformer is used to perform load forecasting based on the fusion features to generate a load forecast result.
8. A load forecasting device, characterized in that: include: An acquisition module is used to obtain load forecasting models, historical load sequences, forecasting environment sequences, and forecasting time characteristics; A generation module is used to generate electricity consumption habits that have no causal relationship with historical load sequences after causal intervention; The prediction module is used to use the load prediction model to perform load prediction based on the power consumption habits, the historical load sequence, the predicted environment sequence and the predicted time characteristics, and generate a load prediction result.
9. A load forecasting device, characterized in that: including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement each step of the load forecasting method according to any one of claims 1 to 7.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the load forecasting method according to any one of claims 1 to 7 is implemented.