A load forecasting method, system, medium and device

By combining reinforcement learning and deep learning in load prediction, dynamically optimized models analyze load change trends and adjust baseline model weights, the problem of insufficient load prediction accuracy and robustness in the existing technology is solved, and more efficient load forecast.

CN119047652BActive Publication Date: 2025-02-18CHINA ACADEMY OF BUILDING RES TIANJIN INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411523293.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-18
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

When faced with complex and variable data space, existing load prediction methods are difficult to accurately capture the time series characteristics and spatial correlations in load data, resulting in insufficient prediction accuracy and robustness.

Method used

The integrated prediction model of reinforcement learning and deep learning is adopted to analyze the load change trend through reinforcement learning dynamic optimization model, adjust the weight of the baseline model in real time, and improve the accuracy and robustness of load prediction.

Benefits of technology

Through real-time weight adjustment of dynamic optimization model, the time series characteristics and spatial correlation of load data can be better captured, significantly improving the accuracy and robustness of load prediction, and reducing the risk of overfitting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119047652B_ABST
    Figure CN119047652B_ABST
Patent Text Reader

Abstract

The present invention proposes a load forecasting method, system, medium and equipment, which relate to the field of energy use forecasting of time series analysis. The specific scheme includes: obtaining load-related data of the target area at the time to be predicted; inputting the load-related data into the pre-trained integrated forecasting model, performing load forecasting of each baseline model, linearly weighting the forecast results of each baseline model by dynamically optimizing the real-time weights output by the model, and finally obtaining the load forecast value of the target area; the present invention combines the prediction ideas of reinforcement learning and deep learning integrated forecasting models, analyzes the load change trend through reinforcement learning, and obtains the real-time weights of each baseline model of the integrated forecasting model, thereby fully mining the time series characteristics and spatial correlation in the load data, and finally improving the accuracy and robustness of load forecasting in the heating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of energy usage prediction based on time series analysis, and in particular relates to a load prediction method, system, medium and equipment. Background Art

[0002] With the development of renewable energy systems, the function of buildings has gradually transitioned from a single energy consumption unit to a multifunctional provider of energy supply and consumption. However, the uncertainty of production capacity and demand has brought huge challenges to the operation and maintenance of the system. In order to ensure the timely and accurate supply of building heat and meet the urgent development needs of energy conservation and carbon reduction in the era, the operation of energy supply systems such as heating and electricity has gradually developed rapidly from traditional manual maintenance to digitalization and modernization.

[0003] In the heating system, the currently widely used day-ahead method allows the supplier to dispatch energy to the demand side in advance based on the load before the working day. During this period, accurate load data can ensure the stability and timeliness of the system supply and thus achieve long-term operation of the system. Therefore, load forecasting technology in the energy dispatching system has become a key issue to be solved in the energy field; by exploring the historical load change patterns, it is beneficial to balance the supply and demand relationship of the system and improve energy utilization efficiency; in addition, accurate predictions can also help related companies implement effective energy-saving and emission reduction measures, which is crucial to achieving long-term carbon reduction and emission reduction goals.

[0004] Traditional short-term forecasting methods summarize and calculate data by using principles such as linear regression and time series analysis. However, load changes are affected by internal and external disturbances in a nonlinear relationship, resulting in large forecasting errors and inability to accurately calculate. By combining advanced machine learning technology to improve the ability to approximate complex functions, the problem of forecasting accuracy deviation can be solved to a certain extent.

[0005] However, complex models such as deep learning and reinforcement learning also have problems such as overfitting and slow convergence. Based on these problems, integrated prediction technology has been proposed to improve the accuracy, stability and reliability of prediction results. This method integrates models by maximizing information utilization, improves the sensitivity of single prediction models to data fluctuations, and improves prediction robustness. It has a strong reference significance and has achieved remarkable results in improving the problems of traditional prediction methods. However, the current method of setting weights under its overall framework is usually pre-set by manual setting, performance-based setting, etc. based on cross-validation or empirical judgment. In the face of complex and diverse data spaces in specific engineering practices, this method cannot well judge the characteristic fluctuations caused by changes in time series data, and there is still room for improvement. Summary of the invention

[0006] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a load forecasting method, system, medium and equipment, which combines the prediction ideas of reinforcement learning and deep learning integrated prediction model, analyzes the load change trend through reinforcement learning, and obtains the real-time weights of each baseline model of the integrated prediction model, thereby fully mining the time series characteristics and spatial correlations in the load data, and ultimately improving the accuracy and robustness of load prediction in the heating system.

[0007] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:

[0008] A first aspect of the present invention provides a load forecasting method.

[0009] A load forecasting method, comprising:

[0010] Obtaining load-related data of the target area at the time to be predicted;

[0011] The load-related data is input into the pre-trained integrated prediction model to perform load prediction for each baseline model. The prediction results of each baseline model are linearly weighted by the real-time weights output by the dynamic optimization model, and finally the load prediction value of the target area is obtained.

[0012] The dynamic optimization model adopts reinforcement learning technology. In the process of interaction with the environment, it obtains learning information and updates the environment state by receiving the environment's reward for the action, and adaptively adjusts the real-time weight;

[0013] The integrated prediction model adopts the LSTM-SVM-MLP integrated prediction model, and selects LSTM, SVM, and MLP as baseline models;

[0014] Each baseline model takes the load-related data at the time to be predicted as input and the load prediction value as output.

[0015] Furthermore, the pre-training of the integrated prediction model is to train the integrated prediction model based on historical load data in a period of time before the prediction time;

[0016] The historical load data is composed of the real load values ​​at several consecutive moments and the corresponding load-related data;

[0017] The load-related data include holidays, working days, temperature, humidity, wind speed, and season.

[0018] Furthermore, the integrated prediction model is trained in the following specific steps:

[0019] Preprocess the historical load data, including missing value filling and normalization;

[0020] The preprocessed historical load data is divided into a multi-dimensional feature set and a target set by using a sliding window method to construct a training data set;

[0021] The initial weight of each baseline model is set to 1, and the Bayesian optimization algorithm and training dataset are used to find the optimal hyperparameters of each baseline model.

[0022] Furthermore, the dynamic optimization model adopts a reinforcement learning actor-critic algorithm, where the actor selects an action based on probability, the critic judges the state value of the action selected by the actor, and the actor modifies the probability of selecting an action according to the state value of the critic.

[0023] The action is the model weight to be optimized.

[0024] Furthermore, the reinforcement learning Actor-Critic algorithm has the following specific steps:

[0025] Initialization, establishing action space set, state space set, reward function, and state transition probability;

[0026] Using the pre-trained integrated prediction model, the load prediction value and loss value at each moment in the training data set are obtained;

[0027] The load prediction value, loss value and actual load value at each moment in the training data set are combined into observation values, input into the Actor actor, and based on the state transition probability, the action is selected to obtain the model weight at the next moment;

[0028] Input the observation value into the Critic of reinforcement learning, calculate the reward of the selected action based on the reward function, and then update the value of the current state;

[0029] Based on the value in the current state, the temporal difference error value is calculated, and the model weight is adjusted based on the temporal difference error value.

[0030] Furthermore, the reward function is established by using the TOPSIS comprehensive analysis method to normalize the evaluation indicators into a single reward function.

[0031] A second aspect of the present invention provides a load forecasting system.

[0032] A load forecasting system includes a data acquisition module and a load forecasting module:

[0033] The data acquisition module is configured to: acquire load-related data of the target area at the time to be predicted;

[0034] The load forecasting module is configured to: input load-related data into the pre-trained integrated forecasting model, perform load forecasting of each baseline model, linearly weight the forecast results of each baseline model through the real-time weight output by the dynamic optimization model, and finally obtain the load forecast value of the target area;

[0035] The dynamic optimization model adopts reinforcement learning technology. In the process of interaction with the environment, it obtains learning information and updates the environmental state by receiving the rewards of the environment for actions, and adaptively adjusts the real-time weights.

[0036] A third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of a load forecasting method as described in the first aspect of the present invention.

[0037] The fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in a load forecasting method as described in the first aspect of the present invention are implemented.

[0038] One or more of the above technical solutions have the following beneficial effects:

[0039] The present invention provides a load forecasting method, system, medium and equipment, which combine the prediction ideas of reinforcement learning and deep learning integrated prediction models, analyze the load change trend through reinforcement learning, and obtain the real-time weights of each baseline model of the integrated prediction model, so as to fully explore the time series characteristics and spatial correlation in the load data, and ultimately improve the load prediction accuracy and robustness.

[0040] The present invention introduces advanced technologies such as reinforcement learning and Bayesian optimization to effectively capture the influence of time series characteristics and spatial correlation in load fluctuations on model weights; compared with the traditional integrated prediction model weighted voting method, the model prediction accuracy under the tuning of the present invention is significantly improved, and the prediction error is reduced. In the face of complex data relationships, the load model prediction under dynamic tuning can better handle complex data and reduce the impact of internal and external noise on the prediction results; it improves the operating efficiency of the comprehensive energy utilization system, provides a scientific basis for energy conservation and emission reduction, and helps achieve energy conservation and emission reduction goals.

[0041] The present invention has made a significant breakthrough in the field of load forecasting, improved prediction accuracy, is suitable for processing complex data relationships, and improves system operating efficiency. At the same time, it provides a scientific basis for energy conservation and emission reduction, effectively reduces the risk of overfitting, and has significant practical value and economic benefits.

[0042] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0044] Figure 1 This is a flow chart of the method of the first embodiment.

[0045] Figure 2 This is a structural diagram of the integrated prediction model of the first embodiment.

[0046] Figure 3 This is a structural diagram of the dynamic optimization model of the first embodiment. DETAILED DESCRIPTION

[0047] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0048] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0049] Embodiment 1

[0050] In one embodiment of the present disclosure, a load forecasting method is provided. Figure 1 As shown, the following steps are included:

[0051] Step S1: Obtaining load-related data of the target area at the time to be predicted;

[0052] Step S2: Input the load-related data into the pre-trained integrated prediction model to perform load prediction for each baseline model, linearly weight the prediction results of each baseline model through the real-time weights output by the dynamic optimization model, and finally obtain the load prediction value of the target area;

[0053] The mathematical expression of linear weighting is:

[0054]

[0055] in, It is the final prediction result of the integrated prediction model, that is, the load prediction value of the target area; is the weight of the ith basic model, which is used to adjust the contribution of the model’s prediction results. is the prediction result of the ith basic model.

[0056] Furthermore, the integrated prediction model adopts the LSTM-SVM-MLP integrated prediction model, and selects LSTM, SVM, and MLP as baseline models;

[0057] Each baseline model takes the load-related data at the time to be predicted as input and the load prediction value as output.

[0058] Furthermore, the pre-training of the integrated prediction model is to train the integrated prediction model based on historical load data in a period of time before the prediction time;

[0059] The historical load data is composed of the real load values ​​at several consecutive moments and the corresponding load-related data;

[0060] The load-related data include holidays, working days, temperature, humidity, wind speed, and season.

[0061] Furthermore, the integrated prediction model is trained in the following specific steps:

[0062] Preprocess the historical load data, including missing value filling and normalization;

[0063] The preprocessed historical load data is divided into a multi-dimensional feature set and a target set by using a sliding window method to construct a training data set;

[0064] The initial weight of each baseline model is set to 1, and the Bayesian optimization algorithm and training dataset are used to find the optimal hyperparameters of each baseline model.

[0065] Furthermore, the dynamic optimization model adopts a reinforcement learning actor-critic algorithm, where the actor selects an action based on probability, the critic judges the state value of the action selected by the actor, and the actor modifies the probability of selecting an action according to the state value of the critic.

[0066] The action is the model weight to be optimized.

[0067] Furthermore, the reinforcement learning Actor-Critic algorithm has the following specific steps:

[0068] Initialization, establishing action space set, state space set, reward function, and state transition probability;

[0069] Using the pre-trained integrated prediction model, the load prediction value and loss value at each moment in the training data set are obtained;

[0070] The load prediction value, loss value and actual load value at each moment in the training data set are combined into observation values, input into the Actor actor, and based on the state transition probability, the action is selected to obtain the model weight at the next moment;

[0071] Input the observation value into the Critic of reinforcement learning, calculate the reward of the selected action based on the reward function, and then update the value of the current state;

[0072] Based on the value in the current state, the temporal difference error value is calculated, and the model weight is adjusted based on the temporal difference error value.

[0073] Furthermore, the reward function is established by using the TOPSIS comprehensive analysis method to normalize the evaluation indicators into a single reward function.

[0074] The following is a detailed description of the implementation process of a load forecasting method in this embodiment.

[0075] In order to overcome the problem that the traditional integrated prediction model cannot adaptively adjust the weights according to data fluctuations during use, causing prediction value deviation and failing to provide guidance for load forecasting, this embodiment discloses a load forecasting method for dynamic tuning of an integrated prediction model based on reinforcement learning, which mainly includes two models: an LSTM-SVM-MLP integrated prediction model for load forecasting and a dynamic optimization model based on reinforcement learning for adaptive weight adjustment.

[0076] Based on the above two models, taking Tianjin A community as the target area, the load value at the next moment is predicted. The load prediction method adopted includes the following steps:

[0077] Step 1: Comprehensively collect historical load data of the target area, including the actual load value and corresponding load-related data.

[0078] Specifically, regional historical load data is collected every m minutes to form a time series; the actual load value is calculated through the collected heating primary and secondary network data; the load-related data is mainly meteorological data, including holidays, working days, temperature, humidity, wind speed, and seasons, where the temperature can be further subdivided into wet-bulb temperature, dry-bulb temperature, and dew point temperature, the unit of temperature data is ℃, and the unit of humidity data is %RH; in this embodiment, the sampling time interval of load data is 30 minutes, with a total of 48 sampling points per day.

[0079] This embodiment selects the historical load data of Community A in Tianjin from October 1, 2020 to December 31, 2022.

[0080] Step 2: Preprocess the historical load data.

[0081] The preprocessing includes missing value filling and normalization. Missing values ​​are supplemented by interpolation methods, and data are normalized by Min-Max Normalization to extract key feature information X that is highly relevant to load forecasting.

[0082] For example, take the historical load data from October 1, 2020 to December 31, 2022, and check whether there are missing values ​​in the data set. If there are missing values, use the corresponding methods to handle them, as follows:

[0083] For missing load values, interpolation methods are used to fill in missing values ​​to ensure data continuity and integrity. For meteorological data, data from adjacent moments are used to fill in missing values, or meteorological models are used to estimate missing values. After filling in missing values, historical data is obtained, and then the data is normalized to ensure the stability and convergence of the model.

[0084] The data after missing value filling is normalized by converting the original data into data between [0, 1] to normalize the data dimension so as to achieve faster convergence of the loss function. The normalization calculation formula is:

[0085]

[0086] In the formula, x is the original data, is the minimum value of the corresponding item in the original data, is the maximum value of the corresponding item in the original data.

[0087] Secondly, the processed data is segmented into multi-dimensional feature sets using a sliding window approach. x 1 … x i … x n ] and the target set [y 1 … y i … y n ], where n is the number of moments in the historical load data time series, x i is the characteristic data related to the load at the i-th moment (i.e., holiday, working day, temperature, humidity, wind speed, season and other load-related data), and yn is the actual load data at the i-th moment (i.e., the true value of the load). During pre-training, the relationship between the load-related features and the actual load data should be characterized.

[0088] Step 3: Build Figure 2 The LSTM-SVM-MLP integrated prediction model shown is pre-trained.

[0089] The model structure is constructed through the deep learning language of the deep learning framework (TensorFlow or PyTorch), and a single prediction model (i.e., baseline model) is established to characterize the complex nonlinear mapping relationship between historical load values ​​and meteorological data, thereby integrating and building an integrated prediction model based on LSTM-SVM-MLP. The model includes an input layer, an interaction layer, and an output layer, so as to fully understand the spatiotemporal characteristics of the load data.

[0090] The input layer mainly takes a multi-dimensional feature set as input and provides it to the model for processing;

[0091] In the interaction layer, it is responsible for processing the original feature information, understanding the association between each node, and converting it into the topological structure expression of the load network to further improve the accuracy of the model; capturing the past and future dependencies of the time series, and more comprehensively understanding the changing trend of the load data, so as to dynamically capture the time series characteristics of the historical load data and obtain the output reflecting the characteristics of the historical load time series; through the nonlinear mapping of the forward feedback unit, the deep features are combined with the output load information to finally generate the load forecast results;

[0092] The final output layer is mainly the target set.

[0093] The pre-training uses the Bayesian optimization algorithm and training data set to find the best hyperparameters for each baseline model, specifically:

[0094] The Bayesian optimization algorithm is used to optimize the hyperparameters of each single load forecasting model. The Bayesian optimization algorithm is a method based on a probability model, which is used to find the optimal hyperparameter combination with the goal of maximizing the performance indicators of the model. Further, as a preferred method, the MAE mean absolute error is used as the performance indicator, that is, the loss value in the prediction process is calculated based on the prediction and the true value, and MAE is selected as the loss value indicator.

[0095] The hyperparameters that need to be optimized are:

[0096] a) LSTM model: learning rate: [0.001-0.1]; batch size: [32, 64, 128, 256, 512]; number of hidden layers: [1, 2, 3]; hidden layer size: [32-512].

[0097] b) SVM model: penalty parameter: [0.01-10]; Gamma: [0.01-1].

[0098] c) MLP model: learning rate: [0.001-0.1]; batch size: [32, 64, 128, 256, 512]; number of hidden layers: [1, 2, 3]; hidden layer size: [32-512].

[0099] From all evaluated hyperparameter combinations, select the combination with the best performance as the optimal hyperparameters, and use the best hyperparameters found to retrain the model on the entire training dataset (training set + validation set) to ensure that the model learns from all available data; use the test set to evaluate the performance of the model trained with the best hyperparameters to obtain an unbiased estimate of the model's performance on unseen data.

[0100] Step 4: Build a dynamic optimization model based on the AC (Reinforcement Learning Actor-Critic Algorithm) framework.

[0101] The structure of the dynamic optimization model is as follows Figure 3 As shown in the figure, it includes two deep neural networks, the Actor and the Critic. The Actor is responsible for receiving observations, i.e., the predicted values, actual values, and loss values ​​from the LSTM-SVM-MLP integrated prediction model, and selecting and outputting actions based on the generated action probabilities, i.e., the real-time weights of each baseline model. The Critic judges the reward of the current environment state under the action selected by the Actor, and the Actor then modifies the probability of selecting an action according to the reward of the Critic.

[0102] In the process of building a dynamic optimization model, the most important part is to establish the action space set, state space set, reward function, state transition probability, and implement Markov's law MDP=(S, A, Psa, R). The specific items are as follows:

[0103] S is a state space set: S={s1, s2, s3, ..., sm}, si represents the state at time step i. This implementation method selects load-related characteristics, predicted values, true values, and real-time losses as state values.

[0104] A is the action space set: A={a1, a2, a3, …, am}, ai represents the action at time step i. In this scheme, the action value is the weight of each baseline model.

[0105] P sa is the state transition probability, which means that after executing action a in the current state s, it will transfer to another state The probability distribution of .

[0106] R is the reward function: after executing action a in state s, transfer to state The reward obtained, where r = .

[0107] The reward here is an evaluation of the target value and the state value of the current state. The decision-making process of the agent is optimized through the reward value, and the evaluation method is calculated through the constructed reward function.

[0108] For the construction of the reward function, the evaluation index is normalized into a single reward function. As a preference, the evaluation index is selected 2 (coefficient of determination) and RMSE (root mean square error), the single reward function described was processed using TOPSIS comprehensive analysis.

[0109] Said 2 The formula for calculating the coefficient of determination is:

[0110] 2 =1-(SSR / SST)

[0111] Among them, SSR (Sum of Squares Residual) is the residual sum of squares, which represents the difference between the fitted curve and the actual observations, and SST (Sum of Squares Total) is the total sum of squares, which represents the difference between the actual observations and their means.

[0112] The calculation formula of the RMSE (root mean square error) is:

[0113]

[0114] Among them, q is the number of samples, yi is the true value of the i-th sample, is the predicted value of the i-th sample.

[0115] Among them, the process of TOPSIS comprehensive analysis is as follows:

[0116] (1) Normalization: In order to solve the problem of different dimensions, 2 The two indicators, coefficient of determination and RMSE, are normalized to eliminate the dimensional differences between different indicators. The normalization formula is as follows:

[0117]

[0118] Where: is the normalized reward value of a single indicator. represents the normalized value of the i-th indicator at time t; , Indicates the maximum and minimum values ​​of the i-th indicator.

[0119] (2) Determine the ideal solution and negative ideal solution: The ideal solution (also called the positive ideal solution) refers to the hypothetical solution that achieves the optimal values ​​on all evaluation indicators, while the negative ideal solution refers to the hypothetical solution that achieves the worst values ​​on all evaluation indicators. The ideal solution and negative ideal solution are determined by calculating the normalized indicator values.

[0120] (3) Calculate the distance: Calculate the distance between each alternative and the ideal solution and the negative ideal solution. Commonly used distance measurement methods include Euclidean distance, Manhattan distance, etc. The distance measurement method should be selected according to the characteristics of the specific problem. Based on step (2), the evaluation of the obtained control strategy can be calculated, that is, the relative distance between the ideal solution and the negative ideal solution, which can be expressed as the following formula:

[0121]

[0122]

[0123] in, is the relative distance between the alternative solutions to the actual optimization problem and the optimal ideal solution, is the relative distance between the alternative solution of the actual optimization problem and the negative ideal solution, , are the reward values ​​of the first and second indicators at time t respectively.

[0124] (4) Determine the reward function: Based on the distance between each alternative solution and the ideal solution and the negative ideal solution in step (3), calculate the reward function. In space, the closer the alternative solution is to the ideal solution and the farther the alternative solution is from the most unfavorable solution, the better the solution is. Based on this, the reward function can be constructed:

[0125]

[0126] Based on the above steps, the TOPSIS analysis method is used to transform the multi-objective evaluation indicators with different dimensions and magnitudes into a single reinforcement learning reward function. In the dynamic optimization of load forecasting by the integrated prediction model, the reward function is finally obtained by obtaining the action plan and the corresponding state value during the simulation.

[0127] Step 5: The pre-trained integrated prediction model takes the historical load data of the first 24 steps as input, the initial weight of the model is 1:1:1, and outputs the load prediction value under the initial weight.

[0128] Step 6: Combine the historical load data of the previous 24 steps, the load forecast value at the current time step, the true value and the loss value into the observation value, substitute it into the dynamic optimization model, and input the data into the Actor network to obtain the weights of each baseline model at the next moment.

[0129] Step 7: Calculate the loss value of the integrated prediction model at the current time step, merge it with the observation value at the current step into the state value, input it into the Critic network, and output the current state value.

[0130] Step 8: According to the state value in step 7, the timing difference (TD) error value under the current step size is calculated. The calculation formula is as follows:

[0131]

[0132] in, is the discount factor, which is 0.99 in this embodiment. is the reward value at the current time step, ) is the difference between the state value of the next step and the state value of the current step; if the TD error is positive, it means that the sum of the actual reward plus the expected future reward is higher than the value prediction of the current state, otherwise it is lower.

[0133] Step 9: Adjust the model weights based on the TD error from step 8.

[0134] First, calculate the gradient of the TD error with respect to the weight, and then define the loss function as the square of the TD error. The loss function can be expressed as follows:

[0135]

[0136] In order to find the model weight to minimize the loss function, the gradient descent method is used to calculate the gradient of the loss function with respect to the weight by the chain rule. The specific calculation is as follows:

[0137]

[0138]

[0139] in, and They are the value functions at states s and s′ with respect to weights θ The gradient of α is the learning rate, which controls the step size of weight update.

[0140] Step 10: Based on the output of the Critic value network, use the policy gradient method to optimize the Actor action network.

[0141] First, the objective function is determined by calculating the expected return J(θ) based on the reward value:

[0142]

[0143] Among them, τ represents a strategy The trajectory sampled from is the reward obtained at time t, γ is the discount factor, and T is the length of the trajectory.

[0144] In order to maximize the expected return, we need to calculate the policy gradient , and use the gradient ascent method to update the parameter θ. Using a single sample trajectory to approximate the expectation, the approximate calculation of the policy gradient can be simplified to:

[0145]

[0146] in, is the sum of the returns starting from time t, also called the discounted return.

[0147] Finally, the gradient ascent method is used to update the parameters of the action network:

[0148]

[0149] Step 11: Repeat steps 6-10 to train the agent until the reward value of the reinforcement learning agent no longer increases, which proves that the training is complete.

[0150] Step 12: Combine the pre-trained integrated prediction model with the dynamic parameter adjustment model to realize the dynamic tuning process of the integrated prediction model.

[0151] The dynamic optimization model in this embodiment is conducive to improving the prediction robustness of the integrated prediction model in the face of nonlinear load changes under multiple disturbance interventions; it makes full use of the spatiotemporal characteristics of the integrated prediction model and the adaptability of reinforcement learning theory, the design process is simple, easy to implement, and can effectively perform short-term daily load forecasting for a large number of users.

[0152] Embodiment 2

[0153] In one embodiment of the present disclosure, a load forecasting system is provided, including a data acquisition module and a load forecasting module:

[0154] The data acquisition module is configured to: acquire load-related data of the target area at the time to be predicted;

[0155] The load forecasting module is configured to: input load-related data into the pre-trained integrated forecasting model, perform load forecasting of each baseline model, linearly weight the forecast results of each baseline model through the real-time weight output by the dynamic optimization model, and finally obtain the load forecast value of the target area;

[0156] The dynamic optimization model adopts reinforcement learning technology. In the process of interaction with the environment, it obtains learning information and updates the environmental state by receiving the rewards of the environment for actions, and adaptively adjusts the real-time weights.

[0157] Embodiment 3

[0158] The purpose of this embodiment is to provide a computer-readable storage medium.

[0159] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in a load forecasting method as described in Embodiment 1 of the present disclosure.

[0160] Embodiment 4

[0161] The purpose of this embodiment is to provide an electronic device.

[0162] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in a load forecasting method as described in Embodiment 1 of the present disclosure are implemented.

[0163] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A load forecasting method, characterized in that: include: Obtaining load-related data of the target area at the time to be predicted; The load-related data is input into the pre-trained integrated prediction model to perform load prediction for each baseline model. The prediction results of each baseline model are linearly weighted by the real-time weights output by the dynamic optimization model, and finally the load prediction value of the target area is obtained. The dynamic optimization model adopts reinforcement learning technology. In the process of interaction with the environment, it obtains learning information and updates the environment state by receiving the environment's reward for the action, and adaptively adjusts the real-time weight; The integrated prediction model adopts the LSTM-SVM-MLP integrated prediction model, and selects LSTM, SVM, and MLP as baseline models; Each baseline model takes the load-related data at the time to be predicted as input and the load prediction value as output; The dynamic optimization model adopts the reinforcement learning Actor-Critic algorithm, where the Actor selects actions based on probability, the Critic judges the state value of the action selected by the Actor, and the Actor modifies the probability of selecting the action according to the state value of the Critic. Wherein, the action is the model weight to be optimized; The reinforcement learning Actor-Critic algorithm has the following specific steps: Initialization, establishing action space set, state space set, reward function, and state transition probability; Using the pre-trained integrated prediction model, the load prediction value and loss value at each moment in the training data set are obtained; The load prediction value, loss value and actual load value at each moment in the training data set are combined into observation values, input into the Actor actor, and based on the state transition probability, the action is selected to obtain the model weight at the next moment; Input the observation value into the Critic of reinforcement learning, calculate the reward of the selected action based on the reward function, and then update the value of the current state; Based on the value in the current state, the temporal difference error value is calculated, and the model weight is adjusted based on the temporal difference error value; The reward function is established by using the TOPSIS comprehensive analysis method to normalize the evaluation indicators into a single reward function; The evaluation metric selection 2 and RMSE, the single reward function described is processed using TOPSIS comprehensive analysis; Said 2 The calculation formula is: 2 =1-(SSR / SST) Among them, SSR is the residual sum of squares, which represents the difference between the fitted curve and the actual observations, and SST is the total sum of squares, which represents the difference between the actual observations and their means; The calculation formula of the RMSE is: Among them, q is the number of samples, yi is the true value of the i-th sample, is the predicted value of the i-th sample; Among them, the process of TOPSIS comprehensive analysis is as follows: 1) Normalization: In order to solve the problem of different dimensions, 2 The two indicators of RMSE are normalized to eliminate the dimensional differences between different indicators. The normalization formula is as follows: Where: is the normalized reward value of a single indicator. represents the normalized value of the i-th indicator at time t; , Indicates the maximum and minimum values ​​of the i-th indicator; 2) Determine the ideal solution and negative ideal solution: The ideal solution refers to the hypothetical solution that achieves the best value on all evaluation indicators, while the negative ideal solution refers to the hypothetical solution that achieves the worst value on all evaluation indicators. The ideal solution and negative ideal solution are determined by calculating the normalized indicator values; 3) Calculate the distance: Calculate the distance between each alternative and the ideal solution and the negative ideal solution. The evaluation of the control strategy calculated in step 2), that is, the relative distance between the ideal solution and the negative ideal solution, is expressed as follows: in, is the relative distance between the alternative solutions to the actual optimization problem and the optimal ideal solution, is the relative distance between the alternative solution of the actual optimization problem and the negative ideal solution, , are the reward values ​​of the first and second indicators at time t respectively; 4) Determine the reward function: Based on the distance between each alternative solution and the ideal solution and the negative ideal solution in step 3), calculate the reward function. In space, the closer the solution is to the ideal solution and the farther the solution is from the most unfavorable solution, the better the solution is. Construct the reward function: 。 2. A load forecasting method according to claim 1, characterized in that: The pre-training of the integrated prediction model is to train the integrated prediction model based on the historical load data in a period of time before the prediction time; The historical load data is composed of the real load values ​​at several consecutive moments and the corresponding load-related data; The load related data include holidays, working days, temperature, humidity, wind speed and season.

3. A load forecasting method according to claim 2, characterized in that: The specific steps of training the integrated prediction model are as follows: Preprocess the historical load data, including missing value filling and normalization; The preprocessed historical load data is divided into a multi-dimensional feature set and a target set by using a sliding window method to construct a training data set; The initial weight of each baseline model is set to 1, and the Bayesian optimization algorithm and training dataset are used to find the optimal hyperparameters of each baseline model.

4. A load forecasting system, characterized in that: A load forecasting method as described in claims 1-3 is adopted, comprising a data acquisition module and a load forecasting module: The data acquisition module is configured to: acquire load-related data of the target area at the time to be predicted; The load forecasting module is configured to: input load-related data into the pre-trained integrated forecasting model, perform load forecasting of each baseline model, linearly weight the forecast results of each baseline model through the real-time weight output by the dynamic optimization model, and finally obtain the load forecast value of the target area; The dynamic optimization model adopts reinforcement learning technology. In the process of interaction with the environment, it obtains learning information and updates the environment state by receiving the environment's reward for the action, and adaptively adjusts the real-time weight; The integrated prediction model adopts the LSTM-SVM-MLP integrated prediction model, and selects LSTM, SVM, and MLP as baseline models; Each baseline model takes the load-related data at the time to be predicted as input and the load prediction value as output.

5. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; a processor for executing the computer-readable instructions; Wherein, when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 3 is executed.

6. A storage medium, characterized in that: The computer-readable instructions are non-transitorily stored, wherein when the computer-readable instructions are executed by a computer, the method according to any one of claims 1 to 3 is performed.