Photovoltaic power generation power prediction method based on dynamic differential privacy federated learning

By combining dynamic differential privacy federated learning and DDPG network, the privacy budget value and noise injection are dynamically adjusted, which solves the contradiction between privacy protection and model performance in traditional methods and realizes adaptive protection and efficient prediction of photovoltaic power generation.

CN121749153APending Publication Date: 2026-03-27ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-25
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Traditional centralized photovoltaic power generation prediction methods pose a risk of user privacy leakage, and traditional federated learning struggles to balance privacy protection and model prediction performance in photovoltaic power generation prediction.

Method used

A method based on dynamic differential privacy federated learning is adopted, which dynamically adjusts the optimal privacy budget value and noise injection intensity through the DDPG network and combines it with the LSTM network to predict photovoltaic power generation, thereby achieving adaptive privacy protection.

Benefits of technology

While protecting user data privacy, it reduces the negative impact of noise on global prediction accuracy and improves the robustness of distributed photovoltaic power prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121749153A_ABST
    Figure CN121749153A_ABST
Patent Text Reader

Abstract

The invention discloses a photovoltaic power generation power prediction method based on dynamic differential privacy federal learning, which is applied to a global model of a central server and local models of a plurality of local users, and the global model and the local models are subjected to round aggregation; initializing parameters of the global model, and setting a total privacy budget value of each local model; and the parameters of the current global model are issued to all the local models, and each local model is trained by a preset number of iterations to obtain a trained local model of each local model, and the trained local model is called a first local model. According to the photovoltaic power generation power prediction method based on dynamic differential privacy federated learning, a DDPG network is introduced, the optimal privacy budget value and the intensity of noise injection into a local model are dynamically adjusted, and self-adaptive privacy protection is achieved; according to the method, the negative influence of noise on the global prediction precision is effectively reduced while the privacy of user data is guaranteed, and the robustness of distributed photovoltaic power prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of photovoltaic power prediction, and particularly relates to a photovoltaic power prediction method based on dynamic differential privacy federated learning. BACKGROUND

[0002] With the rapid popularization of distributed photovoltaic systems, especially the wide application of post-meter (user side) photovoltaic power generation scenarios, photovoltaic power prediction plays an important role in improving the flexibility of power grids and the level of user energy management. In the post-meter photovoltaic scenario, the power generation equipment is located at the back end of the user's electricity meter, and the data is controlled by the user. It has the characteristics of distribution dispersion, different scales, and high privacy requirements. The traditional centralized prediction method needs to gather user data to the center platform, which not only has the risk of user privacy leakage, but also is difficult to implement due to data isolation and security regulations.

[0003] Federated learning as a distributed collaborative learning framework provides a feasible technical path for post-meter photovoltaic power prediction. This method allows users to train models locally and only upload model updates rather than raw data, thereby realizing cross-user collaborative modeling on the basis of protecting data privacy. However, in photovoltaic power prediction tasks of time series data, traditional federated learning still faces the inherent contradiction between privacy protection strength and model prediction performance. Although differential privacy technology can provide strict mathematical privacy guarantees by adding noise, the traditional fixed budget allocation mechanism often causes a significant decline in model performance. SUMMARY

[0004] The purpose of the present application is to solve the problems raised in the background art, and to provide a photovoltaic power prediction method based on dynamic differential privacy federated learning.

[0005] To achieve the above purpose, the technical solution adopted by the present application is as follows:

[0006] The photovoltaic power prediction method based on dynamic differential privacy federated learning proposed by the present application is applied to a global model of a center server and local models of a plurality of local users. The global model and the local models are trained in a federated manner. Round aggregation:

[0007] S1, initializing the parameters of the global model, and setting the total privacy budget value of each local model;

[0008] S2, the parameters of the current global model are distributed to all local models, each local model is trained for a preset number of iterations, and a trained local model of each local model is obtained, which is called the first local model;

[0009] S3, calculating an optimal privacy budget value of each first local model based on each first local model and the DDPG network, and referred to as a second privacy budget value;

[0010] S4, generating Gaussian noise according to the second privacy budget value, and adding noise to the corresponding first local model, wherein the second privacy budget value is consumed in the process of adding noise, and calculating a first privacy budget value remaining after adding noise;

[0011] S5, aggregating parameters of all first local models after adding noise, and updating parameters of the global model by aggregation, and the parameters of the updated global model are used as parameters of the global model before the next round of aggregation;

[0012] S6, judging whether each first privacy budget value is zero, when at least one is zero, an updated global model is obtained, and when none is zero, entering the next round of aggregation, repeating S2-S6, until at least one first privacy budget value is zero;

[0013] S7, normalizing the user data to be detected as an input of the updated global model, and obtaining photovoltaic power corresponding to the user data to be detected.

[0014] Preferably, the structure of the global model and each local model is: comprising an LSTM network, a linear hidden layer and a linear layer connected in sequence.

[0015] Preferably, when training each local model, user data of each local model corresponding to users at different times is collected to form a data set, and user data at a single time is used as a subset in the data set, and each user data contains features of: year, month, day, time, maximum photovoltaic power, humidity, atmospheric pressure, wind speed, rainfall and net radiation, and humidity, atmospheric pressure, wind speed, rainfall, net radiation and photovoltaic power in the past 24 hours and 48 hours, and each subset corresponds to different features of year, month, day and time;

[0016] All features in each subset are normalized, and the normalized subsets are trained on the corresponding local model.

[0017] Preferably, the calculation process of the optimal privacy budget value of each first local model is:

[0018] Initializing the state of the current time of the DDPG network, and using the state as the input of the Actor network in the DDPG network, obtaining the action of the current time, calculating the reward of the current time according to the reward function, and calculating the state of the next time;

[0019] The current state, current action, current reward, and next state are combined into an experience tuple and stored in a limited-capacity experience replay pool. When the number of experience tuples stored in the experience replay pool exceeds the preset minimum batch size, a small batch of experience tuples is randomly sampled from the experience replay pool at a preset frequency to update the DDPG network parameters. This process is repeated iteratively until a set deadline for iteration is reached. The iteration round with the highest reward value is then selected, and the experience tuples from that iteration round are used to update the DDPG network parameters. Privacy budget ramp-up value for actions at each moment compared to the previous moment The third privacy budget value in the state is added together to obtain The third privacy budget value at time point is taken as the optimal privacy budget value, which is the second privacy budget value. This is the end point of one iteration of the DDPG network, and , This refers to the current aggregation round.

[0020] Preferably, the state of each first local model includes the current time and the privacy budget value at the current time, and the privacy budget value at the current time is called the third privacy budget value. The action is the privacy budget ramp value at the current time, and the third privacy budget value at the next time is the third privacy budget value at the current time plus the privacy budget ramp value at the current time.

[0021] The reward value for each first local model includes: the negative value of the privacy budget cost at the current time, and the penalty for violating the constraints when the third privacy budget value and the total privacy budget value at the current time are both calculated.

[0022] Preferably, the constraints on the third privacy budget value include: the third privacy budget value is greater than zero, and the sum of the third privacy budget values ​​of each first local model at all times in one round of aggregation is less than a preset value.

[0023] Preferably, the step of generating Gaussian noise based on the second privacy budget value, adding noise to the corresponding first local model, wherein the second privacy budget value is consumed during the noise addition process, and calculating the remaining first privacy budget value after noise addition, includes:

[0024] After obtaining the second privacy budget value, the failure probability parameter is set according to the differential privacy theory framework. This parameter is combined with the sensitivity of the query function to changes in a single subset to calculate the scale of the noise distribution, thereby quantifying the intensity of the random perturbation to be introduced. Based on the obtained noise distribution scale, a corresponding Gaussian noise distribution is constructed, and noise is randomly sampled from it. The randomly sampled noise is superimposed on the corresponding first local model to achieve noise addition.

[0025] The first privacy budget value remaining after adding noise in the current round of aggregation process is the first privacy budget value remaining after adding noise in the last round of aggregation process minus the second privacy budget value consumed in the current round of aggregation process.

[0026] Preferably, the parameters of all the first local models after adding noise are aggregated, and the aggregated parameters are used to update the parameters of the global model, and the updated parameters of the global model are used as the parameters of the global model before the next round of aggregation and updating.

[0027] The parameters of all the first local models after adding noise are weighted and summed, and the result of the weighted sum is added to the parameters of the global model before the current round of aggregation to update the parameters of the global model in the current round of aggregation, and the weighting coefficients are determined by the proportion of the number of subsets in the data set of each first local model to the number of all local model subsets.

[0028] Compared with the prior art, the present application has the following advantages:

[0029] The photovoltaic power prediction method based on dynamic differential privacy federated learning of the present application introduces a DDPG network to dynamically adjust the optimal privacy budget value and the strength of noise injection into the local model, thereby realizing adaptive privacy protection. BRIEF DESCRIPTION OF DRAWINGS

[0030] Figure 1 The flowchart of the photovoltaic power prediction method based on dynamic differential privacy federated learning of the present application is shown in the figure.

[0031] Figure 2 The structure block diagram of the photovoltaic power prediction method based on dynamic differential privacy federated learning of the present application is shown in the figure.

[0032] Figure 3 The influence of the selection of the parameter value ratio on the prediction performance is shown in the figure.

[0033] Figure 4 The comparison chart of the experimental results of the root mean square error and the average absolute error of the method of the present application and the prior art is shown in the figure.

[0034] Figure 5 The variation law of the optimal privacy budget value with the aggregation round number of the present application and the prior art is shown in the figure. DETAILED DESCRIPTION

[0035] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below, obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work belong to the scope of protection of the present application.

[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing the specific embodiments only and is not intended to be limiting of the present application.

[0037] As shown in Figures 1-5 , a photovoltaic power generation power prediction method based on dynamic differential privacy federated learning is provided, wherein the dynamic differential privacy federated learning comprises a global model of a central server and a local model of a local user, the global model and the local model of a local user are aggregated for a round (such as 100 rounds of aggregation), the parameter update of the global model is realized, and an updated global model is finally obtained, wherein the photovoltaic power generation power prediction method based on the dynamic differential privacy federated learning comprises:

[0038] A round of aggregation starts:

[0039] S1, initialize the parameters of the global model, and set the total privacy budget value of each local model (in this embodiment, the total privacy budget value of each local model is 60, and as the number of aggregation rounds increases, the value becomes smaller, and the total privacy budget value is the initial first privacy budget value, which is mainly based on the following two points: first, the budget can meet the privacy consumption demand of long-term multi-round communication; second, through the dynamic budget allocation strategy, even if the total budget is large, the actual privacy loss of each round can still be maintained at a low level);

[0040] Wherein, the global model and each local model adopt the same network structure, and are composed of a layer of LSTM network, linear hidden layer and linear layer connected in sequence. The LSTM network contains 64 hidden units for extracting the time sequence features of the input time sequence, and the output at the last time step is taken as the feature representation, then it is subjected to linear transformation from 64 dimensions to 32 dimensions and combined with the ReLU activation function for nonlinear mapping, and finally the output linear layer generates the prediction result.

[0041] S2, the parameters of the current global model are distributed to all local models, and after each local model receives the parameters, it is trained for a preset number of iterations to obtain a trained local model of each local model, which is called the first local model;

[0042] During the training of each local model, user data at different times corresponding to each local model is collected to form a dataset (in this embodiment, a publicly available electricity meter dataset is used, which contains photovoltaic power generation recorded at a time resolution of 30 minutes and corresponding meteorological observation data, specifically as disclosed in reference [1] EL Ratnam, SR Weller, CMKellett, and AT Murray, “Residential load and rooftop PV generation: An Australian distribution network dataset,” Int. J. Sustain. Energy, vol. 36, no. 8, pp. 787–806, 2017. and the photovoltaic power generation data and the data from Weather The meteorological observation data provided by the Underground website is a subset of user data at a single moment. Each user data set includes the following features: year, month, day, time, maximum photovoltaic power generation, humidity, atmospheric pressure, wind speed, rainfall, and net radiation, as well as humidity, atmospheric pressure, wind speed, rainfall, net radiation, and photovoltaic power generation 24 hours and 48 hours in advance (the 24 hours and 48 hours in advance are relative to the "year, month, day, and time" in the subset). The features of year, month, day, and time are different for each subset.

[0043] All features in each subset are normalized (using Min-Max normalization). The normalized subsets are then used to train the corresponding local models (the network learning rate is set to 1e-3, the number of local model iterations is set to 30, the number of subsets in each local model dataset is 16000, the batch size is set to 128, and the step size is set to 0.001).

[0044] The objective function of each local model is:

[0045] ;

[0046] in, For the first The objective function of the local model The MSE loss function is... For the first The dataset of the first local model For the first The number of subsets in the dataset of the first local model For the first Characteristics of a subset For the first The actual photovoltaic power generation corresponding to each subset;

[0047] During the training process of each local model, the parameters of the local model are updated as follows:

[0048] ;

[0049] in, For the first The first round of aggregation process After the training iteration, the... Parameters of a local model For the first The first round of aggregation process After the training iteration, the... Parameters of a local model For learning rate, The gradient of the objective function;

[0050] The formula for gradient clipping of the local model during training is as follows:

[0051] ;

[0052] in, For the first The first round of aggregation process The gradient of the local model. For the first The first round of aggregation process The maximum threshold of gradients for a local model The cropping threshold is typically set to 10, and the above formula ensures that it is met. This limits the sensitivity of the local model to a controllable range for subsequent local model noise injection.

[0053] During local model training, the ADAM (Adaptive Moment Estimation) optimizer improves model convergence speed and stability by adaptively adjusting the parameter learning rate. Its core idea is to simultaneously use the first-moment estimate (mean) and the second-moment estimate (uncentered variance) of the gradient to update the model parameters.

[0054] Specifically, in each round of local training, ADAM first calculates the gradient of the model parameters based on the current mini-batch data (set to 32 in this method); then, it performs exponentially weighted moving averages on the first and second moments of the gradient to characterize the directionality and scale information of the gradient; based on this, bias correction is introduced to eliminate estimation bias in the initial stage. Through this mechanism, ADAM can demonstrate good optimization performance in non-stationary objective functions and sparse gradient scenarios, making it suitable for efficient training of local models.

[0055] S3. Based on each first local model and the DDPG (Deep Deterministic Policy Gradient) network (including the Actor network, Critic network, target Actor network, and target Critic network), the optimal privacy budget value of each local model is calculated and referred to as the second privacy budget value. This second privacy budget value is used as the privacy budget value consumed in this round of aggregation (in this embodiment, the DDPG algorithm is used to solve the problem of dynamic allocation of privacy budget in a continuous action space. Since the differential privacy budget is a continuous real variable and needs to be adaptively adjusted within a finite interval, traditional reinforcement learning algorithms based on discrete action spaces are difficult to apply directly. Therefore, the DDPG algorithm is selected, and the Actor network outputs continuous actions to achieve fine control of the privacy budget adjustment range), including:

[0056] Initialize the current state of the DDPG network (and set the learning rate of the Actor network). (0.0001) and Critic network learning rate (0.001), Target network update rate (0.005)), and use it as input to the Actor network in the DDPG network to obtain the action at the current time, and calculate the reward at the current time according to the reward function (in this embodiment, the design of the reward function fully combines the coupling characteristics of federated learning and differential privacy. Its essential goal is to guide the agent (i.e., the DDPG network) to minimize the long-term prediction error under the constraint of a limited total privacy budget. Specifically, when the privacy budget allocated by the agent can effectively reduce the model loss or slow down the model degradation trend in the current training stage, the reward function gives positive feedback; conversely, when the budget allocation leads to the waste of privacy budget, premature consumption or model performance deterioration, the value evaluation of the action is reduced through a penalty term), and calculate the state at the next time step;

[0057] The state of each first local model includes the current time and the privacy budget value at the current time. The privacy budget value at the current time is called the third privacy budget value. The action is the privacy budget ramp value at the current time. The third privacy budget value at the next time is the third privacy budget value at the current time plus the privacy budget ramp value at the current time.

[0058] The reward value of each first local model includes: the negative value of the privacy budget cost at the current time, and the penalty for violating the constraints when the third privacy budget value and the total privacy budget value at the current time are both present;

[0059] Among them, the The first round of aggregation process The first local model The state at time t is represented as , No. The first round of aggregation process The first local model The action at a given moment is represented as , For the first The first round of aggregation process The first local model The third privacy budget value at any given moment For the first The first round of aggregation process The first local model Privacy budget ramp-up value at any time, and the first The first round of aggregation process The first local model at the next time step The third privacy budget value in the state , , No. The first round of aggregation process The first local model Momentary Rewards The calculation formula is as follows:

[0060] ;

[0061] in,

[0062] ;

[0063] ;

[0064] ;

[0065] ;

[0066] ;

[0067] ;

[0068] ;

[0069] in, For the first The first round of aggregation process The first local model The negative cost of privacy budgets at all times. For the first The first round of aggregation process The first local model The third-party privacy budget is subject to penalties for violating constraints. and All of these are intermediate parameters. and For the first The weighting factor in the round aggregation process is used to balance the contributions of the two objective functions. For the first The first round of aggregation process The first local model The third privacy budget value at any given moment As a penalty weight, To obtain the minimum value, and These are all global hyperparameters (global hyperparameters directly affect the size of the optimal privacy budget value). The higher the ratio, The larger the corresponding minimum point, the greater the impact on the optimal privacy budget value will be. For the first The first round of aggregation process The total of the first local models The parameters of dimension and the first Total before global model update during round aggregation process The parameters of dimension are calculated using Euclidean distance (where Euclidean distance represents the approximation between the current first local model and the global model before the update in this round of aggregation; the lower the approximation value, the more similar the first local model is to the global model, and the closer the model is to convergence). For the first The first round of aggregation process The first local model of the first Dimensional parameters, For the first The first round of aggregation before the global model is updated (dimensional parameters). For the first The first round of aggregation process The loss value of the first local model (the loss value represents the performance of the current local model; the lower the value, the stronger the performance). For the first The first round of aggregation process The objective function of the first local model. For the first The first round of aggregation process The parameters of the first local model, For the first The dataset of the first local model For the first The number of subsets in the dataset of the first local model For the first Characteristics of a subset For the first The actual photovoltaic power generation corresponding to each subset For the first Before adding noise during the aggregation process The remaining first privacy budget value of each local model (the first privacy budget value represents the currently available privacy budget value; the smaller the value, the less privacy budget is available, which directly affects the magnitude of subsequent injected noise). For the first Before adding noise during the aggregation process The remaining first privacy budget value for the first local model For the first The first round of aggregation process The second privacy budget value consumed when adding noise to the first local model. ,when hour, That is, the first The total privacy budget value of the first local model; in this embodiment, the reward function is designed to fully combine the coupling characteristics of federated learning and differential privacy. Its essential goal is to guide the DDPG network to minimize long-term prediction error under the constraint of a limited total privacy budget. Specifically, when the privacy budget allocated to the DDPG network can effectively reduce model loss or slow down model degradation in the current training phase, the reward function provides positive feedback; conversely, when the budget allocation leads to wasted privacy budget, premature consumption, or deterioration of model performance, the value evaluation of this action is reduced through a penalty term.

[0070] The constraints on the third privacy budget value are as follows (the constraints on the third privacy budget value include: the third privacy budget value is greater than zero, and the sum of the third privacy budget values ​​of each first local model at all times in one round of aggregation is less than a preset value):

[0071] ;

[0072] .

[0073] The current state, current action, current reward, and next state are combined into an experience tuple and stored in a limited-capacity experience replay pool (e.g., size 1200). When the number of experience tuples stored in the experience replay pool exceeds the preset minimum batch size, a small batch (e.g., 64) of experience tuples is randomly sampled from the experience replay pool at a preset frequency to update the DDPG network parameters. This process is repeated iteratively until a set deadline for iteration is reached. The iteration with the highest reward value is then selected, and the reward from that iteration is used to update the DDPG network parameters. Privacy budget ramp-up value for actions at each moment compared to the previous moment The third privacy budget value in each time state is added together to obtain The third privacy budget value at time point is taken as the optimal privacy budget value, which is the second privacy budget value. This is the end point of one iteration of the DDPG network, and , This refers to the current aggregation round.

[0074] It should be noted that the Actor network and the Critic network are responsible for decision generation and value evaluation, respectively. Specifically, the Actor network is used to characterize the mapping relationship between the privacy budget ramp value and the system state given the current system state, and its output action essentially determines the intensity of privacy budget allocation in each round of federated learning; the Critic network is used to evaluate the long-term cumulative benefits that can be obtained by taking the privacy budget allocation action in the current state.

[0075] By modeling the dynamic allocation problem of privacy budgets as a Markov decision process in a continuous action space, the merits of privacy budget allocation strategies can be uniformly characterized by the state-action value function. The Critic network estimates the value of different state-action pairs, and its output state-action value function (Q-value) reflects the combined impact of adopting a certain privacy budget allocation strategy in the current state on the balance between future model performance and privacy consumption.

[0076] The Actor network's update process is based on the Q-value output of the Critic network. Its parameters are continuously adjusted through gradient descent to ensure that the actions generated under the same conditions maximize the long-term cumulative reward estimated by the Critic network. Therefore, the continuous update of the Actor network is equivalent to continuously searching for and approximating the optimal privacy budget allocation strategy in the policy space.

[0077] Meanwhile, the Critic network continuously improves the accuracy of its value assessment of privacy budget allocation actions by minimizing the error between the target Q-value and the current Q-value of the target Critic network, thus providing the Actor network with a more reliable optimization direction. The alternating update process between the Actor network and the Critic network ensures that the privacy budget allocation strategy and its value assessment function work together and gradually converge.

[0078] Therefore, by continuously iteratively updating the parameters of the Actor network and the Critic network, this invention can guide the privacy budget allocation strategy to gradually approach the optimal goal of "minimizing long-term prediction error and maximizing privacy budget utilization efficiency" while satisfying the total privacy budget constraint, without having to explicitly solve a complex constraint optimization problem.

[0079] Actor Network Update: The Actor network optimizes the deterministic policy function. To maximize the expected cumulative return, during each parameter update, the Actor network parameters are updated using the gradient of the value function of the action generated by the current policy through the Critic network.

[0080] ;

[0081] ;

[0082] ;

[0083] ;

[0084] in, This represents a discount factor (e.g., 0.98). This represents the Q-value of the Critic network. The Q-value represents the next-time state and action of the target Critic network. Indicates the state at the next time step. The parameters represent the target Critic network. This represents the expected cumulative reward under the current Actor network parameters. This represents the parameters of the Critic network; the action values ​​are determined by the policy function. generate, This indicates that the expected value is calculated for the samples in the experience replay buffer. This represents the learning rate of the Actor network. This represents the gradient.

[0085] Critic network update: Update the parameters of the Critic network using the target Q-value y generated by the target network, by minimizing the loss function:

[0086] ;

[0087] ;

[0088] ;

[0089] ;

[0090] in, This represents the learning rate and action of the Critic network. It is generated by the target Actor network, with noise added to increase exploratory power:

[0091] ;

[0092] in, Describes the policy of the target Actor network. The parameters represent the target Actor network. Indicates Gaussian noise. represents the standard deviation applied to Gaussian noise (e.g., 1), and c represents the noise clipping threshold.

[0093] In this method, both the Actor network and Critic network of the DDPG algorithm use the ADAM optimizer for parameter updates. The ADAM optimizer maintains high convergence speed and stability during training by calculating the first moment estimate (mean) and second moment estimate (uncentered variance) of the gradient.

[0094] To reduce instability during the learning process, both the target Critic network and the target Actor network employ a soft update strategy. The update method for the target network is as follows:

[0095] ;

[0096] ;

[0097] in, With an update factor (e.g., 0.005), this exponentially decaying update allows the target network parameters to slowly track the DDPG network, thereby maintaining parameter stability and continuing to reflect the latest directions of policy optimization.

[0098] S4. Generate Gaussian noise based on the second privacy budget value, and add noise to the corresponding first local model. The second privacy budget value will be consumed during the noise addition process. Calculate the remaining first privacy budget value after noise addition, including:

[0099] After obtaining the second privacy budget value, a failure probability parameter is set according to the differential privacy theory framework. This parameter is combined with the sensitivity of the query function to changes in a single subset to calculate the scale of the noise distribution, thereby quantifying the required intensity of random perturbation. A corresponding Gaussian noise distribution is constructed based on the obtained noise distribution scale, and noise is randomly sampled from it. The randomly sampled noise is then superimposed onto the corresponding first local model to achieve noise addition (i.e., according to the formula...). Generate Gaussian noise as The generated Gaussian noise is superimposed on the corresponding first local model to achieve noise addition. For the first The first round of aggregation process The second privacy budget value for the first local model. For the standard deviation of Gaussian noise, a constant. From the formula get, This represents the failure probability parameter, typically taken as 1e-5. For global sensitivity, and );

[0100] The remaining first privacy budget value after adding noise is , For the first Before adding noise during the aggregation process The remaining first privacy budget value of the first local model, i.e., the first... After adding noise during the aggregation process, the first The remaining first privacy budget value of the first local model (i.e., the remaining first privacy budget value after adding noise in the current round of aggregation is the remaining first privacy budget value after adding noise in the previous round of aggregation minus the second privacy budget value consumed in the current round of aggregation).

[0101] S5. Aggregate the parameters of all the noisy first local models, and use the aggregated parameters to update the parameters of the global model. The updated parameters of the global model will be used as the parameters for the next round of global model aggregation and update, including:

[0102] All the noisy first local model parameters are weighted and summed, and the weighted sum is added to the parameters before the global model update in this round of aggregation to update the global model parameters in this round of aggregation. The weighting coefficient is determined by the proportion of the number of subsets in the dataset of each first local model to the total number of subsets of all local models.

[0103] The formula for updating the parameters of the global model is as follows:

[0104] ;

[0105] in, For the first The parameters before the global model update during the round aggregation process, i.e., the parameters of the first round aggregation process. The parameters of the global model after the round aggregation process. For the first Parameters before global model update during round aggregation. For the first The first round of aggregation process The gradient of the local model. This represents the number of all local model subsets.

[0106] S6. Determine if each first privacy budget value is zero. If at least one is zero, the updated global model is obtained (among all the first privacy budget values ​​of the first local models, if any one is zero, the aggregation stops and the updated global model is obtained). If none of them are zero, proceed to the next round of aggregation and repeat S2-S6 until at least one first privacy budget value is zero and the updated global model is obtained.

[0107] S7. Normalize the user data to be detected and use it as input to the updated global model to obtain the photovoltaic power generation corresponding to the user data to be detected. The user data to be detected includes the current year, month, day, time, maximum photovoltaic power generation, humidity, atmospheric pressure, wind speed, rainfall, and net radiation, as well as the humidity, atmospheric pressure, wind speed, rainfall, net radiation, and photovoltaic power generation 24 hours and 48 hours in advance (i.e., relative to the "current year, month, day, time").

[0108] In practical engineering applications, the method of this invention can be deployed in a distributed post-meter photovoltaic aggregation management platform, suitable for typical scenarios such as residential communities, industrial and commercial parks, microgrids, and virtual power plants. Specifically, the system consists of a cloud-based federated learning server, edge-side aggregation nodes, and multiple user-side photovoltaic terminals. Each user-side terminal can embed a lightweight prediction and privacy control module, deployed in a home energy management system (HEMS), industrial and commercial energy management system (EMS), or smart inverter control unit, for the acquisition, preprocessing, and model training of local photovoltaic power data.

[0109] At cloud or edge aggregation nodes, servers periodically perform weighted aggregation of privacy-preserving model parameters from different users and distribute the updated global model to each terminal. This global model can be directly used to generate short-term photovoltaic power prediction results and further serve application scenarios such as distributed photovoltaic output assessment, user-side load-PV collaborative optimization, grid dispatch auxiliary decision-making, and virtual power plant aggregation control. Through the adaptive adjustment mechanism of dynamic differential privacy budget, the system can balance prediction accuracy and privacy protection requirements in long-term operation, avoiding model performance degradation caused by fixed noise injection.

[0110] In this method, The value of directly affects the allocation strategy of privacy budget values. When When the value is too large, too much privacy budget is allocated in the early stages of aggregation, resulting in insufficient available privacy budget in the later stages, thus causing a decline in the performance of the global model; conversely, when... If the value is too small, the privacy budget value will also be improperly allocated in the early stages of aggregation, leading to a degradation in the performance of the global model. Figure 3 As shown, the parameter value is When the value increases by 1 in the range of 4.5 to 9.5, when When the value is 7.5, the privacy budget allocation reaches a relatively optimal balance, and the global model performance reaches its best. Figure 3 This shows the result after 100 rounds of aggregation, with the parameter values... The ratios are selected by using the test set to predict the root mean square error (RMSE) and mean absolute error (MAE) of photovoltaic power generation performance.

[0111] The results of comparing the root mean square error (RMSE) and mean absolute error (MAE) of this method with existing privacy allocation strategies for predicting photovoltaic power generation performance are as follows: Figure 4 As shown (and Figure 4 (This is the average of five predictions). The baseline methods compared include five privacy budget allocation strategies: Step (step decay), Poly (polynomial decay), Time (linear decay), Exp (exponential decay), and Uniform (fixed privacy budget). As a benchmark, Figure 4 The paper also demonstrates the performance of the FedAvg (Federated Average) algorithm without added noise. Figure 5 The paper demonstrates the five existing privacy budget allocation strategies and the variation of the optimal privacy budget value of the proposed method with the number of aggregation rounds.

[0112] This photovoltaic power prediction method based on dynamic differential privacy federated learning introduces a DDPG network to dynamically adjust the optimal privacy budget value and the intensity of noise injection into the local model, achieving adaptive privacy protection. While ensuring user data privacy, this method effectively reduces the negative impact of noise on global prediction accuracy and improves the robustness of distributed photovoltaic power prediction.

[0113] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0114] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0115] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. A photovoltaic power generation prediction method based on dynamic differential privacy federated learning, characterized in that: This involves applying a global model to a central server and local models to several local users, with the global model and local models being... Wheel aggregation: S1. Initialize the parameters of the global model and set the total privacy budget value for each local model; S2. Distribute the parameters of the current global model to all local models. Each local model is trained for a preset number of iterations to obtain the trained local model, which is called the first local model. S3. The optimal privacy budget value of each first local model is calculated based on each first local model and the DDPG network, and is called the second privacy budget value. S4. Generate Gaussian noise based on the second privacy budget value and add noise to the corresponding first local model. The second privacy budget value will be consumed during the noise addition process. Calculate the remaining first privacy budget value after adding noise. S5. Aggregate the parameters of all the first local models after adding noise, and update the parameters of the global model with the aggregated parameters. The updated parameters of the global model are used as the parameters before the next round of global model aggregation. S6. Determine whether each first privacy budget value is zero. If at least one is zero, the updated global model is obtained. If none of them are zero, proceed to the next round of aggregation and repeat S2-S6 until at least one first privacy budget value is zero. S7. Normalize the user data to be detected and use it as input to the updated global model to obtain the photovoltaic power generation corresponding to the user data to be detected.

2. The photovoltaic power generation prediction method based on dynamic differential privacy federated learning as described in claim 1, characterized in that: The structure of the global model and each local model is as follows: it includes an LSTM network, a linear hidden layer, and a linear layer connected in sequence.

3. The photovoltaic power generation prediction method based on dynamic differential privacy federated learning as described in claim 1, characterized in that: During the training of each local model, user data at different times corresponding to each local model is collected to form a dataset. The user data at a single time moment is a subset of the dataset. The features of each user data are: year, month, day, time, maximum photovoltaic power generation, humidity, atmospheric pressure, wind speed, rainfall, and net radiation, as well as humidity, atmospheric pressure, wind speed, rainfall, net radiation, and photovoltaic power generation 24 hours and 48 hours in advance. The features of year, month, day, and time are different for each subset. All features in each subset are normalized, and the normalized subsets are used to train the corresponding local models.

4. The photovoltaic power generation prediction method based on dynamic differential privacy federated learning as described in claim 1, characterized in that: The calculation process for the optimal privacy budget value of each first local model is as follows: Initialize the current state of the DDPG network and use it as input to the Actor network in the DDPG network to obtain the action at the current time, calculate the reward at the current time according to the reward function, and calculate the state at the next time step; The current state, current action, current reward, and next state are combined into an experience tuple and stored in a limited-capacity experience replay pool. When the number of experience tuples stored in the experience replay pool exceeds the preset minimum batch size, a small batch of experience tuples is randomly sampled from the experience replay pool at a preset frequency to update the DDPG network parameters. This process is repeated iteratively until a set deadline for iteration is reached. The iteration round with the highest reward value is then selected, and the experience tuples from that iteration round are used to update the DDPG network parameters. Privacy budget ramp-up value for actions at each moment compared to the previous moment The third privacy budget value in the state is added together to obtain The third privacy budget value at time point is taken as the optimal privacy budget value, which is the second privacy budget value. This is the end point of one iteration of the DDPG network, and , This refers to the current aggregation round.

5. The photovoltaic power generation prediction method based on dynamic differential privacy federated learning as described in claim 4, characterized in that: The state of each first local model includes the current time and the privacy budget value at the current time. The privacy budget value at the current time is called the third privacy budget value. The action is the privacy budget ramp value at the current time. The third privacy budget value at the next time is the third privacy budget value at the current time plus the privacy budget ramp value at the current time. The reward value for each first local model includes: the negative value of the privacy budget cost at the current time, and the penalty for violating the constraints when the third privacy budget value and the total privacy budget value at the current time are both calculated.

6. The photovoltaic power generation prediction method based on dynamic differential privacy federated learning as described in claim 5, characterized in that: The constraints on the third privacy budget value include: the third privacy budget value is greater than zero, and the sum of the third privacy budget values ​​of each first local model at all times in one round of aggregation is less than a preset value.

7. The photovoltaic power generation prediction method based on dynamic differential privacy federated learning as described in claim 1, characterized in that: The process of generating Gaussian noise based on the second privacy budget value and adding noise to the corresponding first local model, wherein the second privacy budget value is consumed during the noise addition process, and calculating the remaining first privacy budget value after noise addition, includes: After obtaining the second privacy budget value, the failure probability parameter is set according to the differential privacy theory framework. This parameter is combined with the sensitivity of the query function to changes in a single subset to calculate the scale of the noise distribution, thereby quantifying the intensity of the random perturbation to be introduced. Based on the obtained noise distribution scale, a corresponding Gaussian noise distribution is constructed, and noise is randomly sampled from it. The randomly sampled noise is superimposed on the corresponding first local model to achieve noise addition. The remaining first privacy budget value after adding noise during the current round of aggregation is the remaining first privacy budget value after adding noise during the previous round of aggregation minus the second privacy budget value consumed during the current round of aggregation.

8. The photovoltaic power generation prediction method based on dynamic differential privacy federated learning as described in claim 7, characterized in that: The process of aggregating the parameters of all noisy first local models, updating the global model with the aggregated parameters, and using the updated global model parameters as the parameters for the next round of global model aggregation includes: All the noisy first local model parameters are weighted and summed, and the weighted sum is added to the parameters before the global model update in this round of aggregation to update the global model parameters in this round of aggregation. The weighting coefficient is determined by the proportion of the number of subsets in the dataset of each first local model to the total number of subsets of all local models.

Citation Information

Patent Citations

  • Federal learning method based on adaptive differential privacy

    CN117874829A

  • Differential privacy protection-based IGA-LSTM photovoltaic power generation power prediction method and system

    CN119940650A