Distributed photovoltaic generating capacity prediction method, system and device and storage medium
By combining LSTM and GRU prediction network models with federated learning and employing a model decoupling method, the problems of privacy risks and inaccurate predictions in distributed photovoltaic power generation systems are solved, achieving the effect of improving prediction accuracy and efficiency while protecting privacy.
Patent Information
- Application Number
- CN202511000920.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-11-11
AI Technical Summary
Existing methods for predicting photovoltaic power generation pose privacy risks and are not accurate enough, especially in distributed systems where centralized data processing leads to privacy leaks and low computational efficiency.
A prediction network model combining Long Short-Term Memory (LSTM) network and Gated Recurrent Unit (GRU) is adopted. Through federated learning and model decoupling, all parties collaborate to train the model. The local parameters are decomposed into two parts: variational encoder and classifier. Only the classifier parameters are uploaded to protect privacy. At the same time, the variational encoder is used to map the data to the probabilistic latent space to hide sensitive information.
This approach improves the accuracy and efficiency of photovoltaic power generation forecasting while protecting data privacy, and avoids the privacy risks associated with centralized data processing.
Smart Images

Figure CN120929905A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of photovoltaic power generation prediction technology, and particularly relates to methods, systems, equipment and storage media for predicting distributed photovoltaic power generation. Background Technology
[0002] With the continued growth in global demand for renewable energy, distributed photovoltaic (PV) power generation, as a clean and sustainable energy form, is gradually becoming an important component of electricity supply. Distributed PV systems are typically installed at the user end or near locations with high electricity demand, such as rooftops, ground surfaces, or building facades, directly converting sunlight into electricity using the photovoltaic effect. This distributed generation model not only reduces reliance on centralized power grids and enhances the flexibility and resilience of the power system, but also helps reduce greenhouse gas emissions and promotes a green transformation of the energy structure.
[0003] However, photovoltaic (PV) power generation is affected by various factors, including but not limited to solar radiation intensity, ambient temperature, wind speed, cloud cover, cleanliness of PV panels, aging of PV modules, and system installation angle and orientation. This results in a high degree of intermittency and uncertainty in PV power generation. This uncertainty poses challenges to the stable operation of the power system, particularly in areas such as grid dispatching, energy storage configuration, demand response, and electricity market trading. Therefore, accurate forecasting of distributed PV power generation is crucial for effectively managing and optimizing the operation of distributed PV power generation systems, improving energy efficiency, and reducing grid operating costs.
[0004] Furthermore, traditional photovoltaic (PV) power generation forecasting methods mostly rely on time series analysis of historical data, statistical models, or physical models, each with its own drawbacks. In recent years, with the rapid development of big data, artificial intelligence, and machine learning technologies, these technologies have provided new possibilities for forecasting distributed PV power generation. By training on large amounts of historical data, these models can learn the complex mapping relationship between PV power generation and various influencing factors, thereby achieving more accurate forecasts. However, traditional machine learning methods used for forecasting typically require processing all training data on a central server or data center. While this method has advantages in computational efficiency and model performance, it poses serious privacy risks. Therefore, developing a method that can both protect data privacy and achieve accurate forecasts is particularly important. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention proposes a method, system, equipment, and storage medium for predicting distributed photovoltaic power generation.
[0006] This invention combines Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs) with model parameter decoupling methods in federated learning. The LSTM plus GRU network is used as the prediction network model. All parties collaboratively train the model using federated learning. Furthermore, model decoupling is utilized to decompose local parameters into two parts, with one part stored locally, thereby enhancing privacy protection. These techniques achieve the goal of accurately predicting power generation while protecting the local data of each distributed photovoltaic power generation system.
[0007] In a first aspect, the present invention proposes a method for predicting distributed photovoltaic power generation, the method comprising:
[0008] The photovoltaic power generation data and meteorological data to be predicted are obtained, and after data preprocessing, they are input into the trained photovoltaic power generation prediction neural network to obtain the prediction results.
[0009] The distributed training process of the photovoltaic power generation prediction neural network includes:
[0010] S1: The central server initializes the global network model and distributes the initial network parameters to each client;
[0011] S2: Each client obtains local historical photovoltaic power generation data and historical meteorological data, and after data preprocessing, obtains a local training sample set;
[0012] S2: Each client uses a variational encoder to map the training sample data to the probability latent space, thus obtaining the latent space representation;
[0013] S4: Each client inputs its own potential space representation into its local prediction network model, captures the time series characteristics of photovoltaic power, and obtains the parameters of its local prediction network model.
[0014] S5: Each client only uploads the predicted network model parameters to the central server. The central server aggregates the predicted network model parameters uploaded by all clients, updates the global network model parameters, and distributes them to each client. Each client combines its local training sample data to perform the next step of network training until the preset training rounds are reached or the global network model converges, at which point training stops.
[0015] Secondly, this invention proposes a distributed photovoltaic power generation prediction system. This prediction system is based on the distributed photovoltaic power generation prediction method described in the first aspect of this invention. It includes at least one data processing center and multiple clients. The data processing center is equipped with a central server. Trained photovoltaic power generation prediction neural networks are deployed on each client and the central server. Each client obtains photovoltaic power generation data and meteorological data to be predicted. After data preprocessing, the data is input into each optimized power generation prediction neural network to obtain prediction results. The prediction results are then transmitted to the data processing center to obtain the final global photovoltaic power generation prediction result.
[0016] Thirdly, the present invention provides an electronic device comprising:
[0017] One or more processors;
[0018] Memory, used to store one or more programs;
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed photovoltaic power generation prediction method as described in the first aspect of the present invention.
[0020] Fourthly, the present invention provides a computer-storable medium having a computer program stored thereon, which, when executed by a processor, implements the method for predicting distributed photovoltaic power generation as described in the first aspect of the present invention.
[0021] The beneficial effects of this invention are:
[0022] 1. This invention deploys a photovoltaic power generation prediction neural network on each client and in the data center. A model decoupling method is used to decompose the parameters of the photovoltaic power generation prediction neural network deployed on each client into variational encoder parameters and classifier parameters (specifically, the prediction network model). During network training, the client uses the variational encoder to map local historical photovoltaic power generation data and historical meteorological data to a probabilistic latent space, effectively hiding sensitive information from the original training sample data and protecting privacy. A reparameterization technique is used to generate a latent space representation, extracting effective features from the data while maintaining the input data dimension unchanged. The client uses the latent space representation to train the prediction network model and uploads the prediction network model parameters to the central server in the data center. The central server aggregates the prediction network model parameters uploaded by all clients, updates the global network model parameters, and distributes them to each client. Each client then combines these with its local training sample data for the next stage of network training. When the client shares the parameters of the prediction network model (or classifier) with the central server, it does not share the variational encoder parameters or the original training sample data, further enhancing privacy protection.
[0023] 2. This invention designs a prediction network model based on a combination of LSTM and GRU networks. By fully utilizing LSTM to capture long-term dependencies and temporal structure in time series data, the model's performance in processing complex sequence data can be improved, thereby increasing the accuracy of photovoltaic power generation prediction results. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of a distributed photovoltaic power generation system and prediction process in an embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram of the overall process of an embodiment of the present invention;
[0026] Figure 3 This is a flowchart of the distributed training steps of the power generation prediction neural network in an embodiment of the present invention;
[0027] Figure 4 This is a schematic diagram of the network structure of the prediction network model in an embodiment of the present invention. Detailed Implementation
[0028] The terms "first," "second," "third," "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application.
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0030] This invention proposes a method for predicting distributed photovoltaic power generation.
[0031] Figure 1 This is a schematic diagram of a distributed photovoltaic power generation system and prediction process in an embodiment of the present invention.
[0032] Reference Figure 1 As shown, the distributed photovoltaic (PV) power generation system includes at least one data center and m clients. The data center houses a central server, and the clients refer to PV power generation systems distributed in different geographical locations. A PV power generation prediction neural network is deployed on each client and the central server, and network parameters can be exchanged between the clients and the central server; specifically, each client transmits its local network parameters W. c,mThe data is transmitted to the central server, which then updates the global network parameter W. c,g Distribute network parameters to each client.
[0033] Figure 2 This is a schematic diagram of the overall process of an embodiment of the present invention. Figure 2 In this embodiment of the invention, the overall process is divided into a network training stage (i.e., the distributed training process of the power generation prediction neural network) and a network actual prediction stage.
[0034] The network training phase includes: the central server initializes the global network model and distributes the initial network parameters to each client; the client receives the initial global model parameters distributed by the central server, prepares local historical photovoltaic power generation data, and inputs the preprocessed data into a personalized variational encoder to obtain the corresponding probability latent space, and optimizes the variational encoder parameters W. enc,m The latent space representation generated by the variational encoder is input into the local prediction network model (specifically, a classifier) for training, resulting in the parameters W of the local prediction network model for each client. c,m (Classifier parameters); Each client only uploads the trained prediction network model parameters (classifier parameters) to the central server, but does not share the parameters of the personalized variational encoder or the local training sample data; the central server aggregates the prediction network model parameters (classifier parameters) uploaded by all clients to obtain the global model parameters W. c,g The server then distributes the updated global model parameters to all clients for use in the next round of training. This training process is repeated multiple times until the model converges, meaning the prediction accuracy reaches the expected level or the loss no longer decreases significantly.
[0035] The actual prediction phase of the network includes: each client loading the final global network model parameters received from the central server, as well as the locally trained personalized variational encoder parameters; each client collecting its own photovoltaic power generation data to be predicted and preprocessing it to obtain the samples to be predicted; inputting the samples to be predicted into the personalized variational encoder, which maps the samples to be predicted into the latent space to generate latent space samples; inputting the latent space samples into the locally trained classifier (i.e., the power generation prediction neural network model) to obtain the classification prediction result (i.e., the predicted future photovoltaic power output); and performing inverse normalization on the prediction result to obtain the overall photovoltaic power generation prediction value of the power generation prediction neural network.
[0036] Reference Figure 1 , 2 As shown, the method for predicting distributed photovoltaic power generation includes:
[0037] The system acquires photovoltaic power generation data and meteorological data to be predicted, preprocesses the data, and then inputs it into an optimized photovoltaic power generation prediction neural network to obtain the prediction results.
[0038] Figure 3 This is a flowchart of the distributed training steps of the photovoltaic power generation prediction neural network in an embodiment of the present invention.
[0039] Reference Figure 3 As shown, the distributed training process of the photovoltaic power generation prediction neural network includes:
[0040] S1: The central server initializes the global network model and distributes the initial network parameters to each client.
[0041] The global network model refers specifically to the initial prediction network model (such as a classifier or LSTM+GRU network). This initial global model has not yet converged and needs to be continuously trained to obtain the final global model.
[0042] S2: Each client obtains local historical photovoltaic power generation data and historical meteorological data, and obtains a local training sample set after data preprocessing.
[0043] Historical photovoltaic power generation data specifically includes: historical actual power generation and total power generation over a period of time.
[0044] Historical meteorological data specifically includes: solar radiation, temperature and humidity, wind speed, precipitation, cloud cover, etc.
[0045] Data preprocessing specifically includes: data cleaning (i.e., removing duplicate data, handling missing values, and handling outliers), data standardization, and feature extraction. After preprocessing, historical photovoltaic power generation data and historical meteorological data are arranged in chronological order to form time series data. Based on the requirements of the LSTM model, the time step is determined, and the time series data is divided into sequences with multiple time steps, thus obtaining the training sample set.
[0046] The training sample set is obtained by preprocessing data collected from various clients and stored locally. Since the clients are located in different geographical locations, the data in each training sample set reflects local characteristics or the influence of local meteorological information on photovoltaic power generation, exhibiting different data properties and variations.
[0047] This invention employs a model decoupling method, decomposing the parameters of the photovoltaic power generation prediction neural network deployed on each client into variational encoder parameters W. enc,m and prediction network model W c,m(Specifically, classifier parameters). The client uses a variational encoder to map local historical photovoltaic power generation data and historical meteorological data to a probabilistic latent space, protecting privacy, and uses reparameterization techniques to generate a latent space representation while keeping the input data dimension unchanged.
[0048] S3: Each client uses a variational encoder to map the training sample data to the probability latent space, thus obtaining the latent space representation.
[0049] The personalized variational encoder is one of the core components of this invention. Its main function is to map the client's private data to a probabilistic latent space. Through this mapping, sensitive information is hidden in the latent space, thereby protecting data privacy. At the same time, the representation of the latent space can preserve the key features of the data, so that subsequent prediction network models (such as classifiers, LSTM-GRU) can be effectively trained.
[0050] Personalized variational encoders typically consist of multiple layers of neural networks, including an input layer, convolutional layers, fully connected layers, reparameterization layers, and an output layer. Their specific structure includes:
[0051] Input layer: Receives raw training sample data from the client (such as photovoltaic power data, light intensity, temperature, etc.).
[0052] Convolutional layer: Extracts spatial features from training sample data.
[0053] Fully connected layer: Further processes the extracted spatial features.
[0054] Reparameterization layer: Generates the mean and standard deviation of the latent space based on the extracted spatial features, which are used to define the Gaussian distribution.
[0055] Output layer: Outputs the latent space representation.
[0056] The core idea of a variational autoencoder (VAE) is to map the input data to a probability distribution (usually a Gaussian distribution) rather than a fixed latent vector. Specifically, a variational encoder outputs two vectors: the mean (μ) and the standard deviation (σ). These two vectors define a Gaussian distribution, and samples in the latent space can be generated as follows:
[0057]
[0058] Where z is a sample in the latent space.
[0059] To maintain differentiability during training, a reparameterization technique is employed:
[0060] z=μ+σ·∈
[0061] Where ∈ is random noise sampled from the standard normal distribution N(0,1).
[0062] Unlike traditional variational encoders, the variational encoder in this embodiment maintains the same dimensionality of the latent space as the input data. This design avoids information loss due to dimensionality reduction while preserving data integrity and key features. Samples from the latent space can be directly used as input to subsequent models (such as LSTM-GRU) without losing important information.
[0063] This invention utilizes a variational encoder to map training data to a probabilistic latent space, effectively hiding sensitive information from the original training sample data. Since the latent space is generated based on a probability distribution, it is very difficult for attackers to reconstruct the original training sample data through reverse engineering. Furthermore, when the client shares the parameters of the prediction network model (or classifier) with the central server, it does not share the parameters of the variational encoder or the original training sample data, further enhancing privacy protection.
[0064] S4: Each client inputs its own potential space representation into its local prediction network model, captures the time series characteristics of photovoltaic power, and obtains the parameters of its local prediction network model.
[0065] Long Short-Term Memory (LSTM) networks are a special type of recurrent neural network (RNN) that effectively captures long-term dependencies in time-series data. LSTM avoids the vanishing gradient problem by introducing gating mechanisms (input gate, forget gate, and output gate) to control the flow of information. Its basic structure is as follows:
[0066] Input gate: controls the degree to which new information enters the cell state.
[0067] Forget Gate: Determines which information should be discarded from the cell state.
[0068] Output gate: determines the degree to which the cell state contributes to the output.
[0069] In the framework of this invention, the input to the prediction network model is the latent space representation generated by the personalized variational encoder, and the personalized variational encoder and the classifier or prediction network model are trained and fine-tuned simultaneously on the client.
[0070] The goal of distributed network training is to minimize the local loss function, which includes data reconstruction loss and model prediction loss.
[0071] Specifically, each client has its own optimized network parameters W, and the objective function f is used. m Train a local model on your own dataset to obtain local parameters W.m In detail, it means minimizing f m Obtain the corresponding W m .
[0072]
[0073] In the formula, W m * This indicates that we are looking for the value of Wm. The superscript * indicates that we are looking for the optimal value of Wm that minimizes the objective function fm. m (X m y m W m Let be the local objective function of the m-th client, which should be minimized to find the optimal model parameters Wm for a given dataset Dm. The training dataset is Dm = (X... m ,y m ), where Xm represents the feature space and ym represents the corresponding label vector. Find the optimal model parameters W. m This minimizes the local objective function, thus completing the local training.
[0074] Figure 4 This is a schematic diagram of the network structure of the prediction network model in an embodiment of the present invention.
[0075] In the illustrated embodiment, reference Figure 3 As shown, the predictive neural network model includes a Long Short-Term Memory (LSTM) network and a gated recurrent unit (GRU). The LSTM network is used to capture the time-series characteristics of photovoltaic power, and the output h of the GRU... t The final predicted value y is obtained through a fully connected layer. t .
[0076] S5: Each client only uploads the predicted network model parameters to the central server. The central server aggregates the predicted network model parameters uploaded by all clients, updates the global network model parameters, and distributes them to each client. Each client combines its local training sample data to perform the next step of network training until the preset training rounds are reached or the global network model converges, at which point training stops.
[0077] Furthermore, the central server aggregates the prediction network model parameters uploaded by all clients through FedAvg.
[0078] It's important to note that Federated Averaging (FedAvg) is an algorithm widely used in federated learning. Federated learning is a distributed machine learning method that allows models to be trained on multiple distributed edge devices or servers (often called clients) without centralizing data in a single location. This approach is particularly suitable for situations requiring protection of user privacy and reduction of data transmission costs.
[0079] The working principle of the federal average algorithm includes:
[0080] Step a: Initialize the network: Initialize a global model on the central server and distribute it to all clients participating in the training.
[0081] Step b, Local Network Training and Update: Each client uses its own local data to train the received global model for several rounds (usually gradient descent) to obtain an updated local model. The key point here is that these training processes are entirely based on local data and do not require sharing data with the outside world.
[0082] Step c, Global Model Parameter Aggregation and Distribution: After completing local training, each client sends its updated model parameters back to the central server. The central server performs a weighted average of all received local models according to certain weights (usually proportional to the amount of data from each client) to generate a new global model, and then distributes the global model parameters to each client for the next training step.
[0083] Step d, Iterative optimization: Repeat steps b and c until a specific stopping condition is met (such as reaching the maximum number of iterations, model performance convergence, etc.).
[0084] This invention divides the model into two distinct components. The first component (called the encoding part) consists of a personalized layer (variational encoder) retained by each client, responsible for feature extraction and transformation into a latent space. The second component is the prediction network model, specifically an FL classifier. The prediction network model can be trained locally on the client using the latent space and then shared with the server for global aggregation. By isolating these two components, the model parameters can be decoupled into two parts, resulting in W at the end of training. m Afterwards, W m It is divided into two components, the first component being used as the personalized variational encoder parameter W. enc,m It is trained locally and saved by the client. The second component serves as the classifier parameter W. c,m It is sent from the client to the central server for aggregation, and then the central server sends the aggregated global classifier parameters W. c,g It is then sent back and distributed to each client.
[0085] The aggregation method is FedAvg, and the aggregation process is as follows:
[0086]
[0087] In the formula, W c,g W represents the parameters of the global classifier. c,m Let M represent the classifier parameters for the m-th client, where M represents the number of clients, and m∈[1,2,…,M].
[0088] Based on the same inventive concept, this invention proposes a distributed photovoltaic power generation prediction system, which is based on the aforementioned distributed photovoltaic power generation prediction method. The distributed photovoltaic power generation prediction method and system have the same or similar technical features, which will not be elaborated further below.
[0089] Reference Figure 1 As shown, the distributed photovoltaic power generation prediction system includes at least one data processing center and m clients. The data processing center is equipped with a central server. The trained photovoltaic power generation prediction neural network is deployed on each client and the central server respectively. Each client obtains the photovoltaic power generation data to be predicted and meteorological data respectively. After data preprocessing, the data is input into each optimized power generation prediction neural network to obtain each prediction result. The prediction results are then transmitted to the data processing center to obtain the final global photovoltaic power generation prediction result.
[0090] This invention provides an electronic device, comprising:
[0091] One or more processors;
[0092] Memory, used to store one or more programs;
[0093] When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed photovoltaic power generation prediction method as described above.
[0094] This invention provides a computer-storable medium storing a computer program that, when executed by a processor, implements the method for predicting distributed photovoltaic power generation as described above.
[0095] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include ROM, RAM, disk, or optical disk, etc.
[0096] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for predicting distributed photovoltaic power generation, characterized in that, The method includes: The photovoltaic power generation data and meteorological data to be predicted are obtained, and after data preprocessing, they are input into the optimized photovoltaic power generation prediction neural network to obtain the prediction results. The distributed training process of the photovoltaic power generation prediction neural network includes: The central server initializes the global network model and distributes the initial network parameters to each client; Each client acquires local historical photovoltaic power generation data and historical meteorological data, and obtains a local training sample set after data preprocessing. Each client uses a variational encoder to map the training sample data to the probability latent space, thus obtaining the latent space representation; Each client inputs its own potential space representation into its local prediction network model, captures the time series characteristics of photovoltaic power, and obtains the parameters of its local prediction network model. Each client only uploads the predicted network model parameters to the central server. The central server aggregates the predicted network model parameters uploaded by all clients, updates the global network model parameters, and distributes them to each client. Each client then uses its local training sample data to perform the next step of network training until the preset number of training rounds is reached or the global network model converges, at which point training stops.
2. The method for predicting distributed photovoltaic power generation according to claim 1, characterized in that, The variational encoder consists of a multi-layer neural network, including an input layer, convolutional layers, fully connected layers, reparameterization layers, and an output layer. The input layer is used to receive the input training sample data; Convolutional layers are used to extract spatial features from training sample data; Fully connected layers are used to further process the extracted spatial features; The reparameterization layer is used to generate the mean and standard deviation of the latent space based on the extracted spatial features, defining a Gaussian distribution; The output layer is used to output the latent space representation.
3. The method for predicting distributed photovoltaic power generation according to claim 1, characterized in that, The prediction network model includes a Long Short-Term Memory (LSTM) network and a Gated Recurrent Unit (GRU). The LSTM network is used to extract long-term dependencies from the training sample data.
4. The method for predicting distributed photovoltaic power generation according to claim 1, characterized in that, The central server aggregates the prediction network model parameters uploaded by all clients through federated averaging.
5. The method for predicting distributed photovoltaic power generation according to claim 4, characterized in that, The polymerization process is as follows: In the formula, W c,g W represents the parameters of the global classifier. c,m Let M represent the classifier parameters for the m-th client, where M represents the number of clients, and m∈[1,2,…,M].
6. A system for predicting distributed photovoltaic power generation, the system being based on the method for predicting distributed photovoltaic power generation as described in claim 1, characterized in that, The prediction system includes at least one data processing center and multiple clients. The data processing center is equipped with a central server. Trained photovoltaic power generation prediction neural networks are deployed on each client and the central server. Each client obtains photovoltaic power generation data and meteorological data to be predicted. After data preprocessing, the data is input into each optimized power generation prediction neural network to obtain prediction results. The prediction results are then transmitted to the data processing center to obtain the final global photovoltaic power generation prediction result.
7. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for predicting distributed photovoltaic power generation as described in any one of claims 1-5.
8. A computer-storable medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the method for predicting distributed photovoltaic power generation as described in any one of claims 1-5.