Short-term power load prediction method and device based on multi-gradient descent, terminal equipment and storage medium
By adopting a short-term power load prediction method based on multi-gradient descent in the power system, the problems of data leakage and transmission delay in the centralized model are solved, and higher prediction accuracy and privacy protection are achieved.
Patent Information
- Application Number
- CN202411695459.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, power load prediction methods rely on a centralized model to summarize all data to a centralized server, with the risk of data breaches, and as the amount of data increases, delays or interruptions in data transmission may affect the accuracy of load prediction.
The short-term power load prediction method based on multi-gradient descent is adopted. By obtaining the initial global model parameters and initial gradients, it is sent to the local model of each power node for training, the local model parameters and gradients are updated, and the global model parameters are repeatedly updated in the global model training until each local model converges.
This method reduces data traffic, protects user privacy, and enhances the generalization ability of the model through distributed learning, improving the accuracy of load prediction.
Smart Images

Figure CN119561026A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power systems, and in particular to a short-term power load forecasting method, device, terminal equipment and storage medium based on multi-gradient descent. Background Art
[0002] With the continuous development of power systems and the popularization of smart grids, short-term load forecasting of power systems usually predicts power loads for hours to days, providing accurate load demand information for short-term dispatch and operation of power systems. Due to the sensitivity of power supply and demand balance, short-term load forecasting has high requirements for forecasting accuracy. At present, power load forecasting methods mainly rely on historical load data, which are aggregated into centralized models. Then, the centralized model aggregates all data to the central server, which poses a risk of data leakage. Moreover, as the amount of data increases, the accuracy of load forecasting may be affected by delays or interruptions in data transmission. Summary of the invention
[0003] The embodiments of the present invention provide a short-term power load forecasting method, apparatus, terminal device and storage medium based on multi-gradient descent, which can effectively solve the problem that the centralized model in the prior art aggregates all data to a central server, which poses a risk of data leakage, and as the amount of data increases, the accuracy of load forecasting may be affected by delays or interruptions in data transmission.
[0004] An embodiment of the present invention provides a short-term power load forecasting method based on multi-gradient descent, comprising:
[0005] Acquiring first load data of the power system to be predicted;
[0006] Inputting the first load data into a preset load forecasting model to perform load forecasting, and obtaining a short-term load forecasting result of the power system to be forecasted;
[0007] The training of the load forecasting model includes:
[0008] Get the initial global model parameters and initial gradients;
[0009] Sending the initial global model parameters and initial gradients to the local models of each power node, so that each local model performs a local model training operation according to local historical load data, current global model parameters and current gradients, and updates the local model parameters and current gradients;
[0010] According to the updated current local model parameters and the updated current gradient, the global model training operation is repeatedly performed, and the current global model parameters are updated until all local models converge to obtain a trained load forecasting model;
[0011] Among them, the current global model parameters and the current gradient of the first local model training operation are the initial global model parameters and the initial gradient respectively; the current local model parameters of the first global model training operation are the local model parameters when the local model training operation is performed for the first time.
[0012] Furthermore, the local model training operation includes:
[0013] Obtain local historical load data and time series;
[0014] Based on the time series, the local historical load data is divided into a number of equally divided local historical load sub-data;
[0015] Each local historical load sub-data is input into the local model for training to obtain the predicted load sub-data;
[0016] Compare the predicted load sub-data with the local historical load sub-data of the subsequent time series, and calculate a local loss function;
[0017] According to the current global model parameters and the local loss function, the current model parameters are updated; and according to the current model parameters and the current gradient, under the preset gradient update constraints, the current gradient is updated to obtain the updated current gradient;
[0018] The gradient update constraint is determined according to a local loss function and a preset fairness guidance vector.
[0019] Furthermore, the global model training operation includes:
[0020] Construct a gradient matrix based on the updated current gradients;
[0021] Calculate the global model gradient descent direction according to the updated current local model parameters and the gradient matrix;
[0022] Adjusting the global model update direction according to the global model gradient descent direction and a preset fairness guidance vector;
[0023] The current global model parameters are updated according to the adjusted global model update direction to obtain updated global model parameters.
[0024] Furthermore, before inputting the first load data into a preset load forecasting model, the method further includes:
[0025] The first load data is windowed and segmented according to a preset window length to obtain a plurality of load sequence data;
[0026] Normalizing a number of load series data to obtain normalized load series data;
[0027] Perform missing value processing on the normalized load series data, perform sum and average calculation on the load series data of the previous non-missing value and the load series data of the next non-missing value of the current missing value, and use the sum and average calculation result as the load series data of the current missing value;
[0028] The final first load data is obtained based on the load series data after missing value processing.
[0029] Furthermore, the local model is a local LSTM model; and the global model is a global LSTM model.
[0030] As an improvement of the above solution, another embodiment of the present invention provides a short-term power load forecasting device based on multi-gradient descent, including:
[0031] A load data acquisition module, used to acquire first load data of the power system to be predicted;
[0032] A load forecasting module, used for inputting the first load data into a preset load forecasting model to perform load forecasting and obtain a short-term load forecasting result of the power system to be forecasted;
[0033] Also includes:
[0034] Model parameter acquisition module, used to obtain initial global model parameters and initial gradients;
[0035] A local model training module, used to send the initial global model parameters and initial gradients to the local model of each power node, so that each local model performs a local model training operation according to local historical load data, current global model parameters and current gradients, and updates the local model parameters and current gradients;
[0036] The global model training module is used to repeatedly perform the global model training operation according to the updated current local model parameters and the updated current gradient, and update the current global model parameters until all local models converge to obtain a trained load forecasting model;
[0037] Among them, the current global model parameters and the current gradient of the first local model training operation are the initial global model parameters and the initial gradient respectively; the current local model parameters of the first global model training operation are the local model parameters when the local model training operation is performed for the first time.
[0038] Furthermore, the local model training module includes:
[0039] A first data acquisition unit, used to acquire local historical load data;
[0040] A first data division unit, configured to divide the local historical load data into a plurality of equally divided local historical load sub-data based on a time series;
[0041] A first prediction training unit is used to input each local historical load sub-data into a local model for training to obtain predicted load sub-data;
[0042] A first loss function calculation unit, used for comparing the predicted load sub-data with the local historical load sub-data of a subsequent time series, and calculating a local loss function;
[0043] A first gradient updating unit is used to update the current model parameters according to the current global model parameters and the local loss function; and according to the current model parameters and the current gradient, under a preset gradient update constraint, the current gradient is updated to obtain an updated current gradient;
[0044] The gradient update constraint is determined according to a local loss function and a preset fairness guidance vector.
[0045] Furthermore, the global model training module includes:
[0046] A gradient matrix construction unit, used to construct a gradient matrix according to each updated current gradient;
[0047] A gradient direction calculation unit, used to calculate the global model gradient descent direction according to the updated current local model parameters and the gradient matrix;
[0048] A global model update direction adjustment unit, used to adjust the global model update direction according to the global model gradient descent direction and a preset fairness guidance vector;
[0049] The global model updating unit is used to update the current global model parameters according to the adjusted global model updating direction to obtain updated global model parameters.
[0050] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements a short-term power load forecasting method based on multi-gradient descent as described in the above embodiment.
[0051] Another embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a short-term power load forecasting method based on multi-gradient descent as described in the above embodiment.
[0052] By implementing the present invention, at least the following beneficial effects are achieved:
[0053] The present invention provides a short-term power load forecasting method, device, terminal device and storage medium based on multi-gradient descent, wherein the method can obtain the first load data of the power system to be predicted; input the first load data into a preset load forecasting model for load forecasting, and obtain the short-term load forecasting result of the power system to be predicted; the training of the global model includes: obtaining initial global model parameters and initial gradients; sending the initial global model parameters and initial gradients to the local models of each power node, so that each local model performs a local model training operation according to local historical load data, current global model parameters and current gradients, and updates the local model parameters and current gradients; according to the updated current local model parameters and the updated current gradients, the global model training operation is repeatedly performed, and the current global model parameters are updated until each local model converges to obtain a trained global model; wherein the current global model parameters and current gradients of the first local model training operation are the initial global model parameters and initial gradients respectively; the current local model parameters of the first global model training operation are the local model parameters when the first local model training operation is performed. During the training process of the global model, the local model of each power node will continuously interact with the global model to update the model parameters and gradients. This distributed learning method helps the model learn broader and more comprehensive data features, thereby enhancing the generalization ability of the model and enabling it to adapt to load changes at different power nodes. It not only considers the overall load characteristics of the power system, but also takes into account the personalized characteristics of each node, thereby improving the accuracy of load forecasting. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a flowchart of a short-term power load forecasting method based on multi-gradient descent provided by an embodiment of the present invention;
[0055] Figure 2 It is a structural schematic diagram of a short-term power load forecasting device based on multi-gradient descent provided by one embodiment of the present invention;
[0056] Figure 3 It is another flow chart of a short-term power load forecasting method based on multi-gradient descent provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] See also Figure 1 , is a flow chart of a short-term power load forecasting method based on multi-gradient descent provided by an embodiment of the present invention, comprising:
[0059] S1. Acquire first load data of the power system to be predicted;
[0060] S2. Inputting the first load data into a preset load forecasting model to perform load forecasting, and obtaining a short-term load forecasting result of the power system to be forecasted;
[0061] The training of the load forecasting model includes:
[0062] Get the initial global model parameters and initial gradients;
[0063] Sending the initial global model parameters and initial gradients to the local models of each power node, so that each local model performs a local model training operation according to local historical load data, current global model parameters and current gradients, and updates the local model parameters and current gradients;
[0064] According to the updated current local model parameters and the updated current gradient, the global model training operation is repeatedly performed, and the current global model parameters are updated until all local models converge to obtain a trained load forecasting model;
[0065] Among them, the current global model parameters and the current gradient of the first local model training operation are the initial global model parameters and the initial gradient respectively; the current local model parameters of the first global model training operation are the local model parameters when the local model training operation is performed for the first time.
[0066] Specifically, the first load data represents the historical load data of the previous period of time that is equal to the period to be predicted. For example, if the power load in the next two days is predicted, the first load data is the historical load data of the previous two days; the short-term load forecasting results are usually power load forecasting results for several hours to several days, and the time range is usually from 1 hour to 7 days. The short-term load forecasting results can provide accurate load demand information for the short-term scheduling and operation of the power system to be predicted. The initial global model parameters include: initial global weights, initial step size, initial dual remainder, initial Lagrange multiplier, and initial dual variables. The local model refers to the equipment model at each power terminal in the power system, such as a multi-distributed system operator (DSOs) model. The global model represents the power model of the central server of the power system.
[0067] Specifically, each DSO independently initializes its local model parameters, and the central server initializes the global model parameters. The initial global model parameters include: initial global weight, initial step size, initial dual remainder, initial Lagrange multiplier, and initial dual variable. Global weight ω: This is the global model weight trained by all participating local models; step size η s : Determines the step size of the global model parameter update in each iteration; dual remainder Introduced in the dual problem to handle constraints on global model parameter updates; Lagrange multiplier λ i : Used in the Lagrangian function to integrate the constraints into the Lagrangian objective function; Dual variable λ: A variable introduced in the dual problem to represent the Lagrangian function of the original problem. Gradient d s : The gradients calculated by each local model in each iteration are used to update the global model parameters. These parameters together constitute the global model in the federated learning framework and are continuously updated through an iterative optimization process to achieve collaborative prediction between multiple DSOs while protecting privacy.
[0068] In a preferred embodiment of the present invention, the first load data of the power system to be predicted is first obtained, and then the first load data is input into a preset load prediction model for load prediction, so as to obtain the short-term load prediction result of the power system to be predicted; wherein, the training of the load prediction model includes: first obtaining the initial global model parameters and initial gradients, and then sending the initial global model parameters and initial gradients to the local models of each power node, each local model performs a local model training operation according to the local historical load data, the current global model parameters and the current gradients, updates the local model parameters and the current gradients, and returns the updated local model parameters and the updated current gradients to the global model; the global model repeats the global model training operation according to the returned updated current local model parameters and the updated current gradients, and updates the current global model parameters until all local models converge to obtain a trained load prediction model. wherein, the current global model parameters and the current gradients of the first local model training operation are the initial global model parameters and the initial gradients respectively; the current local model parameters of the first global model training operation are the local model parameters obtained when the first local model training operation is performed.
[0069] When each local model converges, a load forecasting model trained jointly by the local and central servers is obtained. The convergence of each local model is converted into a multi-objective optimization problem (MOD), that is, the loss function of each local model is converted into a joint optimization objective.
[0070]
[0071] Among them, F i (ω) represents the local model loss function of the i-th DSO; ω represents the parameter vector of the global model. The global model parameters are updated in each round of iteration to ensure that the downward trend of all local loss functions is consistent.
[0072] Preferably, the local model training operation includes:
[0073] Obtain local historical load data and time series;
[0074] Based on the time series, the local historical load data is divided into a number of equally divided local historical load sub-data;
[0075] Each local historical load sub-data is input into the local model for training to obtain the predicted load sub-data;
[0076] Compare the predicted load sub-data with the local historical load sub-data of the subsequent time series, and calculate a local loss function;
[0077] According to the current global model parameters and the local loss function, the current model parameters are updated; and according to the current model parameters and the current gradient, under the preset gradient update constraints, the current gradient is updated to obtain the updated current gradient;
[0078] The gradient update constraint is determined according to a local loss function and a preset fairness guidance vector.
[0079] Specifically, the local model uses local historical load data to perform model training locally according to preset batches or time intervals (such as every day or every hour). First, obtain local historical load data and time series; based on the time series, divide the local historical load data into several equally divided local historical load sub-data; input each local historical load sub-data into the local model for training to obtain predicted load sub-data, that is, each local model is trained according to its local historical load sub-data; then compare the predicted load sub-data with the local historical load sub-data of the next time series, and calculate the local loss function; according to the current global model parameters and the local loss function, update the current model parameters; and according to the current model parameters and the current gradient, under the preset gradient update constraint, update the current gradient to obtain the updated current gradient; wherein the gradient update constraint is determined according to the local loss function and the preset fairness guidance vector. The gradient update constraint ensures the rapid convergence of the prediction model while improving the model accuracy. When the global model is updated, the central server will dynamically adjust the update target of the model according to the PPC mechanism.
[0080] After completing local training, each local model transmits the updated current gradient of its local model and the updated local model parameters to the global model. At this time, based on the federated learning framework, the local model and the global model only exchange model parameters but not the original data, thereby reducing data communication and protecting user privacy.
[0081] Preferably, the global model training operation includes:
[0082] Construct a gradient matrix based on the updated current gradients;
[0083] Calculate the global model gradient descent direction according to the updated current local model parameters and the gradient matrix;
[0084] Adjusting the global model update direction according to the global model gradient descent direction and a preset fairness guidance vector;
[0085] The current global model parameters are updated according to the adjusted global model update direction to obtain updated global model parameters.
[0086] In a preferred embodiment of the present invention, the global model constructs a gradient matrix according to each updated current gradient, and then calculates the global model gradient descent direction according to the updated current local model parameters and the gradient matrix; adjusts the global model update direction according to the global model gradient descent direction and the preset fairness guidance vector; finally, updates the current global model parameters according to the adjusted global model update direction to obtain updated global model parameters. The global model update direction is adjusted by limiting the global model gradient descent direction to ensure that the local loss function has a similar decrease in the common gradient direction. The core idea of multi-gradient descent is to find a direction that can make all local model loss functions decrease together according to the local gradient information uploaded by each DSO, so as to ensure that the local models of each DSO can be updated and converged synchronously. Under the control of the PPC (performance fairness control) mechanism, the model not only focuses on minimizing the global loss, but also focuses on the fairness of the model performance of each DSO. If the model performance of a DSO lags significantly behind other DSOs, the PPC mechanism will adjust the update direction of the global model to obtain the updated global model parameters, so that the performance of the lagging DSO can be improved faster.
[0087] In an illustrative manner, before inputting the first load data into a preset load forecasting model, the method further includes:
[0088] The first load data is windowed and segmented according to a preset window length to obtain a plurality of load sequence data;
[0089] Normalizing a number of load series data to obtain normalized load series data;
[0090] Perform missing value processing on the normalized load series data, perform sum and average calculation on the load series data of the previous non-missing value and the load series data of the next non-missing value of the current missing value, and use the sum and average calculation result as the load series data of the current missing value;
[0091] The final first load data is obtained based on the load series data after missing value processing.
[0092] In a preferred embodiment of the present invention, the load data input to the load forecasting model is time series data, which requires appropriate data preprocessing. Normalization is first performed to obtain normalized load series data, and then the normalized load series data is processed for missing values to obtain the final first load data.
[0093] Preferably, the local model is a local LSTM model; and the global model is a global LSTM model.
[0094] The use of long short-term memory network (LSTM) can handle complex nonlinear features, and combined with the collaborative mode of federated learning, the accuracy of prediction is significantly improved. Compared with traditional time series methods (such as ARI MA, SVR, etc.), this embodiment has stronger generalization ability and prediction accuracy when dealing with complex load pattern changes.
[0095] In another preferred embodiment of the present invention, Figure 3 As shown in the figure, each local model is trained, and the local model parameters and current gradients are obtained to update the global model, so that the global model updates the global model parameters under the multi-gradient descent and KKT conditions (Karush-Kuhn-Tucker conditions), and then the global model parameters are returned to each local model for training. Finally, based on the convergence of each local model, the final load forecasting model is obtained. The federated learning based on multi-gradient descent (MGD-FLP) framework plays an important role in the load forecasting model. Each local model does not need to share local original data, so the load forecasting model can be trained, reducing the risk of data leakage; the KKT condition allows the optimization of the global objective loss function under the premise of satisfying multiple local model constraints, thereby improving the training efficiency of the model.
[0096] By implementing this embodiment, the first load data of the power system to be predicted is obtained; the first load data is input into the preset load prediction model for load prediction, and the short-term load prediction result of the power system to be predicted is obtained; the training of the global model includes: obtaining initial global model parameters and initial gradients; sending the initial global model parameters and initial gradients to the local models of each power node, so that each local model performs local model training operations according to local historical load data, current global model parameters and current gradients, and updates local model parameters and current gradients; according to the updated current local model parameters and the updated current gradients, the global model training operation is repeatedly performed, and the current global model parameters are updated until each local model converges to obtain a trained global model; wherein the current global model parameters and current gradients of the first local model training operation are the initial global model parameters and initial gradients respectively; the current local model parameters of the first global model training operation are the local model parameters when the local model training operation is performed for the first time. During the training process of the global model, the local model of each power node will continuously interact with the global model to update the model parameters and gradients. This distributed learning method helps the model learn broader and more comprehensive data features, thereby enhancing the generalization ability of the model and enabling it to adapt to load changes at different power nodes. It not only considers the overall load characteristics of the power system, but also takes into account the personalized characteristics of each node, thereby improving the accuracy of load forecasting.
[0097] See also Figure 2, is a schematic diagram of the structure of a short-term power load forecasting device based on multi-gradient descent provided by an embodiment of the present invention, comprising:
[0098] A load data acquisition module, used to acquire first load data of the power system to be predicted;
[0099] A load forecasting module, used for inputting the first load data into a preset load forecasting model to perform load forecasting and obtain a short-term load forecasting result of the power system to be forecasted;
[0100] Also includes:
[0101] Model parameter acquisition module, used to obtain initial global model parameters and initial gradients;
[0102] A local model training module, used to send the initial global model parameters and initial gradients to the local model of each power node, so that each local model performs a local model training operation according to local historical load data, current global model parameters and current gradients, and updates the local model parameters and current gradients;
[0103] The global model training module is used to repeatedly perform the global model training operation according to the updated current local model parameters and the updated current gradient, and update the current global model parameters until all local models converge to obtain a trained load forecasting model;
[0104] Among them, the current global model parameters and the current gradient of the first local model training operation are the initial global model parameters and the initial gradient respectively; the current local model parameters of the first global model training operation are the local model parameters when the local model training operation is performed for the first time.
[0105] Preferably, the local model training module includes:
[0106] A first data acquisition unit, used to acquire local historical load data;
[0107] A first data division unit, configured to divide the local historical load data into a plurality of equally divided local historical load sub-data based on a time series;
[0108] A first prediction training unit is used to input each local historical load sub-data into a local model for training to obtain predicted load sub-data;
[0109] A first loss function calculation unit, used for comparing the predicted load sub-data with the local historical load sub-data of a subsequent time series, and calculating a local loss function;
[0110] A first gradient updating unit is used to update the current model parameters according to the current global model parameters and the local loss function; and according to the current model parameters and the current gradient, under a preset gradient update constraint, the current gradient is updated to obtain an updated current gradient;
[0111] The gradient update constraint is determined according to a local loss function and a preset fairness guidance vector.
[0112] Specifically, the global model training module includes:
[0113] A gradient matrix construction unit, used to construct a gradient matrix according to each updated current gradient;
[0114] A gradient direction calculation unit, used to calculate the global model gradient descent direction according to the updated current local model parameters and the gradient matrix;
[0115] A global model update direction adjustment unit, used to adjust the global model update direction according to the global model gradient descent direction and a preset fairness guidance vector;
[0116] The global model updating unit is used to update the current global model parameters according to the adjusted global model updating direction to obtain updated global model parameters.
[0117] The present invention provides a short-term power load forecasting device based on multi-gradient descent, which obtains the first load data of the power system to be predicted according to the load data acquisition module; then, through the load prediction module, the first load data is input into a preset load prediction model to perform load prediction, and a short-term load prediction result of the power system to be predicted is obtained; it also includes: according to the model parameter acquisition module, initial global model parameters and initial gradients are obtained; through the local model training module, the initial global model parameters and initial gradients are sent to the local model of each power node, so that each local model performs a local model training operation according to local historical load data, current global model parameters and current gradients, and updates the local model parameters and current gradients; in the global model training module, according to the updated current local model parameters and the updated current gradients, the global model training operation is repeatedly performed, and the current global model parameters are updated until all local models converge to obtain a trained load prediction model; wherein, the current global model parameters and current gradients of the first local model training operation are the initial global model parameters and initial gradients respectively; the current local model parameters of the first global model training operation are the local model parameters when the first local model training operation is performed. During the training of the global model, the local model of each power node will continuously interact with the global model to update the model parameters and gradients. This distributed learning method helps the model learn a wider and more comprehensive data feature, thereby enhancing the generalization ability of the model, enabling it to adapt to the load changes of different power nodes, and not only considering the overall load characteristics of the power system, but also taking into account the personalized characteristics of each node, thereby improving the accuracy of load forecasting.
[0118] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0119] Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0120] Another embodiment of the present invention further provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, a short-term power load forecasting method based on multi-gradient descent as described in the above embodiment is implemented. The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory.
[0121] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.
[0122] The memory can be used to store the computer program, and the processor realizes various functions of the terminal device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device or other volatile solid-state storage device.
[0123] Another embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a short-term power load forecasting method based on multi-gradient descent as described in the above embodiment.
[0124] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium.
[0125] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A short-term power load forecasting method based on multi-gradient descent, characterized in that: include: Acquiring first load data of the power system to be predicted; Inputting the first load data into a preset load forecasting model to perform load forecasting, and obtaining a short-term load forecasting result of the power system to be forecasted; The training of the load forecasting model includes: Get the initial global model parameters and initial gradients; Sending the initial global model parameters and initial gradients to the local models of each power node, so that each local model performs a local model training operation according to local historical load data, current global model parameters and current gradients, and updates the local model parameters and current gradients; According to the updated current local model parameters and the updated current gradient, the global model training operation is repeatedly performed, and the current global model parameters are updated until all local models converge to obtain a trained load forecasting model; Among them, the current global model parameters and the current gradient of the first local model training operation are the initial global model parameters and the initial gradient respectively; the current local model parameters of the first global model training operation are the local model parameters when the local model training operation is performed for the first time.
2. A short-term power load forecasting method based on multi-gradient descent as claimed in claim 1, characterized in that: The local model training operation includes: Obtain local historical load data and time series; Based on the time series, the local historical load data is divided into a number of equally divided local historical load sub-data; Each local historical load sub-data is input into the local model for training to obtain the predicted load sub-data; Compare the predicted load sub-data with the local historical load sub-data of the subsequent time series, and calculate a local loss function; According to the current global model parameters and the local loss function, the current model parameters are updated; and according to the current model parameters and the current gradient, under the preset gradient update constraints, the current gradient is updated to obtain the updated current gradient; The gradient update constraint is determined according to a local loss function and a preset fairness guidance vector.
3. A short-term power load forecasting method based on multi-gradient descent as claimed in claim 1, characterized in that: The global model training operation includes: Construct a gradient matrix based on the updated current gradients; Calculate the global model gradient descent direction according to the updated current local model parameters and the gradient matrix; Adjusting the global model update direction according to the global model gradient descent direction and a preset fairness guidance vector; The current global model parameters are updated according to the adjusted global model update direction to obtain updated global model parameters.
4. A short-term power load forecasting method based on multi-gradient descent as claimed in claim 1, characterized in that: Before inputting the first load data into a preset load forecasting model, the method further includes: The first load data is windowed and segmented according to a preset window length to obtain a plurality of load sequence data; Normalizing a number of load series data to obtain normalized load series data; Perform missing value processing on the normalized load series data, perform sum and average calculation on the load series data of the previous non-missing value and the load series data of the next non-missing value of the current missing value, and use the sum and average calculation result as the load series data of the current missing value; The final first load data is obtained based on the load series data after missing value processing.
5. A short-term power load forecasting method based on multi-gradient descent as claimed in claim 1, characterized in that: The local model is a local LSTM model; the global model is a global LSTM model.
6. A short-term power load forecasting device based on multi-gradient descent, characterized in that: include: A load data acquisition module, used to acquire first load data of the power system to be predicted; A load forecasting module, used for inputting the first load data into a preset load forecasting model to perform load forecasting and obtain a short-term load forecasting result of the power system to be forecasted; Also includes: Model parameter acquisition module, used to obtain initial global model parameters and initial gradients; A local model training module, used to send the initial global model parameters and initial gradients to the local model of each power node, so that each local model performs a local model training operation according to local historical load data, current global model parameters and current gradients, and updates the local model parameters and current gradients; The global model training module is used to repeatedly perform the global model training operation according to the updated current local model parameters and the updated current gradient, and update the current global model parameters until all local models converge to obtain a trained load forecasting model; Among them, the current global model parameters and the current gradient of the first local model training operation are the initial global model parameters and the initial gradient respectively; the current local model parameters of the first global model training operation are the local model parameters when the local model training operation is performed for the first time.
7. A short-term power load forecasting device based on multi-gradient descent as claimed in claim 6, characterized in that: The local model training module includes: A first data acquisition unit, used to acquire local historical load data; A first data division unit, configured to divide the local historical load data into a plurality of equally divided local historical load sub-data based on a time series; A first prediction training unit is used to input each local historical load sub-data into a local model for training to obtain predicted load sub-data; A first loss function calculation unit, used for comparing the predicted load sub-data with the local historical load sub-data of a subsequent time series, and calculating a local loss function; A first gradient updating unit is used to update the current model parameters according to the current global model parameters and the local loss function; and according to the current model parameters and the current gradient, under a preset gradient update constraint, the current gradient is updated to obtain an updated current gradient; The gradient update constraint is determined according to a local loss function and a preset fairness guidance vector.
8. A short-term power load forecasting device based on multi-gradient descent as claimed in claim 6, characterized in that: The global model training module comprises: A gradient matrix construction unit, used to construct a gradient matrix according to each updated current gradient; A gradient direction calculation unit, used to calculate the global model gradient descent direction according to the updated current local model parameters and the gradient matrix; A global model update direction adjustment unit, used to adjust the global model update direction according to the global model gradient descent direction and a preset fairness guidance vector; The global model updating unit is used to update the current global model parameters according to the adjusted global model updating direction to obtain updated global model parameters.
9. A terminal device, characterized in that: It comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, a short-term power load forecasting method based on multi-gradient descent as described in any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute a short-term power load forecasting method based on multi-gradient descent as described in any one of claims 1 to 5.
Citation Information
Cited By
Model training method and system applied to electricity utilization information acquisition system
CN121188488A