A federated learning system and incentive method for energy blockchain
By deploying incentive smart contracts on the energy blockchain, a collaborative security incentive method is constructed based on game theory, the problem of participants' malicious behavior in federated learning is solved, the model accuracy is improved and the collaboration security is achieved.
Patent Information
- Application Number
- CN202310528215.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2043-05-11
AI Technical Summary
Existing federated learning incentives fail to effectively address possible malicious behaviors in participants, resulting in energy transactions or scheduling errors in the energy blockchain environment and fail to consider collaborative security issues.
Design a federated learning system for energy blockchain, through the incentive smart contracts deployed on the chain, build a collaborative security incentive method based on game theory, calculate the number of malicious behaviors among participants and implement reward and punishment strategies, ensure that the energy department and the committee show honest behavior and build a Nash equilibrium.
It reduces malicious behavior in the federated learning process in the energy blockchain environment, improves model accuracy, reduces the impact of malicious behavior on the final model, and achieves collaborative security.
Smart Images

Figure CN116579442B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a federated learning system and incentive method for energy blockchain. Background Art
[0002] With the digital transformation of the energy industry, energy blockchain plays a vital role in applications such as energy data sharing and distributed power trading. The use of energy data is crucial in this process. Federated learning can enable analysis and computation of energy data while protecting its privacy. However, traditional federated learning relies on a central server, making the various participating parties untrustworthy.
[0003] Furthermore, in the energy blockchain environment, federated learning faces the risk of poisoning attacks from the energy sector and spoofing attacks from committee members responsible for model review. To address collaborative security issues, the use of incentives is a key component of federated learning on the energy blockchain. Current federated learning incentives primarily aim to increase returns for task initiators and participants. However, participants in federated learning may engage in malicious behavior, significantly reducing the accuracy of the resulting model and leading to errors in energy trading or scheduling within the energy blockchain environment. However, current incentives fail to consider collaborative security.
[0004] Game theory can be used to analyze the strategies of participants and their interactions. Through game analysis, participants can learn and predict each other's behavior, and then formulate optimal response strategies based on equilibrium analysis. Therefore, game theory can be used to develop incentives to prevent participants from engaging in malicious behavior. Summary of the Invention
[0005] The present invention provides a federated learning incentive method and system for energy blockchain, which is used to solve the problem that existing federated learning incentive methods do not consider the possible malicious behavior of participants, and encourage energy departments and committee members of the energy blockchain to show honesty during federated learning and reduce malicious behavior.
[0006] In the first part, the present invention provides a federated learning system for energy blockchain, including:
[0007] Energy blockchain uses consortium blockchain as the underlying blockchain technology for energy data sharing and distributed power trading. It uses federated learning technology to achieve privacy-preserving computing of energy data. At the same time, it runs a game-based collaborative security incentive method through incentive smart contracts deployed on the chain.
[0008] The task publisher is responsible for publishing the federated learning tasks of the energy blockchain, uploading the initialized training model through the energy blockchain, and downloading the final training model from the energy blockchain;
[0009] The energy department is responsible for downloading the initial model from the energy blockchain, iteratively training the initial model using local energy privacy data, uploading the trained model to the energy blockchain after homomorphic encryption, and sending the current round of training information to the incentive smart contract. However, the energy department may conduct poisoning attacks to pursue additional benefits.
[0010] The committee is responsible for checking whether the model uploaded by the energy department is secure, sending the inspection results and calculation information of this round to the smart contract, and aggregating and decrypting the model. However, the energy department may conduct deception attacks to save computing costs;
[0011] The incentive smart contract is responsible for determining whether each energy department and committee member has engaged in malicious behavior based on the inspection results and calculation information of this round, and calculating and implementing reward and punishment strategies based on the review results;
[0012] Among them, the task issuer, the energy department and the committee interact in federated learning through the energy blockchain. The incentive smart contract on the chain encourages the energy department and the committee to behave honestly, so that the game model constructed with the energy department and committee members as participants has a Nash equilibrium in which all federated learning participants can collaborate safely.
[0013] The specific process of the federated learning system of the energy blockchain proposed in this invention is as follows:
[0014] S1: Establish a game model, design an incentive method based on the game model, and prove the existence of Nash equilibrium. Then, compile the incentive method into an incentive smart contract and deploy it on the energy blockchain.
[0015] S2: The task publisher publishes the federated learning model training task on the energy blockchain and uploads the initial model of the task to the energy blockchain for the energy department to download and train;
[0016] In S3, the energy department participating in the training downloads the initial model of the task from the blockchain, and then uses local energy privacy data to train the model. The energy department encrypts the trained model using a homomorphic encryption algorithm, uploads it to the blockchain, and then sends the training cost information to the smart contract;
[0017] In S4, committee members download the encrypted models uploaded by each energy department from the blockchain, check these models, upload the verifiable check calculation proof to the blockchain, and then send the check results and check cost information to the smart contract;
[0018] In step S5, after removing abnormal models, committee members aggregate the models and collaboratively decrypt the aggregated models. The decrypted model is the updated model trained by federated learning after this round of iteration. The updated model is then uploaded to the blockchain for the energy department to download and iterate.
[0019] S6, the smart contract implemented on the energy blockchain implements the incentive method, including calculating the number of malicious actions taken by each participant in the federated learning in this round of iteration and calculating the penalty for each participant in this round of iteration;
[0020] In S7, the energy departments participating in the training download the updated model of the task from the blockchain and perform iterative training of the federated learning model until the loss function of the updated model summarized by the committee converges. The updated model of this round is the final training model;
[0021] S8, the task publisher downloads the final training model from the blockchain;
[0022] S9, the smart contract deployed on the energy blockchain implements the incentive method and calculates the rewards obtained by each participant in this federated learning;
[0023] During the federated learning process of the energy blockchain, it is necessary to ensure that the energy department and the committee can properly train and check the model. Therefore, this paper designs an incentive method to ensure the security of the collaboration between the energy department and the committee, and constructs a game model to prove that this incentive method can enable the constructed game model to have a Nash equilibrium in which all federated learning participants can collaborate securely.
[0024] In the second part, the present invention provides a federated learning incentive method for energy blockchain, including the specific processes of S6 and S9 described above.
[0025] The specific process of S6 includes the following steps:
[0026] S601, the smart contract calculates the number of poisoning attacks θ launched by each energy department in this federated learning based on the inspection results sent by the committee members i The smart contract calculates the number of cheating attacks μ launched by each committee member in this federated learning based on the verifiable check calculation proof sent to the blockchain by the committee members. j The smart contract calculates the number of rounds T for this federated learning based on the number of updated models on the blockchain.
[0027] S602, the smart contract calculates the number of all poisoning attacks θ in this federated learning, and calculates the incentive coefficient δ based on this number n ,in
[0028] In S603, the smart contract calculates the penalty for this round, f, for the energy department that initiated the poisoning attack and the committee member that initiated the cheating attack. i,n and f j,n , where f i,n =(δ n -acc)*p i,n / (acc*num n ), f j,n =q j,n +s j,n , where acc is the accuracy of the model checking algorithm, p i,n This is the reward that the energy sector deserves this round, num n is the number of committee members performing model checking in this round, q j,n is the reward that committee members deserve in this round, s j,n is the computational cost of model checking by committee members in this round;
[0029] The specific process of S9 includes the following steps:
[0030] S901, federated learning is completed, and the smart contract calculates the final reward p obtained by each energy sector i , where p i =[(T-θ i ) / T]*P, where T is the number of rounds of federated learning, θ i is the number of malicious behaviors performed by the energy department, and P is the reward that the energy department should receive, as set by the task issuer;
[0031] S902, the smart contract calculates the final reward q received by each committee member j , where q j =[(T-μ j ) / T]*Q, where T is the number of rounds of federated learning, μ j is the number of malicious behaviors performed by the committee member, and Q is the reward that the committee member should receive, as set by the task issuer;
[0032] S903: If the participant does not engage in malicious behavior in this federated learning, that is, does not carry out poisoning attacks or deception attacks, then the smart contract will send the participant an additional honesty reward w set by the task publisher.
[0033] In the third part, the present invention also establishes a game model with the energy sector and committee members as participants and conducts Nash equilibrium analysis, including the following steps:
[0034] S101, defines the strategy set of the energy department and the committee in each iteration in the federated learning of the energy blockchain;
[0035] S102, calculates the total benefit function of the energy department and the committee in the nth round of iteration in the federated learning of the energy blockchain;
[0036] S103, write a game model between the energy sector and the committee in the federated learning of the energy blockchain;
[0037] S104, write the Nash equilibrium and existence proof in the game model.
[0038] The specific process of S101 includes the following steps:
[0039] S1011, Defining energy sector strategies for federated learning on energy blockchains;
[0040] S1012, Defining Committee Strategies in Federated Learning for Energy Blockchains.
[0041] The specific process of S102 includes the following steps:
[0042] S1021, setting relevant parameters for federated learning of energy blockchain;
[0043] S1022, Calculating the energy sector e in pure strategy games i The total profit function in the nth iteration;
[0044] S1023, Calculating committee members c in pure strategy games j The total profit function in the nth iteration;
[0045] S1024, Computational mixed strategy games in the energy sector i and committee members c j The total profit function in the nth iteration.
[0046] The specific process of S103 includes the following steps:
[0047] S1031, write a pure strategy game model for federated learning in energy blockchain;
[0048] S1032, write a mixed strategy game model for federated learning in energy blockchain.
[0049] The specific process of S104 includes the following steps:
[0050] S1041. Write the Nash equilibrium corresponding to the pure strategy game model and the proof of the existence of the Nash equilibrium.
[0051] S1042. Write the Nash equilibrium corresponding to the mixed strategy game model and the proof of the existence of the Nash equilibrium.
[0052] The federated learning system and incentive method for energy blockchain provided by the present invention have the following beneficial technical effects:
[0053] The federated learning system provided by the present invention is adapted to the energy blockchain environment. According to the incentive method provided by the present invention, the smart contract can calculate the number of malicious behaviors of each member and their respective rewards and penalties based on the training costs and inspection costs sent by the energy department and the committee, as well as the inspection results on the energy blockchain, thereby incentivizing the energy department and the committee to exhibit honest behavior, so that the game model constructed with the energy department and committee members as participants has a Nash equilibrium in which all federated learning participants can collaborate safely. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings of the embodiments are briefly introduced below.
[0055] Figure 1 This is a diagram of the federated learning system architecture of the energy blockchain provided by the present invention;
[0056] Figure 2 A flowchart of a federated learning incentive method for energy blockchain provided by the present invention;
[0057] Figure 3 This is a flowchart of S6 in the federated learning incentive method for energy blockchain provided by the present invention;
[0058] Figure 4 This is a flowchart of S9 in the federated learning incentive method for energy blockchain provided by the present invention;
[0059] Figure 5 A flowchart of the federated learning game analysis of the energy blockchain provided by the present invention;
[0060] Figure 6 This is a rendering of the federated learning incentive method for energy blockchain provided by the present invention;
[0061] Figure 7 This is a rendering of the federated learning incentive method for energy blockchain provided by the present invention;
[0062] Figure 8 This is a rendering of the federated learning incentive method for energy blockchain provided by the present invention;
[0063] Figure 9 A computational cost diagram of a federated learning incentive smart contract for an energy blockchain provided by the present invention;
[0064] Figure 10 A deployment cost diagram of a federated learning incentive smart contract for an energy blockchain provided by the present invention; DETAILED DESCRIPTION
[0065] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention.
[0066] Today's federated learning incentive methods mainly encourage task initiators and federated learning participants to obtain higher returns. However, participants in federated learning may engage in malicious behavior, which greatly reduces the accuracy of the model ultimately obtained by federated learning, leading to energy trading or scheduling errors in the energy blockchain environment. However, the current incentive methods do not consider collaborative security issues.
[0067] To address these issues, embodiments of the present invention provide a federated learning system and incentive method for energy blockchains. The federated learning system is adapted to the energy blockchain environment, and the smart contracts deployed on the chain incentivize energy departments and committees to behave honestly, thereby reducing malicious behavior in the federated learning process of the energy blockchain.
[0068] As attached Figure 1 As shown, the present invention provides a federated learning system for energy blockchain, including:
[0069] Energy blockchain uses consortium blockchain as the underlying blockchain technology for energy data sharing and distributed power trading. It uses federated learning technology to achieve privacy-preserving computing of energy data. At the same time, it runs a game-based collaborative security incentive method through incentive smart contracts deployed on the chain.
[0070] The task publisher is responsible for publishing the federated learning tasks of the energy blockchain, uploading the initialized training model through the energy blockchain, and downloading the final training model from the energy blockchain;
[0071] The energy department is responsible for downloading the initial model from the energy blockchain, iteratively training the initial model using local energy privacy data, uploading the trained model to the energy blockchain after homomorphic encryption, and sending the current round of training information to the incentive smart contract. However, the energy department may conduct poisoning attacks to pursue additional benefits.
[0072] The committee is responsible for checking whether the model uploaded by the energy department is secure, sending the inspection results and calculation information of this round to the smart contract, and aggregating and decrypting the model. However, the energy department may conduct deception attacks to save computing costs;
[0073] The incentive smart contract is responsible for determining whether each energy department and committee member has engaged in malicious behavior based on the inspection results and calculation information of this round, and calculating and implementing reward and punishment strategies based on the review results;
[0074] Among them, the task issuer, the energy department and the committee interact in federated learning through the energy blockchain. The incentive smart contract on the chain encourages the energy department and the committee to behave honestly, so that the game model constructed with the energy department and committee members as participants has a Nash equilibrium in which all federated learning participants can collaborate safely.
[0075] As attached Figure 2 As shown, the present invention provides a federated learning incentive method for energy blockchain, including:
[0076] S1: Establish a game model, design an incentive method based on the game model, and prove the existence of Nash equilibrium. Then, compile the incentive method into an incentive smart contract and deploy it on the energy blockchain.
[0077] S2: The task publisher publishes the federated learning model training task on the energy blockchain and uploads the initial model of the task to the energy blockchain for the energy department to download and train;
[0078] In S3, the energy department participating in the training downloads the initial model of the task from the blockchain, and then uses local energy privacy data to train the model. The energy department encrypts the trained model using a homomorphic encryption algorithm, uploads it to the blockchain, and then sends the training cost information to the smart contract;
[0079] In S4, committee members download the encrypted models uploaded by each energy department from the blockchain, check these models, upload the verifiable check calculation proof to the blockchain, and then send the check results and check cost information to the smart contract;
[0080] In step S5, after removing abnormal models, committee members aggregate the models and collaboratively decrypt the aggregated models. The decrypted model is the updated model trained by federated learning after this round of iteration. The updated model is then uploaded to the blockchain for the energy department to download and iterate.
[0081] S6, the smart contract implemented on the energy blockchain implements the incentive method, including calculating the number of malicious actions taken by each participant in the federated learning in this round of iteration and calculating the penalty for each participant in this round of iteration;
[0082] In S7, the energy departments participating in the training download the updated model of the task from the blockchain and perform iterative training of the federated learning model until the loss function of the updated model summarized by the committee converges. The updated model of this round is the final training model;
[0083] S8, the task publisher downloads the final training model from the blockchain;
[0084] S9, the smart contract deployed on the energy blockchain implements the incentive method and calculates the rewards obtained by each participant in this federated learning;
[0085] As attached Figure 3 As shown, the specific process of S6 includes the following steps:
[0086] S601, the smart contract calculates the number of poisoning attacks θ launched by each energy department in this federated learning based on the inspection results sent by the committee members i The smart contract calculates the number of cheating attacks μ launched by each committee member in this federated learning based on the verifiable check calculation proof sent to the blockchain by the committee members. j The smart contract calculates the number of rounds T for this federated learning based on the number of updated models on the blockchain.
[0087] S602, the smart contract calculates the number of all poisoning attacks θ in this federated learning, and calculates the incentive coefficient δ based on this number n ,in
[0088] In S603, the smart contract calculates the penalty for this round, f, for the energy department that initiated the poisoning attack and the committee member that initiated the cheating attack. i,n and f j,n , where f i,n =(δ n -acc)*p i,n / (acc*num n ), f j,n =q j,n +s j,n , where acc is the accuracy of the model checking algorithm, p i,n This is the reward that the energy sector deserves this round, num n is the number of committee members performing model checking in this round, q j,n is the reward that committee members deserve in this round, s j,n is the computational cost of model checking by committee members in this round;
[0089] As attached Figure 4 As shown, the specific process of S9 includes the following steps:
[0090] S901, federated learning is completed, and the smart contract calculates the final reward p obtained by each energy sector i , where p i =[(T-θ i ) / T]*P, where T is the number of rounds of federated learning, θ i is the number of malicious behaviors performed by the energy department, and P is the reward that the energy department should receive, as set by the task issuer;
[0091] S902, the smart contract calculates the final reward q received by each committee memberj , where q j =[(T-μ j ) / T]*Q, where T is the number of rounds of federated learning, μ j is the number of malicious behaviors performed by the committee member, and Q is the reward that the committee member should receive, as set by the task issuer;
[0092] S903: If the participant does not engage in malicious behavior in this federated learning, that is, does not carry out poisoning attacks or deception attacks, then the smart contract will send the participant an additional honesty reward w set by the task publisher.
[0093] As attached Figure 5 As shown, the present invention provides a game analysis method for the system, comprising the following steps:
[0094] S101, defines the strategy set of the energy department and the committee in each iteration in the federated learning of the energy blockchain;
[0095] S102, calculates the total benefit function of the energy department and the committee in the nth round of iteration in the federated learning of the energy blockchain;
[0096] S103, write a game model between the energy sector and the committee in the federated learning of the energy blockchain;
[0097] S104, write the Nash equilibrium and existence proof in the game model.
[0098] The specific process of S101 includes the following steps:
[0099] S1011, Defining the energy sector strategy in federated learning of energy blockchain, energy sector in the energy blockchain environment i ∈E, E is the set of all energy sectors. In the pure strategy game, the energy sector e i The strategy set is α i,n ∈{0,1}, Strategy 0 means that the energy department is conducting poisoning attacks in this round, and strategy 1 means that the energy department is training the model normally in this round. In addition, in the mixed strategy game, the energy department e i With probability u i,n ∈[0,1] selects normal training;
[0100] S1012, Define the Committee Strategy in Federated Learning for Energy Blockchain, Committee Members c j ∈C, C is the set of all committee members. In pure strategy games, committee member c j The strategy set is β j,n ∈{0,1}, Strategy 0 means that the committee member does not check the model in this round and generates a false check calculation proof. Strategy 1 means that the committee member checks the model normally in this round. In addition, in the mixed strategy game, the committee member c j There is a probability v j,n ∈[0,1] performs model checking normally;
[0101] The specific process of S102 includes the following steps:
[0102] S1021, set the relevant parameters in the federated learning of energy blockchain, for the energy sector e i ∈E, the total profit in the nth iteration is P i,n (α i,n ,β j,n ), P i,n (α i,n ,β j,n ) is obtained from the training benefit p i,n , training cost r i,n , additional income g i,n and fines i,n In addition, the present invention considers the success rate acc∈[0,1] of the model detection method. Assume that in the nth round, there are num n Committee members to conduct inspections; for Committee c j ∈C, the total benefit in the nth iteration is Q j,n (α i,n ,β j,n ), Q j,n (α i,n ,β j,n ) by checking the income q j,n , inspection costs j,n 、Bonus g j,n 、fine j,n Composition, bonus g j,n It is a reward that the committee receives when it detects malicious behavior in the energy sector, of which g j,n =f i,n ;
[0103] S1022, Calculating the energy sector e in pure strategy games i The total revenue function in the nth iteration, for the energy sector e i ∈E, when the strategy α is selected in the nth round of iteration i,n =1, e i The total revenue in this round is shown in formula (1):
[0104] P i,n (α i,n ,β j,n )=p i,n -ri,n (1)
[0105] When the energy sector i ∈E selects strategy α in the nth round of iteration i,n = 0, and committee c j ∈C selects strategy β j,n =1, e i The total revenue in this round is shown in formula (2):
[0106]
[0107] In addition, when the energy sector i ∈E selects strategy α in the nth round of iteration i,n = 0, and committee c j ∈C selects strategy β j,n = 0, e i The total revenue in this round is shown in formula (3):
[0108] P i,n (α i,n ,β j,n )=p i,n -r i,n +g i,n (3)
[0109] You can write the energy sector e i The total profit function of ∈E in the nth round of iteration is shown in formula (4):
[0110]
[0111] S1023, Calculating committee members c in pure strategy games j The total profit function in the nth iteration, for committee c j ∈C, when the strategy β is selected in the nth round of iteration j,n =1, and the energy sector e i ∈E selects strategy α i,n =1, c j The total revenue in this round is shown in formula (5):
[0112] Q j,n (α i,n ,β j,n )=q j,n -s j,n (5)
[0113] When the committee j ∈C selects strategy β in the nth round of iteration j,n =1, the energy sector e i ∈E selects strategy α i,n =0, cj The total revenue in this round is shown in formula (6):
[0114]
[0115] In addition, when the committee c j ∈C selects strategy β in the nth round of iteration j,n =0, c j The total revenue in this round is shown in formula (7):
[0116] Q j,n (α i,n ,β j,n )=-f j,n (7)
[0117] You can write the energy sector e i The total profit function of ∈E in the nth round of iteration is shown in formula (8):
[0118]
[0119] S1024, Computational mixed strategy games in the energy sector i and committee members c j The total revenue function in the nth iteration, according to the von Neumann-Morgenstern axiom, is the energy sector e i Expected return With committee members c j The expected return ω j,n As shown in formula (9):
[0120]
[0121] in and Represents the energy sector e i Expected benefits of normal training and malicious behavior, and Represents committee members c j The expected returns of checking and not checking are calculated as follows:
[0122] For the energy sector i , in the nth round of iteration, normal training is selected, that is, α i,n The expected return when =1 is shown in formula (10):
[0123]
[0124] In the nth round of iteration, malicious behavior is chosen, that is, α i,n The expected return when =0 is shown in formula (11):
[0125]
[0126] For committee members c j , in the nth round of iteration, the model is selected for testing, that is, β j,n The expected return when =1 is shown in formula (12):
[0127]
[0128] In the nth round of iteration, we choose not to perform model detection, that is, β j,n The expected return when =0 is shown in formula (13):
[0129]
[0130] Therefore, under the mixed strategy game, the energy sector e i With committee members c j The respective total expected return functions are shown in Equations (14) and (15):
[0131]
[0132] The specific process of S103 includes the following steps:
[0133] S1031, write a pure strategy game model for federated learning in the energy blockchain, as follows:
[0134] Participants: Energy sector in the energy blockchain environment i ∈E, E is the set of all energy sectors; committee members c j ∈C, C is the set of all committee members;
[0135] Strategy set: The strategy set of the energy sector is α i,n ∈{0,1}, Strategy 0 indicates that the energy department conducts poisoning attacks in this round, and strategy 1 indicates that the energy department trains the model normally in this round; the strategy set of committee members is β j,n ∈{0,1}, Strategy 0 means that the committee member does not check the model in this round and generates a false check calculation proof. Strategy 1 means that the committee member checks the model normally in this round.
[0136] Profit: The profit of the energy sector is P i,n (α i,n ,β j,n ), j∈C represents the benefits of the energy sector under the influence of its own strategy and the strategies of committee members; the benefits of committee members are Q j,n (α i,n ,βj,n ), j∈C, represents the benefits of the committee member under the influence of his own strategy and the energy department's strategy;
[0137] S1032: Write a mixed strategy game model for federated learning in the energy blockchain, as follows:
[0138] Participants: Energy sector in the energy blockchain environment i ∈E, E is the set of all energy sectors; committee members c j ∈C, C is the set of all committee members;
[0139] Strategy set: The strategy set of the energy sector is α i,n ∈{0,1}, At the same time, the energy sector i With probability u i,n ∈[0,1] selects normal training; the strategy set of committee members is β j,n ∈{0,1}, At the same time, committee members c j There is a probability v j,n ∈[0,1] performs model checking normally;
[0140] Benefits: According to the von Neumann-Morgenstern axiom, the energy sector e i Expected return With committee members c j The expected return ω j,n As shown in formula (16):
[0141]
[0142] in and Represents the energy sector e i Expected benefits of normal training and malicious behavior, and Represents committee members c j the expected benefits of checking versus not checking;
[0143] The specific process of S104 includes the following steps:
[0144] S1041, the Nash equilibrium corresponding to the pure strategy game model is as follows:
[0145] In the nth iteration, the energy sector e i Policy set exists E is the set of energy sectors that meet the equilibrium conditions, and the committee members c j Policy set exists C is a set of committee members that meet the equilibrium conditions, so that formula (17) is established:
[0146]
[0147] Based on the above, we can write the energy sector e i With committee members c j The specific benefit functions are as follows:
[0148]
[0149]
[0150] For the energy sector i , according to formula (17) and formula (18), and p i,n -r i,n +g i,n >p i,n -r i,n Established, therefore does not exist That is, there is no α i,n =1 Nash equilibrium.
[0151] For committee members c j , according to formula (17) and formula (19), since acc∈(0,1), then therefore The Nash equilibrium is β j,n =1.
[0152] That is, there is no pure strategy game model that satisfies α at the same time. i,n =1 and β j,n =1 Nash equilibrium.
[0153] S1042, the Nash equilibrium corresponding to the mixed strategy game model is as follows:
[0154] In the nth iteration, the energy sector e i Policy set exists E is the set of energy sectors that meet the equilibrium conditions, and the committee members c j Policy set exists C is a set of committee members that meet the equilibrium conditions, so that formula (20) is established:
[0155]
[0156] Based on the above, we can write the energy sector e i With committee members c j The specific expected return function is as follows:
[0157]
[0158] Because the strategic choices of committee members will affect the expected returns of the energy sector, we first analyze the Nash equilibrium of committee members' strategies. The specific analysis is as follows:
[0159] For committee members c j , according to formula (22), we can get formula (23) and formula (24):
[0160]
[0161]
[0162] According to formula (24), we can get make Then f(u i.n ) in u i,n ∈[0,1] decreasing, f(u i.n )>f(1), so when f(1)>0, ω j,n In v j,n ∈[0,1] increases, that is, when q j,n -s j,n +f j,n > 0, the greater the probability that committee members will conduct model checking, the greater the expected benefit. Under this condition, in the nth round of iteration, v j,n =1.
[0163] For the energy sector i , according to formula (21), we can get formula (25) and formula (26):
[0164]
[0165] According to formula (26), we can get make When q j,n -s j,n +f j,n > 0, for committee member v j,n =1, so When g(1)>0, in u j,n ∈[0,1] increases, that is, when The greater the probability that the energy sector conducts normal training, the greater the expected benefit.
[0166] Therefore, when q j,n -s j,n +f j,n >0 and When , the greater the probability that the committee members conduct model checking, the greater the expected benefit, and the greater the probability that the energy department conducts normal training, the greater the expected benefit, that is, there is α i,n =1 and β j,n =1 Nash equilibrium.
[0167] The incentive method provided by the present invention can reduce poisoning attacks launched by the energy sector and deception attacks launched by the committee responsible for checking the model in the federated learning of the energy blockchain, thereby reducing the impact of these malicious behaviors on the accuracy of the final model.
[0168] Attachment Figure 6 To the attached Figure 9 The experimental and simulation evaluation results of the federated learning system and incentive method for energy blockchain provided by the present invention are demonstrated, namely, their effectiveness in reducing malicious behavior and achieving collaborative security.
[0169] The effect of the incentive method provided by the present invention is as shown in the attached Figure 6 As shown, in a federated learning environment on an energy blockchain, 10 energy departments and 3 committee members participated. These participants had a 20% chance of launching a data poisoning or deceptive attack, while committee members had an 80% probability of detecting malicious models uploaded by energy departments. Although participants in the energy blockchain federated learning environment only had a 20% chance of launching a malicious attack, the accuracy of the final aggregated model significantly decreased by approximately 14.3% compared to normal training. However, the incentive method provided by the present invention reduced the risk of malicious behavior, resulting in a final model accuracy drop of only approximately 1.72% compared to normal training. The accompanying figure demonstrates the effectiveness of the incentive method provided by the present invention.
[0170] The effect of the incentive method provided by the present invention is as shown in the attached Figure 7 As shown in the figure, when conducting federated learning in the energy blockchain environment, as the probability of participants initiating malicious behavior increases, the accuracy of the final model gradually decreases. However, under the incentive method provided by the present invention, even if the probability of participants initiating malicious behavior reaches 40%, the accuracy of the final aggregated model is only reduced by about 9.10% compared with normal training. The figure demonstrates the robustness of the incentive method provided by the present invention.
[0171] The effect of the incentive method provided by the present invention is as shown in the attached Figure 8 As shown, when conducting federated learning in an energy blockchain environment, as the accuracy of the model checking algorithm used by committee members decreases, the accuracy of the final model also gradually decreases. However, under the incentive method provided by the present invention, even if the committee members have only a 50% probability of detecting the malicious model uploaded by the energy department, the accuracy of the final model is only reduced by about 9.27%. The accompanying figure demonstrates the robustness of the incentive method provided by the present invention.
[0172] The gas cost of the incentive smart contract in the system provided by the present invention is as follows: Figure 9 and attached Figure 10 As shown, with Figure 9 is the computational overhead of each step in the incentive method provided by the present invention, Figure 10 It is the deployment cost of the incentive smart contract in the incentive method provided by this invention. Figure 9 and attached Figure 10 It can be seen that the computational cost and deployment cost of the incentive smart contract written by the incentive method provided by the present invention are within an acceptable range. The accompanying drawings demonstrate the low complexity and ease of deployment of the incentive method provided by the present invention.
Claims
1. A game-based energy blockchain federated learning incentive method, characterized by: The following steps are involved: Step 1: Establish a game model, design an incentive method based on the game model, and prove the existence of Nash equilibrium. Then, compile the incentive method into an incentive smart contract and deploy it on the energy blockchain. Step 2: The task publisher publishes the federated learning model training task on the energy blockchain and uploads the initial model of the task to the energy blockchain for the energy department to download and train; In step 3, the energy department participating in the training downloads the initial model of the task from the blockchain, and then uses the local energy privacy data to train the model. The energy department encrypts the trained model using a homomorphic encryption algorithm, uploads it to the blockchain, and then sends the training cost information to the smart contract; Step 4: Committee members download the encrypted models uploaded by each energy department from the blockchain, check these models, upload verifiable proof of the check calculations to the blockchain, and then send the check results and check cost information to the smart contract; Step 5: After removing abnormal models, committee members aggregate the models and collaboratively decrypt the aggregated models. The decrypted model is the updated model trained by federated learning after this round of iteration. The updated model is then uploaded to the blockchain for the energy department to download and iteratively train. Step 6: The smart contract deployed on the energy blockchain implements the incentive method, including calculating the number of malicious actions taken by each federated learning participant in this round of iteration and calculating the penalty for each participant in this round of iteration; Step 6.1: The smart contract calculates the number of poisoning attacks θ launched by each energy sector in this federated learning based on the inspection results sent by the committee members. i The smart contract calculates the number of cheating attacks μ launched by each committee member in this federated learning based on the verifiable check calculation proof sent to the blockchain by the committee members. j The smart contract calculates the number of rounds T for this federated learning based on the number of updated models on the blockchain. Step 6.2: The smart contract calculates the number of poisoning attacks θ in this federated learning and calculates the incentive coefficient δ based on this number. n ,in Step 6.3: The smart contract calculates the penalty f for the energy sector that launched the poisoning attack and the committee member that launched the cheating attack. i,n and f j,n , where f i,n =(δ n -acc)*p i,n / (acc*num n ), f j,n =q j,n +s j,n , where acc is the accuracy of the model checking algorithm, p i,n This is the reward that the energy sector deserves this round, num n is the number of committee members performing model checking in this round, q j,n is the reward that committee members deserve in this round, s j,n is the computational cost of model checking by committee members in this round; Step 7: The energy departments participating in the training download the updated model of the task from the blockchain and perform iterative training of the federated learning model until the loss function of the updated model summarized by the committee converges. The updated model of this round is the final training model. Step 8: The task publisher downloads the final training model from the blockchain; Step 9: The smart contract deployed on the energy blockchain implements the incentive method and calculates the rewards obtained by each participant in this federated learning; Step 9.1: Federated learning is completed, and the smart contract calculates the final reward p obtained by each energy sector i , where p i =[(T-θ i ) / T]*P, where T is the number of rounds of federated learning, θ i is the number of malicious behaviors performed by the energy department, and P is the reward that the energy department should receive, as set by the task issuer; Step 9.2: The smart contract calculates the final reward q received by each committee member j , where q j =[(T-μ j ) / T]*Q, where T is the number of rounds of federated learning, μ j is the number of malicious behaviors performed by the committee member, and Q is the reward that the committee member should receive, as set by the task issuer; Step 9.3: If the participant does not engage in malicious behavior in this federated learning, that is, does not perform poisoning attacks or cheating attacks, then the smart contract will send the participant an additional honesty reward w set by the task publisher.
2. A game-based energy blockchain federated learning system for executing the method of claim 1, characterized in that: The game-based energy blockchain federated learning system includes: Energy blockchain uses consortium blockchain as the underlying blockchain technology for energy data sharing and distributed power trading. It uses federated learning technology to achieve privacy-preserving computing of energy data. At the same time, it runs a game-based collaborative security incentive method through incentive smart contracts deployed on the chain. The task publisher is responsible for publishing the federated learning tasks of the energy blockchain, uploading the initialized training model through the energy blockchain, and downloading the final training model from the energy blockchain; The energy department is responsible for downloading the initial model from the energy blockchain, iteratively training the initial model using local energy privacy data, uploading the trained model to the energy blockchain after homomorphic encryption, and sending the current round of training information to the incentive smart contract. However, the energy department may conduct poisoning attacks to pursue additional benefits. The committee is responsible for checking whether the model uploaded by the energy department is secure, sending the inspection results and calculation information of this round to the smart contract, and aggregating and decrypting the model. However, the energy department may conduct deception attacks to save computing costs; The incentive smart contract is responsible for determining whether each energy department and committee member has engaged in malicious behavior based on the inspection results and calculation information of this round, and calculating and implementing reward and punishment strategies based on the review results; Among them, the task issuer, the energy department and the committee interact in federated learning through the energy blockchain. The incentive smart contract on the chain encourages the energy department and the committee to behave honestly, so that the game model constructed with the energy department and committee members as participants has a Nash equilibrium in which all federated learning participants can collaborate safely.
3. The game-based energy blockchain federated learning system according to claim 2, characterized in that: The game model includes: 1) Pure strategy game model Participants: Energy sector in the energy blockchain environment i ∈E, E is the set of all energy sectors; committee members c j ∈C, C is the set of all committee members; Strategy Set: The strategy set for the energy sector is Strategy 0 indicates that the energy department is conducting a poisoning attack in this round, and strategy 1 indicates that the energy department is training the model normally in this round; the strategy set of the committee members is Strategy 0 means that the committee member does not check the model in this round and generates a false check calculation proof. Strategy 1 means that the committee member checks the model normally in this round. Earnings: Earnings in the energy sector are represents the benefits of the energy sector under the influence of its own strategy and the strategies of committee members; the benefits of committee members are Indicates the benefits of the committee members under the influence of their own strategies and the energy sector's strategies; The pure strategy Nash equilibrium corresponding to this game model is as follows: In the nth iteration, the energy sector e i Policy set exists E is the set of energy sectors that meet the equilibrium conditions, and the committee members c j Policy set exists C is the set of committee members that meet the equilibrium conditions such that: 2) Mixed Strategy Game Model Participants: Energy sector in the energy blockchain environment i ∈E, E is the set of all energy sectors; committee members c j ∈C, C is the set of all committee members; Strategy Set: The strategy set for the energy sector is At the same time, the energy sector i With probability u i,n ∈[0,1] selects normal training; the strategy set of committee members is At the same time, committee members c j There is a probability v j,n ∈[0,1] performs model checking normally; Benefits: According to the von Neumann-Morgenstern axiom, the energy sector e i Expected return With committee members c j The expected return ω j,n for: in and Represents the energy sector e i Expected benefits of normal training and malicious behavior, and Represents committee members c j the expected benefits of checking versus not checking; The mixed strategy Nash equilibrium corresponding to this game model is as follows: In the nth iteration, the energy sector e i Policy set exists E is the set of energy sectors that meet the equilibrium conditions, and the committee members c j Policy set exists C is the set of committee members that meet the equilibrium conditions such that:
Citation Information
Patent Citations
Federal learning excitation method and device based on block chain, equipment and medium
CN114580658A
Dynamic excitation model based on smart contract and evolutionary game theory
CN115731035A