A computing power network privacy protection federated learning method, device and storage medium

By using public and private keys and blockchain technology in a decentralized computing network, combined with single-mask encryption and linear homomorphic hashing algorithms, the problems of data privacy protection and model training accuracy in the computing network are solved and achieved. Stable and efficient federated learning.

CN118282610BActive Publication Date: 2024-09-27NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410697728.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-27
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

In a decentralized computing network environment, the existing centralized federated learning encryption algorithm cannot effectively protect data privacy, cannot tolerate client disconnection, and server dishonesty will lead to a decrease in model training accuracy.

Method used

It adopts public and private key algorithms and blockchain technology, generates shared keys through Diffie-Hellman key agreement algorithm, uses single mask encryption algorithm and linear homomorphic hash algorithm to ensure the privacy and aggregation correctness of the model, and achieves partial calculation The training process can still be completed when the force node is offline.

Benefits of technology

In the computing power network environment, the stable training effect of the model is achieved, preventing theft and collusion of computing power nodes, ensuring the security of private data, and improving the robustness and computing power utilization of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118282610B
    Figure CN118282610B
Patent Text Reader

Abstract

The present invention discloses a computing power network privacy protection federated learning method in the field of network information security and data privacy protection technology, including: based on the mask obtained by decrypting the encryption mask through a shared key and the self-mask generated by the computing power node through a mask generation function, the global model is encrypted by a single mask encryption algorithm to obtain an encryption model; the mask and the aggregate model of all encryption models are input using a single mask decryption algorithm to complete decryption; the computing power node downloads the homomorphic hash value uploaded by other computing power nodes from the blockchain, and the correctness of the aggregate model is verified by the homomorphic hash verification algorithm. The blockchain selects a model that has passed the verification as a new global model, and iterates all the above steps until the global model converges or reaches the communication round. The present invention can solve the technical problems of privacy leakage caused by the theft of privacy data by computing power nodes, the collusion between computing power nodes, and the appearance of dishonest aggregate models in computing power nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network information security and data privacy protection, and in particular to a computing power network privacy protection federated learning method, device and storage medium. Background Art

[0002] In recent years, with the innovation and development of technologies such as the Internet, big data, and artificial intelligence, AI has gradually penetrated into our daily lives. AI models have a huge number of parameters and require a huge number of samples for training. In reality, data samples are scattered. Each company has its own user data. In order to enhance their own corporate competitiveness, companies will not share data, which forms a "data island". In addition, computing power platforms are also scattered. Many computing power platforms provide computing power services, but they do not have data training models themselves, so computing power will be wasted when there are no tasks.

[0003] In response to the data silo problem, Google proposed federated learning in 2016, which is a distributed machine learning paradigm. Federated learning consists of two parts: global model aggregation and local update. A server sends an initialized model to the client. The client trains the model with local data and sends the iterated model back to the server. Finally, the server aggregates the model through some aggregation strategies (for example, FedAvg). In this way, a high-quality model can be obtained without leaking local data to other participants.

[0004] In response to the problem of decentralized computing power, China Mobile published a white paper on computing power networks in 2021. With the rapid development of technologies such as 5G, big data, and cloud computing, data processing requires powerful computing power and network connections for cloud-edge collaboration. In the context of computing power networks, computing power providers and data holders can train models on decentralized data sets and achieve model aggregation through certain algorithms. This can protect the privacy of each data holder to a certain extent and improve the computing power utilization of each computing power provider. Although the training structure of federated learning protects the privacy of data holders to a certain extent, it still needs to be combined with traditional encryption algorithms in actual applications to protect the privacy of data holders. Among them, most encryption algorithms are based on centralized federated learning methods. In the decentralized network structure of the computing power network, centralized federated learning encryption algorithms have some shortcomings, such as:

[0005] Centralized federated learning encryption algorithms use the same public and private keys between clients, which are not disclosed to the central server. However, if the central server and the client collude with each other, the client's data will be leaked. Therefore, some centralized encryption algorithms cannot be directly applied in a decentralized environment.

[0006] Some centralized federated learning algorithms do not support client disconnection. That is, if some clients are disconnected, the federated learning process will not be able to continue. Therefore, compared with these centralized federated learning encryption algorithms, decentralized encryption algorithms also need to consider the client disconnection problem. It is necessary to complete the federated learning training and encryption and decryption process even after some clients are disconnected.

[0007] In addition, the centralized federated learning encryption algorithm requires the server to remain honest. If the server does not have the correct aggregation model, that is, returns the wrong model to the client, the client will be unable to effectively iterate the model, ultimately resulting in a decrease in the accuracy of model training.

[0008] In the computing network system, the client is equivalent to the computing node, and the same technical defects and deficiencies will occur. Therefore, a computing network privacy protection federated learning method, device and storage medium are urgently needed to solve the above technical problems. Summary of the invention

[0009] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide a computing power network privacy-preserving federated learning method, device and storage medium, which can solve the technical problems of privacy leakage of holders caused by the theft of private data by computing power nodes, collusion between computing power nodes, and dishonest aggregation models of computing power nodes.

[0010] To achieve the above object, the present invention is implemented by adopting the following technical solutions:

[0011] In a first aspect, the present invention provides a computing power network privacy protection federated learning method, comprising:

[0012] The computing node generates a public-private key pair through a public-private key algorithm, uploads the public key in the public-private key pair and the initialization model of the computing node to the blockchain, and randomly selects an initialization model as the global model;

[0013] The computing node obtains the public keys of the global model and other computing nodes from the blockchain, and trains the global model through the local data set;

[0014] Download the encryption mask sent by other computing nodes from the blockchain, encrypt the global model by a single-mask encryption algorithm based on the mask obtained by decrypting the encryption mask by the shared key and the self-mask generated by the computing node by the mask generation function to obtain an encrypted model, and upload the encrypted model to the blockchain;

[0015] The computing power node calculates the masked sum using the masked sum calculation formula according to the set of online computing power nodes obtained from the blockchain, and uploads the masked sum to the blockchain;

[0016] The computing node downloads all the encrypted models and mask sums from the blockchain, and uses the single mask decryption algorithm to input the mask sum into the aggregate model of all encrypted models to complete the decryption;

[0017] The computing node uses the linear homomorphic hashing algorithm to calculate the homomorphic hash values ​​of the unencrypted model and the decrypted aggregate model, and uploads the two homomorphic hash values ​​together with the decrypted model to the blockchain;

[0018] The computing node downloads the homomorphic hash value uploaded by other computing nodes from the blockchain, verifies the correctness of the aggregation model using the linear homomorphic hash verification algorithm and uploads the verification result to the blockchain. The blockchain selects a verified model as the new global model and iterates all the above steps until the global model converges or reaches the communication round;

[0019] The computing power node generates a shared key using the private key in its own public-private key pair and the public key of the other computing power nodes.

[0020] Furthermore, the downloading of the encryption mask sent by other computing nodes from the blockchain includes:

[0021] Other computing nodes generate masks through the mask generation function, generate shared keys through the shared key generation algorithm, encrypt the mask through the symmetric encryption algorithm and upload it to the blockchain.

[0022] Furthermore, the public-private key algorithm is a Diffie-Hellman key agreement algorithm, including:

[0023] ;

[0024] The shared key generation algorithm is a Diffie-Hellman key agreement algorithm, including:

[0025] The security parameters As input, we get the Diffie-Hellman public parameter KApp, namely:

[0026] ;

[0027] Among them, KA.Setup is the public parameter generation algorithm;

[0028] The public parameter KApp is used as the input of the key generation algorithm to obtain the public and private keys of the computing power nodes u and v, that is:

[0029] ;

[0030] The computing node u uses his private key and the public key of computing node v Generate a shared key using the Diffie-Hellman negotiation algorithm:

[0031] ;

[0032] in, is the private key, is the public key, is the key generation algorithm, is a safety parameter, satisfy ; For two computing nodes, For computing power nodes And computing power nodes The shared key between is the key agreement algorithm, For computing power nodes The private key of For computing power nodes The public key of

[0033] Further, the encrypted mask is decrypted by a shared key to obtain a mask, including:

[0034] The Diffie-Hellman key negotiation algorithm is used to As a symmetric key, that is:

[0035] ;

[0036] Among them, SE.KeyGen is the symmetric key generation algorithm in symmetric encryption;

[0037] The computing power node Send to computing power node The mask is used as plain text, As the shared key for communication between the two parties, the AES symmetric encryption algorithm is used to obtain the encryption mask ,Right now:

[0038] ;

[0039] Among them, SE.Enc is the encryption algorithm in symmetric encryption;

[0040] Computing Node Upon receipt of the encryption mask After use Decrypted by the computing power node Send to computing power node The mask vector ,Right now:

[0041] ;

[0042] Among them, SE.Dec is the decryption algorithm in symmetric encryption;

[0043] Said The generating function of is expressed as:

[0044] ;

[0045] in, It's a seed Generate a vector of pseudo-random numbers, A pseudo-random number generator.

[0046] Furthermore, the single-mask encryption algorithm is expressed as:

[0047] ;

[0048] in, is the encrypted model vector, is the unencrypted model vector, For computing power nodes The generated self-masking vector, The set of computing nodes that successfully uploaded the encryption mask. To divide the computing power node A collection of computing power nodes other than .

[0049] Furthermore, the mask and calculation method include:

[0050] ;

[0051] in, is the mask sum calculated based on the set of online computing nodes, For computing power nodes The generated self-mask, The set of computing nodes that successfully uploaded the encryption mask. The set of computing nodes that successfully uploaded the encryption model. For collection and collection The difference of .

[0052] Furthermore, the single mask decryption algorithm includes:

[0053] ;

[0054] in, is the decrypted aggregate model vector, is the aggregated encrypted model vector, For all masks and downloaded from the blockchain, The computing node in the computing node set that successfully uploaded the encryption mask.

[0055] Furthermore, the linear homomorphic hash algorithm is expressed as:

[0056] ;

[0057] The expression of the linear homomorphic hash verification algorithm is:

[0058] ;

[0059] in, express A linear combination of homomorphic hash values, represents the number of linear coefficients, Represents the model hash value, Expressed as a linear coefficient, Represents the hash value after hashing the model. represents the model dimension, is one of the model dimensions, represents the model vector, represents a cyclic group with order , is a prime number, and the generator is , Indicates belonging to of elements.

[0060] In a second aspect, the present invention provides a privacy-preserving federated learning device, comprising:

[0061] An initialization module is used for the computing node to generate a public-private key pair through a public-private key algorithm, and upload the public key in the public-private key pair and the initialization model of the computing node to the blockchain, and randomly select an initialization model as the global model;

[0062] A training module, used for a computing node to obtain the global model and the public keys of other computing nodes from the blockchain, and train the global model through a local data set;

[0063] A model encryption module, used to download the encryption mask sent by other computing nodes from the blockchain, encrypt the global model by a single-mask encryption algorithm based on the mask obtained by decrypting the encryption mask by a shared key and the self-mask generated by the computing node by a mask generation function to obtain an encrypted model, and upload the encrypted model to the blockchain;

[0064] A mask sum calculation module, which is used for the computing power node to calculate the mask sum using the mask sum calculation formula according to the set of online computing power nodes obtained from the blockchain, and upload the mask sum to the blockchain;

[0065] The decryption module is used by the computing power node to download all encryption models and mask sums from the blockchain, and use the single mask decryption algorithm to input the mask sum into the aggregate model of all encryption models to complete the decryption;

[0066] The homomorphic hash value calculation module is used for the computing node to calculate the homomorphic hash values ​​of the unencrypted model and the decrypted aggregate model using the linear homomorphic hash algorithm, and upload the two homomorphic hash values ​​together with the decrypted model to the blockchain;

[0067] Verification module, which is used by computing nodes to download homomorphic hash values ​​uploaded by other computing nodes from the blockchain, use the linear homomorphic hash verification algorithm to verify the correctness of the aggregation model and upload the verification results to the blockchain. The blockchain selects a model that has passed the verification as the new global model and iterates all the above steps until the global model converges or reaches the communication round;

[0068] The computing power node generates a shared key using the private key in its own public-private key pair and the public key of the other computing power nodes.

[0069] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any of the above methods when executed by a processor.

[0070] Compared with the prior art, the present invention has the following beneficial effects:

[0071] The present invention is a computing power network privacy protection federated learning method. In a computing power network environment, under the premise of stable overall model effect, a single-mask encryption-based scheme is proposed for honest but curious computing power nodes in federated learning. The linear homomorphic hash algorithm is used to ensure the correctness of model aggregation, further preventing other computing power nodes from destroying the model during the aggregation process, and also ensuring tolerance for computing power node disconnection. The training process can be continued after a certain number of computing power nodes are disconnected. Lightweight encryption is used to ensure that other computing power nodes cannot infer privacy data.

[0072] The present invention applies single-mask encryption to the federated learning framework in the computing network, reduces the computational complexity with a lightweight encryption method, and realizes a new privacy-preserving federated learning solution in the current computing network environment;

[0073] The present invention uses self-masking and masks of other computing nodes to encrypt the model, which can not only prevent other computing nodes from stealing private data, but also prevent collusion between computing nodes, thus ensuring the privacy of the entire process.

[0074] The present invention also uses a linear homomorphic hashing algorithm to verify the correctness of model aggregation, and can check whether other computing nodes have dishonest aggregation models. The federated learning method proposed in the present invention is based on the infrastructure of the FedAvg algorithm. After the model training is completed, each computing node encrypts the trained model and uploads it to the blockchain, and then aggregates the encrypted model uploaded to the blockchain. Through the mask sum uploaded by the computing node, each computing node can decrypt the aggregated model, thus achieving the goal of aggregating the model without leaking the privacy of a single computing node;

[0075] The present invention is applied in a computing power network environment. Compared with traditional centralized federated learning, it can reduce the impact caused by the computing power node being offline, and at the same time avoid the impact of server failures on the entire learning process, thereby improving the robustness of the overall system and the utilization of computing power. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 A flowchart of a computing power network privacy-preserving federated learning method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0077] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.

[0078] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0079] For ease of understanding, here is a brief description of mask encryption:

[0080] As a classic privacy protection model, mask encryption mainly encrypts the model by generating a pseudo-random number vector of the same length as the model vector, so that the distribution of the encrypted model tends to be average. The attacker cannot obtain the pseudo-random number vector without knowing the pseudo-random number generation seed, so he cannot decrypt the model, so the original data will not be leaked. Mask encryption is divided into paired mask and single mask. Paired mask requires determining the order of computing power nodes. Considering that in the computing power network environment, determining the order of computing power nodes may make the scheme "fragile", that is, the computing power node may be offline. Therefore, this application uses a single mask as a privacy protection model, which can achieve privacy protection for the computing power node model without affecting the overall training effect.

[0081] Embodiment 1:

[0082] Figure 1 This is a flow chart of the computing power network privacy protection federated learning method in the first embodiment of the present invention. This flow chart only shows the logical sequence of the method described in this embodiment. In other possible embodiments of the present invention, different Figure 1 The steps shown or described are accomplished in the order shown.

[0083] The computing power network privacy protection federated learning method provided in this embodiment can be applied to a terminal and can be executed by a privacy protection federated learning device. The device can be implemented by software and / or hardware. The device can be integrated in a terminal, for example: any smart phone, tablet computer or computer device with communication function. Figure 1 The method of this embodiment specifically includes the following steps:

[0084] Step 1: The computing node generates a public-private key pair through a public-private key algorithm, and uploads the public key in the public-private key pair and the initialization model of the computing node to the blockchain, and randomly selects an initialization model as the global model;

[0085] The public-private key algorithm is the Diffie-Hellman key agreement algorithm. The present invention uses the Diffie-Hellman key agreement algorithm and the symmetric encryption algorithm in the computing power node encryption to encrypt the mask sent to other computing power nodes. The public-private key algorithm includes:

[0086] ;

[0087] in, is the private key, is the public key, is the key generation algorithm, is a security parameter. Step 2: The computing node obtains the public keys of the global model and other computing nodes from the blockchain, and trains the global model through the local data set;

[0088] Step 3: Download the encryption mask sent by other computing nodes from the blockchain, encrypt the global model using a single-mask encryption algorithm based on the mask obtained by decrypting the encryption mask using the shared key and the self-mask generated by the computing node using the mask generation function to obtain an encrypted model, and upload the encrypted model to the blockchain;

[0089] The encryption mask sent by other computing nodes is downloaded from the blockchain from: other computing nodes generate masks through mask generation functions, and shared keys are generated by shared key generation algorithms, and the masks are encrypted through symmetric encryption algorithms and uploaded to the blockchain, where the shared keys are generated by the computing nodes through their own private keys and the public keys of the other computing nodes;

[0090] The shared key generation algorithm is the Diffie-Hellman key agreement algorithm, including:

[0091] The security parameters Get the Diffie-Hellman public parameters as input ,Right now:

[0092] ;

[0093] Among them, KA.Setup is the public parameter generation algorithm;

[0094] The public parameters As the input of the key generation algorithm, the computing power node is obtained and The public and private keys are:

[0095] ;

[0096] Computing Node Use his private key With computing power nodes The public key Generate a shared key using the Diffie-Hellman negotiation algorithm:

[0097] ;

[0098] in, is the private key, is the public key, satisfy ; For two computing nodes, For computing power nodes And computing power nodes The shared key between is the key agreement algorithm, For computing power nodes The private key of For computing power nodes 's public key;

[0099] The encrypted mask is decrypted by a shared key to obtain a mask, comprising:

[0100] Use the Diffie-Hellman key negotiation algorithm to share keys As a symmetric key, that is:

[0101] ;

[0102] Among them, SE.KeyGen is the symmetric key generation algorithm in symmetric encryption;

[0103] The computing power node Send to computing power node The mask is used as plain text, The shared key for communication between the two parties is obtained by using the AES symmetric encryption algorithm. ,Right now:

[0104] ;

[0105] Among them, SE.Enc is the encryption algorithm in symmetric encryption;

[0106] Computing Node Upon receipt of the encrypted After use Decrypted ,Right now:

[0107] ;

[0108] Among them, SE.Dec is the decryption algorithm in symmetric encryption;

[0109] Said The generating function of is expressed as:

[0110] ;

[0111] in, It's a seed Generate a vector of pseudo-random numbers, is a pseudo-random number generator that satisfies:

[0112] The output is computationally indistinguishable from uniformly distributed elements sampled from the output space;

[0113] The same seed produces the same output;

[0114] The single-mask encryption algorithm is expressed as:

[0115] ;

[0116] in, is the encrypted model vector, is the unencrypted model vector, For computing power nodes The generated self-masking vector, The set of computing nodes that successfully uploaded the encryption mask. To divide the computing power node A collection of computing nodes other than

[0117] Since the output of pseudo-random numbers is uniformly distributed, after the local model is encrypted with a single mask, the local model vector is also uniformly distributed. The attacker cannot separate the original model from the encrypted model. Therefore, single-mask encryption protects the privacy of the computing nodes. At the same time, in order to prevent collusion between computing nodes, a self-generated mask is added to the single-mask encryption. Even if the colluding computing nodes know all , but they don't know , so the model cannot be decrypted, which makes the encryption algorithm have the function of preventing collusion between computing nodes;

[0118] Step 4: The computing power node calculates the mask sum using the mask sum calculation formula according to the set of online computing power nodes obtained from the blockchain, and uploads the mask sum to the blockchain;

[0119] The mask and calculation method include:

[0120] ;

[0121] in, is the mask sum calculated based on the set of online computing nodes, The set of computing nodes that successfully uploaded the encryption model. For collection and collection The difference of

[0122] The formula consists of 3 parts. The first part is , which is the computing power node The generated self-mask, the second part is This part mainly realizes that the federated learning process can continue after some computing power nodes are offline, so the mask of the offline computing power nodes is added. The last part It is the computing power node The mask sent to other computing nodes. Through this formula, federated learning can reduce the impact of offline computing nodes;

[0123] Step 5: The computing node downloads all the encrypted models and mask sums from the blockchain, and uses the single mask decryption algorithm to input the mask sum into the aggregate model of all encrypted models to complete the decryption.

[0124] The single mask decryption algorithm includes:

[0125] ;

[0126] in, is the decrypted aggregate model vector, is the aggregated encrypted model vector, For all masks and downloaded from the blockchain, A computing node in the computing node set that successfully uploaded the encryption mask;

[0127] This formula is used to decrypt the aggregate model. Because single-mask encryption requires a way for other computing nodes to know the mask sum, the above mask sum calculation formula can be used to make other computing nodes know the mask sum without exposing a single mask, so that the model can be decrypted.

[0128] Step 6: The computing node uses the linear homomorphic hash algorithm to calculate the homomorphic hash values ​​of the unencrypted model and the decrypted aggregate model, and uploads the two homomorphic hash values ​​together with the decrypted model to the blockchain;

[0129] The computing node downloads the homomorphic hash value uploaded by other computing nodes from the blockchain, verifies the correctness of the aggregation model using the linear homomorphic hash verification algorithm and uploads the verification result to the blockchain. The blockchain selects a verified model as the new global model and iterates all the above steps until the global model converges or reaches the communication round;

[0130] The linear homomorphic hash algorithm contains three polynomial algorithms, expressed as :

[0131] about :The algorithm outputs the public parameters of linear homomorphic hashing, which include a cyclic group , the group order is , is a prime number, group The generator of ,besides Different elements ,make is the public parameter of linear homomorphic hashing;

[0132] about :The algorithm calculates the model vector The hash value of and , the output is expressed as: .

[0133] about :This algorithm is used to linearly combine multiple homomorphic hash values. Since homomorphic hashing supports addition operations, combining multiple hash values ​​can verify the correctness of the aggregation model. The specific formula is expressed as ;

[0134] That is, the linear homomorphic hash algorithm includes:

[0135] ;

[0136] The linear homomorphic hash verification algorithm includes:

[0137] ;

[0138] in, express A linear combination of homomorphic hash values, represents the number of linear coefficients, Represents the model hash value, Expressed as a linear coefficient, Represents the hash value after hashing the model. represents the model dimension, is one of the model dimensions, represents the model vector, represents a cyclic group with order , is a prime number, and the generator is , Indicates belonging to of elements.

[0139] Specifically, the present invention uses the MNIST dataset and regards the distributed computing nodes as multiple computing nodes, each of which has a part of the MNIST dataset. Downloading the model training from the blockchain to uploading the verification results is considered an iteration. In one iteration, at least The computing nodes are online. In each round of iteration, the specific steps are as follows:

[0140] 1) System initialization

[0141] Computing Node : Generate a public-private key pair , the public-private key pair is used for Diffie-Hellman key exchange to generate a shared key and then encrypt the mask value. Upload to blockchain. Randomly generate model , upload the model to the blockchain.

[0142] Blockchain: Blockchain writes at least indivual , where t represents the minimum number of computing nodes required for the entire system to continue running. Randomly select an uploaded model as the initial model , and write the model into the blockchain. Let the set of computing nodes successfully submitted to the blockchain be .if , terminate subsequent operations.

[0143] 2) Model training and mask upload

[0144] Computing Node : Download the latest global model from the blockchain and . Using local datasets , training to obtain a global model iteration . Computing Node To the computing power node Request mask value, computing power node Select a random seed , and calculate the negotiated key for the user's encrypted mask value . Computing Node by As The input is , and then Encrypted using a symmetric encryption algorithm , Will Package and upload to blockchain.

[0145] Blockchain: Receive at least The uploaded mask value is written into the block, and the computing power node set that uploads the mask value is recorded as .if , terminate subsequent operations.

[0146] 3) Model encryption and upload

[0147] For computing nodes :Computing power node Download all from the blockchain , first generate and compute nodes Negotiated key , and then use the negotiated key , decrypt get . Pick a random number As The seed is entered into Get . Using the decrypted and self-generated Encrypt the model and get , upload the encrypted model .

[0148] Blockchain: Receive at least Uploaded encrypted models , write the uploaded model into the block. The computing node set that uploads the encrypted model is recorded as .if , terminate subsequent operations.

[0149] 4) Mask and upload

[0150] For computing nodes : Obtained from the blockchain Collection. Computing nodes calculate ,Will Upload to blockchain.

[0151] For blockchain: receiving uploaded , and written into the blockchain.

[0152] 5) Model aggregation decryption

[0153] For computing nodes :Computing power node Download all uploaded encrypted models from the blockchain , aggregate the encrypted model to get . Computing Node Download all from the blockchain to local, and then use Decryption model, that is: .

[0154] 6) Model aggregation result verification

[0155] Computing Node :Computing power node Calculate the homomorphic hash value of the unencrypted model, that is: , and Upload to the blockchain. Computing nodes Calculate the homomorphic hash value of the decrypted aggregate model, that is: , and With the Aggregate Model Upload to the blockchain together. Download all , verify that each ,Right now ,if , then accept the aggregation result, otherwise reject the result. Finally, submit the verification result to the blockchain.

[0156] Blockchain: Receive data uploaded by participants Receive the verification results uploaded by the participants and select any correctly verified aggregation result as the global model for the next round of training.

[0157] After all iterations are completed, the computing power network privacy-preserving federated learning method adopted by the present invention for the computing power network can achieve secure training and stable model training effects in a decentralized computing power network environment. At the same time, it can realize the verification of computing power node aggregation results, and can also complete the federated learning process when some computing power nodes are offline.

[0158] Embodiment 2:

[0159] An embodiment of the present invention further provides a privacy-preserving federated learning device, the device comprising:

[0160] Initialization module: used for computing nodes to generate a public-private key pair through a public-private key algorithm, and upload the public key in the public-private key pair and the initialization model of the computing node to the blockchain, and randomly select an initialization model as the global model;

[0161] Training module: used for the computing node to obtain the global model and the public keys of other computing nodes from the blockchain, and train the global model through the local data set;

[0162] A model encryption module, used to download the encryption mask sent by other computing nodes from the blockchain, encrypt the global model by a single-mask encryption algorithm based on the mask obtained by decrypting the encryption mask by a shared key and the self-mask generated by the computing node by a mask generation function to obtain an encrypted model, and upload the encrypted model to the blockchain;

[0163] A mask sum calculation module, which is used for the computing power node to calculate the mask sum using the mask sum calculation formula according to the set of online computing power nodes obtained from the blockchain, and upload the mask sum to the blockchain;

[0164] The decryption module is used by the computing power node to download all encryption models and mask sums from the blockchain, and use the single mask decryption algorithm to input the mask sum into the aggregate model of all encryption models to complete the decryption;

[0165] The homomorphic hash value calculation module is used for the computing node to calculate the homomorphic hash values ​​of the unencrypted model and the decrypted aggregate model using the linear homomorphic hash algorithm, and upload the two homomorphic hash values ​​together with the decrypted model to the blockchain;

[0166] Verification module, which is used by computing nodes to download homomorphic hash values ​​uploaded by other computing nodes from the blockchain, use the linear homomorphic hash verification algorithm to verify the correctness of the aggregation model and upload the verification results to the blockchain. The blockchain selects a model that has passed the verification as the new global model and iterates all the above steps until the global model converges or reaches the communication round;

[0167] The computing power node generates a shared key using the private key in its own public-private key pair and the public key of the other computing power nodes.

[0168] The privacy-preserving federated learning device provided in the embodiment of the present invention can execute the computing power network privacy-preserving federated learning method provided in the embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0169] Embodiment three:

[0170] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method described in the first embodiment are implemented, and the program has functional modules and beneficial effects corresponding to the execution method.

[0171] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application 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 codes.

[0172] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, 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 generate 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 flowchart and / or block diagram. 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.

[0173] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate 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 A function specified in one or more boxes.

[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions 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.

[0175] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A privacy-preserving federated learning method for computing power networks, It is characterized in that include: The computing node generates a public-private key pair through a public-private key algorithm, uploads the public key in the public-private key pair and the initialization model of the computing node to the blockchain, and randomly selects an initialization model as the global model; The computing node obtains the public keys of the global model and other computing nodes from the blockchain, and trains the global model through the local data set; The computing power node downloads the encryption mask sent by other computing power nodes from the blockchain, encrypts the global model through a single-mask encryption algorithm based on the mask obtained by decrypting the encryption mask through the shared key and the self-mask generated by the computing power node through the mask generation function to obtain an encrypted model, and uploads the encrypted model to the blockchain; The computing power node calculates the masked sum using the masked sum calculation formula according to the set of online computing power nodes obtained from the blockchain, and uploads the masked sum to the blockchain; The computing node downloads all the encrypted models and mask sums from the blockchain, and uses the single mask decryption algorithm to input the mask sum into the aggregate model of all encrypted models to complete the decryption; The computing power node calculates the homomorphic hash values ​​of the unencrypted model and the decrypted aggregate model using a linear homomorphic hash algorithm, and uploads the homomorphic hash values ​​of the unencrypted model and the decrypted aggregate model together with the decrypted aggregate model to the blockchain; The computing node downloads the homomorphic hash value uploaded by other computing nodes from the blockchain, verifies the correctness of the decrypted aggregation model using the linear homomorphic hash verification algorithm and uploads the verification result to the blockchain. The blockchain selects a verified model as the new global model and iterates all the above steps until the global model converges or reaches the communication round; The computing power node generates a shared key using the private key in its own public-private key pair and the public key of the other computing power node; The public-private key algorithm is the Diffie-Hellman key agreement algorithm, including: ; The shared key generation algorithm is a Diffie-Hellman key agreement algorithm, including: The security parameters As input, we get the Diffie-Hellman public parameter KApp, namely: ; Among them, KA.Setup is the public parameter generation algorithm; The public parameter KApp is used as the input of the key generation algorithm to obtain the public and private keys of the computing power nodes u and v, that is: ; The computing node u uses his private key The public key of the computing power node Generate a shared key using the Diffie-Hellman negotiation algorithm: ; in, is the private key, is the public key, is the key generation algorithm, is a safety parameter, satisfy ; For two computing nodes, is the shared key between computing node u and computing node v, is the key agreement algorithm, is the private key of computing node u, is the public key of computing node v; The encrypted mask is decrypted by a shared key to obtain a mask, comprising: The Diffie-Hellman key negotiation algorithm is used to As a symmetric key, that is: ; Among them, SE.KeyGen is the symmetric key generation algorithm in symmetric encryption; The mask sent by computing node v to computing node u is used as plain text. As the shared key for communication between the two parties, the AES symmetric encryption algorithm is used to obtain the encryption mask ,Right now: ; Among them, SE.Enc is the encryption algorithm in symmetric encryption; The computing node u receives the encryption mask After use Decryption obtains the mask vector sent by computing node v to computing node u ,Right now: ; Among them, SE.Dec is the decryption algorithm in symmetric encryption; Said The generating function of is expressed as: ; in, is a pseudo-random number vector generated by seed s, PRG is a pseudo-random number generator; The single-mask encryption algorithm is expressed as: ; in, is the encrypted model vector, is the unencrypted model vector, For computing power nodes The generated self-masking vector, The set of computing nodes that successfully uploaded the encryption mask. To divide the computing power node A collection of computing nodes other than The mask and calculation method include: ; in, is the mask sum calculated based on the set of online computing nodes, For computing power nodes The generated self-mask, The set of computing nodes that successfully uploaded the encryption mask. The set of computing nodes that successfully uploaded the encryption model. For collection and collection The difference of The single mask decryption algorithm includes: ; in, is the decrypted aggregate model vector, is the aggregated encrypted model vector, For all masks and downloaded from the blockchain, A computing node in the computing node set that successfully uploaded the encryption mask; The expression of the linear homomorphic hash algorithm is: ; The expression of the linear homomorphic hash verification algorithm is: ; in, express A linear combination of homomorphic hash values, represents the number of linear coefficients, Represents the model hash value, Expressed as a linear coefficient, Represents the hash value after hashing the model. represents the model dimension, is one of the model dimensions, represents the model vector, represents a cyclic group with order , is a prime number, and the generator is , Indicates belonging to of elements.

2. The computing power network privacy-preserving federated learning method according to claim 1, Features: The encryption mask is obtained by the following method: Other computing power nodes generate a mask through a mask generation function, generate a shared key through a shared key generation algorithm, and encrypt the mask through a symmetric encryption algorithm to obtain the encrypted mask.

3. A privacy-preserving federated learning device capable of executing the privacy-preserving federated learning method according to any one of claims 1 to 2, It is characterized in that include: An initialization module is used for the computing node to generate a public-private key pair through a public-private key algorithm, and upload the public key in the public-private key pair and the initialization model of the computing node to the blockchain, and randomly select an initialization model as the global model; A training module, used for a computing node to obtain the global model and the public keys of other computing nodes from the blockchain, and train the global model through a local data set; A model encryption module, used to download the encryption mask sent by other computing nodes from the blockchain, encrypt the global model by a single-mask encryption algorithm based on the mask obtained by decrypting the encryption mask by a shared key and the self-mask generated by the computing node by a mask generation function to obtain an encrypted model, and upload the encrypted model to the blockchain; A mask sum calculation module, which is used for the computing power node to calculate the mask sum using the mask sum calculation formula according to the set of online computing power nodes obtained from the blockchain, and upload the mask sum to the blockchain; The decryption module is used by the computing power node to download all encryption models and mask sums from the blockchain, and use the single mask decryption algorithm to input the mask sum into the aggregate model of all encryption models to complete the decryption; The homomorphic hash value calculation module is used for the computing node to calculate the homomorphic hash values ​​of the unencrypted model and the decrypted aggregate model using the linear homomorphic hash algorithm, and upload the two homomorphic hash values ​​together with the decrypted model to the blockchain; Verification module, which is used by computing nodes to download homomorphic hash values ​​uploaded by other computing nodes from the blockchain, use the linear homomorphic hash verification algorithm to verify the correctness of the aggregation model and upload the verification results to the blockchain. The blockchain selects a model that has passed the verification as the new global model and iterates all the above steps until the global model converges or reaches the communication round; The computing power node generates a shared key through its own private key and the public keys of the other computing power nodes.

4. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.