Online power load prediction method, system, equipment and medium
The power load prediction model is constructed through a dynamic combination module combined with TCN and LSTM, and the conditional random field model is used to correct it, which solves the problem of model performance degradation in the existing technology, and achieves higher accuracy and stable load prediction.
Patent Information
- Application Number
- CN202411473681.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-11
AI Technical Summary
The existing neural network-based power load prediction method has deteriorated model performance and gradually reduced prediction accuracy, which has failed to effectively solve this problem.
The dynamic combination module is used to combine the timing convolution network (TCN) and the long and short-term memory network (LSTM) to build a power load prediction model. The best combination weight is learned online through the event-driven mechanism, and the conditional random field model is used to capture event-driven prediction. The factors influencing the results were corrected.
It effectively eliminates the problem of model performance degradation caused by concept drift, improves the accuracy and stability of load prediction, and provides better support for power companies to formulate power generation plans and achieve grid supply and demand balance.
Smart Images

Figure CN119419756A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power load forecasting, and in particular to an online power load forecasting method, system, equipment and medium. Background Art
[0002] With the further development of smart grid construction and marketization, not only the requirements for safe and stable operation of power grids are increased, but also the speed and accuracy of short-term power system load forecasting are required to be higher. Continuously improving load forecasting methods and improving forecasting speed and accuracy can not only improve the stability, economy and power supply quality of system operation, but also is the key for power companies to formulate power generation plans and balance power grid supply and demand.
[0003] However, existing neural network-based load forecasting methods generally assume that the entire training data set is available previously and that the relationship between input and output variables remains unchanged during the learning process. These methods are problematic in real-world applications because concepts are often unstable and change over time, which is called concept drift, where future data exhibits different patterns from the past, i.e., the data distribution or data concepts change over time. Such changes may lead to a degradation in model performance because the model is trained based on the old data distribution, and the new data distribution may be different from the old data distribution.
[0004] For example, Chinese patent CN111582943A discloses a power system load forecasting method based on CNN and LSTM. This method converts historical time series data into a load picture according to the periodicity of the power system load, uses a feature extraction model pre-trained based on a CNN network to extract h time series features of each pixel in the load picture, converts the load picture with the extracted time series features into a time series again to obtain a first time series, and then inputs the load forecasting model pre-trained based on an LSTM network to obtain the predicted value of the power system load. This method improves the ability to extract implicit time series features and the computing power on the time axis, overcomes the shortcomings of CNN and LSTM, and is conducive to improving the accuracy and precision of the prediction of power system loads with periodicity and long-term dependence. However, this method does not take into account concept drift, resulting in a decline in model performance and a gradual decrease in prediction accuracy.
[0005] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention
[0006] 1. Technical issues to be resolved
[0007] In view of the deficiencies in the prior art, the present invention provides an online power load forecasting method, system, device and medium, which have the advantage of high load forecasting accuracy, thereby eliminating the problem of model performance degradation due to concept drift in the process of load forecasting for traditional neural networks.
[0008] (II) Technical solution
[0009] In order to achieve the above-mentioned advantage of high load forecasting accuracy, the specific technical solution adopted by the present invention is as follows:
[0010] According to a first aspect of the present invention, there is provided an online power load forecasting method, the online power load forecasting method comprising:
[0011] Obtain historical power load data to build a database and pre-process the historical power load data;
[0012] Constructing a power load forecasting model, taking the preprocessed historical power load data as the input of the power load forecasting model, and forecasting the power load through the power load forecasting model;
[0013] Establish a dynamic combination module to generate combination weights, and assign the combination weights to the output of the power load forecasting model to obtain the power load forecasting results;
[0014] A conditional random field model is established to capture the influencing factors of event-driven power load forecasting results, and the power load forecasting results are corrected based on the influencing factors.
[0015] Preferably, the power load forecasting model includes a power load forecasting model based on a temporal convolutional network and a power load forecasting model based on a long short-term memory network;
[0016] The power load forecasting model based on time series convolutional network is used to capture the temporal correlation in historical power load data;
[0017] The power load forecasting model based on long short-term memory network is used to capture the dependencies between target variables in historical power load data.
[0018] Preferably, the construction of the power load forecasting model based on the time series convolutional network includes:
[0019] Construct a temporal convolution block and add weights after the dilated causal convolution in each layer of temporal volume, and normalize the weights in each layer of convolution;
[0020] The temporal convolutional blocks are stacked to construct a temporal convolutional network, and the output sequence of the temporal convolutional network is used as the input of the attention mechanism layer and the attention weight is calculated;
[0021] The attention weights are normalized and then weighted summed to obtain the attention value, forming a context vector that reflects the input sequence;
[0022] The context vector is processed through several fully connected layers to obtain a power load forecasting model based on a temporal convolutional network.
[0023] Preferably, a dynamic combination module is established to generate combination weights, and the combination weights are assigned to the output of the power load forecasting model, and the power load forecasting results obtained include:
[0024] Design event trigger conditions. If the power load forecasting model meets the event trigger conditions, the dynamic combination module will be automatically triggered;
[0025] In the dynamic combination module, the minimum power load forecast error is calculated based on the predefined decision space, the input data stream of the power load forecast and the power load forecast target;
[0026] The mean square error is used as the loss function, and the gradient of the loss function with respect to the output weight of the power load forecasting model is calculated;
[0027] Calculate the momentum term and mean square gradient term of the output weight based on the gradient of the output weight of the power load forecasting model, and calculate the deviation correction values of the momentum term and the mean square gradient term respectively;
[0028] The modified momentum term and mean square gradient term are used to update the weight of the power load forecasting model, and the updated power load forecasting model is used to perform power load forecasting to obtain a power load forecasting result;
[0029] The power load indicators in the power load forecasting results are monitored in combination with the multi-task learning algorithm, and the status of the power load forecasting model is evaluated based on the changes in the power load indicators.
[0030] Preferably, an event triggering condition is designed. If the power load forecasting model meets the event triggering condition, the dynamic combination module is automatically triggered, including:
[0031] Calculate the difference between the outputs of the power load forecasting model based on the time series convolutional network and the power load forecasting model based on the long short-term memory network, and compare the output difference with the predefined event trigger condition;
[0032] If the output difference is less than the event trigger condition, the average value of the model output is used as the model output result; otherwise, the dynamic combination module is triggered.
[0033] Preferably, monitoring the power load index in the power load forecasting result in combination with a multi-task learning algorithm, and evaluating the power load forecasting model state based on the change of the power load index includes:
[0034] The initial solution of the power load index is randomly selected as the target ideal point, and the ideal constraint of each power load index is solved based on the norm characteristics of the target ideal point;
[0035] A penalty term is constructed based on the ideal constraint and penalty factor of each power load indicator, and the penalty term is used to transform the ideal constraint into a non-ideal constraint;
[0036] The chaotic variable sequence of each power load index is obtained by using the mapping function, and the chaotic variable sequence is enlarged to the value range that meets the target ideal point to obtain the optimized chaotic variable sequence;
[0037] The wide-area search and local search are performed in sequence by optimizing the chaotic variable sequence, and the ideal solution of the power load index is obtained by integrating the wide-area search and local search results.
[0038] The ideal solution of the power load index is configured with the power load forecasting model, and the state of the power load forecasting model is evaluated based on the configuration result.
[0039] Preferably, the wide area search and the local search are sequentially performed using the optimized chaotic variable sequence, and the ideal solution of the power load index is obtained by fusing the wide area search and the local search results, including:
[0040] The ideal solution is iteratively searched using the optimized chaotic variable sequence, the solution obtained each time is compared with the initial solution, and the better solution is selected as the current ideal solution based on the comparison result;
[0041] Determine whether the current ideal solution remains unchanged after several steps of iterative search, and perform secondary carrier on the current ideal solution that remains unchanged;
[0042] The chaotic variables after the secondary carrier are used to perform a secondary iterative search, and the performance index corresponding to the solution generated in the secondary iterative search is calculated; if the performance index is less than the current ideal solution, the iterative search is stopped and the ideal solution of the power load index is output.
[0043] Preferably, configuring the ideal solution of the power load indicator with the power load forecasting model, and evaluating the power load forecasting model state based on the configuration result includes:
[0044] Calculate the evolution entropy of the power load forecasting model, and generate the ordered relationship between the evolution entropy of the power load forecasting model and the ideal solution of the power load index;
[0045] If the evolution entropy of the power load forecasting model is greater than the ideal solution of the power load index, it indicates that the entropy of the power load forecasting model has decreased and the model is in a benign prediction state; if the evolution entropy of the power load forecasting model is less than the ideal solution of the power load index, it indicates that the evolution entropy of the power load forecasting model has decreased and the model is in an unstable prediction state; if the evolution entropy of the power load forecasting model is equal to the ideal solution of the power load index, it indicates that the evolution entropy of the power load forecasting model has not changed and the model is in a stable state.
[0046] Preferably, establishing a conditional random field model to capture the influencing factors of event-driven power load forecasting results, and correcting the power load forecasting results based on the influencing factors includes:
[0047] Extract the unstable prediction state of the power load forecasting model, identify the events that affect the power load forecasting results, and save the environmental data related to the events into the database;
[0048] Design a conditional random field model combined with hidden states to capture the influencing factors that cause unstable prediction states in the power load forecasting model when driven by events;
[0049] Based on the influencing factors, the unstable prediction state of the power load prediction model is corrected, and the power load prediction results are corrected at the same time.
[0050] Preferably, the factors that cause the unstable prediction state of the power load forecasting model when the conditional random field model is designed in combination with the hidden state to capture event-driven include:
[0051] Analyze the event-driven sequence in power load forecasting, initialize the attribute values and event-driven categories related to the event-driven sequence;
[0052] Construct a state transition diagram based on the event-driven sequence, calculate the transition probability between each event, and evaluate the conditional probability of the power load forecasting model state based on the transition probability;
[0053] Based on the conditional probability, attribute value and event-driven category of the power load forecasting model state, an identification code is configured for each event to identify the influencing factors generated when each event is driven.
[0054] Preferably, the expression for attention weight normalization is:
[0055]
[0056] In the formula, a i represents the normalized attention weight; e i represents the attention weight of the i-th dimension; e j represents the j-th dimension attention weight; t represents the time step.
[0057] Preferably, the expression of the context vector is:
[0058]
[0059] Where c represents the context vector; a i represents the normalized attention weight; m i represents the output of temporal convolution; t represents the time step.
[0060] According to a second aspect of the present invention, there is provided an online power load forecasting system, the online power load forecasting system comprising:
[0061] The data acquisition module is used to obtain historical power load data to build a database and pre-process the historical power load data;
[0062] The power load forecasting module is used to construct a power load forecasting model, use the pre-processed historical power load data as the input of the power load forecasting model, and perform power load forecasting through the power load forecasting model;
[0063] A weight allocation module is used to establish a dynamic combination module to generate a combination weight, and allocate the combination weight to the output of the power load forecasting model to obtain a power load forecasting result;
[0064] The prediction result correction module is used to establish a conditional random field model to capture the influencing factors of event-driven power load prediction results, and to correct the power load prediction results based on the influencing factors.
[0065] According to a third aspect of the present invention, a computer device is provided.
[0066] Preferably, the computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0067] According to a fourth aspect of the present invention, a computer readable storage medium is provided.
[0068] Preferably, a computer program is stored on a computer-readable storage medium, and the steps of the above method are implemented when the computer program is executed by a processor.
[0069] (III) Beneficial effects
[0070] Compared with the prior art, the present invention provides an online power load forecasting method, system, device and medium, which have the following beneficial effects:
[0071] The present invention dynamically combines a TCN neural network model that mines the relationship between different variables that affect power load and an LSTM neural network model that captures the long-term dependencies of time series data, triggers an online adjustment model to learn the optimal combination weights based on an event-driven mechanism, and eliminates the defect of model performance degradation caused by concept drift in the process of load forecasting for traditional neural networks, so as to better perform load forecasting, which not only improves the accuracy of load forecasting, but also provides support for power companies to formulate power generation plans and achieve power grid supply and demand balance. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0073] Figure 1 is a flow chart of an online power load forecasting method according to an embodiment of the present invention;
[0074] Figure 2 is a principle block diagram of an online power load forecasting system according to an embodiment of the present invention;
[0075] Figure 3 is a schematic diagram of the structure of a computer device according to an embodiment of the present invention;
[0076] Figure 4 is a flowchart for implementing an improved exponential gradient descent method in an online power load forecasting method according to an embodiment of the present invention;
[0077] Figure 5 This is a flowchart of implementing the LSTM neural network algorithm in the online power load forecasting method according to an embodiment of the present invention;
[0078] Figure 6 It is a flowchart of implementing the TCN-Attention algorithm in the online power load forecasting method according to an embodiment of the present invention.
[0079] In the figure:
[0080] 1. Data acquisition module; 2. Power load forecasting module; 3. Weight allocation module; 4. Forecast result correction module. DETAILED DESCRIPTION
[0081] To further illustrate each embodiment, the present invention provides drawings, which are part of the disclosure of the present invention and are mainly used to illustrate the embodiments. They can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in this field should be able to understand other possible implementation methods and advantages of the present invention.
[0082] According to an embodiment of the present invention, an online power load forecasting method, system, device and medium are provided.
[0083] Figure 1 An embodiment of an online power load forecasting method of the present invention is shown.
[0084] In this optional embodiment, the online power load forecasting method includes:
[0085] S1. Obtain historical power load data to build a database and preprocess the historical power load data.
[0086] It should be noted that the historical power load data, regional meteorological data, whether the historical day is a weekend or a holiday and other information are integrated to build a database containing historical power load data information; the original real data has data loss, temporary equipment maintenance, circuit failure and other emergencies that lead to power load data loss or abnormalities, and the original data is cleaned in turn, and abnormal values and missing values are processed.
[0087] Among them, cleaning refers to using visualization tools (such as heat maps) to identify missing values and fill in missing values through interpolation methods. For example, the mean interpolation method calculates the mean of the column containing missing values, replaces the missing values in the column with the mean, and uses statistical methods (such as the triple standard deviation method) to identify outliers and delete them. If they exceed the range of three times the standard deviation of the mean, they are regarded as outliers.
[0088] S2. Build a power load forecasting model, use the preprocessed historical power load data as input of the power load forecasting model, and perform power load forecasting through the power load forecasting model.
[0089] Among them, the power load forecasting model includes the power load forecasting model based on the time series convolutional network and the power load forecasting model based on the long short-term memory network; the power load forecasting model based on the time series convolutional network is used to capture the time correlation in the historical power load data; the power load forecasting model based on the long short-term memory network is used to capture the dependency between the target variables in the historical power load data.
[0090] Among them, the construction of the power load forecasting model based on the time series convolutional network includes:
[0091] Construct a temporal convolution block and add weights after the dilated causal convolution in each layer of temporal volume, and normalize the weights in each layer of convolution;
[0092] The temporal convolutional blocks are stacked to construct a temporal convolutional network, and the output sequence of the temporal convolutional network is used as the input of the attention mechanism layer and the attention weight is calculated;
[0093] The attention weights are normalized and then weighted summed to obtain the attention value, forming a context vector that reflects the input sequence;
[0094] The context vector is processed through several fully connected layers to obtain a power load forecasting model based on a temporal convolutional network.
[0095] It should be noted that if Figure 6 As shown in the figure, the construction of the power load forecasting model based on the time series convolutional network includes:
[0096] Based on dilated causal convolution and residual connection, a temporal convolution block is constructed, including two layers of dilated causal convolution, two layers of nonlinear mapping and one residual connection.
[0097] The LeakyRelu activation function (a variant of the ReLU activation function) is used for nonlinear mapping. Weight normalization is added after the dilated causal convolution in each temporal convolution layer to normalize the weights. A Dropout layer is added to regularize the network and reduce overfitting.
[0098] The Temporal Convolutional Network (TCN) model is constructed by stacking temporal convolutional blocks. The optimizer uses the Adam function, and the weight initialization uses He initialization instead of the conventional initialization that obeys the normal distribution to ensure that the input and output variance of each layer remains unchanged. In order to reflect that convolution is only performed in the variable dimension, all variables in the current time step (including whether it is a holiday, temperature, precipitation, etc.) are used as input to predict the load output of a time step, and a power load prediction model based on TCN is constructed.
[0099] It should be noted that the role of the attention mechanism is to emphasize and highlight the role of time steps with high weights in the transmission of predicted data information. The output sequence of the TCN layer is used as the input of the attention mechanism layer to calculate the weight of each time step.
[0100] Assume that the output of the TCN layer is m1, m2, ..., m i For each m i (i is between 0 and t), and the attention weight e is calculated using dot product attention i , which can be accomplished through a feed-forward neural network, for example using a linear transformation and an activation function:
[0101] e i =tanh(W y m i +b y )
[0102] In the formula, e i represents the attention weight of the i-th dimension; W y , b y The weights and biases that need to be learned respectively; m i Represents the i-th output of the TCN layer.
[0103] Normalize the attention weights, perform weighted summation to get the attention value, and finally output it through the fully connected layer Dense. Use the softmax function to normalize the attention score to the weight a i :
[0104]
[0105] Use attention weights to i The sequence is weighted summed to obtain the context vector c:
[0106]
[0107] Where c represents the context vector; a i represents the normalized attention weight; m i represents the output of temporal convolution; t represents the time step.
[0108] The context vector c is used as the prediction input and can be further processed through a fully connected layer to obtain the final load prediction value. The prediction effect of the temporal convolutional network (TCN) model is evaluated by the mean absolute error (MAE) and mean square error (MSE) indicators to obtain the prediction results:
[0109]
[0110]
[0111] Where, MAE is the mean absolute error; MSE is the mean square error; y i is the true value, is the predicted value, and n is the number of samples.
[0112] It should be noted that as an evaluation indicator, the mean absolute error is used to measure the average absolute difference between the predicted value and the true value. It can help evaluate the prediction accuracy of the model. The smaller the mean absolute error means that the model's prediction is closer to the true value. MAE is usually used for performance evaluation in regression problems.
[0113] As an evaluation indicator, the mean square error is used to measure the average of the squared differences between the predicted value and the true value. The smaller the mean square error, the closer the model's prediction is to the true value. MSE is usually used for performance evaluation in regression problems.
[0114] It should be noted that this process also includes the following steps: evaluating the accuracy of model prediction based on the actual value and the predicted value to obtain a model prediction evaluation index, judging whether to generate a combined weight based on the model prediction evaluation index and a preset prediction evaluation threshold range, if the model prediction evaluation index is within the preset prediction evaluation threshold range, then a combined weight is generated, otherwise it is fed back to the preset personnel to re-enter the pre-processed historical power load data, and the model prediction evaluation index is used to comprehensively quantify the accuracy of the model prediction.
[0115] The specific process of obtaining the model prediction evaluation index is as follows:
[0116] The true value, predicted value and mean square error are combined with the influencing factors obtained from the preset database to obtain the model prediction evaluation related values, which include the prediction error fluctuation value, the prediction accuracy related value and the prediction trend related value. The influencing factors include the prediction error deviation influencing factor and the prediction relative fluctuation influencing factor.
[0117] The model prediction evaluation index is obtained based on the model prediction evaluation related values and combined with the prediction evaluation weights obtained from the preset database. The prediction evaluation weights include prediction error fluctuation weights, prediction accuracy weights, and prediction consistency trend weights.
[0118] The method to obtain the model prediction evaluation index is as follows:
[0119]
[0120] In the formula, Y represents the model prediction evaluation index, α represents the prediction error fluctuation weight, VOE represents the prediction error fluctuation value, β represents the prediction accuracy weight, and VIE represents the prediction accuracy correlation value. It represents the weight of the predicted consistent trend, VTE represents the predicted trend correlation value, ξ1 represents the prediction error deviation impact factor, and ξ2 represents the prediction relative volatility impact factor.
[0121] It should be noted that the preset prediction evaluation threshold range is set by professionals according to standards in the field. For example, the prediction error fluctuation value range (generally 0.1 to 0.3), the prediction accuracy correlation value range (generally 0.4 to 1) and the prediction trend correlation value range (generally 0.7 to 1) are set to determine the preset prediction evaluation threshold range.
[0122] Among them, the prediction error fluctuation weight is used to describe the influence of the fluctuation of the model prediction error on the model prediction evaluation index. Specifically, the prediction error fluctuation weight is the weight corresponding to the prediction error fluctuation preset in the preset database, which represents the numerical value of the influence of the error fluctuation in the model prediction process on the model prediction evaluation index. When used, the weight corresponding to the preset prediction error fluctuation can be directly obtained from the preset database, and the corresponding relationship can be a pre-set mapping relationship. For example, the error fluctuation in the model prediction process and the weight corresponding to the prediction error fluctuation preset in the preset database form a mapping set, and the real-time prediction error fluctuation is input into the mapping set to obtain the corresponding weight. The mapping relationship can be one-to-one or many-to-one. In this example, the value range is [0, 1].
[0123] The prediction accuracy weight is used to describe the influence of the accuracy of the model prediction error on the model prediction evaluation index. Specifically, the prediction accuracy weight is the weight corresponding to the prediction accuracy preset in the preset database, which represents the numerical value of the influence of the error accuracy in the model prediction process on the model prediction evaluation index. When used, the weight corresponding to the preset prediction accuracy can be directly obtained from the preset database, and the corresponding relationship can be a pre-set mapping relationship. For example, the error accuracy in the model prediction process and the weight corresponding to the prediction accuracy preset in the preset database form a mapping set, and the real-time prediction accuracy is input into the mapping set to obtain the corresponding weight. The mapping relationship can be one-to-one or many-to-one. In this example, the value range is [0, 1].
[0124] In this example, the sum of the prediction error fluctuation weight, the prediction accuracy weight, and the prediction consistency trend weight is 1. The prediction consistency trend weight is used to describe the influence of the consistency of the model prediction error on the model prediction evaluation index.
[0125] The prediction error deviation impact factor is used to describe the degree of influence of the deviation of the prediction error on the prediction accuracy related value. Specifically, the prediction error deviation impact factor is the impact factor corresponding to the prediction error deviation preset in the preset database, which represents the numerical value of the degree of influence of the deviation of the error in the model prediction process on the prediction accuracy related value. When used, the impact factor corresponding to the preset prediction error deviation can be directly obtained from the preset database, and the corresponding relationship can be a pre-set mapping relationship. For example, the deviation of the error in the model prediction process and the impact factor corresponding to the preset prediction error deviation in the preset database form a mapping set, and the real-time prediction error deviation is input into the mapping set to obtain the corresponding impact factor, wherein the mapping relationship can be one-to-one or many-to-one. In this example, the value range is [0, 1]. In this example, the sum of the prediction error deviation impact factor and the prediction relative fluctuation impact factor is 1, and the prediction relative fluctuation impact factor is used to describe the degree of influence of the relative fluctuation of the prediction error on the prediction accuracy related value.
[0126] It should be noted that the prediction error fluctuation value is used to measure the fluctuation of the prediction error. As the prediction error fluctuation value increases, that is, the prediction error stability decreases, the prediction error increases accordingly, and the accuracy of the model prediction decreases. The smaller the prediction error fluctuation value, the smaller the volatility of the model prediction value, and the greater the stability of the model prediction.
[0127] The prediction accuracy correlation value is obtained by calculating the sum of two parts, where the first part is used to measure the error of the model prediction, and is expressed by calculating the product of the difference deviation value and the prediction error deviation influence factor. The difference deviation value is the ratio of the average absolute difference between the predicted value and the true value to the average of the true value; the second part is used to measure the prediction stability of the model, and is expressed by calculating the product of the predicted volatility value and the predicted relative volatility influence factor. The predicted volatility value is the ratio of the predicted value volatility to the true value volatility.
[0128] As the prediction accuracy correlation value decreases, it indicates that the volatility of the model prediction is more closely matched with the true value; the prediction trend correlation value is used to measure the consistency between the predicted value and the true value. As the prediction trend correlation value increases, it indicates that the consistency between the predicted value and the true value is increasing.
[0129] It should be noted that if Figure 5 As shown in the figure, the construction of the power load forecasting model based on long short-term memory network includes:
[0130] LSTM only considers the positive update process and has three gates, namely the input gate, the forget gate, and the output gate. All gates have an sigmoid activation function, f t is the output of the sigmoid function of the forget gate, i t is the output of the sigmoid function of the input gate, ot is the output of the sigmoid function of the output gate, and its expression is:
[0131] f t =σ(W f [H t-1 ,X t ]+b f )
[0132] i t =σ(W i [H t-1 ,X t ]+b i )
[0133] o t =σ(W o [H t-1 ,X t ]+b o )
[0134]
[0135] Finally, LSTM updates the next cell state C t , and use the result of the internal gate and candidate cell state to output H t , the results are as follows:
[0136]
[0137] After the above neural network training, it is finally mapped to the output through a fully connected layer. t Input to a fully connected layer, which contains a weight matrix W and a bias vector b, which is mapped to the output sequence Y. The calculation formula of the output sequence is:
[0138]
[0139] In the formula, f t is the output of the sigmoid function of the forget gate, i t is the output of the sigmoid function of the input gate, o t is the output X of the sigmoid function of the output gate t is the input data at time step t; H t-1 The hidden state at time step t-1 or from the previous time step is The candidate cell state is the input data X t The result of nonlinear transformation using tanh; W and b are parameter matrix and vector respectively; tanh is the activation function, and its output range is from 1 to -1; σ is the activation function; t is the time step.
[0140] S3. Establish a dynamic combination module to generate combination weights, and distribute the combination weights to the output of the power load forecasting model to obtain the power load forecasting result.
[0141] Among them, a dynamic combination module is established to generate combination weights, and the combination weights are assigned to the output of the power load forecasting model. The power load forecasting results obtained include:
[0142] like Figure 4 As shown, the event triggering conditions are designed. If the power load forecasting model meets the event triggering conditions, the online adjustment model OAM (Online adjustment model) module is automatically triggered.
[0143] Among them, the event triggering conditions are designed. If the power load forecasting model meets the event triggering conditions, the dynamic combination module is automatically triggered, including:
[0144] Calculate the difference between the outputs of the power load forecasting model based on the time series convolutional network and the power load forecasting model based on the long short-term memory network, and compare the output difference with the predefined event trigger condition;
[0145] If the output difference is less than the event triggering condition, the average value of the model output is used as the model output result; otherwise, the OAM dynamic combination module is triggered.
[0146] It should be noted that, assuming that the outputs of the TCN-Attention module and the LSTM model are y1 and y2 respectively, and setting a threshold T, when |y1-y2|<T, (y1+y2) / 2 is used as the model output, otherwise, the OAM dynamic combination module is triggered.
[0147] In the dynamic combination module, the minimum power load forecast error is calculated based on the predefined decision space, the input data stream of the power load forecast and the power load forecast target;
[0148] The mean square error is used as the loss function, and the gradient of the loss function with respect to the output weight of the power load forecasting model is calculated;
[0149] Calculate the momentum term and mean square gradient term of the output weight based on the gradient of the output weight of the power load forecasting model, and calculate the deviation correction values of the momentum term and the mean square gradient term respectively;
[0150] The modified momentum term and mean square gradient term are used to update the weights of the power load forecasting model, and the updated power load forecasting model is used to perform power load forecasting to obtain the power load forecasting result.
[0151] It should be noted that the OAM module of the online update model is realized by designing a dynamic combination of TCN-Attention (Temporal Convolutional Network, TCN temporal convolutional network combined with Attention mechanism) and LSTM (Long Short-Term Memory) output weights. The design principle is that the weights of models with good performance are getting bigger and bigger, and the weights of models with poor performance are getting smaller and smaller.
[0152] Assume that the decision space is Δ. Since the present invention uses two models as predictors, Δ is a two-dimensional simplex, i.e., a triangle. Δ={w t |w i,t ≥0and||w t ||1=1}, i∈{1,2};
[0153] Assume that the input data stream of online load forecasting is x, the load forecasting target is y, and the expression of the minimum forecast error is:
[0154]
[0155] In the formula, represents the minimum prediction error; y i represents the output of the i-th model; W i represents the weight of the i-th model; t is the time step.
[0156] Choose mean square error (MSE) as the loss function:
[0157]
[0158] Calculate the loss function L for each model weight W 1,t and W 2,t The gradient is:
[0159]
[0160] Set the parameters of the Adam optimizer, including the momentum decay rate β1, the mean squared gradient decay rate β2, the learning rate η, and a constant ε to prevent division by zero.
[0161] Momentum update, calculate the momentum term m for each weight:
[0162]
[0163] Mean square gradient update, calculate the mean square gradient term v for each weight:
[0164]
[0165] Bias correction, calculate the bias correction values of the momentum term and the mean square gradient term:
[0166]
[0167]
[0168] Weight updates are performed using the modified momentum and mean squared gradient terms:
[0169]
[0170] The updated weights are normalized to ensure that they sum to 1:
[0171]
[0172] In the formula, m w1 、v m1 are the momentum term and mean square gradient term of the TCN model output weight respectively; m w2 、v m2 are the momentum term and mean square gradient term of the LSTM model output weights respectively; β1 is the momentum decay rate; β2 is the mean square gradient decay rate, η is the learning rate; ε is a constant; W 1,t Output weight for the TCN model; W 2,t is the output weight of the LSTM model; t is the time step; L represents the loss function; y 1,t is the output of the TCN model; y 2,t Output of LSTM model; They are the deviation correction values of the momentum term and the mean square gradient term of the TCN model output weight respectively; They are the bias correction values of the momentum term and the mean square gradient term of the LSTM model output weights respectively.
[0173] It should be noted that this process also includes the update judgment of the weights. The specific process is as follows: the degree of conformity between the TCN model and the LSTM model predictions is evaluated to obtain an adjusted conformity evaluation index. Based on the adjusted conformity evaluation index and the preset adjusted conformity threshold range, it is determined whether to update the power load forecasting model weights. If the adjusted conformity evaluation index is within the preset adjusted conformity threshold range, the power load forecasting model weights are updated. Otherwise, no update is performed and the weights are fed back to the preset personnel to recalculate the deviation correction values of the momentum term and the mean square gradient term. The adjusted conformity evaluation index is used to comprehensively quantify the degree of conformity between the TCN model and the LSTM model predictions.
[0174] The specific process of adjusting the compliance assessment index is as follows:
[0175] According to the deviation correction value of the momentum term and the deviation correction value of the mean square gradient term of the output weights of the TCN model and the LSTM model, the correction value change is obtained, and the correction value change includes the momentum term deviation correction value change and the mean square gradient deviation correction value change.
[0176] The adjustment compliance evaluation index is obtained according to the change in the correction value, the TCN model output, the LSTM model output and the model convergence speed, combined with the adjustment evaluation weights obtained from the preset database. The adjustment evaluation weights include momentum deviation weight, mean square deviation weight, output deviation weight and convergence speed deviation weight.
[0177] The method for obtaining the adjusted compliance assessment index is as follows:
[0178]
[0179] In the formula, Q represents the adjustment compliance assessment index, represents the change in the momentum term deviation correction value, It represents the change of the mean square gradient deviation correction value, Δs represents the change of the model convergence speed, δ represents the momentum deviation weight, ε represents the mean square deviation weight, μ represents the output deviation weight, τ represents the convergence speed deviation weight, and e represents a natural constant.
[0180] It should be noted that the preset adjustment compliance threshold range is set by professionals according to standards in the field. For example, the momentum term deviation correction value change range (generally 0 to 0.3), the mean square gradient deviation correction value change range (generally 0 to 0.3) and the model convergence speed change range (generally 0 to 0.2) are set to determine the preset adjustment compliance threshold range.
[0181] Among them, the change in the momentum term deviation correction value represents the absolute value of the difference between the deviation correction value of the momentum term of the TCN model output weight and the deviation correction value of the momentum term of the LSTM model output weight; the change in the mean square gradient deviation correction value represents the absolute value of the difference between the deviation correction value of the mean square gradient term of the TCN model output weight and the deviation correction value of the mean square gradient term of the LSTM model output weight; the change in the model convergence speed represents the absolute value of the difference between the convergence speed of the TCN model and the convergence speed of the LSTM model.
[0182] The momentum deviation weight is used to describe the influence of the deviation degree of the momentum term of the output weight of the TCN model and the LSTM model on the adjustment of the compliance evaluation index. Specifically, the momentum deviation weight is the weight corresponding to the preset momentum deviation in the preset database, which represents the numerical value of the influence degree of the deviation degree of the momentum term of the output weight of the TCN model and the LSTM model on the adjustment of the compliance evaluation index. When used, the weight corresponding to the preset momentum deviation can be directly obtained from the preset database, and the corresponding relationship can be a pre-set mapping relationship. For example, the deviation degree of the momentum term of the output weight of the TCN model and the LSTM model and the weight corresponding to the momentum deviation preset in the preset database form a mapping set, and the deviation degree of the real-time momentum term is input into the mapping set to obtain the corresponding weight. The mapping relationship can be one-to-one or many-to-one. In this example, the value range is [0, 1].
[0183] The mean square deviation weight is used to describe the influence of the deviation degree of the mean square gradient item output by the TCN model and the LSTM model on the adjustment compliance evaluation index. Specifically, the mean square deviation weight is the weight corresponding to the momentum deviation preset in the preset database, which represents the numerical value of the influence degree of the deviation degree of the mean square gradient item output by the TCN model and the LSTM model on the adjustment compliance evaluation index. When used, the weight corresponding to the preset mean square deviation can be directly obtained from the preset database, and the corresponding relationship can be a pre-set mapping relationship. For example, the deviation degree of the mean square gradient item of the output weight of the TCN model and the LSTM model and the weight corresponding to the mean square deviation preset in the preset database form a mapping set, and the deviation degree of the real-time mean square gradient item is input into the mapping set to obtain the corresponding weight. The mapping relationship can be one-to-one or many-to-one. In this example, the value range is [0, 1].
[0184] The output deviation weight is used to describe the influence of the deviation degree of the output of the TCN model and the LSTM model on the adjustment compliance evaluation index. Specifically, the output deviation weight is the weight corresponding to the output deviation preset in the preset database, which represents the numerical value of the influence degree of the deviation degree of the output of the TCN model and the LSTM model on the adjustment compliance evaluation index. When used, the weight corresponding to the preset output deviation can be directly obtained from the preset database, and the corresponding relationship can be a preset mapping relationship. For example, the deviation degree of the output of the TCN model and the LSTM model and the weight corresponding to the preset output deviation in the preset database form a mapping set, and the deviation degree of the real-time TCN model and the LSTM model output is input into the mapping set to obtain the corresponding weight. The mapping relationship can be one-to-one or many-to-one. In this example, the value range is [0, 1].
[0185] In this example, the sum of the momentum bias weight, mean square bias weight, output bias weight, and convergence speed bias weight is 1. The convergence speed bias weight is used to describe the influence of the deviation degree of convergence speed between the TCN model and the LSTM model on the adjustment compliance evaluation index.
[0186] It should be noted that by comparing the difference between the momentum terms of the output weights of the TCN model and the LSTM model, when the difference is 0, it means that the TCN model and the LSTM model have the same degree of similar gradient information accumulated at the same time step, that is, the prediction trends of the TCN model and the LSTM model are consistent, and the degree of consistency between the TCN model and the LSTM model predictions increases.
[0187] Similarly, by comparing the difference between the mean square gradient terms of the output weights of the TCN model and the LSTM model, when the difference is 0, it means that the TCN model and the LSTM model have the same sensitivity in dealing with gradient fluctuations, that is, the response to error changes is the same. As the difference between the two increases, it indicates that the difference in stability in the prediction and the consistency in the error direction between the two decrease, and the consistency between the TCN model and the LSTM model prediction decreases.
[0188] Among them, the difference between the output of the TCN model and the output of the LSTM model is used to measure the degree of difference in the power load forecast results. If the output of the TCN model is the same as the output of the LSTM model, it means that the TCN model and the LSTM model are consistent in the power load forecast results, and the degree of consistency between the TCN model and the LSTM model prediction increases. As the difference between the output of the TCN model and the LSTM model increases, it indicates that the degree of consistency between the TCN model and the LSTM model prediction decreases, and the deviation correction values of the momentum term and the mean square gradient term need to be recalculated. At the same time, the change in the model convergence speed is used to measure the number of iterations required for the TCN model and the LSTM model to reach stability. If the convergence speeds of the two are the same, it means that the TCN model and the LSTM model have the same reaction speed to the gradient change during the optimization process, that is, the degree of consistency between the TCN model and the LSTM model prediction increases.
[0189] The power load indicators in the power load forecasting results are monitored in combination with the multi-task learning algorithm, and the status of the power load forecasting model is evaluated based on the changes in the power load indicators.
[0190] Among them, combining the multi-task learning algorithm to monitor the power load indicators in the power load forecast results, and evaluating the power load forecast model status based on the changes in the power load indicators include:
[0191] The initial solution of the power load index is randomly selected as the target ideal point, and the ideal constraint of each power load index is solved based on the norm characteristics of the target ideal point.
[0192] It should be noted that randomly selecting the initial solution of the power load index as the target ideal point and solving the ideal constraint of each power load index based on the norm characteristics of the target ideal point includes: randomly selecting a set of power load indicators (such as peak load, valley load, etc.) from historical data or determining them based on a certain heuristic method as the target ideal point of the optimization problem. This point represents the target state that the model hopes to achieve or be as close as possible;
[0193] To form constraints, the distance or difference between each power load indicator and the target ideal point is calculated, usually quantified using the Euclidean norm (i.e., the square root of the squared difference).
[0194] Among them, the distance or difference between each power load indicator and the target ideal point is quantified by the Euclidean norm (i.e., the square root of the square difference) to obtain the difference quantification value. As the difference quantification value decreases, it indicates that the difference between the power load indicator and the target ideal point decreases, that is, the degree of conformity between the optimization effect of the model and the target state increases.
[0195] A penalty term is constructed based on the ideal constraint and penalty factor of each power load indicator, and the penalty term is used to transform the ideal constraint into a non-ideal constraint.
[0196] It should be noted that the ideal constraint of each power load indicator is expressed through a penalty term. The size of the penalty factor is usually proportional to the degree of constraint violation, which means that the farther away from the ideal point, the greater the penalty; through the introduction of the penalty term, the original optimization problem with ideal constraints is transformed into a form without ideal constraints. In this new form, the original constraints are embedded in the objective function as the penalty part, so that the optimization algorithm is not directly restricted by hard constraints, but indirectly satisfies these constraints through the optimization of the objective function.
[0197] The chaotic variable sequence of each power load indicator is obtained by using the mapping function, and the chaotic variable sequence is enlarged to a value range that meets the target ideal point to obtain the optimized chaotic variable sequence.
[0198] It should be noted that the chaotic variable sequence of each power load indicator is obtained by using the mapping function, and the chaotic variable sequence is enlarged to a value range that meets the target ideal point, and the optimized chaotic variable sequence includes:
[0199] Selecting a mapping function: Selecting a mapping function, such as the Logistic mapping, which is widely used because of its ability to produce sequences with chaotic properties.
[0200] Applying mapping function: Applying mapping function to each power load indicator to generate an initial chaotic variable sequence.
[0201] Evaluation and adjustment: Analyze the comparison between the generated chaotic variable sequence and the value range of the target ideal point to determine the necessary enlargement or reduction ratio.
[0202] Adjust the sequence range: Use linear or nonlinear amplification technology to adjust the numerical range of the chaotic variable sequence to match the value range of the target ideal point.
[0203] Wide-area search and local search are performed in sequence using optimized chaotic variable sequences, and the ideal solution for power load indicators is obtained by integrating the results of wide-area search and local search.
[0204] Among them, the wide-area search and local search are performed in sequence by optimizing the chaotic variable sequence, and the ideal solution of the power load index is obtained by integrating the wide-area search and local search results, including:
[0205] The ideal solution is iteratively searched using the optimized chaotic variable sequence, the solution obtained each time is compared with the initial solution, and the better solution is selected as the current ideal solution based on the comparison result;
[0206] Determine whether the current ideal solution remains unchanged after several steps of iterative search, and perform secondary carrier on the current ideal solution that remains unchanged;
[0207] The chaotic variables after the secondary carrier are used to perform a secondary iterative search, and the performance index corresponding to the solution generated in the secondary iterative search is calculated; if the performance index is less than the current ideal solution, the iterative search is stopped and the ideal solution of the power load index is output.
[0208] The ideal solution of the power load index is configured with the power load forecasting model, and the state of the power load forecasting model is evaluated based on the configuration result.
[0209] It should be noted that the optimized chaotic variable sequence is used: the iterative search process is started based on the previously adjusted chaotic variable sequence.
[0210] Wide-area search: Searching for possible ideal solutions in a larger search space helps explore multiple possible states and ensures that no potential optimal solutions are missed.
[0211] Local Search: Perform a more detailed search near potential solutions found by the wide-area search to fine-tune and optimize the solution.
[0212] Comparison of solutions: Compare the solution obtained from each iterative search with the current ideal solution, and select the solution with better performance as the new ideal solution.
[0213] Stability judgment: If the current ideal solution remains unchanged after several iterations, the depth of the secondary carrier enhancement search is performed.
[0214] Secondary carrier: Further enhance the current ideal solution to expand the search effect.
[0215] Secondary Search: Perform an iterative search again using the enhanced chaotic variables and evaluate the performance of these solutions.
[0216] Stop condition: If the new performance index is better than the performance index of the current ideal solution, update the ideal solution; otherwise stop the search.
[0217] It should be noted that, through the combination of wide-area search and local search, a wider solution space can be explored while ensuring the accuracy of the solution, thereby increasing the possibility of finding the global optimal solution; the use of chaotic variables increases the model's adaptability to the nonlinear and dynamic changes of power load data, enabling the model to better reflect the complexity of the actual power system; through continuous iterative search and secondary carrier, the model is gradually optimized in the process of pursuing the optimal solution, ultimately achieving efficient prediction performance.
[0218] Among them, configuring the ideal solution of the power load index with the power load forecasting model, and evaluating the power load forecasting model status based on the configuration result include:
[0219] Calculate the evolution entropy of the power load forecasting model, and generate the ordered relationship between the evolution entropy of the power load forecasting model and the ideal solution of the power load index;
[0220] If the evolution entropy of the power load forecasting model is greater than the ideal solution of the power load index, it indicates that the entropy of the power load forecasting model has decreased and the model is in a benign prediction state; if the evolution entropy of the power load forecasting model is less than the ideal solution of the power load index, it indicates that the evolution entropy of the power load forecasting model has decreased and the model is in an unstable prediction state; if the evolution entropy of the power load forecasting model is equal to the ideal solution of the power load index, it indicates that the evolution entropy of the power load forecasting model has not changed and the model is in a stable state.
[0221] S4. Establish a conditional random field model to capture the influencing factors of event-driven power load forecasting results, and modify the power load forecasting results based on the influencing factors.
[0222] Among them, the conditional random field model is established to capture the influencing factors of event-driven power load forecasting results, and the power load forecasting results are corrected based on the influencing factors, including:
[0223] Extract the unstable prediction state of the power load forecasting model, identify the events that affect the power load forecasting results, and save the environmental data related to the events into the database;
[0224] The conditional random field model is designed in combination with hidden states to capture the influencing factors that cause unstable prediction states in the power load forecasting model when driven by events.
[0225] Among them, the factors that cause the unstable prediction state of the power load forecasting model when designing a conditional random field model combined with hidden state capture event-driven include:
[0226] Analyze the event-driven sequence in power load forecasting, initialize the attribute values and event-driven categories related to the event-driven sequence;
[0227] Construct a state transition diagram based on the event-driven sequence, calculate the transition probability between each event, and evaluate the conditional probability of the power load forecasting model state based on the transition probability;
[0228] Based on the conditional probability, attribute value and event-driven category of the power load forecasting model state, an identification code is configured for each event to identify the influencing factors generated when each event is driven.
[0229] Based on the influencing factors, the unstable prediction state of the power load prediction model is corrected, and the power load prediction results are corrected at the same time.
[0230] It should be noted that the factors that lead to unstable prediction state of power load forecasting model when designing conditional random field model combined with hidden state to capture event-driven include:
[0231] Data collection: Collect event-driven data related to power load, such as weather changes, holidays, and emergencies, and initialize relevant attribute values for these events, such as temperature, humidity, time, etc.
[0232] State definition: Define event-driven categories, such as normal, peak, trough, etc., and label each event.
[0233] State transition diagram: Construct a state transition diagram based on the event-driven sequence to represent the relationship and transition between different events.
[0234] Transition probability calculation: Calculate the state transition probability, that is, the probability of one event transforming to another event.
[0235] Conditional probability calculation: Calculate the conditional probability of the power load forecasting model state based on the transition probability and the observed event attributes.
[0236] Configure identification codes: Configure specific identification codes for each event to identify and handle specific event drivers.
[0237] Impact Factor Analysis: Identify the specific impact of each event on the state of the power load forecasting model, including instability factors.
[0238] Result correction: After the adjustment is implemented, the power load forecast results are updated and corrected to ensure accuracy and stability.
[0239] It should be noted that by analyzing and responding to event drivers, the model can adapt to environmental changes and emergencies more flexibly, and improve the accuracy and reliability of predictions; by accurately calculating conditional probabilities and promptly correcting affected predictions, the volatility of prediction results can be reduced and the model’s robustness to external changes can be enhanced; accurate event identification and adjustment of prediction states provide more effective decision-making support for power system operations, especially in demand response and load management; the conditional random field model can not only capture and analyze event drivers in power load forecasting, but also adjust prediction strategies in real time, effectively respond to unstable prediction states, and improve overall system performance and responsiveness.
[0240] Figure 2 An embodiment of an online power load forecasting system of the present invention is shown.
[0241] In this optional embodiment, the online power load forecasting system includes:
[0242] Data acquisition module 1, used to acquire historical power load data to build a database and pre-process the historical power load data;
[0243] The power load forecasting module 2 is used to construct a power load forecasting model, use the pre-processed historical power load data as the input of the power load forecasting model, and perform power load forecasting through the power load forecasting model;
[0244] The weight distribution module 3 is used to establish a dynamic combination module to generate a combination weight, and distribute the combination weight to the output of the power load forecasting model to obtain a power load forecasting result;
[0245] The prediction result correction module 4 is used to establish a conditional random field model to capture the influencing factors of event-driven power load prediction results, and to correct the power load prediction results based on the influencing factors.
[0246] Figure 3 An embodiment of a computer device of the present invention is shown. The computer device may be a server, and the computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store static information and dynamic information data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the steps in the above method embodiment are implemented.
[0247] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0248] In addition, the present invention also provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiment when executing the computer program.
[0249] In addition, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiment are implemented.
[0250] It should be noted that the current power load forecasting methods based on neural networks mainly include the following:
[0251] Feedforward Neural Networks (FFNN): This is one of the earliest neural network models used in load forecasting. FFNN learns and predicts future load values by inputting historical load data and other relevant factors. However, FFNN has some problems when processing time series data, such as being unable to effectively capture the long-term dependencies of time series data.
[0252] Recurrent Neural Networks (RNN): RNN can better process time series data by introducing a loop structure. RNN can capture long-term dependencies in time series data, so it has better performance in load forecasting. However, traditional RNN may have problems with gradient vanishing or gradient exploding when processing long sequences.
[0253] Long Short-Term Memory (LSTM): LSTM is a variant of RNN. By introducing gating mechanisms and memory units, it can effectively solve the problem of RNN in processing long sequences. LSTM can capture long-term dependencies in time series data and has achieved good results in load forecasting.
[0254] Convolutional Neural Networks (CNN): Although CNN was originally designed for image processing, it has also been applied to load forecasting in recent years. CNN can extract local features of input data through convolution operations, then reduce the dimension of the data through pooling operations, and finally make predictions through fully connected layers. CNN has good performance when processing data with local correlation.
[0255] Hybrid neural network model: In addition to the single neural network model mentioned above, different neural network models can also be combined to form a hybrid neural network model. For example, LSTM and CNN can be combined to use LSTM to capture the long-term dependencies of time series data and CNN to extract local features of input data, thereby improving the accuracy of load forecasting.
[0256] The above-mentioned load forecasting methods based on neural networks all have the problem of concept drift, which refers to the phenomenon that data distribution or data concepts change over time in the field of machine learning and data mining. This change may cause the performance of the model to deteriorate because the model is trained based on the old data distribution, and the new data distribution may be different from the old data distribution. To solve this problem, the present invention is based on actual historical power load data, and pre-processes the historical power load data by removing abnormal data, repairing missing data, etc., to obtain effective training samples; the present invention considers that for specific variables, information from related sequences in other multivariables may lead to overfitting but can improve the prediction results and variable independence can improve the robustness of the model under concept drift. Load forecasting methods based on TCN-Attention neural network model and LSTM neural network model are designed respectively (these two models are not unique, one focuses on time correlation modeling, and the other focuses on cross-variable dependency modeling). The two methods use the same set of data as the data source, TCN-Attention is used as a cross-variable predictor, and all variables in the current time step are used as input to predict the load output of one time step; LSTM is used as a cross-time predictor, which only considers the change of load over time and only cares about the time dimension, ignoring the relationship between other variables; Exponential Gradient Descent (EGD) is an optimization algorithm, which is particularly effective in dealing with uncertainty in online learning.
[0257] EGD is mainly used for online learning problems, in which the agent needs to gradually optimize its performance while continuously receiving and processing data. The present invention designs an OAM module based on event triggering. When the algorithm deviation of the two models is less than a certain characteristic threshold, the average of the output values of the two models is used as the output of the model, otherwise, the model update of the OAM module is automatically triggered; an improved exponential gradient descent method (PEGD) based on event triggering is designed to dynamically generate combined weights, which are assigned to the output of the TCN-Attention neural network and the output of the LSTM neural network model to obtain load forecasting results, showing faster convergence speed, stronger adaptability and robustness. Finally, through the load forecasting results, it is found that this method improves the prediction accuracy and effectively eliminates the influence of concept offset. It is a practical and effective load forecasting method for power systems, which provides support for power companies to formulate power generation plans and achieve power grid supply and demand balance.
[0258] To sum up, with the help of the above-mentioned technical scheme of the present invention, the present invention dynamically combines the TCN neural network model that mines the relationship between different variables affecting the power load and the LSTM neural network model that captures the long-term dependencies of time series data, and triggers the online adjustment model to learn the optimal combination weights based on the event-driven mechanism, thereby eliminating the defect of model performance degradation caused by concept drift in the process of load forecasting for traditional neural networks, so as to better perform load forecasting, which not only improves the accuracy of load forecasting, but also provides support for power companies to formulate power generation plans and achieve power grid supply and demand balance.
[0259] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An online power load forecasting method, characterized in that: The online power load forecasting method includes: Obtain historical power load data to build a database and pre-process the historical power load data; Constructing a power load forecasting model, taking the preprocessed historical power load data as the input of the power load forecasting model, and forecasting the power load through the power load forecasting model; Establish a dynamic combination module to generate combination weights, and assign the combination weights to the output of the power load forecasting model to obtain the power load forecasting results; A conditional random field model is established to capture the influencing factors of event-driven power load forecasting results, and the power load forecasting results are corrected based on the influencing factors.
2. The online power load forecasting method according to claim 1, characterized in that: The power load forecasting model includes a power load forecasting model based on a temporal convolutional network and a power load forecasting model based on a long short-term memory network; The power load forecasting model based on the time series convolutional network is used to capture the time correlation in the historical power load data; The long short-term memory network power load forecasting model is used to capture the dependencies between target variables in historical power load data.
3. The online power load forecasting method according to claim 2, characterized in that: The construction of the power load prediction model based on the time series convolutional network includes: Construct a temporal convolution block and add weights after the dilated causal convolution in each layer of temporal volume, and normalize the weights in each layer of convolution; The temporal convolutional blocks are stacked to construct a temporal convolutional network, and the output sequence of the temporal convolutional network is used as the input of the attention mechanism layer and the attention weight is calculated; The attention weights are normalized and then weighted summed to obtain the attention value, forming a context vector that reflects the input sequence; The context vector is processed through several fully connected layers to obtain a power load forecasting model based on a temporal convolutional network.
4. The online power load forecasting method according to claim 3 is characterized in that: The dynamic combination module is established to generate the combination weight, and the combination weight is allocated to the output of the power load forecasting model to obtain the power load forecasting result, including: Design event trigger conditions. If the power load forecasting model meets the event trigger conditions, the dynamic combination module will be automatically triggered; In the dynamic combination module, the minimum power load forecast error is calculated based on the predefined decision space, the input data stream of the power load forecast and the power load forecast target; The mean square error is used as the loss function, and the gradient of the loss function with respect to the output weight of the power load forecasting model is calculated; Calculate the momentum term and mean square gradient term of the output weight based on the gradient of the output weight of the power load forecasting model, and calculate the deviation correction values of the momentum term and the mean square gradient term respectively; The modified momentum term and mean square gradient term are used to update the weight of the power load forecasting model, and the updated power load forecasting model is used to perform power load forecasting to obtain a power load forecasting result; The power load indicators in the power load forecasting results are monitored in combination with the multi-task learning algorithm, and the status of the power load forecasting model is evaluated based on the changes in the power load indicators.
5. The online power load forecasting method according to claim 4, characterized in that: The design event triggering condition, if the power load forecasting model meets the event triggering condition, automatically triggering the dynamic combination module includes: Calculate the difference between the outputs of the power load forecasting model based on the time series convolutional network and the power load forecasting model based on the long short-term memory network, and compare the output difference with the predefined event trigger condition; If the output difference is less than the event trigger condition, the average value of the model output is used as the model output result; otherwise, the dynamic combination module is triggered.
6. An online power load forecasting method according to claim 5, characterized in that: The monitoring of the power load index in the power load forecasting result by combining the multi-task learning algorithm and evaluating the power load forecasting model state based on the change of the power load index includes: The initial solution of the power load index is randomly selected as the target ideal point, and the ideal constraint of each power load index is solved based on the norm characteristics of the target ideal point; A penalty term is constructed based on the ideal constraint and penalty factor of each power load indicator, and the penalty term is used to transform the ideal constraint into a non-ideal constraint; The chaotic variable sequence of each power load index is obtained by using the mapping function, and the chaotic variable sequence is enlarged to the value range that meets the target ideal point to obtain the optimized chaotic variable sequence; The wide-area search and local search are performed in sequence by optimizing the chaotic variable sequence, and the ideal solution of the power load index is obtained by integrating the wide-area search and local search results. The ideal solution of the power load index is configured with the power load forecasting model, and the state of the power load forecasting model is evaluated based on the configuration result.
7. An online power load forecasting method according to claim 6, characterized in that: The method of using the optimized chaotic variable sequence to sequentially perform wide-area search and local search, and fusing the wide-area search and local search results to obtain an ideal solution for the power load index includes: The ideal solution is iteratively searched using the optimized chaotic variable sequence, the solution obtained each time is compared with the initial solution, and the better solution is selected as the current ideal solution based on the comparison result; Determine whether the current ideal solution remains unchanged after several steps of iterative search, and perform secondary carrier on the current ideal solution that remains unchanged; The chaotic variables after the secondary carrier are used to perform a secondary iterative search, and the performance index corresponding to the solution generated in the secondary iterative search is calculated; if the performance index is less than the current ideal solution, the iterative search is stopped and the ideal solution of the power load index is output.
8. An online power load forecasting method according to claim 7, characterized in that: The configuring the ideal solution of the power load indicator with the power load forecasting model and evaluating the power load forecasting model state based on the configuration result includes: Calculate the evolution entropy of the power load forecasting model, and generate the ordered relationship between the evolution entropy of the power load forecasting model and the ideal solution of the power load index; If the evolution entropy of the power load forecasting model is greater than the ideal solution of the power load index, it indicates that the entropy of the power load forecasting model has decreased and the model is in a benign prediction state; if the evolution entropy of the power load forecasting model is less than the ideal solution of the power load index, it indicates that the evolution entropy of the power load forecasting model has decreased and the model is in an unstable prediction state; if the evolution entropy of the power load forecasting model is equal to the ideal solution of the power load index, it indicates that the evolution entropy of the power load forecasting model has not changed and the model is in a stable state.
9. An online power load forecasting method according to claim 8, characterized in that: The establishment of the conditional random field model to capture the influencing factors of event-driven power load forecasting results, and the correction of the power load forecasting results based on the influencing factors includes: Extract the unstable prediction state of the power load forecasting model, identify the events that affect the power load forecasting results, and save the environmental data related to the events into the database; Design a conditional random field model combined with hidden states to capture the influencing factors that cause unstable prediction states in the power load forecasting model when driven by events; Based on the influencing factors, the unstable prediction state of the power load prediction model is corrected, and the power load prediction results are corrected at the same time.
10. An online power load forecasting method according to claim 9, characterized in that: The factors that cause the unstable prediction state of the power load forecasting model when the conditional random field model is designed and combined with the hidden state to capture event-driven include: Analyze the event-driven sequence in power load forecasting, initialize the attribute values and event-driven categories related to the event-driven sequence; Construct a state transition diagram based on the event-driven sequence, calculate the transition probability between each event, and evaluate the conditional probability of the power load forecasting model state based on the transition probability; Based on the conditional probability, attribute value and event-driven category of the power load forecasting model state, an identification code is configured for each event to identify the influencing factors generated when each event is driven.
11. An online power load forecasting method according to claim 10, characterized in that: The expression of the attention weight normalization process is: Where a i represents the normalized attention weight; e i represents the attention weight of the i-th dimension; e j represents the j-th dimension attention weight; t represents the time step.
12. An online power load forecasting method according to claim 11, characterized in that: The expression of the context vector is: Where c represents the context vector; a i represents the normalized attention weight; m i represents the output of temporal convolution; t represents the time step.
13. An online power load forecasting system, used to implement the online power load forecasting method according to any one of claims 1 to 12, characterized in that: The online power load forecasting system includes: The data acquisition module is used to obtain historical power load data to build a database and pre-process the historical power load data; The power load forecasting module is used to construct a power load forecasting model, use the pre-processed historical power load data as the input of the power load forecasting model, and perform power load forecasting through the power load forecasting model; A weight allocation module is used to establish a dynamic combination module to generate a combination weight, and allocate the combination weight to the output of the power load forecasting model to obtain a power load forecasting result; The prediction result correction module is used to establish a conditional random field model to capture the influencing factors of event-driven power load prediction results, and to correct the power load prediction results based on the influencing factors.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Power system load prediction method based on CNN and LSTM
CN111582943A
Cited By
Self-adaptive building load prediction method based on load drift perception
CN120410267A
Electrical load prediction system and method for oil-gas exploration and development equipment
CN120497930A
Oil and gas exploration and development equipment power load prediction system and method
CN120497930B