Privacy protection model training method and system suitable for distributed new energy station

By selecting stations with improved performance from distributed new energy power stations to participate in model aggregation, and using distribution differences and weight parameter similarity to aggregate and calculate contribution, the problems of high communication costs and slow training speed in federated learning are solved, and more efficient model training is achieved.

CN119227134BActive Publication Date: 2025-10-21STATE GRID HUNAN ELECTRIC POWER COMPANY LIMITED +3
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411267066.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-10-21
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

Federated learning for distributed new energy power stations suffers from high communication costs, complex model aggregation processes, and slow training speeds.

Method used

By initializing the global model on the server and distributing it to new energy power stations for training, power stations with performance improvements are selected to participate in model aggregation. The aggregation contribution is calculated by using distribution difference aggregation and weight parameter similarity aggregation, which reduces communication costs and data volume and simplifies the model aggregation process.

Benefits of technology

It effectively avoids the waste of communication costs caused by sending highly similar local model weight parameters, reduces the amount of data to be processed for model aggregation, simplifies the model aggregation process, and improves training speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227134B_ABST
    Figure CN119227134B_ABST
Patent Text Reader

Abstract

The application discloses a privacy protection model training method and system suitable for a distributed new energy station, wherein in a federal training process of a second round and subsequent rounds, whether the local model of each new energy station has an improvement in model performance compared with the last round is judged in the current round, if there is an improvement, the new energy station is taken as a participant of model aggregation operation in the current round, otherwise the new energy station is idle in the current round, the new energy station with performance improvement is screened to participate in model aggregation, communication cost waste caused by sending highly similar local model weight parameters is effectively avoided, the amount of data required for model aggregation is reduced, the model aggregation process is simplified, and the training speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of federated learning technology, and in particular, to a privacy protection model training method and system applicable to distributed new energy stations, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of new energy technologies, an increasing number of distributed new energy sites and end-devices are being widely deployed. The data generated by these end-devices contains a wealth of sensitive information, such as energy production and consumption, and related environmental parameters. However, with the increase in data and the growing demand for sharing, privacy protection has become a significant challenge. Traditional centralized data training models may involve centralized data storage and processing, which poses risks of privacy leakage and data security. To address these issues, a recent research trend has been to introduce federated learning technology into the new energy field. Federated learning is a distributed machine learning method that allows local model training on end-devices without transmitting raw data to a central server for model training. After each round of training, end-devices only need to transmit their local model parameters to a central server for model aggregation, which optimizes and updates the global model. This distributed learning approach protects user data privacy and reduces data transmission requirements. However, due to the large number of distributed new energy sites, all distributed new energy sites need to transmit their local model parameters to a central server, which results in high communication costs, a complex model aggregation process, and slow model training. Summary of the Invention

[0003] The present invention provides a privacy-preserving model training method and system, electronic equipment, and computer-readable storage medium suitable for distributed new energy stations. These methods can effectively avoid the waste of communication costs caused by sending highly similar local model weight parameters, reduce the amount of data required for model aggregation, simplify the model aggregation process, and improve the training speed.

[0004] According to one aspect of the present invention, a privacy protection model training method applicable to distributed new energy stations is provided, comprising the following contents:

[0005] Initialize the server's global model and distribute it to all new energy stations to serve as local models for training at each station. Each station conducts the first round of federated training based on the local model, while the server conducts the first round of federated training based on the global model.

[0006] During the second and subsequent rounds of federated training, determine whether the performance of each new energy station's local model in the current round has improved compared to the previous round. If so, the new energy station will be included in the model aggregation operation in this round. Otherwise, the new energy station will not participate in this round.

[0007] Multiple rounds of federated training are performed until the global optimization loss function of the global model converges, and the training ends.

[0008] Furthermore, in the second and subsequent rounds of federated training, each round of federated training includes the following:

[0009] Calculate the aggregated contribution of each participant based on the distribution difference aggregation and weight parameter similarity aggregation, and send the aggregated contribution and local model weight parameters of each participant to the server;

[0010] The global model weight parameters are calculated based on the aggregated contributions of all participants and the local model weight parameters to optimize and update the server's global model, and the server's global model weight parameters and the local model weight parameters of all participants are distributed to all new energy stations;

[0011] Each new energy station updates and trains its own local model based on the global model weight parameters and the local model weight parameters of all participants.

[0012] Furthermore, the distribution difference aggregation of each participant is calculated based on the following formula:

[0013] d j =KL(D j ,D global )

[0014]

[0015] Among them, d j Denotes the difference between the local data distribution of the jth participant and the data distribution of the server, D j represents the local data distribution of the jth participant, D global Represents the data distribution of the server, which is uniformly distributed, KL() represents the KL divergence calculation function, n j represents the relative size of the dataset of the jth participant, N j represents the dataset size of the jth participant, C represents the number of participants, and N i represents the dataset size of the i-th participant, q j represents the distribution difference aggregation of the jth participant, Max() represents the maximum value function, d irepresents the difference between the local data distribution of the i-th participant and the data distribution of the server, and a represents a hyperparameter.

[0016] Furthermore, the weight parameter similarity aggregation of each participant is calculated based on the following formula:

[0017]

[0018] in, represents the weight parameter similarity aggregation of the jth participant in the tth round, β represents the hyperparameter, cosine() represents the cosine similarity calculation function, and denote the local model weight parameters of the jth participant in rounds t-1 and t, respectively. and denote the local model weight parameters of the kth participant in rounds t-1 and t, respectively, and C t represents the number of participants in round t.

[0019] Furthermore, the process of updating and training the local model of each new energy station based on the global model weight parameters and the local model weight parameters of all participants includes the following:

[0020] Each new energy station calculates the similarity between its own local model weight parameters and the local model weight parameters of all participants, selects the local model weight parameters with the greatest similarity, and performs weighted summation on them with the global model weight parameters before updating and training its own local model.

[0021] Furthermore, the global optimization loss function value of the global model is calculated based on the following formula:

[0022]

[0023] Among them, Loss represents the global optimization loss function value, M represents the number of new energy stations, q i represents the distribution difference aggregation of the i-th new energy station, L i Represents the loss function value of the i-th new energy station.

[0024] Furthermore, when the number of byes of a certain new energy station is greater than a preset threshold, the new energy station will be used as a participant in the model aggregation operation in the next round of federated training.

[0025] In addition, the present invention also provides a privacy protection model training system applicable to distributed new energy stations, including:

[0026] The initialization module is used to initialize the server's global model and distribute it to all new energy sites to be trained as local models of each new energy site. Each new energy site conducts the first round of federated training based on the local model, and the server conducts the first round of federated training based on the global model.

[0027] The screening module is used to determine whether the performance of the local model of each new energy station in the second and subsequent rounds of federated training has improved compared to the previous round. If so, the new energy station will be included as a participant in the current round of model aggregation operations; otherwise, the new energy station will not be selected in this round;

[0028] The iterative training module is used to perform multiple rounds of federated training until the global optimization loss function of the global model converges, at which point the training ends.

[0029] Furthermore, during the second and subsequent rounds of federated training, the screening module calculates the aggregate contribution of each participant based on the distribution difference aggregation and weight parameter similarity aggregation, and sends the aggregate contribution and local model weight parameters of each participant to the server, and calculates the global model weight parameters based on the aggregate contribution and local model weight parameters of all participants to optimize and update the global model of the server, and distributes the global model weight parameters of the server and the local model weight parameters of all participants to all new energy stations. Each new energy station updates and trains its own local model based on the global model weight parameters and the local model weight parameters of all participants.

[0030] Furthermore, the screening module calculates the distribution difference aggregation of each participant based on the following formula:

[0031] d j =KL(D j ,D global )

[0032]

[0033] Among them, d j Denotes the difference between the local data distribution of the jth participant and the data distribution of the server, D j represents the local data distribution of the jth participant, D global Represents the data distribution of the server, which is uniformly distributed, KL() represents the KL divergence calculation function, n j represents the relative size of the dataset of the jth participant, N j represents the dataset size of the jth participant, C represents the number of participants, and N i represents the dataset size of the i-th participant, q jrepresents the distribution difference aggregation of the jth participant, Max() represents the maximum value function, d i represents the difference between the local data distribution of the i-th participant and the data distribution of the server, and a represents a hyperparameter.

[0034] Furthermore, the screening module calculates the weight parameter similarity aggregation of each participant based on the following formula:

[0035]

[0036] in, represents the weight parameter similarity aggregation of the jth participant in the tth round, β represents the hyperparameter, cosine() represents the cosine similarity calculation function, and denote the local model weight parameters of the jth participant in rounds t-1 and t, respectively. and denote the local model weight parameters of the kth participant in rounds t-1 and t, respectively, c t represents the number of participants in round t.

[0037] Furthermore, each new energy station calculates the similarity between its own local model weight parameters and the local model weight parameters of all participants, selects the local model weight parameters with the greatest similarity, and performs weighted summation on them with the global model weight parameters to update and train its own local model.

[0038] Furthermore, the iterative training module calculates the global optimization loss function value of the global model based on the following formula:

[0039]

[0040] Among them, Loss represents the global optimization loss function value, M represents the number of new energy stations, q i represents the distribution difference aggregation of the i-th new energy station, L i Represents the loss function value of the i-th new energy station.

[0041] Furthermore, when the number of byes of a certain new energy station is greater than a preset threshold, the new energy station will be used as a participant in the model aggregation operation in the next round of federated training.

[0042] In addition, the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the steps of the above method by calling the computer program stored in the memory.

[0043] In addition, the present invention also provides a computer-readable storage medium for storing a computer program for training a privacy protection model suitable for distributed new energy stations, and the computer program executes the steps of the method described above when running on a computer.

[0044] The present invention has the following beneficial effects:

[0045] The privacy-preserving model training method for distributed renewable energy stations of the present invention first initializes the global model of the server and distributes it to all renewable energy stations as the local model of each renewable energy station. Each renewable energy station uses its own data to train the local model and transmits the trained local model weight parameters to the server to update the global model weight parameters, thereby completing the first round of federated training. Then, in the second and subsequent rounds of federated training, by judging whether the model performance of the local model of each renewable energy station in the current round is improved compared with the previous round, if so, the renewable energy station is selected as a participant in the model aggregation operation of this round. Otherwise, the renewable energy station is not selected in this round. By screening renewable energy stations with improved performance to participate in model aggregation, the communication cost waste caused by sending highly similar local model weight parameters is effectively avoided, the amount of data required for model aggregation is reduced, the model aggregation process is simplified, and the training speed is improved. Finally, through multiple rounds of federated training, the global optimization loss function of the global model converges, and the training ends.

[0046] In addition, the privacy protection model training system applicable to distributed new energy stations of the present invention also has the above advantages.

[0047] In addition to the above-described objects, features and advantages, the present invention has other objects, features and advantages. The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which constitute part of the present invention, are provided to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are provided to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:

[0049] Figure 1 It is a flowchart of a privacy protection model training method applicable to distributed new energy stations according to a preferred embodiment of the present invention.

[0050] Figure 2 It is a flowchart of the second and subsequent rounds of federated training process in the preferred embodiment of the present invention.

[0051] Figure 3It is a schematic diagram of the module structure of a privacy protection model training system applicable to distributed new energy stations according to another embodiment of the present invention. DETAILED DESCRIPTION

[0052] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0053] Reference Figure 1 The preferred embodiment of the present invention provides a privacy protection model training method applicable to distributed new energy stations, including the following contents:

[0054] Step S1: Initialize the global model of the server and distribute it to all new energy stations to serve as the local model for training at each new energy station. Each new energy station performs the first round of federated training based on the local model, and the server performs the first round of federated training based on the global model.

[0055] Step S2: During the second and subsequent rounds of federated training, determine whether the performance of the local model of each new energy station in the current round has improved compared to the previous round. If so, the new energy station will be included in the model aggregation operation in this round. Otherwise, the new energy station will not participate in this round.

[0056] Step S3: Perform multiple rounds of federated training until the global optimization loss function of the global model converges, and the training ends.

[0057] It can be understood that the privacy-preserving model training method for distributed renewable energy stations in this embodiment first initializes the server's global model and distributes it to all renewable energy stations as local models for each renewable energy station. Each renewable energy station then trains the local model using its own data and transmits the trained local model weight parameters to the server to update the global model weight parameters, thereby completing the first round of federated training. Then, in the second and subsequent rounds of federated training, the performance of each renewable energy station's local model in the current round is determined to be improved compared to the previous round. If so, the renewable energy station is selected as a participant in the current round of model aggregation. Otherwise, the renewable energy station is not selected in the current round. By selecting renewable energy stations with improved performance to participate in model aggregation, the communication cost waste caused by sending highly similar local model weight parameters is effectively avoided, the amount of data required for model aggregation is reduced, the model aggregation process is simplified, and the training speed is improved. Finally, through multiple rounds of federated training, the global optimization loss function of the global model converges, and the training ends.

[0058] It can be understood that in step S1, the global model on the server is initialized, and the initialized global model is encrypted and distributed to all new energy stations. After each new energy station decrypts it, it uses the initialized global model as its own local model and uses its own local data to train the local model. The trained local model weight parameters are then transmitted to the server to update the global model weight parameters, thereby completing the first round of federated training. Therefore, in the first round of federated training, all new energy stations participate in the model aggregation operation. The global model weight parameters are calculated based on the following formula:

[0059]

[0060] Among them, E() represents the CKKS homomorphic encryption calculation function, W t+1 represents the global model weight parameter of the t+1th round, represents the aggregate contribution of the jth participant in round t, represents the local model weight parameter of the jth participant in round t, c t represents the number of participants in round t.

[0061] Optionally, during the first round of federated training, each new energy station uses distribution difference aggregation as its aggregate contribution, where the distribution difference aggregation of each participant is calculated based on the following formula:

[0062] d j =KL(D j ,D global )

[0063]

[0064] Among them, d j Denotes the difference between the local data distribution of the jth participant and the data distribution of the server, D j represents the local data distribution of the jth participant, D global represents the data distribution of the server, which is assumed to be uniformly distributed based on prior knowledge. KL() represents the KL divergence calculation function, n j represents the relative size of the dataset of the jth participant, N j represents the dataset size of the jth participant, C represents the number of participants, and N i represents the dataset size of the i-th participant, q j represents the distribution difference aggregation of the jth participant, Max() represents the maximum value function, d i represents the difference between the local data distribution of the i-th participant and the data distribution of the server, and a represents a hyperparameter.

[0065] It can be understood that when performing model aggregation, the existing technology usually sets the aggregation contribution of each local model parameter to a fixed value, resulting in poor generalization ability of the global model. The present invention calculates the difference between the data distribution of each participant and the server through KL divergence, and combines the relative size of each participant's data set to assign different distribution difference aggregation values ​​to each participant, so that participants with larger data sets and smaller distribution differences are assigned higher distribution difference aggregation, thereby realizing dynamic adjustment of the aggregation contribution and improving the generalization ability and accuracy of the global model. Of course, in other embodiments of the present invention, during the first round of federated training, a fixed aggregation contribution can also be set for all new energy sites.

[0066] It can be understood that in the entire federated learning process, the distribution difference aggregation of each participant only needs to be calculated once.

[0067] It can be understood that in step S2, in the second and subsequent rounds of federated training, it is necessary to screen the new energy stations, and all new energy stations are no longer included as participants in the model aggregation operation. Specifically, it is determined whether the model performance of the local model of each new energy station in the current round has been improved compared to the previous round. If so, the new energy station is included as a participant in the current round of model aggregation operation. Otherwise, the new energy station is eliminated in this round. Therefore, the present invention effectively avoids the waste of communication costs caused by sending highly similar local model weight parameters by screening new energy stations with improved performance to participate in model aggregation, reduces the amount of data required to be processed for model aggregation, simplifies the model aggregation process, and improves the training speed.

[0068] Optionally, during the entire federated learning process, if the number of byes for a particular new energy station exceeds a preset threshold, that new energy station will be included as a participant in the model aggregation operation during the next round of federated training. By setting a threshold for the number of byes, when a new energy station's number of byes exceeds the threshold, it will be re-included as a participant in the model aggregation operation, ensuring that all new energy stations have the opportunity to participate in training, enhancing the fairness and participation of the training system.

[0069] In addition, if Figure 2 As shown in the figure, in the second and subsequent rounds of federated training, each round of federated training includes the following:

[0070] Step S21: Calculate the aggregated contribution of each participant based on the distribution difference aggregation and weight parameter similarity aggregation, and send the aggregated contribution and local model weight parameters of each participant to the server;

[0071] Step S22: Calculate the global model weight parameters based on the aggregated contributions of all participants and the local model weight parameters to optimize and update the global model of the server, and distribute the global model weight parameters of the server and the local model weight parameters of all participants to all new energy stations;

[0072] Step S23: Each new energy station updates and trains its own local model based on the global model weight parameters and the local model weight parameters of all participants.

[0073] Specifically, in the second and subsequent rounds of federated training, the aggregated contribution of each participant is calculated based on the weighted sum of the distribution difference aggregation and the weight parameter similarity aggregation. The distribution difference aggregation has been calculated in the first federated learning process and will not be repeated here. The weight parameter similarity aggregation of each participant is calculated based on the following formula:

[0074]

[0075] in, represents the weight parameter similarity aggregation of the jth participant in the tth round, β represents the hyperparameter, cosine() represents the cosine similarity calculation function, and denote the local model weight parameters of the jth participant in rounds t-1 and t, respectively. and denote the local model weight parameters of the kth participant in rounds t-1 and t, respectively, c t Represents the number of participants in round t. The present invention takes into account the differences in the weight parameters of the local models of participants in two adjacent rounds. The similarity of the weight parameters of the local models in two adjacent rounds is calculated using cosine similarity, thereby assigning a different weight parameter similarity aggregation value to each participant. Participants with lower similarity in the local model weight parameters in two adjacent rounds are assigned a higher weight parameter similarity aggregation value, further improving the generalization ability and accuracy of the global model while maintaining balance and fairness among participants.

[0076] In addition, the aggregate contribution is calculated based on the following formula: in, represents the aggregate contribution of the jth participant in round t, q j represents the distribution difference aggregation of the jth participant, represents the weight parameter similarity aggregation of the jth participant in the tth round, γ, represents the weight coefficient,

[0077] It can be understood that in the second and subsequent rounds of federated training, the aggregate contribution of each participant is calculated based on the weighted sum of the distribution difference aggregation and weight parameter similarity aggregation, which not only takes into account the novelty of each participant's local model update, but also takes into account the diversity of data distribution, thereby greatly improving the generalization ability and accuracy of the global model.

[0078] Then, each participant sends its aggregated contribution and local model weight parameters to the server after CKKS homomorphic encryption. The server decrypts them based on the formula: The global model weight parameters are calculated to optimize and update the global model. The global model weight parameters and the local model weight parameters of all participants are distributed to all new energy stations after being homomorphically encrypted using CKKS. This invention introduces the CKKS homomorphic encryption method to encrypt the model updates of new energy stations, ensuring secure model aggregation without leaking the data privacy of new energy stations. This measure significantly improves the security of the system and combats potential data leakage risks.

[0079] Finally, after decryption, each new energy station obtains the global model weight parameters and the local model weight parameters of all participants. Each new energy station calculates the similarity between its own local model weight parameters and the local model weight parameters of all participants, selects the local model weight parameters with the greatest similarity, and performs a weighted sum of them with the global model weight parameters to update and train its own local model. It can be understood that the global model weight parameters need to adapt to the data of all participants. By selecting the local model weight parameters with the greatest similarity and performing a weighted sum with the global model weight parameters, each new energy station can not only learn the data characteristics of other similar stations, but also avoid overfitting the global model weight parameters.

[0080] It can be understood that in step S3, multiple rounds of federated training are performed until the global optimization loss function of the global model converges, then the federated learning ends, and the final global model is a privacy protection model suitable for distributed new energy stations. The global optimization loss function value of the global model is calculated based on the following formula:

[0081]

[0082] Among them, Loss represents the global optimization loss function value, M represents the number of new energy stations, q i represents the distribution difference aggregation of the i-th new energy station, L i represents the loss function value of the i-th new energy station. In addition, the specific loss function type can be a distillation loss function, a cross entropy loss function, a Hinge loss function, etc., which are not specifically limited here.

[0083] It can be understood that the present invention uses the distribution difference aggregation of each new energy station as the weight coefficient, comprehensively calculates the global loss based on the loss function value of all new energy stations, combines the diversity of data distribution to consider global convergence, and realizes the precise convergence of the global model.

[0084] In addition, if Figure 3 As shown, another embodiment of the present invention further provides a privacy protection model training system applicable to distributed new energy stations, preferably using the privacy protection model training method described above, including:

[0085] The initialization module is used to initialize the server's global model and distribute it to all new energy sites to be trained as local models of each new energy site. Each new energy site conducts the first round of federated training based on the local model, and the server conducts the first round of federated training based on the global model.

[0086] The screening module is used to determine whether the performance of the local model of each new energy station in the second and subsequent rounds of federated training has improved compared to the previous round. If so, the new energy station will be included as a participant in the current round of model aggregation operations; otherwise, the new energy station will not be selected in this round;

[0087] The iterative training module is used to perform multiple rounds of federated training until the global optimization loss function of the global model converges, at which point the training ends.

[0088] It can be understood that the privacy-preserving model training system for distributed renewable energy stations in this embodiment first initializes the server's global model and distributes it to all renewable energy stations as local models for each renewable energy station. Each renewable energy station then trains the local model using its own data and transmits the trained local model weight parameters to the server to update the global model weight parameters, thereby completing the first round of federated training. Then, in the second and subsequent rounds of federated training, the system determines whether the model performance of each renewable energy station's local model in the current round has improved compared to the previous round. If so, the renewable energy station is selected as a participant in the current round of model aggregation operations. Otherwise, the renewable energy station is not selected in the current round. By screening renewable energy stations with improved performance to participate in model aggregation, the communication cost waste caused by sending highly similar local model weight parameters is effectively avoided, the amount of data required for model aggregation is reduced, the model aggregation process is simplified, and the training speed is improved. Finally, through multiple rounds of federated training, the global optimization loss function of the global model converges, and the training ends.

[0089] Among them, during the second and subsequent rounds of federated training, the screening module calculates the aggregate contribution of each participant based on the distribution difference aggregation and weight parameter similarity aggregation, and sends the aggregate contribution and local model weight parameters of each participant to the server, and calculates the global model weight parameters based on the aggregate contribution and local model weight parameters of all participants to optimize and update the global model of the server, and distributes the global model weight parameters of the server and the local model weight parameters of all participants to all new energy stations. Each new energy station updates and trains its own local model based on the global model weight parameters and the local model weight parameters of all participants.

[0090] In addition, the screening module calculates the distribution difference aggregation of each participant based on the following formula:

[0091] d j =KL(D j ,D global )

[0092]

[0093] Among them, d j Denotes the difference between the local data distribution of the jth participant and the data distribution of the server, D j represents the local data distribution of the jth participant, D global Represents the data distribution of the server, which is uniformly distributed, KL() represents the KL divergence calculation function, n j represents the relative size of the dataset of the jth participant, N j represents the dataset size of the jth participant, C represents the number of participants, and N i represents the dataset size of the i-th participant, q j represents the distribution difference aggregation of the jth participant, Max() represents the maximum value function, d i represents the difference between the local data distribution of the i-th participant and the data distribution of the server, and a represents a hyperparameter.

[0094] In addition, the screening module calculates the weight parameter similarity aggregation of each participant based on the following formula:

[0095]

[0096] in, represents the weight parameter similarity aggregation of the jth participant in the tth round, β represents the hyperparameter, cosine() represents the cosine similarity calculation function, and denote the local model weight parameters of the jth participant in rounds t-1 and t, respectively. and denote the local model weight parameters of the kth participant in rounds t-1 and t, respectively, c t represents the number of participants in round t.

[0097] In addition, each new energy station calculates the similarity between its own local model weight parameters and the local model weight parameters of all participants, selects the local model weight parameters with the greatest similarity, and performs weighted summation on them with the global model weight parameters before updating and training its own local model.

[0098] In addition, the iterative training module calculates the global optimization loss function value of the global model based on the following formula:

[0099]

[0100] Among them, Loss represents the global optimization loss function value, M represents the number of new energy stations, q i represents the distribution difference aggregation of the i-th new energy station, L i Represents the loss function value of the i-th new energy station.

[0101] In addition, when the number of byes of a new energy station is greater than the preset threshold, the new energy station will be used as a participant in the model aggregation operation in the next round of federated training.

[0102] In addition, another embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the steps of the above method by calling the computer program stored in the memory.

[0103] In addition, another embodiment of the present invention also provides a computer-readable storage medium for storing a computer program for training a privacy protection model suitable for distributed new energy stations, and the computer program executes the steps of the method described above when running on a computer.

[0104] Common computer-readable storage media include: floppy disks, flexible disks, hard disks, magnetic tape, any other magnetic media, CD-ROMs, any other optical media, punch cards, paper tape, any other physical medium with a pattern of holes, random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), flash-erasable programmable read-only memory (FLASH-EPROM), any other memory chip or cartridge, or any other medium that can be read by a computer. Instructions can further be transmitted or received via a transmission medium. The term transmission medium may include any tangible or intangible medium that can be used to store, encode, or carry instructions for execution by a machine, and includes digital or analog communication signals or other intangible media that facilitate communication of such instructions. Transmission media include coaxial cables, copper wire, and fiber optics, including the wires of a bus used to transmit a computer data signal.

[0105] It will be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention may be implemented in various computer languages, for example, the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0106] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0107] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0109] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0110] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

[0111] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A privacy protection model training method applicable to distributed new energy stations, characterized in that: Includes the following: Initialize the server's global model and distribute it to all new energy stations to serve as local models for training at each station. Each station conducts the first round of federated training based on the local model, while the server conducts the first round of federated training based on the global model. During the second and subsequent rounds of federated training, determine whether the performance of each new energy station's local model in the current round has improved compared to the previous round. If so, the new energy station will be included in the model aggregation operation in this round. Otherwise, the new energy station will not participate in this round. Perform multiple rounds of federated training until the global optimization loss function of the global model converges, and then the training ends; In the second and subsequent rounds of federated training, each round of federated training includes the following: Calculate the aggregated contribution of each participant based on the distribution difference aggregation and weight parameter similarity aggregation, and send the aggregated contribution and local model weight parameters of each participant to the server; The global model weight parameters are calculated based on the aggregated contributions of all participants and the local model weight parameters to optimize and update the server's global model, and the server's global model weight parameters and the local model weight parameters of all participants are distributed to all new energy stations; Each new energy station updates and trains its own local model based on the global model weight parameters and the local model weight parameters of all participants.

2. The privacy protection model training method applicable to distributed new energy stations according to claim 1, characterized in that: The distribution difference aggregate for each participant is calculated based on the following formula: d j =KL(D j ,D global ) Among them, d j Denotes the difference between the local data distribution of the jth participant and the data distribution of the server, D j represents the local data distribution of the jth participant, D global Represents the data distribution of the server, which is uniformly distributed, KL() represents the KL divergence calculation function, n j represents the relative size of the dataset of the jth participant, N j represents the dataset size of the jth participant, C represents the number of participants, and N i represents the dataset size of the i-th participant, q j represents the distribution difference aggregation of the jth participant, Max() represents the maximum value function, d i represents the difference between the local data distribution of the i-th participant and the data distribution of the server, and a represents a hyperparameter.

3. The privacy protection model training method applicable to distributed new energy stations according to claim 1 is characterized in that: The weight parameter similarity aggregation of each participant is calculated based on the following formula: in, represents the weight parameter similarity aggregation of the jth participant in the tth round, β represents the hyperparameter, cosine() represents the cosine similarity calculation function, and denote the local model weight parameters of the jth participant in rounds t-1 and t, respectively. and denote the local model weight parameters of the kth participant in rounds t-1 and t, respectively, and C t represents the number of participants in round t.

4. The privacy protection model training method applicable to distributed new energy stations according to claim 1, characterized in that: The process of updating and training the local model of each new energy station based on the global model weight parameters and the local model weight parameters of all participants includes the following: Each new energy station calculates the similarity between its own local model weight parameters and the local model weight parameters of all participants, selects the local model weight parameters with the greatest similarity, and performs weighted summation on them with the global model weight parameters before updating and training its own local model.

5. The privacy protection model training method applicable to distributed new energy stations according to claim 1, characterized in that: The global optimization loss function value of the global model is calculated based on the following formula: Among them, Loss represents the global optimization loss function value, M represents the number of new energy stations, q i represents the distribution difference aggregation of the i-th new energy station, L i Represents the loss function value of the i-th new energy station.

6. The privacy protection model training method applicable to distributed new energy stations according to claim 1, characterized in that: When the number of byes of a new energy station is greater than the preset threshold, the new energy station will be used as a participant in the model aggregation operation in the next round of federated training.

7. A privacy protection model training system suitable for distributed new energy stations, characterized in that: include: The initialization module is used to initialize the server's global model and distribute it to all new energy sites to be trained as local models of each new energy site. Each new energy site conducts the first round of federated training based on the local model, and the server conducts the first round of federated training based on the global model. The screening module is used to determine whether the performance of the local model of each new energy station in the second and subsequent rounds of federated training has improved compared to the previous round. If so, the new energy station will be included as a participant in the current round of model aggregation operations; otherwise, the new energy station will not be selected in this round; The iterative training module is used to perform multiple rounds of federated training until the global optimization loss function of the global model converges, at which point the training ends; During the second and subsequent rounds of federated training, the screening module calculates the aggregate contribution of each participant based on the distribution difference aggregation and weight parameter similarity aggregation, and sends the aggregate contribution and local model weight parameters of each participant to the server. The global model weight parameters are calculated based on the aggregate contribution and local model weight parameters of all participants to optimize and update the global model of the server, and the global model weight parameters of the server and the local model weight parameters of all participants are distributed to all new energy stations. Each new energy station updates and trains its own local model based on the global model weight parameters and the local model weight parameters of all participants.

8. The privacy protection model training system for distributed new energy stations according to claim 7, characterized in that: The screening module calculates the distribution difference aggregation for each participant based on the following formula: d j =KL(D j ,D global ) Among them, d j Denotes the difference between the local data distribution of the jth participant and the data distribution of the server, D j represents the local data distribution of the jth participant, D global Represents the data distribution of the server, which is uniformly distributed, KL() represents the KL divergence calculation function, n j represents the relative size of the dataset of the jth participant, N j represents the dataset size of the jth participant, C represents the number of participants, and N i represents the dataset size of the i-th participant, q j represents the distribution difference aggregation of the jth participant, Max() represents the maximum value function, d i represents the difference between the local data distribution of the i-th participant and the data distribution of the server, and a represents a hyperparameter.

9. The privacy protection model training system for distributed new energy stations according to claim 7, characterized in that: The screening module calculates the weight parameter similarity aggregation of each participant based on the following formula: in, represents the weight parameter similarity aggregation of the jth participant in the tth round, β represents the hyperparameter, cosine() represents the cosine similarity calculation function, and denote the local model weight parameters of the jth participant in rounds t-1 and t, respectively. and denote the local model weight parameters of the kth participant in rounds t-1 and t, respectively, and C t represents the number of participants in round t.

10. The privacy protection model training system for distributed new energy stations according to claim 7, characterized in that: Each new energy station calculates the similarity between its own local model weight parameters and the local model weight parameters of all participants, selects the local model weight parameters with the greatest similarity, and performs weighted summation on them with the global model weight parameters before updating and training its own local model.

11. The privacy protection model training system for distributed new energy stations according to claim 7, characterized in that: The iterative training module calculates the global optimization loss function value of the global model based on the following formula: Among them, Loss represents the global optimization loss function value, M represents the number of new energy stations, q i represents the distribution difference aggregation of the i-th new energy station, L i Represents the loss function value of the i-th new energy station.

12. The privacy protection model training system for distributed new energy stations according to claim 7, characterized in that: When the number of byes of a new energy station is greater than the preset threshold, the new energy station will be used as a participant in the model aggregation operation in the next round of federated training.

13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the steps of the method according to any one of claims 1 to 6 by calling the computer program stored in the memory.

14. A computer-readable storage medium for storing a computer program for training a privacy-preserving model for a distributed new energy station, characterized in that: When the computer program is run on a computer, the steps of the method according to any one of claims 1 to 6 are executed.

Citation Information

Patent Citations

  • AGV self-learning navigation obstacle avoidance method for large smart factory

    CN116149328A

  • Federal learning optimization method and system based on reinforcement learning

    CN116523079A

  • Model training method and device, power prediction method, equipment and medium

    CN117094420A