Training method, device, system and medium for wind and solar power prediction model
Through the adaptive parameter update method, the wind and light power prediction model of the wind and light power station is optimized by combining the server-side shared model and local data, the problem of insufficient generalization ability in federated learning is solved and the accuracy of power generation power prediction is improved.
Patent Information
- Application Number
- CN202410279367.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-12
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2044-03-12
AI Technical Summary
The generalization capability of the wind and light power prediction model based on federal learning technology among different wind and light power stations is insufficient, resulting in low prediction accuracy of power generation power.
Adaptive parameter update method is adopted, and the common model parameters provided by the server are adaptively adjusted in combination with local data, and the local model parameters and weights are optimized round by round to ensure that each client retains the local data characteristics while taking into account the data characteristics of other clients.
The generalization ability of the wind and light power prediction model and the prediction accuracy of the power generation power are improved, the adaptability to local data is enhanced, and the data differences between different wind and light power stations are solved.
Smart Images

Figure CN118134039B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of renewable energy power generation, and in particular to a training method, device, system and medium for a wind-solar power prediction model. Background Art
[0002] With the widespread adoption of renewable energy and the transformation of energy mix, wind power and photovoltaics, as important forms of renewable energy, have seen continued growth in installed capacity worldwide. However, the randomness and volatility of wind power and photovoltaics pose significant challenges to the stable operation and dispatch of power systems. Therefore, accurate wind and solar power forecasting is crucial for economic dispatch, optimized operation, and improving the absorption capacity of wind and photovoltaic power.
[0003] To achieve wind and solar power forecasting, related technologies provide model training methods based on federated learning technology. These methods use wind and solar data from different wind and solar power plants to train wind and solar power prediction models, which can then be used to predict the power generation of wind and solar power plants. However, these federated learning-based model training methods directly replace the model parameters determined in the previous training round with the model parameters determined in the new training round. Due to differences in wind and solar data from different wind and solar power plants, such as meteorological conditions and geographical location, different wind and solar power plants do not need to share wind and solar data. As a result, the wind and solar power prediction models trained using these federated learning-based model training methods lack generalization capabilities, which in turn affects the accuracy of power generation predictions for wind and solar power plants. Summary of the Invention
[0004] In order to solve the above technical problems, the present disclosure provides a training method, device, system and medium for a wind-solar power prediction model.
[0005] In a first aspect, the present disclosure provides a training method for a wind / solar power prediction model, which is applied to a first client of a target wind / solar power station, the method comprising:
[0006] Obtaining current shared parameters of the current shared model in the current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind / solar power station and the previous target parameters of the reference wind / solar power station in the previous training round;
[0007] Determining current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station;
[0008] Using the first training sample of the target wind / solar power station, adjusting the current candidate parameters corresponding to the current local model of the target wind / solar power station, and determining the current target parameters and the current target weight of the current local model of the target wind / solar power station;
[0009] transmitting the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station;
[0010] The current training round is updated, and model training is continued based on the next common parameters until the target local model of the target wind and solar power station obtained through training meets the preset convergence conditions, and the target local model is used as the wind and solar power prediction model of the target wind and solar power station.
[0011] In a second aspect, the present disclosure provides a training device for a wind / solar power prediction model, which is configured at a first client of a target wind / solar power station, and includes:
[0012] A first acquisition module is configured to acquire current shared parameters of a current shared model in a current training round, wherein the current shared parameters are determined by the server based on previous target parameters of the target wind / solar power station and previous target parameters of a reference wind / solar power station in a previous training round;
[0013] A first determination module is configured to determine current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station;
[0014] A second determination module is configured to adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station by using the first training sample of the target wind / solar power station, and determine the current target parameters and current target weight of the current local model of the target wind / solar power station;
[0015] a transmission module, configured to transmit the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station;
[0016] The first training module is used to update the current training round and continue model training based on the next common parameters until the target local model of the target wind and solar power station obtained by training meets the preset convergence conditions, and the target local model is used as the wind and solar power prediction model of the target wind and solar power station.
[0017] In a third aspect, an embodiment of the present disclosure further provides a training system for a wind / solar power prediction model, comprising: a first client of a target wind / solar power station, a second client of a reference wind / solar power station, and a server; the first client is configured to perform the following steps:
[0018] Obtaining current shared parameters of the current shared model in the current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind / solar power station and the previous target parameters of the reference wind / solar power station in the previous training round;
[0019] Determining current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station;
[0020] Using the first training sample of the target wind / solar power station, adjusting the current candidate parameters corresponding to the current local model of the target wind / solar power station, and determining the current target parameters and the current target weight of the current local model of the target wind / solar power station;
[0021] transmitting the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station;
[0022] The current training round is updated, and model training is continued based on the next common parameters until the target local model of the target wind and solar power station obtained through training meets the preset convergence conditions, and the target local model is used as the wind and solar power prediction model of the target wind and solar power station.
[0023] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the method provided in the first aspect when the computer program is executed by a processor.
[0024] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art:
[0025] A training method, device, system and medium for a wind-solar power prediction model according to an embodiment of the present disclosure are applied to a first client of a target wind-solar power station. The method comprises: obtaining current shared parameters of a current shared model in a current training round, wherein the current shared parameters are determined by a server based on the previous target parameters of the target wind-solar power station in a previous training round and the previous target parameters of a reference wind-solar power station; determining current candidate parameters of the target wind-solar power station based on the current shared parameters, the previous target parameters of the target wind-solar power station and the previous target weight of the target wind-solar power station; adjusting the current local model corresponding to the target wind-solar power station using the first training sample of the target wind-solar power station The current candidate parameters of the target wind and solar power station are used to determine the current target parameters and current target weights of the current local model of the target wind and solar power station; the current target parameters of the current local model of the target wind and solar power station are transmitted to the server, so that the server determines the next shared parameters of the next shared model of the next training round based on the current target parameters of the current local model of the target wind and solar power station and the current target parameters of the current local model of the reference wind and solar power station; the current training round is updated, and the model training is continued based on the next shared parameters until the target local model of the target wind and solar power station obtained by training meets the preset convergence conditions, and the target local model is used as the wind and solar power power prediction model of the target wind and solar power station. Thus, each client adaptively determines the local parameters and weights to start the next round of training based on the shared parameters of the shared model sent by the server, the local parameters determined in the previous training round, the weights determined in the previous training round, and the local training data, so that each client retains its own data characteristics while also taking into account the data characteristics of other clients. In this way, not only the adaptability to the local wind and solar data of the client is improved, but also the different characteristics of wind and solar data of different clients can be effectively processed, thereby improving the generalization ability of the wind and solar power prediction model and ultimately improving the prediction accuracy of the power generation of wind and solar power stations. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0027] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0028] Figure 1 A schematic diagram of a flow chart of a training method for a wind / solar power prediction model provided in an embodiment of the present disclosure;
[0029] Figure 2A schematic diagram of the process of S130 provided in an embodiment of the present disclosure;
[0030] Figure 3 A flowchart of another method for training a wind / solar power prediction model provided by an embodiment of the present disclosure;
[0031] Figure 4 A schematic diagram of the structure of a training device for a wind / solar power prediction model provided by an embodiment of the present disclosure;
[0032] Figure 5 A structural diagram of a training system for a wind / solar power prediction model provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0034] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0035] Related technologies also employ statistical and machine learning methods for wind and solar power forecasting. Statistical methods primarily rely on linear regression analysis based on historical wind and solar data, but are ineffective when dealing with nonlinear problems and complex relationships. Machine learning methods offer significant advantages in processing large-scale, complex data and discovering hidden patterns within the data. However, using machine learning methods for wind and solar power forecasting requires a large amount of wind and solar data and historical power data from wind farms. These data often involve sensitive information, and centralized storage and processing of these data can easily lead to data leakage and privacy violations. Furthermore, machine learning methods involve a large amount of training data and computing resources. Due to these limitations, traditional machine learning processes struggle to achieve high-precision wind and solar power forecasting.
[0036] To solve the above problems, related technologies have proposed a model training method based on federated learning technology, using wind and solar data from different wind and solar power stations to train a wind and solar power prediction model. However, this method has the problem of insufficient generalization ability of the trained wind and solar power prediction model, which in turn affects the prediction accuracy of the power generation of the wind and solar power station.
[0037] In order to solve the above problems, the embodiments of the present disclosure provide a training method, device, system and medium for a wind-solar power prediction model.
[0038] The following combination Figure 1 The training method for the wind / solar power prediction model provided in the embodiments of the present disclosure is described. In the embodiments of the present disclosure, the training method for the wind / solar power prediction model can be executed by a first client of a target wind / solar power station. The first client can be an electronic device or a server. The electronic device can include a device with communication capabilities, such as a tablet computer, desktop computer, or laptop computer, and can also include a virtual machine or a device simulated by a simulator. The server can include a server cluster and a cloud server.
[0039] Figure 1 A flow chart of a method for training a wind / solar power prediction model provided by an embodiment of the present disclosure is shown.
[0040] like Figure 1 As shown, the training method of the wind-solar power prediction model may include the following steps.
[0041] S110 , obtaining current shared parameters of the current shared model in the current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind and solar power station in the previous training round and the previous target parameters of the reference wind and solar power station.
[0042] In this embodiment, any wind-solar power station is taken as the target wind-solar power station, and its corresponding first client can train a wind-solar power prediction model through iterative training of multiple training rounds, so that the target wind-solar power station can use the trained wind-solar power prediction model to perform wind-solar power prediction.
[0043] Specifically, starting from the first training round, the first client obtains the initial shared parameters of the initial shared model from the server, then the first client adjusts the initial shared parameters for the first training round, and transmits the adjusted initial shared parameters to the server, so that the server determines the shared parameters of the shared model in the second training round based on the adjusted initial shared parameters; then, any one training round is taken as the current training round, the first client obtains the current shared parameters of the current shared model in the current training round from the server, and continues to adjust the current shared parameters, and transmits the adjusted current shared parameters to the server, so that the server determines the shared parameters of the shared model in the next round; repeat the above process until the wind and solar power prediction model of the target wind and solar power station is trained.
[0044] The current shared model is a prediction model determined by the server and includes the previous target parameters of the target wind and solar power station in the previous training round and the previous target parameters of the reference wind and solar power station.
[0045] The target wind-solar power station refers to the wind-solar power station that needs to perform power generation prediction, and the reference wind-solar power station refers to the wind-solar power station that provides a reference for the model training process of the target wind-solar power station.
[0046] In some embodiments, the target wind / solar power station can be a newly built, expanded, or renovated wind / solar power station, which can only provide a small amount of training samples. The reference solar power station is a wind / solar power station that has been in operation for a long time and has sufficient training data. Therefore, when training the wind / solar power prediction model for the target wind / solar power station, it is necessary to combine the parameters determined during the model training process of the reference wind / solar power station to perform auxiliary training on the model training process of the target wind / solar power station to improve the training accuracy of the wind / solar power prediction model for the target wind / solar power station.
[0047] In other embodiments, both the target wind and solar power station and the reference wind and solar power station can be wind and solar power stations that have been in long-term operation and have sufficient training data, so that when training the wind and solar power prediction model of the target wind and solar power station, the parameters determined by the model training process of the reference wind and solar power station can be combined to train a wind and solar power prediction model with better performance.
[0048] Among them, the server can communicate with clients of different wind and solar power stations. In some embodiments, the server adds the previous target parameters of the target wind and solar power station in the previous training round and the previous target parameters of the reference wind and solar power station and averages them to obtain the current shared parameters of the current shared model in the current training round. In other embodiments, the previous target parameters of the target wind and solar power station and the previous target parameters of the reference wind and solar power station are parameters encrypted using a public key. The server homomorphically encrypts the encrypted previous target parameters of the target wind and solar power station and the encrypted previous target parameters of the reference wind and solar power station and averages them to obtain the current shared parameters of the current shared model in the current training round.
[0049] Optionally, the target wind and solar power station is recorded as , with reference to the wind and solar power station , target wind and solar power stations The previous target parameter of , refer to wind and solar power stations The previous target parameter of , the current shared model The current shared parameters are recorded as .
[0050] S120 : Determine current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station.
[0051] To improve the model's adaptability and prediction accuracy, this embodiment uses an adaptive parameter update method to update the model parameters of the target wind / PV power station. Specifically, in this step, the first client adjusts the global model parameters (i.e., the current shared parameters) issued by the server to preliminarily determine the parameters of the target wind / PV power station's local model (i.e., determine the current candidate parameters corresponding to the target wind / PV power station's current local model). In subsequent steps, the parameters of the preliminarily determined target wind / PV power station's local model are further adjusted based on the target wind / PV power station's first training sample to determine the final parameters of the target wind / PV power station's local model (i.e., the current target parameters of the target wind / PV power station's current local model in subsequent steps).
[0052] The previous target parameters of the target wind / solar power station refer to the parameters of the local model of the first client in the previous training round. The previous target weights of the target wind / solar power station refer to the weight matrix set by the first client to determine the current candidate parameters of the target wind / solar power station. The current candidate parameters of the target wind / solar power station refer to the preliminarily determined parameters of the local model of the target wind / solar power station.
[0053] Optionally, the previous target parameter of the target wind and solar power station is recorded as , the previous target weight of the target wind and solar power station is recorded as , the current candidate parameters of the target wind and solar power station are recorded as .
[0054] In this embodiment, the specific implementation method of S120 includes but is not limited to the following methods: calculating the first difference between the current shared parameter and the previous target parameter of the target wind and solar power station; multiplying the first difference by the previous target weight of the target wind and solar power station to obtain a first product; adding the first product to the previous target parameter of the target wind and solar power station to obtain the current candidate parameter of the target wind and solar power station.
[0055] Optionally, the current candidate parameters of the target wind / solar power station determined by the above process can be expressed as follows:
[0056]
[0057] In this way, the first client uses the adaptive parameter updating method to first adjust the current shared parameters (i.e., global model parameters) sent by the server to preliminarily determine the parameters of the local model of the target wind and solar power station as the current candidate parameters of the target wind and solar power station.
[0058] S130 : Using the first training sample of the target wind / solar power station, adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station, and determine the current target parameters and current target weight of the current local model of the target wind / solar power station.
[0059] In this embodiment, the first client uses an adaptive parameter updating method, combined with the first training sample of the target wind and solar power station, to continue adjusting the parameters of the local model of the initially determined target wind and solar power station (i.e., the current candidate parameters of the target wind and solar power station) to determine the final parameters of the local model of the target wind and solar power station as the current target parameters of the current local model of the target wind and solar power station, and to obtain a weight matrix set for determining the next candidate parameters of the target wind and solar power station.
[0060] Specifically, the first training sample is divided into several parts, and each training sample is brought into the current local model of the current candidate parameter, and the loss value between its power prediction value and the actual power value is calculated. Then, based on the loss value, the current candidate parameter is adjusted to obtain the current target parameter of the current local model of the target wind and solar power station, thereby obtaining a model suitable for predicting wind and solar power for the local data of the target wind and solar power station in the current training round. In order to continue to use the adaptive parameter update method to optimize the current local model of the target wind and solar power station, the first client can also update the previous target weight of the target wind and solar power station based on the loss value to obtain the current target weight of the target wind and solar power station, so as to further determine the current target weight of the target wind and solar power station and determine the next candidate parameter of the target wind and solar power station.
[0061] The first training samples of the target wind / solar power station refer to the local training samples of the target wind / solar power station. If the target wind / solar power station is a newly built, expanded, or renovated wind / solar power station, the data volume of the first training samples is relatively small. If the target wind / solar power station is a long-term operating wind / solar power station, the data volume of the first training samples is relatively large.
[0062] Among them, the current local model of the target wind and solar power station can be the current shared model, and in the current training round, since the current candidate parameters are determined by using the adaptive update method, the parameters of the current local model are first updated to the current candidate parameters, and then the first training sample of the target wind and solar power station is used to continue to adjust the current candidate parameters of the current local model to the current target parameters.
[0063] Optionally, the loss value between the power prediction value and the actual power value includes but is not limited to the mean square error loss, and may also be data determined based on other loss calculation methods.
[0064] Optionally, the current local model is recorded as , the current target parameters of the current local model of the target wind and solar power station are recorded as , the current target weight is recorded as .
[0065] In this way, the first client adopts an adaptive parameter updating method to continue adjusting the current candidate parameters of the target wind and solar power station to determine the final parameters of the local model of the target wind and solar power station as the current target parameters of the current local model of the target wind and solar power station, and obtains a weight matrix set for determining the next candidate parameters of the target wind and solar power station.
[0066] Therefore, in each training round, the first client adaptively determines local parameters and weights to start the next round of training based on the shared model's shared parameters sent by the server, the local parameters determined in the previous training round, the weights determined in the previous training round, and the local training data. Compared to federated learning methods that directly replace the local model parameters from the previous round, this method improves adaptability to local data. By utilizing local data to adaptively personalize model fusion, it solves the problem of data heterogeneity faced by federated learning.
[0067] S140. Transmit the current target parameters of the current local model of the target wind and solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind and solar power station and the current target parameters of the current local model of the reference wind and solar power station.
[0068] In this embodiment, after the first client determines the current target parameters of the current local model of the target wind / PV power station, the adaptive parameter update for the current training round is completed. Next, the first client transmits the current target parameters of the current local model of the target wind / PV power station to the server to start the next training round. The server then determines the next shared parameters of the next shared model for the next training round based on the current target parameters of the current local model of the target wind / PV power station and the current target parameters of the current local model of the reference wind / PV power station.
[0069] In some embodiments, the server adds the current target parameters of the target wind / solar power station and the current target parameters of the reference wind / solar power station in the current training round and averages them to obtain the next shared parameters of the next shared model in the next training round. In other embodiments, the current target parameters of the target wind / solar power station and the current target parameters of the reference wind / solar power station are parameters encrypted using a public key. The server homomorphically encrypts the encrypted current target parameters of the target wind / solar power station and the encrypted current target parameters of the reference wind / solar power station and averages them to obtain the next shared parameters of the next previous shared model in the next training round.
[0070] Among them, the current target parameters of the current local model transmitted by the second client are determined after adjusting the previous shared model corresponding to the previous shared parameters based on the second training data of the reference wind farm; or, the current target parameters of the current local model transmitted by the second client are determined after adjusting the previous local model corresponding to the current candidate parameters of the reference wind and solar power station based on the second training data of the reference wind farm, wherein the current candidate parameters of the reference wind and solar power station are determined based on the current shared parameters of the current shared model of the current training round, the previous target parameters of the reference wind and solar power station, and the previous target weight of the reference wind and solar power station.
[0071] Specifically, the second client determines the mean square error losses corresponding to the two methods mentioned above for model training, compares the two mean square error losses, and selects the training method of the mean square error loss to continue to determine the current target parameters of the current local model of the second client.
[0072] S150, updating the current training round, and continuing model training based on the next common parameters until the target local model of the target wind and solar power station obtained by training meets the preset convergence conditions, and using the target local model as the wind and solar power prediction model of the target wind and solar power station.
[0073] In this embodiment, after the first client determines the next shared parameters of the next previous shared model, it updates the current training round and enters the next training round, and returns to execute S110~S140 to continue model training based on the next shared parameters until the target local model of the target wind and solar power station obtained by training meets the preset convergence conditions, and the target local model is used as the wind and solar power prediction model of the target wind and solar power station.
[0074] The preset convergence condition refers to the cutoff condition for the first client to perform model training. Specifically, when the first client iteratively performs model training, it calculates the loss value of each training round. If the loss value is less than a preset loss threshold, it is determined that the target local model of the target wind and solar power station meets the preset convergence condition, thereby terminating the iterative training.
[0075] Optionally, the loss value of each training round includes but is not limited to mean square error loss, and may also be data determined based on other loss calculation methods.
[0076] The embodiment of the present disclosure provides a training method for a wind-solar power prediction model, which is applied to a first client of a target wind-solar power station. The method comprises: obtaining current shared parameters of a current shared model in a current training round, wherein the current shared parameters are determined by a server based on the previous target parameters of the target wind-solar power station in a previous training round and the previous target parameters of a reference wind-solar power station; determining current candidate parameters of the target wind-solar power station based on the current shared parameters, the previous target parameters of the target wind-solar power station and the previous target weight of the target wind-solar power station; adjusting the current candidate parameters corresponding to the current local model of the target wind-solar power station using the first training sample of the target wind-solar power station; Select parameters to determine the current target parameters and current target weights of the current local model of the target wind and solar power station; transmit the current target parameters of the current local model of the target wind and solar power station to the server, so that the server determines the next shared parameters of the next shared model of the next training round based on the current target parameters of the current local model of the target wind and solar power station and the current target parameters of the current local model of the reference wind and solar power station; update the current training round, and continue model training based on the next shared parameters until the target local model of the target wind and solar power station obtained by training meets the preset convergence conditions, and use the target local model as the wind and solar power power prediction model of the target wind and solar power station. Thus, each client adaptively determines the local parameters and weights to start the next round of training based on the shared parameters of the shared model sent by the server, the local parameters determined in the previous training round, the weights determined in the previous training round, and the local training data, so that each client retains its own data characteristics while also taking into account the data characteristics of other clients. In this way, not only the adaptability to the local wind and solar data of the client is improved, but also the different characteristics of wind and solar data of different clients can be effectively processed, thereby improving the generalization ability of the wind and solar power prediction model and ultimately improving the prediction accuracy of the power generation of wind and solar power stations.
[0077] In another embodiment of the present disclosure, S130 is explained in detail.
[0078] Figure 2 A schematic diagram of the process of S130 provided in an embodiment of the present disclosure is shown.
[0079] like Figure 2 As shown, S130 may include the following steps.
[0080] S210: Input the historical wind and solar data in the first training sample into the current local model corresponding to the current candidate parameters to obtain the predicted generated power of the target wind and solar power station.
[0081] In this embodiment, the first client divides the first training sample into multiple parts, and inputs the historical wind and solar data in each training sample into the current local model corresponding to the current candidate parameters to obtain the predicted power generation of the target wind and solar power station.
[0082] S220 : Determine a loss value of a current local model corresponding to a current candidate parameter based on the predicted power generation and the actual power generation of the target wind and solar power station.
[0083] In this embodiment, a mean square error calculation method is used but not limited to calculate the loss value of the predicted power generation and actual power generation of the target wind and solar power station to obtain the loss value of the current local model corresponding to the current candidate parameters.
[0084] Optionally, the loss value can be recorded as .
[0085] S230 : Adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station according to the loss value, and obtain the current target parameters and current target weight of the current local model of the target wind / solar power station.
[0086] In this embodiment, the specific implementation method of S230 includes but is not limited to the following methods: calculating the gradient of the current candidate parameter based on the loss value to obtain the gradient data of the current candidate parameter; calculating the gradient of the previous target weight based on the loss value to obtain the gradient data of the previous target weight; using the gradient data of the current candidate parameter, adjusting the current candidate parameter corresponding to the current local model to determine the current target parameter of the current local model; using the gradient data and hyperparameters of the previous target weight, adjusting the gradient data of the previous target weight to determine the current target weight of the current local model.
[0087] Optionally, the gradient data of the current candidate parameter can be recorded as .
[0088] Among them, the first client can use the chain derivation method to calculate the gradient of the previous target weight based on the loss value to obtain the gradient data of the previous target weight.
[0089] Optionally, the gradient data of the previous target weight can be determined as follows:
[0090]
[0091] Furthermore, after determining the gradient data of the current candidate parameters, the first client uses the gradient data of the current candidate parameters to adjust the current candidate parameters corresponding to the current local model using the stochastic gradient descent method to determine the current target parameters of the current local model. In addition, the first client uses the gradient data and hyperparameters of the previous target weight to update the gradient data of the previous target weight to obtain the current target weight of the current local model.
[0092] Optionally, the current target weight of the current local model can be determined as follows:
[0093]
[0094] in, is the current target weight of the current local model, is a hyperparameter.
[0095] Through this approach, in each training round, the first client adaptively determines the current target parameters and target weights for the current training round based on the current candidate parameters determined in the current training round and the local training data to initiate the next round of training. Compared to federated learning methods that directly replace the local model parameters of the previous round, this improves adaptability to local data. By utilizing local data to adaptively personalize model fusion, it solves the problem of data heterogeneity faced by all parties in federated learning.
[0096] In another embodiment of the present disclosure, in order to avoid leakage of local data of each wind and solar power station during the model training process, the data transmitted from each client to the server is encrypted using encryption technology, so that each client can perform model training and parameter updates without exposing the original data.
[0097] Figure 3 A flow chart of another method for training a wind / solar power prediction model provided by an embodiment of the present disclosure is shown.
[0098] like Figure 3 As shown, the training method of the wind-solar power prediction model may include the following steps.
[0099] S310. Obtain the current shared parameters of the current shared model in the current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind and solar power station and the previous target parameters of the reference wind and solar power station in the previous training round. The previous target parameters of the target wind and solar power station are parameter ciphertexts encrypted using the first public key, and the previous target parameters of the reference wind and solar power station are parameter ciphertexts encrypted using the second public key. The current shared parameters are obtained by the server by homomorphically adding the parameter ciphertexts of the target wind and solar power station and the parameter ciphertexts of the reference wind and solar power station and then averaging them.
[0100] In this embodiment, in each training round, the parameters transmitted by the client of each wind and solar power station to the server are encrypted before transmission, so that the server can only process the parameter ciphertext and cannot obtain the plaintext information. The server determines the common model and its common parameters of each training round based on the parameter ciphertext.
[0101] Specifically, for the last training round in multiple training rounds, after the first client determines the last target parameters of the target wind and solar power station and the second client determines the last target parameters of the reference wind and solar power station, the first client uses the homomorphic encryption algorithm (Paillier Cryptosystem) to encrypt the last target parameters of the target wind and solar power station using the first public key to obtain the parameter ciphertext of the target wind and solar power station. At the same time, the second client uses the homomorphic encryption algorithm to encrypt the last target parameters of the reference wind and solar power station using the second public key to obtain the parameter ciphertext of the reference wind and solar power station. Then, the first client and the second client send the parameter ciphertexts they have determined to the server.
[0102] The target wind / PV power station's previous target parameters can be understood as the plaintext data of the target wind / PV power station in the previous training round, and the target wind / PV power station's ciphertext parameters refer to the encrypted parameters of the target wind / PV power station. The reference wind / PV power station's previous target parameters can be understood as the plaintext data of the reference wind / PV power station in the previous training round, and the reference wind / PV power station's ciphertext parameters refer to the encrypted parameters of the reference wind / PV power station.
[0103] The first public key and the second public key are secret keys generated using a homomorphic encryption algorithm. Optionally, the first public key and the second public key can be the same or different.
[0104] Specifically, both the first client and the second client can determine the corresponding public key through the following homomorphic encryption algorithm: First, randomly select two large prime numbers 、 , two large prime numbers 、 The conditions to be met are: , and satisfies 、 of equal length, represents the greatest common divisor; then, calculate as well as , Represents the least common multiple; then, randomly select an integer ,calculate ,in , then the public key is determined to be ; Further, given a plaintext , choose a random number , the first client encrypts the target wind and solar power station's last target parameter using the determined first public key and random number to obtain the target wind and solar power station's parameter ciphertext. At the same time, the second client encrypts the reference wind and solar power station's last target parameter using the determined second public key and random number to obtain the reference wind and solar power station's parameter ciphertext. When the first public key and the second public key are the same, both the first public key and the second public key can be expressed as .
[0105] Furthermore, after receiving the parameter ciphertext of the target wind-solar power station and the parameter ciphertext of the reference wind-solar power station, the server performs homomorphic addition on the parameter ciphertext of the target wind-solar power station and the parameter ciphertext of the reference wind-solar power station and calculates the average to determine the current shared parameters of the current shared model.
[0106] Specifically, in the homomorphic encryption algorithm, the sum of two plaintexts corresponds to the decryption of the product of their ciphertexts, that is, if yes encryption, yes If the encryption yes Decryption.
[0107] In this way, before the client of each wind and solar power station transmits local data to the server, the local data is encrypted before transmission, so that the server can only process the parameter ciphertext but cannot obtain the plaintext information, avoiding the leakage of local data of the wind and solar power station.
[0108] S320 : Determine current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station.
[0109] In this embodiment, the specific implementation method of S320 includes but is not limited to the following methods: using the first private key to decrypt the current shared parameters to determine the parameter plaintext corresponding to the current shared parameters; determining the current candidate parameters of the target wind and solar power station based on the parameter plaintext corresponding to the current shared parameters, the previous target parameters of the target wind and solar power station, and the previous target weight of the target wind and solar power station.
[0110] The first private key and the second private key are private keys generated using a homomorphic encryption algorithm. Optionally, the first private key and the second private key may be the same or different.
[0111] Specifically, when the first client and the second client can use the homomorphic encryption algorithm to determine the public key, they can also determine the corresponding private key. , then, for a given ciphertext , using the private key Calculate the plaintext information as Among them, the ciphertext It can be the current shared parameters of the current shared model, that is, the above The first private key determined by the first client is , plain text This is the parameter plaintext corresponding to the current shared parameter.
[0112] Furthermore, the first client uses an adaptive update method to preliminarily determine the parameters of the local model of the target wind / solar power station based on the parameter plaintext corresponding to the current shared parameter, the previous target parameter of the target wind / solar power station, and the previous target weight of the target wind / solar power station, as the current candidate parameters of the target wind / solar power station. It should be noted that the specific steps for determining the current candidate parameters of the target wind / solar power station based on this method can be referred to the description of the above embodiment.
[0113] It is understandable that since the current shared parameters determined by the server are the fusion data of the parameter ciphertext of the target wind and solar power station and the parameter ciphertext of the reference wind and solar power station, the server cannot see the local plaintext data of the target wind and solar power station and the reference wind and solar power station. In this way, after the first client decrypts the current shared parameters, the parameter plaintext corresponding to the current shared parameters obtained is also the fusion data of the parameter ciphertext of the target wind and solar power station and the parameter plaintext of the reference wind and solar power station. It is impossible to infer the specific parameter plaintext of the reference wind and solar power station. Therefore, not only can the local data of the reference wind and solar power station play an auxiliary role in the model training process of the target wind and solar power station, but it can also avoid the leakage of the local data of the reference wind and solar power station during the model training process of the target wind and solar power station, thereby improving data privacy and data security.
[0114] S330 : Using the first training sample of the target wind / solar power station, adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station, and determine the current target parameters and current target weight of the current local model of the target wind / solar power station.
[0115] Among them, S330 is similar to S110 and will not be described in detail here.
[0116] S340. Transmit the current target parameters of the current local model of the target wind and solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind and solar power station and the current target parameters of the current local model of the reference wind and solar power station.
[0117] In this embodiment, the specific implementation method of S340 includes but is not limited to the following methods: using the third public key to encrypt the current target parameters of the current local model of the target wind and solar power station to obtain the current encrypted parameters; transmitting the current encrypted parameters of the current local model of the target wind and solar power station to the server, so that the server performs homomorphic addition and average on the current encrypted parameters of the current local model of the target wind and solar power station and the current encrypted parameters of the current local model of the reference wind and solar power station to determine the next shared parameters of the next shared model of the target wind and solar power station.
[0118] The current target parameters of the current local model of the target wind / solar power station can be understood as the plaintext data of the target wind / solar power station in the current training round, and the current encrypted parameters of the target wind / solar power station refer to the encrypted parameters of the target wind / solar power station. The current encrypted parameters of the current local model of the reference wind / solar power station can be understood as the plaintext data of the reference wind / solar power station in the current training round, and the current encrypted parameters of the reference wind / solar power station refer to the encrypted parameters of the reference wind / solar power station.
[0119] The third public key and the fourth public key are secret keys generated using a homomorphic encryption algorithm. Optionally, the third public key and the fourth public key can be the same or different, and the third public key can also be the same as the first public key, and the fourth public key can also be the same as the second public key.
[0120] Specifically, the first client and the second client both determine the corresponding public key through the homomorphic encryption algorithm, which can be described in the above steps. Among them, when the third public key and the fourth public key are the same, the third public key and the fourth public key can be expressed as .
[0121] Furthermore, after the server receives the current encryption parameters of the current local model of the target wind and solar power station and the current encryption parameters of the current local model of the reference wind and solar power station, it homomorphically adds the current encryption parameters of the target wind and solar power station and the current encryption parameters of the reference wind and solar power station and then calculates the average to determine the next shared parameters of the next shared model in the next training round.
[0122] In this way, before the client of each wind and solar power station transmits local data to the server, the local data is encrypted before transmission, so that the server can only process the parameter ciphertext but cannot obtain the plaintext information, avoiding the leakage of local data of the wind and solar power station.
[0123] S350, updating the current training round, and continuing model training based on the next common parameters until the target local model of the target wind and solar power station obtained by training meets the preset convergence conditions, and using the target local model as the wind and solar power prediction model of the target wind and solar power station.
[0124] Among them, S350 is similar to S150 and will not be described in detail here.
[0125] The embodiment of the present disclosure also provides a training device for a wind-solar power prediction model for implementing the training method of the wind-solar power prediction model. Figure 4 In the disclosed embodiment, the training device for the wind / solar power prediction model is configured on a first client, which can be an electronic device or a server. The electronic device can include a tablet computer, desktop computer, laptop computer, or other device with communication capabilities, or a virtual machine or simulator-simulated device. The server can include a server cluster and a cloud server.
[0126] Figure 4 A structural schematic diagram of a training device for a wind-solar power prediction model provided by an embodiment of the present disclosure is shown.
[0127] like Figure 4 As shown, the training device 400 for the wind and solar power prediction model may include:
[0128] A first acquisition module 410 is configured to acquire current shared parameters of the current shared model in the current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind / solar power station and the previous target parameters of the reference wind / solar power station in the previous training round;
[0129] A first determining module 420 is configured to determine current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station;
[0130] A second determination module 430 is configured to adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station using the first training sample of the target wind / solar power station, and determine the current target parameters and current target weight of the current local model of the target wind / solar power station;
[0131] a transmission module 440, configured to transmit the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station;
[0132] The first training module 450 is used to update the current training round and continue model training based on the next common parameters until the target local model of the target wind and solar power station obtained by training meets the preset convergence conditions, and use the target local model as the wind and solar power prediction model of the target wind and solar power station.
[0133] A training device for a wind-solar power prediction model according to an embodiment of the present disclosure is configured at a first client of a target wind-solar power station, and the device comprises: obtaining current shared parameters of a current shared model in a current training round, wherein the current shared parameters are determined by a server based on the previous target parameters of the target wind-solar power station in a previous training round and the previous target parameters of a reference wind-solar power station; determining current candidate parameters of the target wind-solar power station based on the current shared parameters, the previous target parameters of the target wind-solar power station, and the previous target weight of the target wind-solar power station; adjusting the current candidate parameters corresponding to the current local model of the target wind-solar power station using the first training sample of the target wind-solar power station; Parameters, determine the current target parameters and current target weights of the current local model of the target wind and solar power station; transmit the current target parameters of the current local model of the target wind and solar power station to the server, so that the server determines the next shared parameters of the next shared model of the next training round based on the current target parameters of the current local model of the target wind and solar power station and the current target parameters of the current local model of the reference wind and solar power station; update the current training round, and continue model training based on the next shared parameters until the target local model of the target wind and solar power station obtained by training meets the preset convergence conditions, and use the target local model as the wind and solar power power prediction model of the target wind and solar power station. Thus, each client adaptively determines the local parameters and weights to start the next round of training based on the shared parameters of the shared model sent by the server, the local parameters determined in the previous training round, the weights determined in the previous training round, and the local training data, so that each client retains its own data characteristics while also taking into account the data characteristics of other clients. In this way, not only the adaptability to the local wind and solar data of the client is improved, but also the different characteristics of wind and solar data of different clients can be effectively processed, thereby improving the generalization ability of the wind and solar power prediction model and ultimately improving the prediction accuracy of the power generation of wind and solar power stations.
[0134] In some embodiments of the present disclosure, the first determining module 420 includes:
[0135] A first calculation unit, configured to calculate a first difference between the current common parameter and a previous target parameter of the target wind / solar power station;
[0136] A first acquiring unit is configured to multiply the first difference by a previous target weight of the target wind / solar power station to obtain a first product;
[0137] The second acquisition unit is configured to add the first product to the previous target parameter of the target wind-solar power station to obtain the current candidate parameter of the target wind-solar power station.
[0138] In some embodiments of the present disclosure, the second determining module 430 includes:
[0139] A first determining unit is configured to input the historical wind and solar data in the first training sample into a current local model corresponding to the current candidate parameter to obtain a predicted generated power of the target wind and solar power station;
[0140] A second determining unit is configured to determine a loss value of a current local model corresponding to the current candidate parameter based on the predicted power generation power and the actual power generation power of the target wind and solar power station;
[0141] The third determining unit is configured to adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station according to the loss value, and obtain the current target parameters and current target weight of the current local model of the target wind / solar power station.
[0142] In some embodiments of the present disclosure, the third determining unit is specifically configured to:
[0143] Calculating the gradient of the current candidate parameter based on the loss value to obtain gradient data of the current candidate parameter;
[0144] Calculating the gradient of the previous target weight based on the loss value to obtain gradient data of the previous target weight;
[0145] Using the gradient data of the current candidate parameters, adjusting the current candidate parameters corresponding to the current local model to determine the current target parameters of the current local model;
[0146] The gradient data of the previous target weight is adjusted using the gradient data and hyperparameters of the previous target weight to determine the current target weight of the current local model.
[0147] In some embodiments of the present disclosure, the previous target parameter of the target wind and solar power station is a parameter ciphertext encrypted using a first public key, and the previous target parameter of the reference wind and solar power station is a parameter ciphertext encrypted using a second public key; the current shared parameter is obtained by the server performing homomorphic addition on the parameter ciphertext of the target wind and solar power station and the parameter ciphertext of the reference wind and solar power station and then averaging them.
[0148] In some embodiments of the present disclosure, the first determining module 420 includes:
[0149] a fourth determining unit, configured to decrypt the current shared parameter using the first private key, and determine a parameter plaintext corresponding to the current shared parameter;
[0150] The fifth determining unit is configured to determine the current candidate parameters of the target wind / solar power station according to the parameter plaintext corresponding to the current shared parameter, the previous target parameter of the target wind / solar power station, and the previous target weight of the target wind / solar power station.
[0151] In some embodiments of the present disclosure, the transmission module 440 includes:
[0152] an encryption unit, configured to encrypt the current target parameters of the current local model of the target wind / solar power station using a third public key to obtain current encrypted parameters;
[0153] The first transmission unit is used to transmit the current encryption parameters of the current local model of the target wind and solar power station to the server end, so that the server end homomorphically adds the current encryption parameters of the current local model of the target wind and solar power station and the current encryption parameters of the current local model of the reference wind and solar power station and then averages them to determine the next shared parameters of the next shared model of the next training round.
[0154] It should be noted that Figure 4 The training device 400 of the wind and solar power prediction model shown can be executed Figures 1-3 The various steps in the method embodiment shown are implemented Figures 1-3 The various processes and effects in the illustrated method embodiment are not described in detail here.
[0155] The embodiment of the present disclosure also provides a training system for a wind power prediction model for implementing the training method of the wind power prediction model. Figure 5 In the embodiment of the present disclosure, the training system of the wind-solar power prediction model includes: a first client 510 of a target wind-solar power station, a second client 520 of a reference wind-solar power station, and a server 530; the first client 510 is configured to perform the following steps:
[0156] Obtaining current shared parameters of the current shared model in the current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind / solar power station and the previous target parameters of the reference wind / solar power station in the previous training round;
[0157] Determining current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station;
[0158] Using the first training sample of the target wind / solar power station, adjusting the current candidate parameters corresponding to the current local model of the target wind / solar power station, and determining the current target parameters and the current target weight of the current local model of the target wind / solar power station;
[0159] transmitting the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station;
[0160] The current training round is updated, and model training is continued based on the next common parameters until the target local model of the target wind and solar power station obtained through training meets the preset convergence conditions, and the target local model is used as the wind and solar power prediction model of the target wind and solar power station.
[0161] A training system for a wind-solar power prediction model according to an embodiment of the present disclosure includes a first client of a target wind-solar power station, a second client of a reference wind-solar power station, and a server; the first client is used to execute the following method: obtaining current shared parameters of a current shared model in a current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind-solar power station and the previous target parameters of the reference wind-solar power station in the previous training round; determining the current candidate parameters of the target wind-solar power station based on the current shared parameters, the previous target parameters of the target wind-solar power station, and the previous target weight of the target wind-solar power station; adjusting the target wind-solar power station using the first training sample of the target wind-solar power station The current candidate parameters corresponding to the current local model of the wind and solar power station are used to determine the current target parameters and current target weights of the current local model of the target wind and solar power station; the current target parameters of the current local model of the target wind and solar power station are transmitted to the server, so that the server determines the next shared parameters of the next shared model of the next training round based on the current target parameters of the current local model of the target wind and solar power station and the current target parameters of the current local model of the reference wind and solar power station; the current training round is updated, and model training is continued based on the next shared parameters until the target local model of the target wind and solar power station obtained by training meets the preset convergence conditions, and the target local model is used as the wind and solar power prediction model of the target wind and solar power station. Thus, each client adaptively determines the local parameters and weights to start the next round of training based on the shared parameters of the shared model sent by the server, the local parameters determined in the previous training round, the weights determined in the previous training round, and the local training data, so that each client retains its own data characteristics while also taking into account the data characteristics of other clients. In this way, not only the adaptability to the local wind and solar data of the client is improved, but also the different characteristics of wind and solar data of different clients can be effectively processed, thereby improving the generalization ability of the wind and solar power prediction model and ultimately improving the prediction accuracy of the power generation of wind and solar power stations.
[0162] The following is an embodiment of a computer-readable storage medium provided in an embodiment of the present disclosure. The computer-readable storage medium and the training method of the wind and solar power prediction model of the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the computer-readable storage medium, please refer to the embodiment of the training method of the wind and solar power prediction model.
[0163] This embodiment provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform a training method for a wind / solar power prediction model. The method is applied to a first client and includes:
[0164] Obtaining current shared parameters of the current shared model in the current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind / solar power station and the previous target parameters of the reference wind / solar power station in the previous training round;
[0165] Determining current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station;
[0166] Using the first training sample of the target wind / solar power station, adjusting the current candidate parameters corresponding to the current local model of the target wind / solar power station, and determining the current target parameters and the current target weight of the current local model of the target wind / solar power station;
[0167] transmitting the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station;
[0168] The current training round is updated, and model training is continued based on the next common parameters until the target local model of the target wind and solar power station obtained through training meets the preset convergence conditions, and the target local model is used as the wind and solar power prediction model of the target wind and solar power station.
[0169] Of course, the storage medium containing computer-executable instructions provided in the embodiment of the present disclosure is not limited to the above method operations, and its computer-executable instructions can also execute related operations of the training method of the wind and solar power prediction model provided in any embodiment of the present disclosure.
[0170] Through the above description of the implementation methods, those skilled in the art can clearly understand that the present disclosure can be implemented with the help of software and necessary general-purpose hardware. Of course, it can also be implemented through hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the existing technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., and includes a number of instructions for enabling a computer cloud platform (which can be a personal computer, server, or network cloud platform, etc.) to execute the training method of the wind and solar power prediction model provided by each embodiment of the present disclosure.
[0171] Note that the above are only preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will understand that the present disclosure is not limited to the specific embodiments herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present disclosure. Therefore, although the present disclosure has been described in more detail through the above embodiments, the present disclosure is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present disclosure, and the scope of the present disclosure is determined by the scope of the appended claims.
Claims
1. A training method for a wind and solar power prediction model, characterized in that: Applied to a first client of a target wind / solar power station, the method includes: Obtaining current shared parameters of the current shared model in the current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind / solar power station and the previous target parameters of the reference wind / solar power station in the previous training round; Determining current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station; Using the first training sample of the target wind / solar power station, adjusting the current candidate parameters corresponding to the current local model of the target wind / solar power station, and determining the current target parameters and the current target weight of the current local model of the target wind / solar power station; transmitting the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station; Updating the current training round and continuing model training based on the next common parameters until the target local model of the target wind-solar power station obtained through training meets a preset convergence condition, and using the target local model as the wind-solar power prediction model of the target wind-solar power station; The determining, based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station, current candidate parameters of the target wind / solar power station includes: Calculating a first difference between the current common parameter and a previous target parameter of the target wind / solar power station; multiplying the first difference by the previous target weight of the target wind-solar power station to obtain a first product; Adding the first product to the previous target parameter of the target wind-solar power station to obtain current candidate parameters of the target wind-solar power station; The using the first training sample of the target wind / solar power station to adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station to determine the current target parameters and the current target weight of the current local model of the target wind / solar power station includes: Inputting the historical wind and solar data in the first training sample into the current local model corresponding to the current candidate parameter to obtain the predicted power generation power of the target wind and solar power station; Determining a loss value of a current local model corresponding to the current candidate parameter based on the predicted power generation and the actual power generation of the target wind and solar power station; According to the loss value, the current candidate parameters corresponding to the current local model of the target wind / solar power station are adjusted to obtain the current target parameters and the current target weight of the current local model of the target wind / solar power station.
2. The method according to claim 1, characterized in that The step of adjusting the current candidate parameters corresponding to the current local model of the target wind / solar power station according to the loss value to obtain the current target parameters and the current target weight of the current local model of the target wind / solar power station includes: Calculating the gradient of the current candidate parameter based on the loss value to obtain gradient data of the current candidate parameter; Calculating the gradient of the previous target weight based on the loss value to obtain gradient data of the previous target weight; Using the gradient data of the current candidate parameters, adjusting the current candidate parameters corresponding to the current local model to determine the current target parameters of the current local model; The gradient data of the previous target weight is adjusted using the gradient data and hyperparameters of the previous target weight to determine the current target weight of the current local model.
3. The method according to claim 1, characterized in that The previous target parameter of the target wind and solar power station is a parameter ciphertext encrypted using the first public key, and the previous target parameter of the reference wind and solar power station is a parameter ciphertext encrypted using the second public key; the current shared parameter is obtained by the server end by homomorphically adding the parameter ciphertext of the target wind and solar power station and the parameter ciphertext of the reference wind and solar power station and then averaging them.
4. The method according to claim 3, characterized in that The determining, based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station, current candidate parameters of the target wind / solar power station includes: Decrypting the current shared parameter using the first private key to determine a parameter plaintext corresponding to the current shared parameter; The current candidate parameters of the target wind / solar power station are determined according to the parameter plaintext corresponding to the current shared parameter, the previous target parameter of the target wind / solar power station, and the previous target weight of the target wind / solar power station.
5. The method according to claim 3, characterized in that The transmitting the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station, includes: Using the third public key, encrypting the current target parameters of the current local model of the target wind and solar power station to obtain current encrypted parameters; The current encryption parameters of the current local model of the target wind and solar power station are transmitted to the server, so that the server performs homomorphic addition and average on the current encryption parameters of the current local model of the target wind and solar power station and the current encryption parameters of the current local model of the reference wind and solar power station to determine the next shared parameters of the next shared model of the next training round.
6. The method according to claim 1, characterized in that The current target parameters of the current local model of the reference wind-solar power station are determined by adjusting the previous common model corresponding to the previous common parameters based on the second training data of the reference wind-solar power station; or, The current target parameters of the current local model of the reference wind and solar power station are determined after adjusting the previous local model corresponding to the current candidate parameters of the reference wind and solar power station based on the second training data of the reference wind and solar power station, wherein the current candidate parameters of the reference wind and solar power station are determined based on the current shared parameters of the current shared model of the current training round, the previous target parameters of the reference wind and solar power station, and the previous target weight of the reference wind and solar power station.
7. A training device for a wind and solar power prediction model, characterized in that: A first client device configured at a target wind / solar power station includes: A first acquisition module is configured to acquire current shared parameters of a current shared model in a current training round, wherein the current shared parameters are determined by the server based on previous target parameters of the target wind / solar power station and previous target parameters of a reference wind / solar power station in a previous training round; A first determination module is configured to determine current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station; A second determination module is configured to adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station by using the first training sample of the target wind / solar power station, and determine the current target parameters and current target weight of the current local model of the target wind / solar power station; a transmission module, configured to transmit the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station; A first training module is configured to update the current training round and continue model training based on the next common parameters until a target local model of the target wind and solar power station obtained through training meets a preset convergence condition, and use the target local model as a wind and solar power prediction model for the target wind and solar power station; The first determining module includes: A first calculation unit, configured to calculate a first difference between the current common parameter and a previous target parameter of the target wind / solar power station; A first acquiring unit is configured to multiply the first difference by a previous target weight of the target wind / solar power station to obtain a first product; a second acquiring unit, configured to add the first product to the previous target parameter of the target wind / solar power station to obtain a current candidate parameter of the target wind / solar power station; The second determining module includes: A first determining unit is configured to input the historical wind and solar data in the first training sample into a current local model corresponding to the current candidate parameter to obtain a predicted generated power of the target wind and solar power station; A second determining unit is configured to determine a loss value of a current local model corresponding to the current candidate parameter based on the predicted power generation power and the actual power generation power of the target wind and solar power station; The third determining unit is configured to adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station according to the loss value, and obtain the current target parameters and current target weight of the current local model of the target wind / solar power station.
8. A training system for a wind and solar power prediction model, characterized in that: include: A first client of a target wind-solar power station, a second client of a reference wind-solar power station, and a server; the first client is configured to perform the following steps: Obtaining current shared parameters of the current shared model in the current training round, wherein the current shared parameters are determined by the server based on the previous target parameters of the target wind / solar power station and the previous target parameters of the reference wind / solar power station in the previous training round; Determining current candidate parameters of the target wind / solar power station based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station; Using the first training sample of the target wind / solar power station, adjusting the current candidate parameters corresponding to the current local model of the target wind / solar power station, and determining the current target parameters and the current target weight of the current local model of the target wind / solar power station; transmitting the current target parameters of the current local model of the target wind / solar power station to the server, so that the server determines the next common parameters of the next common model of the next training round based on the current target parameters of the current local model of the target wind / solar power station and the current target parameters of the current local model of the reference wind / solar power station; Updating the current training round and continuing model training based on the next common parameters until the target local model of the target wind-solar power station obtained through training meets a preset convergence condition, and using the target local model as the wind-solar power prediction model of the target wind-solar power station; The determining, based on the current shared parameters, the previous target parameters of the target wind / solar power station, and the previous target weight of the target wind / solar power station, current candidate parameters of the target wind / solar power station includes: Calculating a first difference between the current common parameter and a previous target parameter of the target wind / solar power station; multiplying the first difference by the previous target weight of the target wind-solar power station to obtain a first product; Adding the first product to the previous target parameter of the target wind-solar power station to obtain current candidate parameters of the target wind-solar power station; The using the first training sample of the target wind / solar power station to adjust the current candidate parameters corresponding to the current local model of the target wind / solar power station to determine the current target parameters and the current target weight of the current local model of the target wind / solar power station includes: Inputting the historical wind and solar data in the first training sample into the current local model corresponding to the current candidate parameter to obtain the predicted power generation power of the target wind and solar power station; Determining a loss value of a current local model corresponding to the current candidate parameter based on the predicted power generation and the actual power generation of the target wind and solar power station; According to the loss value, the current candidate parameters corresponding to the current local model of the target wind / solar power station are adjusted to obtain the current target parameters and the current target weight of the current local model of the target wind / solar power station.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Federal learning method and field generalization federal system
CN115456200A
Photovoltaic power generation combination prediction method and device based on federated learning, and electronic equipment
CN115983460A