Short-term photovoltaic power generation prediction method and system based on deep learning and federated learning

By combining deep learning and federated learning with the MAS algorithm and PCC algorithm, the challenges of the photovoltaic power generation prediction model in data privacy and catastrophic forgetting are solved, the prediction accuracy and accuracy are improved, and efficient data processing and processing of the photovoltaic power generation prediction model are achieved. Security.

CN118798677APending Publication Date: 2024-10-18JIANGSU HOPERUN SOFTWARE CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410880025.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing photovoltaic power generation prediction models have challenges in data privacy protection and model catastrophic forgetting, resulting in insufficient prediction accuracy.

Method used

Using the federated learning method based on deep learning, combined with the Memory Aware Synapses (MAS) algorithm and the PCC algorithm, model training and parameter importance calculation are performed through the LSTM neural network to avoid excessive update of model parameters, improve prediction accuracy, and filter through features and data preprocessing to improve model performance.

Benefits of technology

It effectively avoids the catastrophic forgetting phenomenon of the model, ensures data privacy, and improves the overall prediction accuracy and accuracy of the photovoltaic power generation prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118798677A_ABST
    Figure CN118798677A_ABST
Patent Text Reader

Abstract

The invention discloses a short-term photovoltaic power generation prediction method and system based on deep learning and federated learning, and the method comprises the steps: collecting historical photovoltaic power generation associated data of each photovoltaic station as feature data, and correspondingly generating a training data set of each photovoltaic station; adopting the constructed LSTM neural network as a photovoltaic power generation prediction model of each photovoltaic station; performing model joint training on each photovoltaic power generation prediction model by adopting a federated learning algorithm introduced with an MAS algorithm to obtain each trained photovoltaic power generation prediction model; and utilizing the trained photovoltaic power generation prediction model of each photovoltaic station to predict the photovoltaic power generation capacity of the corresponding photovoltaic station. According to the invention, the data security of the photovoltaic power generation prediction model of each photovoltaic station can be guaranteed, and the prediction precision of the photovoltaic power generation prediction model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0002] The present application relates to the technical field of photovoltaic power generation prediction, and specifically to a federated learning short-term photovoltaic power generation prediction method and system based on deep learning. Background Art

[0003] With the continuous deepening of power system reform, large-scale photovoltaic power generation systems have begun to be connected to the main power grid. While optimizing resource allocation and increasing the proportion of clean energy, it has also increased the difficulty of system optimization and scheduling. Photovoltaic power generation forecasting, as an important basis for power system scheduling, plays an important role.

[0004] Considering the establishment of some new photovoltaic sites, the relevant historical power generation data and meteorological data are less accumulated, which is very unfavorable for modeling using machine learning algorithms; in addition, due to the need for data privacy, the relevant photovoltaic sites cannot upload their internal data to participate in the centralized model training. In response to the above problems, after a lot of work by relevant personnel, the Federated Learning (FL) algorithm was introduced to solve the problem of less data volume of relevant sites and data privacy of different data suppliers; in the traditional FL framework, each distributed client completes the corresponding model training based on internal data and uploads the model parameters to the server, so as to finally obtain a global prediction model suitable for all clients. However, this method ignores the data differences between different clients when training the model on each client, and will produce catastrophic forgetting when aggregating the model parameters of each client; on the other hand, when the server aggregates the model parameters of different clients, it currently mainly uses the FedAvg algorithm for aggregation calculation. This method of directly taking the average ignores the differences between the data suppliers, which limits the fitting accuracy of the aggregation model to a certain extent.

[0005] Therefore, how to ensure that data privacy is not leaked and catastrophic model forgetting occurs when client model parameters are integrated, and how to improve the overall prediction accuracy of the model to a certain extent is a problem to be solved. Summary of the invention

[0006] In order to ensure the data security of the photovoltaic power generation prediction model of each photovoltaic site, avoid catastrophic forgetting of the model, and improve the prediction accuracy of the photovoltaic power generation prediction model, the present application provides a federated learning short-term photovoltaic power generation prediction method and system based on deep learning.

[0007] In a first aspect, the present application provides a federated learning short-term photovoltaic power generation prediction method based on deep learning, comprising: collecting historical photovoltaic power generation related data of each photovoltaic site as feature data, and correspondingly generating a training data set for each photovoltaic site; the photovoltaic power generation related data comprises: meteorological data, date data, photovoltaic power generation data; The constructed LSTM neural network is used as the photovoltaic power generation prediction model; The federated learning algorithm that introduces the MAS algorithm is used to perform joint model training on the photovoltaic power generation prediction models of each photovoltaic station to obtain the trained photovoltaic power generation prediction models; the joint model training process includes: Initialize the parameters of the photovoltaic power generation prediction model in the central server, download the photovoltaic power generation prediction model with initialized parameters as the photovoltaic power generation prediction model of each photovoltaic station; use the training data set of each photovoltaic station to train the photovoltaic power generation prediction model of each photovoltaic station and upload the model parameters to the central server after the training is completed; use the central server to aggregate the model parameters of each uploaded photovoltaic power generation prediction model and send the aggregated model parameters; based on the MAS algorithm, according to the aggregated model parameters sent to each photovoltaic station and the training data set of each photovoltaic station, continue to train the photovoltaic power generation prediction model of each photovoltaic station according to the model sorting, and after all the photovoltaic power generation prediction models are trained, repeat the model parameter uploading, model parameter aggregation and model training according to the model sorting until the prediction accuracy of the photovoltaic power generation prediction model in the central server meets the preset prediction accuracy, and obtain the trained photovoltaic power generation prediction models; when continuing the model training according to the model sorting, a regularization term generated according to the importance of each model parameter in the photovoltaic power generation prediction model of the previous order is added to the loss function of each photovoltaic power generation prediction model; the model sorting is randomly generated based on the photovoltaic power generation prediction models of all photovoltaic stations; The trained photovoltaic power generation prediction model of each photovoltaic station is used to predict the photovoltaic power generation of the corresponding photovoltaic station.

[0008] By adopting the above solution, federated learning combined with the Memory Aware Synapses algorithm is introduced to calculate the importance of model parameters in the photovoltaic power generation prediction model corresponding to each photovoltaic site, and a regular term is generated and added to the loss function. When encountering new data during the model training process, the update range of important parameters is limited, thereby avoiding catastrophic forgetting of the model when the photovoltaic power generation prediction model parameters are integrated, ensuring that the global model parameters are suitable for each photovoltaic site, and improving the overall prediction accuracy of the model.

[0009] Preferably, it also includes: The PCC algorithm is used to calculate the correlation between each feature data in the training data set of each photovoltaic station and the photovoltaic power generation data to be predicted, and the feature data in the training data set whose correlation value with the photovoltaic power generation data to be predicted is greater than a preset value is screened and retained; the correlation calculation formula is: In the formula, ρ represents the correlation value; x iRepresents the i-th type of feature data; represents the average value corresponding to the i-th type of feature data; y i Indicates the photovoltaic power generation data to be predicted; Represents the average value corresponding to the photovoltaic power generation data to be predicted.

[0010] By adopting the above scheme, the PCC algorithm is used to calculate the correlation between each feature data and the photovoltaic power generation data to be predicted, and the data features with greater correlation are selected to construct the feature vector of photovoltaic power generation prediction, thereby improving the accuracy of photovoltaic power generation prediction.

[0011] Preferably, the constructed LSTM neural network includes an input layer, an LSTM layer, a fully connected layer and an output layer, the LSTM layer is p layers, the time series length is q, and p and q are both hyperparameters.

[0012] By adopting the above solution, on the one hand, considering the advantages of LSTM in processing time series data, the time series length and number of layers are set to complete the time series-based model prediction. On the other hand, considering the processing of multiple feature data, a fully connected layer is established to obtain the photovoltaic power generation prediction results.

[0013] Preferably, the aggregating the model parameters of each uploaded photovoltaic power generation prediction model by using the central server includes: The prediction accuracy of the photovoltaic power generation prediction model of each photovoltaic station after training is calculated and uploaded to the central server. The prediction accuracy of the photovoltaic power generation prediction model of each photovoltaic station uploaded is calculated by the central server to obtain the weight coefficient of each photovoltaic power generation prediction model parameter. The calculation formula includes: In the formula, α n Represents the weight coefficient of each photovoltaic power generation prediction model parameter; e n represents the prediction error of the photovoltaic power generation prediction model of each photovoltaic station; e n =p(G n (x i )≠y i ), G n () is the photovoltaic power generation prediction model of the corresponding photovoltaic station, and p() is the error calculation function of the photovoltaic power generation prediction model of the corresponding photovoltaic station; The model parameters are aggregated according to the calculated weight coefficients of the parameters of each photovoltaic power generation prediction model to update the network weight of the central server. The formula is: Where M is the number of photovoltaic stations.

[0014] By adopting the above scheme, when the model parameters of the photovoltaic power generation prediction models corresponding to each photovoltaic site are integrated and uploaded by the central server, the prediction accuracy of the photovoltaic power generation prediction models corresponding to each photovoltaic site is considered, and the model parameters are weightedly integrated in combination with the prediction accuracy, thereby increasing the proportion of photovoltaic power generation prediction models corresponding to photovoltaic sites with high accuracy, and improving the overall prediction accuracy of the model to a certain extent.

[0015] Preferably, the specific calculation formula of the loss function of each photovoltaic power generation prediction model during the training process is: Where L(θ) represents the loss function of the photovoltaic power generation prediction model after adding the regularization term; L n (θ) represents the loss function of the photovoltaic power generation prediction model; represents the regularization term added to each photovoltaic power generation prediction model; λ represents the regularization term hyperparameter; Ω ij Indicates the importance of each model parameter in the photovoltaic power generation prediction model; θ ij represents each photovoltaic power generation prediction model parameter; is the aggregated model parameter sent by the central server; where Ω ij The calculation formula includes: Where N represents the number of samples in the training data set corresponding to each photovoltaic station; k represents the kth sample in the training data set corresponding to each photovoltaic station; g ij (x k ) represents the partial derivative of the photovoltaic power generation prediction model for each sample data in the corresponding training data set; x k Represents the sample data of the training data set corresponding to each photovoltaic station.

[0016] By adopting the above scheme, by calculating the importance of each parameter of the previous sequential photovoltaic power generation model, it is possible to avoid a huge change in the importance parameters when training the next sequential photovoltaic power generation model. This ensures that the model fully fits the photovoltaic power generation model data corresponding to the current photovoltaic site, while avoiding the forgetting of the important parameters of the photovoltaic power generation models corresponding to other photovoltaic sites.

[0017] Preferably, the collecting of historical photovoltaic power generation related data of each photovoltaic station as characteristic data includes: Perform data preprocessing on the historical photovoltaic power generation-related data collected from each photovoltaic station, including deletion of abnormal data and data compensation; One-hot encoding is performed on the historical photovoltaic power generation related data of each photovoltaic station after data preprocessing; The historical photovoltaic power generation related data of each photovoltaic site that has completed the encoding process is normalized, and the historical photovoltaic power generation related data of each photovoltaic site after the normalization process is used as feature data.

[0018] By adopting the above scheme, abnormal data processing and compensation, discrete data encoding and normalization processing are carried out, and training feature data is optimized to provide a better data foundation for model training.

[0019] Preferably, the meteorological data includes temperature, irradiance, air pressure, wind speed, wind direction, and rainfall; The date data includes: month, date and time; the power generation data includes: power generation data at the same time on different dates.

[0020] By adopting the above scheme, the characteristic data can be fully and comprehensively acquired from multiple angles so as to better predict the photovoltaic power generation.

[0021] In a second aspect, the present application provides a short-term photovoltaic power generation prediction system based on deep learning and federated learning, comprising: The photovoltaic power generation training data acquisition module is used to collect the historical photovoltaic power generation related data of each photovoltaic station as feature data, and generate a training data set for each photovoltaic station accordingly; the historical photovoltaic power generation related data includes: meteorological data, date data, photovoltaic power generation data; Photovoltaic power generation prediction model construction module, used to use the constructed LSTM neural network as a photovoltaic power generation prediction model; The photovoltaic power generation prediction model training module is used to use the federated learning algorithm that introduces the MAS algorithm to perform model joint training on the photovoltaic power generation prediction model of each photovoltaic site to obtain the trained photovoltaic power generation prediction model; the model joint training process includes: initializing the parameters of the photovoltaic power generation prediction model in the central server, downloading the photovoltaic power generation prediction model with initialized parameters as the photovoltaic power generation prediction model of each photovoltaic site; using the training data set of each photovoltaic site to perform model training on the photovoltaic power generation prediction model of each photovoltaic site and uploading the model parameters to the central server after the training is completed; using the central server to aggregate the model parameters of each uploaded photovoltaic power generation prediction model and send down the aggregated model parameters; based on the MAS algorithm Based on the aggregated model parameters sent to each photovoltaic station and the training data set of each photovoltaic station, the photovoltaic power generation prediction model of each photovoltaic station is continuously trained by model sorting, and after the training of all photovoltaic power generation prediction models is completed, the model parameter uploading, model parameter aggregation and model training by model sorting are repeated until the prediction accuracy of the photovoltaic power generation prediction model in the central server meets the preset prediction accuracy, and the trained photovoltaic power generation prediction models are obtained; when continuing the model training by model sorting, a regularization term generated according to the importance of each model parameter in the photovoltaic power generation prediction model of the previous order is added to the loss function of each photovoltaic power generation prediction model; the model sorting is randomly generated based on the photovoltaic power generation prediction models of all photovoltaic stations; The photovoltaic power generation prediction model application module is used to use the trained photovoltaic power generation prediction model of each photovoltaic site to predict the photovoltaic power generation of the corresponding photovoltaic site.

[0022] By adopting the above solution, it is possible to avoid data privacy leakage and catastrophic model forgetting when model parameters are integrated, thereby improving the overall prediction accuracy of the model.

[0023] In a third aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method as described above.

[0024] In a fourth aspect, the present application provides a computer device, comprising a memory, a processor, and a program stored and executable on the memory, wherein the program implements the steps of the above method when executed by the processor.

[0025] In summary, this application has the following beneficial effects: 1. Compared with traditional federated learning, the MAS algorithm is introduced. When updating and training the photovoltaic power generation model parameters corresponding to the photovoltaic station according to the order of the aggregated model parameters issued, the parameter importance of the previous order model is calculated to generate the regular term for the parameter update restriction of the next order model, so as to avoid the huge changes in the importance parameters when facing the arrival of new data training, and avoid the problem of catastrophic forgetting; 2. Compared with traditional federated learning, this method takes into account the data differences of various photovoltaic sites, uses the prediction accuracy of each photovoltaic power generation model as the basis for updating the global model parameter weights, and improves the prediction accuracy of the final model; 3. Design an LSTM neural network with a fully connected layer as the basic prediction model, give full play to the prediction advantages of LSTM time series data, and combine the construction of feature data with strong correlation of training data to achieve the construction and generation of photovoltaic power generation prediction model with better prediction effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a flowchart of the short-term photovoltaic power generation prediction method based on deep learning and federated learning described in a specific embodiment; Figure 2 It is a schematic diagram of a photovoltaic power generation model in a short-term photovoltaic power generation prediction method based on deep learning and federated learning described in a specific embodiment; Figure 3 It is a schematic diagram of a federated learning framework in a short-term photovoltaic power generation prediction method based on deep learning and federated learning described in a specific embodiment; Figure 4 It is a schematic diagram of the calculation of important parameters of the photovoltaic power generation model and the parameter update restriction in the short-term photovoltaic power generation prediction method based on deep learning and federated learning described in the specific embodiment; Figure 5 It is a structural schematic diagram of the short-term photovoltaic power generation prediction system based on deep learning and federated learning described in a specific embodiment. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0028] like Figure 1 As shown, the embodiment of the present application discloses a short-term photovoltaic power generation prediction method based on deep learning and federated learning, and the specific steps are as follows: S1. Collect historical photovoltaic power generation related data of each photovoltaic station and construct corresponding training data sets for each photovoltaic station.

[0029] Specifically, the photovoltaic power generation related data of each photovoltaic site include: meteorological data (such as temperature, irradiance, air pressure, wind speed, wind direction, rainfall, other weather conditions, etc.), date data (such as year, month, date and time, etc.), power generation data (such as power generation data at the same time in different years, months or dates).

[0030] The collected historical photovoltaic power generation related data can be directly processed as feature data, and the training data set of each photovoltaic station with the feature data as sample data can be constructed accordingly. The processing process includes: data preprocessing of the collected historical photovoltaic power generation related data of each photovoltaic station, including abnormal data deletion (such as: singular points, outliers in the original data, etc.) and data compensation (such as: filling the power generation data of the photovoltaic station according to the average value; for meteorological data, it can be filled in combination with the meteorological data corresponding to the previous few days at the same time as the current time; for date data, it can be obtained by time calculation); one-hot encoding is performed on the historical photovoltaic power generation related data of each photovoltaic station after data preprocessing, so as to eliminate the data's own relationship and improve the overall prediction accuracy of the model; the historical photovoltaic power generation related data of each photovoltaic station that has completed the encoding process is normalized, and the historical photovoltaic power generation related data of each photovoltaic station after normalization is used as feature data.

[0031] Or, based on the principle of correlation, feature data with high correlation with photovoltaic power generation data can be selected from a large number of collected data. By screening out the features, the model calculation burden can be reduced and the prediction speed can be improved while ensuring data fitting. Feature values ​​with high correlation can also be obtained in advance, which can also provide a reference for the collection and preservation of subsequent data. Therefore, after selecting the corresponding training data set for each photovoltaic station with feature data as sample data, the training data set for each photovoltaic station is further screened. The screening steps include: The PCC algorithm is used to calculate the correlation between each feature data in the training data set of each photovoltaic station and the photovoltaic power generation data to be predicted, and the feature data in the training data set whose correlation value with the photovoltaic power generation data to be predicted is greater than a preset value is screened and retained; the correlation calculation formula is: In the formula, ρ represents the correlation value, and the value range of ρ is -1 to 1. The larger the |ρ|, the greater the correlation, and |ρ| is 0, which means that the data has no correlation; x i Represents the i-th type of characteristic data, i=1…n, corresponding to temperature, irradiance, air pressure, wind speed, wind direction, rainfall and other weather conditions; represents the average value corresponding to the i-th type of feature data; y i Indicates the photovoltaic power generation data to be predicted; Represents the average value corresponding to the photovoltaic power generation data to be predicted.

[0032] The correlation between each feature and the data of photovoltaic power generation to be predicted is calculated in turn. The historical photovoltaic power generation data at time t can be used as the photovoltaic power generation data to be predicted, and the top n groups of features with the highest correlation are selected as the final feature data [x1, x2, x3, …, x n ].

[0033] S2. Construct a photovoltaic power generation prediction model.

[0034] Specifically, considering the temporal characteristics of photovoltaic power generation data, the photovoltaic power generation prediction algorithm adopts the LSTM neural network model. Figure 2 As shown, the constructed LSTM neural network includes an input layer for inputting feature data, an LSTM layer for forgetting and updating information by introducing gate control (forget gate, input gate, output gate) and cell state, a fully connected layer, and an output layer; wherein, the LSTM layer is p layers, the time series length is q, and p and q are both hyperparameters.

[0035] S3. Use the federated learning algorithm that introduces the MAS algorithm to conduct joint training on the photovoltaic power generation prediction model of each photovoltaic station.

[0036] Specifically, Figure 3 As shown in Figure 2, the joint training process includes: The model parameters of the global photovoltaic power generation prediction model of the central server are initialized, and the model is distributed to each user client (each photovoltaic site) participating in the training. Each user client downloads the photovoltaic power generation prediction model with initialized parameters from the central server, and uses local data (the training data set corresponding to each photovoltaic site) to complete the initial model training of the photovoltaic power generation prediction model of each photovoltaic site.

[0037] After the photovoltaic power generation prediction model of each photovoltaic station is trained, the corresponding model parameters and prediction accuracy are uploaded to the central server. The central server aggregates the model parameters of each trained photovoltaic power generation prediction model uploaded and sends the aggregated model parameters to each user client. The aggregation process includes: The prediction accuracy of the photovoltaic power generation prediction model of each photovoltaic station after training is calculated and uploaded to the central server. The prediction accuracy of the photovoltaic power generation prediction model of each photovoltaic station uploaded is calculated by the central server to obtain the weight coefficient of each photovoltaic power generation prediction model parameter. The calculation formula includes: In the formula, α n Represents the weight coefficient of each photovoltaic power generation prediction model parameter; e nrepresents the prediction error of the photovoltaic power generation prediction model of each photovoltaic station; e n =p(G n (x i )≠y i ), G n () is the photovoltaic power generation prediction model of the corresponding photovoltaic station, and p() is the error calculation function of the photovoltaic power generation prediction model of the corresponding photovoltaic station; The model parameters are aggregated according to the calculated weight coefficients of the parameters of each photovoltaic power generation prediction model to update the network weights of the central server and complete the global model parameter update. The formula is: Where M is the number of photovoltaic stations.

[0038] In order to avoid catastrophic forgetting of neural networks during the learning process, the MAS algorithm is introduced. According to the aggregated model parameters sent to each photovoltaic station and the training data set of each photovoltaic station, the photovoltaic power generation prediction model of each photovoltaic station is trained according to the model sorting; among them, the photovoltaic power generation prediction models of all photovoltaic stations are randomly sorted or sorted from large to small according to the number of sample data in the training data set of each photovoltaic station.

[0039] Specifically, Figure 4 As shown in the figure, if the current model is sorted as model 1 (corresponding to photovoltaic station 1) - model 2 (corresponding to photovoltaic station 2) - ... - model M (corresponding to photovoltaic station M); then the model training is completed in the order of the models based on the aggregated model parameters and the training data sets of the corresponding photovoltaic stations; in each model training process, each model parameter θ of the model needs to be calculated ij The importance of Ω ij , where the importance of each parameter is equivalent to the sensitivity of the parameter to the model output, based on which the calculation formula can be obtained: According to the above, That is, the partial derivative of the model for each data in the data set, and then the degree of parameter importance Ω is obtained ij , expressed as: Where N represents the number of samples in the training data set corresponding to each photovoltaic station; k represents the kth sample in the training data set corresponding to each photovoltaic station; g ij (x k ) represents the partial derivative of the photovoltaic power generation prediction model for each sample data in the corresponding training data set; x kRepresents the sample data of the training data set corresponding to each photovoltaic station.

[0040] According to the importance of each parameter of each model, when the next model is trained, in order to avoid the arrival of new data and cause a huge change in the importance parameters, a regularization term will be added to the original loss function of the next model, thereby limiting the update range of each parameter and completing the training of the current sequential model. Among them, the loss function of the first sequential model is not adjusted, and the regularization term is 0.

[0041] The loss function formula is as follows: Where L(θ) represents the loss function of the photovoltaic power generation prediction model after adding the regularization term; L n (θ) represents the loss function of the photovoltaic power generation prediction model; represents the regularization term added to each photovoltaic power generation prediction model; λ represents the regularization term hyperparameter; Ω ij Indicates the importance of each model parameter in the photovoltaic power generation prediction model; θ ij represents each photovoltaic power generation prediction model parameter; Aggregated model parameters sent by the central server; After the photovoltaic power generation prediction models of all photovoltaic stations are trained, the prediction accuracy of the corresponding global photovoltaic power generation prediction model can be calculated using the training data sets of each photovoltaic station; determine whether the prediction accuracy of the corresponding global photovoltaic power generation prediction model meets the preset prediction accuracy. If so, stop repeating the steps of uploading the model parameters of all photovoltaic stations after training to the central server, aggregating the model parameters using the central server and sending the aggregated model parameters to all photovoltaic stations, and continuing model training according to the model sequence and the sent model parameters and the training data set to obtain the trained photovoltaic power generation prediction models; otherwise, repeat uploading the model parameters of all photovoltaic stations after training to the central server, aggregating the model parameters using the central server and sending the aggregated model parameters to all photovoltaic stations, and continuing model training according to the model sequence and the sent model parameters and the training data set until the preset prediction accuracy is met.

[0042] For example: Model 1 is trained according to the sent aggregated model parameters and the training set of the training data set of photovoltaic station 1, and the importance of each parameter in model 1 is obtained during training; model 2 is trained according to the sent aggregated model parameters and the training set of the training data set of photovoltaic station 2. During the training process, the importance of each parameter in model 1 is used to adjust the loss function of model 2, and the new data in model 2 is limited to cause a huge change in the important parameters of model 1, thereby affecting the aggregated parameters, and the importance of each parameter in model 2 is obtained during training; the training of all models is completed in the same way in order of models.

[0043] S4. Use the trained photovoltaic power generation prediction model of each photovoltaic station to predict the photovoltaic power generation of the corresponding photovoltaic station.

[0044] Specifically, the photovoltaic related data of each photovoltaic station at the current moment is obtained and the feature data is extracted, and the extracted feature data is input into the trained photovoltaic power generation prediction model corresponding to each photovoltaic station to obtain the predicted value of the photovoltaic power generation of the photovoltaic station at the next moment.

[0045] Through the method described in this embodiment, the photovoltaic power generation prediction value of each photovoltaic station can be obtained more accurately and the data security of each photovoltaic station is guaranteed.

[0046] like Figure 5 As shown, the embodiment of the present application discloses a short-term photovoltaic power generation prediction system based on deep learning and federated learning, which specifically includes: Photovoltaic power generation training data acquisition module 101, used to collect historical photovoltaic power generation related data of each photovoltaic site as feature data, and generate a training data set for each photovoltaic site; the historical photovoltaic power generation related data includes: meteorological data, date data, photovoltaic power generation data; A photovoltaic power generation prediction model acquisition module 102 is used to use the constructed LSTM neural network as a photovoltaic power generation prediction model; The photovoltaic power generation prediction model training module 103 is used to use the federated learning algorithm introduced with the MAS algorithm to perform model joint training on the photovoltaic power generation prediction model of each photovoltaic site to obtain each trained photovoltaic power generation prediction model; the model joint training process includes: initializing the parameters of the photovoltaic power generation prediction model in the central server, downloading the photovoltaic power generation prediction model with the initialized parameters as the photovoltaic power generation prediction model of each photovoltaic site; using the training data set of each photovoltaic site to perform model training on the photovoltaic power generation prediction model of each photovoltaic site and uploading the model parameters to the central server after the training is completed; using the central server to aggregate the model parameters of each uploaded photovoltaic power generation prediction model and send down the aggregated model parameters; using the MAS algorithm as Based on the aggregated model parameters sent to each photovoltaic station and the training data set of each photovoltaic station, the photovoltaic power generation prediction model of each photovoltaic station is continuously trained by model sorting, and after the training of all photovoltaic power generation prediction models is completed, the model parameter uploading, model parameter aggregation and model training by model sorting are repeated until the prediction accuracy of the photovoltaic power generation prediction model in the central server meets the preset prediction accuracy, and the trained photovoltaic power generation prediction models are obtained; when continuing the model training by model sorting, a regularization term generated according to the importance of each model parameter in the photovoltaic power generation prediction model of the previous order is added to the loss function of each photovoltaic power generation prediction model; the model sorting is randomly generated based on the photovoltaic power generation prediction models of all photovoltaic stations; The photovoltaic power generation prediction model application module 104 is used to predict the photovoltaic power generation of the corresponding photovoltaic station using the trained photovoltaic power generation prediction model of each photovoltaic station.

[0047] The photovoltaic power generation prediction model training module 103 is also used in the process of aggregating the model parameters of each photovoltaic power generation prediction model uploaded by the central server, and the weight coefficient of each photovoltaic power generation prediction model parameter is calculated according to the prediction accuracy of the photovoltaic power generation prediction model of each photovoltaic station.

[0048] The embodiment of the present application also discloses a computer-readable storage medium.

[0049] Specifically, the computer-readable storage medium stores a computer program that can be loaded by a processor and execute the short-term photovoltaic power generation prediction method based on deep learning and federated learning as mentioned above. The computer-readable storage medium includes, for example: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0050] The embodiment of the present application also discloses a computer device.

[0051] Specifically, the computer device includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute the above-mentioned short-term photovoltaic power generation prediction method based on deep learning and federated learning.

[0052] The above are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any feature disclosed in this specification (including the abstract and drawings), unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.

Claims

1. A short-term photovoltaic power generation prediction method based on deep learning and federated learning, characterized in that: include: Collect historical photovoltaic power generation related data of each photovoltaic station as feature data, and generate a corresponding training data set for each photovoltaic station; The photovoltaic power generation related data includes: meteorological data, date data, photovoltaic power generation data; The constructed LSTM neural network is used as the photovoltaic power generation prediction model; The federated learning algorithm that introduces the MAS algorithm is used to perform joint model training on the photovoltaic power generation prediction models of each photovoltaic station to obtain the trained photovoltaic power generation prediction models; the joint model training process includes: Initialize the parameters of the photovoltaic power generation prediction model in the central server, download the photovoltaic power generation prediction model with initialized parameters as the photovoltaic power generation prediction model of each photovoltaic station; use the training data set of each photovoltaic station to train the photovoltaic power generation prediction model of each photovoltaic station and upload the model parameters to the central server after the training is completed; use the central server to aggregate the model parameters of each uploaded photovoltaic power generation prediction model and send the aggregated model parameters; based on the MAS algorithm, according to the aggregated model parameters sent to each photovoltaic station and the training data set of each photovoltaic station, continue to train the photovoltaic power generation prediction model of each photovoltaic station according to the model sorting, and after all the photovoltaic power generation prediction models are trained, repeat the model parameter uploading, model parameter aggregation and model training according to the model sorting until the prediction accuracy of the photovoltaic power generation prediction model in the central server meets the preset prediction accuracy, and obtain the trained photovoltaic power generation prediction models; when continuing the model training according to the model sorting, a regularization term generated according to the importance of each model parameter in the photovoltaic power generation prediction model of the previous order is added to the loss function of each photovoltaic power generation prediction model; the model sorting is randomly generated based on the photovoltaic power generation prediction models of all photovoltaic stations; The trained photovoltaic power generation prediction model of each photovoltaic station is used to predict the photovoltaic power generation of the corresponding photovoltaic station.

2. The short-term photovoltaic power generation prediction method based on deep learning and federated learning according to claim 1 is characterized in that: Also includes: The PCC algorithm is used to calculate the correlation between various characteristic data and the photovoltaic power generation data to be predicted, and the characteristic data whose correlation value with the photovoltaic power generation data to be predicted is greater than the preset value is screened and retained; the correlation calculation formula is: In the formula, ρ represents the correlation value; x i Represents the i-th type of feature data; represents the average value corresponding to the i-th type of feature data; y i Indicates the photovoltaic power generation data to be predicted; Represents the average value corresponding to the photovoltaic power generation data to be predicted.

3. The short-term photovoltaic power generation prediction method based on deep learning and federated learning according to claim 1 is characterized in that: The constructed LSTM neural network includes an input layer, an LSTM layer, a fully connected layer and an output layer; the LSTM layer is p layers, the time series length is q, and p and q are both hyperparameters.

4. The short-term photovoltaic power generation prediction method based on deep learning and federated learning according to claim 1 is characterized in that: The method of aggregating the model parameters of each uploaded photovoltaic power generation prediction model by using the central server includes: The prediction accuracy of the photovoltaic power generation prediction model of each photovoltaic station after training is calculated and uploaded to the central server. The prediction accuracy of the photovoltaic power generation prediction model of each photovoltaic station uploaded is calculated by the central server to obtain the weight coefficient of each photovoltaic power generation prediction model parameter. The calculation formula includes: In the formula, α n Represents the weight coefficient of each photovoltaic power generation prediction model parameter; e n represents the prediction error of the photovoltaic power generation prediction model of each photovoltaic station; e n =p(G n (x i )≠y i ), G n () is the photovoltaic power generation prediction model of the corresponding photovoltaic station, and p() is the error calculation function of the photovoltaic power generation prediction model of the corresponding photovoltaic station; The model parameters are aggregated according to the calculated weight coefficients of the parameters of each photovoltaic power generation prediction model to update the network weight of the central server. The formula is: Where M is the number of photovoltaic stations.

5. The short-term photovoltaic power generation prediction method based on deep learning and federated learning according to claim 1 is characterized in that: The specific calculation formula of the loss function of each photovoltaic power generation prediction model in the process of continuing training by model sorting is: Where L(θ) represents the loss function of the photovoltaic power generation prediction model after adding the regularization term; L n (θ) represents the loss function of the photovoltaic power generation prediction model; represents the regularization term added to each photovoltaic power generation prediction model; λ represents the regularization term hyperparameter; Ω ij Indicates the importance of each model parameter in the photovoltaic power generation prediction model; θ ij represents each photovoltaic power generation prediction model parameter; is the aggregated model parameter sent by the central server; where Ω ij The calculation formula includes: Where N represents the number of samples in the training data set corresponding to each photovoltaic station; k represents the kth sample in the training data set corresponding to each photovoltaic station; g ij (x k ) represents the partial derivative of the photovoltaic power generation prediction model for each sample data in the corresponding training data set; x k Represents the sample data of the training data set corresponding to each photovoltaic station.

6. The short-term photovoltaic power generation prediction method based on deep learning and federated learning according to claim 1 is characterized in that: The collecting of historical photovoltaic power generation related data of each photovoltaic station as characteristic data includes: Perform data preprocessing on the historical photovoltaic power generation-related data collected from each photovoltaic station, including deletion of abnormal data and data compensation; One-hot encoding is performed on the historical photovoltaic power generation related data of each photovoltaic station after data preprocessing; The historical photovoltaic power generation related data of each photovoltaic site that has completed the encoding process is normalized, and the historical photovoltaic power generation related data of each photovoltaic site after the normalization process is used as feature data.

7. The short-term photovoltaic power generation prediction method based on deep learning and federated learning according to claim 1 is characterized in that: The meteorological data include temperature, irradiance, air pressure, wind speed, wind direction, and rainfall; The date data includes: month, date and time; the power generation data includes: power generation data at the same time on different dates.

8. A short-term photovoltaic power generation prediction system based on deep learning and federated learning, characterized in that: include: The photovoltaic power generation training data acquisition module is used to collect the historical photovoltaic power generation related data of each photovoltaic station as feature data, and generate a training data set for each photovoltaic station accordingly; the historical photovoltaic power generation related data includes: meteorological data, date data, photovoltaic power generation data; Photovoltaic power generation prediction model acquisition module, used to adopt the constructed LSTM neural network as the photovoltaic power generation prediction model; The photovoltaic power generation prediction model training module is used to use the federated learning algorithm that introduces the MAS algorithm to perform model joint training on the photovoltaic power generation prediction model of each photovoltaic site to obtain the trained photovoltaic power generation prediction model; the model joint training process includes: initializing the parameters of the photovoltaic power generation prediction model in the central server, downloading the photovoltaic power generation prediction model with initialized parameters as the photovoltaic power generation prediction model of each photovoltaic site; using the training data set of each photovoltaic site to perform model training on the photovoltaic power generation prediction model of each photovoltaic site and uploading the model parameters to the central server after the training is completed; using the central server to aggregate the model parameters of each uploaded photovoltaic power generation prediction model and send down the aggregated model parameters; based on the MAS algorithm Based on the aggregated model parameters sent to each photovoltaic station and the training data set of each photovoltaic station, the photovoltaic power generation prediction model of each photovoltaic station is continuously trained by model sorting, and after the training of all photovoltaic power generation prediction models is completed, the model parameter uploading, model parameter aggregation and model training by model sorting are repeated until the prediction accuracy of the photovoltaic power generation prediction model in the central server meets the preset prediction accuracy, and the trained photovoltaic power generation prediction models are obtained; when continuing the model training by model sorting, a regularization term generated according to the importance of each model parameter in the photovoltaic power generation prediction model of the previous order is added to the loss function of each photovoltaic power generation prediction model; the model sorting is randomly generated based on the photovoltaic power generation prediction models of all photovoltaic stations; The photovoltaic power generation prediction model application module is used to use the trained photovoltaic power generation prediction model of each photovoltaic site to predict the photovoltaic power generation of the corresponding photovoltaic site.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.

10. A computer device, characterized in that: The computer device comprises a memory, a processor and a program stored and executable on the memory, and the program implements the steps of the method according to any one of claims 1 to 7 when executed by the processor.

Citation Information

Cited By

  • Training method and device of power demand response prediction model, equipment, storage medium and program product

    CN120013007A

  • Distributed photovoltaic power scheduling method and system based on collaborative learning

    CN122418875A

  • A privacy protection intelligent maintenance of solar energy systems

    GB2704799A