Federal learning security aggregation method and system with delay elasticity
Through single mask aggregation technology and key homomorphic pseudo-random function, the problems of large overhead and latency threats in federated learning are solved, and efficient gradient recovery and latency elasticity are achieved, which is suitable for multi-client scenarios.
Patent Information
- Application Number
- CN202410380464.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-30
- Publication Date
- 2024-11-01
AI Technical Summary
The existing mask-based federated learning method has the problem of large client computing overhead and the introduction of latency threats, especially in multi-client scenarios, resulting in network congestion and privacy loss.
Single mask aggregation technology is used to combine key homomorphic pseudo-random functions to reduce client computing overhead, and delay elasticity is achieved through two-stage aggregation gradient recovery method to improve result recovery efficiency.
In the absence of data loss, only constant interpolation reconstruction is required, which significantly reduces communication overhead and reduces expensive interpolation operations on the server, and is suitable for resource-constrained devices and large-scale histogram scenarios.
Smart Images

Figure CN118890143A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distributed node big data analysis and processing, and relates to node data analysis and processing technology of a client, specifically a federated learning security aggregation method and system with delay elasticity. Background Art
[0002] Federated learning has become an effective way to extract the value of data in various industries while protecting the privacy of users' local datasets and gradients. Figure 1 As shown, federated learning allows a large number of users to contribute to the global model by training locally and submitting local updated gradients. The entire iterative process can ensure that each user obtains a common accurate and universal model. For example, the patent application document with application number 202310901741.6 discloses a practical federated learning malicious security aggregation method and device, the method comprising: receiving a training model initialized by the initiator; negotiating with the initiator the total number of participating users n, the input vector dimension d, the input vector definition domain D and the system security parameter λ and broadcasting; broadcasting the training model obtained after the previous round of federated learning tasks to ordinary users i, so that each ordinary user i and / or the initiator who is willing to participate in this round of federated learning tasks can obtain the training model obtained after the previous round of federated learning tasks locally, and combine the input vector dimension d, the input vector definition domain D and the system security parameter λ to mask the gradient vector updated during the training process; after aggregating the received masked vectors, remove the mask from the obtained aggregation result with masks to obtain the training model obtained after this round of federated learning tasks.
[0003] Many frameworks for federated learning, including those based on homomorphic encryption (HE), differential privacy (DP), and masking schemes, have been widely explored and deployed. In research related to federated learning, mask-based methods are often preferred because they have the advantages of high efficiency and high accuracy while avoiding expensive and noisy operations. In mask-based protocols, the addition of mask values introduces randomness to protect local gradients, which can be safely restored after aggregation. However, the existing mask-based protocols have the following problems:
[0004] First, the client has a lot of computational overhead. In a double-masked protocol, each client must receive 2 secret shares in the initialization phase and send 2n secret shares in the recovery phase, where n is the number of participating clients. In scenarios with a large number of participating clients, network congestion is likely to occur. The more communication and computational overhead a client bears, the more likely it is that the client will quit.
[0005] Second, it introduces new latency threats. The privacy of high-latency clients will be lost, causing their mask values to be reconstructed before their inputs are sent to the server. Traditional techniques mainly solve this problem through double masking, that is, using two different random sampling values for blinding gradients. Therefore, double masking makes a trade-off between privacy and computing resources on the server side. Even if there is no client discarding, the server needs to perform multiple interpolation reconstructions and pseudo-random generation, which significantly increases the convergence time and introduces new latency threats. Summary of the invention
[0006] In response to the technical problems described in the above background technology that the mask-based federated learning method in the prior art has a large amount of client computing overhead and introduces new delay threats, the present invention proposes a federated learning security aggregation method and system with delay resilience.
[0007] The present invention provides a delay-resilient federated learning security aggregation method and system, which combines single-mask aggregation technology and key homomorphic pseudo-random functions, significantly reduces the client's computing overhead, forms delay resilience, and improves result recovery efficiency.
[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0009] The present invention provides a delay-elastic federated learning security aggregation method, comprising the following steps:
[0010] S1: The client sends online identification parameters to the aggregation server;
[0011] S2: The aggregation server collects the online identification parameters of the online clients based on the federated learning security aggregation protocol, and generates the online client identity set U according to the online identification parameters 1 , determine the online client identity set U 1 Whether the threshold requirement is met:
[0012] If the online client identity set U 1 ≥t, t is the number threshold of online client identities, then continue with S3; otherwise, terminate the federated learning security aggregation protocol;
[0013] S3: The client generates a shared secret share S according to the threshold secret sharing algorithm ji , and the shared secret share S ji Encryption to generate the secret share C ji , the secret share C ji Send to aggregation server;
[0014] S4: The aggregation server collects the secret shares C of online clients based on the federated learning secure aggregation protocol ji , and according to the secret share Cji Generate online client identity set U 2 and the online client secret state share set Determine the online client identity set U 2 Whether the threshold requirement is met:
[0015] If the online client identity set U 2 ≥t, the aggregation server will set the online client identity set U 2 Broadcast to all clients and continue S5; otherwise, terminate the federated learning security aggregation protocol;
[0016] S5: The client receives the online client secret share set The secret share set of online clients Decrypt and generate a decrypted shared secret share set Calculate the sum of the shared secret shares The sum of the shared secret shares As the input of the key homomorphic pseudorandom function F(·), the client's gradient blinding value y is calculated using the key homomorphic pseudorandom function F(·) i ; The client blinds the gradient value y i Send to aggregation server;
[0017] S6: The aggregation server collects the blinded gradient value y of the online client based on the federated learning secure aggregation protocol i , and blind the value y according to the gradient i Generate online client identity set U 3 , determine the online client identity set U 3 Whether the threshold requirement is met:
[0018] If the online client identity set U 3 ≥t, the aggregation server will set the online client identity set U 3 Broadcast to all clients and continue S7; otherwise, terminate the federated learning security aggregation protocol;
[0019] S7: The client receives the online client identity set U 3 , and initialize the unblinding factor μ i1 , the client traverses the online client identity set U 2 The logical identity of each client in the traversal is calculated, and the deblinding factor μ is generated according to the traversal result. i1 , judge according to the traversal results:
[0020] If U 3 =U 4 , then the federated learning security aggregation protocol is terminated and the deblinding factor μ i1 Calculate the final aggregate gradient yz ;
[0021] If U 3 ≠U 4 , then the unblinding factor is μ i1 Send to the aggregation server and continue to step S8;
[0022] S8: The aggregation server collects the deblinding factor μ of the online client based on the federated learning secure aggregation protocol i1 , and according to the unblinding factor μ i1 Generate online client identity set U 4 , determine the online client identity set U 4 Whether the threshold requirement is met:
[0023] If the online client identity set U 4 ≥t, the aggregation server will set the online client identity set U 4 Broadcast to all clients and continue S9; otherwise, terminate the federated learning security aggregation protocol;
[0024] S9: The client receives the online client identity set U 4 , and based on the online client identity set U 4 Calculate the deblinding factor 2 and the deblinding factor 3, and send the deblinding factor 2 and the deblinding factor 3 to the aggregation server at the same time;
[0025] S10: The aggregation server collects the de-blinding factor 2 and de-blinding factor 3 of the online clients based on the federated learning security aggregation protocol, and generates the online client identity set U according to the de-blinding factor 2 and de-blinding factor 3 of the online clients. 5 , determine the online client identity set U 5 Whether the threshold requirement is met:
[0026] If the online client identity set U 5 ≥t, the federated learning security aggregation protocol is terminated; otherwise, the de-blinding factor 4 is reconstructed and calculated according to the de-blinding factor 2 and de-blinding factor 3 of the online client, and the final aggregation gradient is calculated according to the de-blinding factor 2, de-blinding factor 3 and de-blinding factor 4 to complete the federated learning security aggregation with delay elasticity.
[0027] Further defined, the step S1 specifically includes: setting the domain space F of the secret share parameter q and the key homomorphic pseudo-random function F(·), and generate a key pair (sk i , pk i ), where sk i refers to the private key of the i-th client, pk i Refers to the public key of the i-th client; according to the public key pk of the i-th clienti Generate a logical identity for the i-th client, denoted as client id i ; Set the client id of the i-th client i and public key pk i Sent to the aggregation server, where the online identification parameter refers to the client ID of the i-th client i and public key pk i .
[0028] Further defined, the step S3 is specifically: the client enters the domain space F of the secret share parameter according to the logical identity q A random value is selected from the client as the client's secret; the client generates a shared secret share S by means of a threshold secret sharing algorithm. ji , and according to the symmetric key K ji is the shared secret share S ji Encryption to generate the secret share C ji , the secret share C ji Sent to the aggregation server.
[0029] Further defined, the step S5 specifically comprises: the client receives the online client secret state share set The secret share set of online clients Decrypt and generate a decrypted shared secret share set The decrypted shared secret share set Aggregate to generate the sum of the shared secret shares The sum of the decrypted shared secret shares As the input of the key homomorphic pseudorandom function F(·), the client's gradient blinding value y is calculated using the key homomorphic pseudorandom function i ; The client blinds the gradient value y i Sent to the aggregation server.
[0030] Further defined, the gradient blinding value y of the client is calculated using the key homomorphic pseudo-random function i The calculation formula is:
[0031]
[0032] In the formula, y i is the blinded gradient value, It means The gradient blinding value output as the input of the key homomorphic pseudorandom function, x i It refers to the local update gradient held by the i-th client.
[0033] Further defined, the step S7 specifically includes: the client receives the online client identity set U3 , the unblinding factor is μ i1 Initialized to zero, where the deblinding factor is μ i1 is the local initialization parameter of the i-th client; the client traverses the online client identity set U 2 The logical identity of each client in , if the traversed client is online during the blind data collection phase, then μ i1 =μ i1 +S ij , if the traversed client is offline during the blind data collection phase, then μ i1 =μ i1 +S ji , where S ij It refers to the shared secret share sent by the i-th client to the j-th client, S ji It refers to the shared secret share shared by the j-th client to the i-th client, i and j refer to the serial numbers of the clients;
[0034] If U 3 =U 4 , then the federated learning security aggregation protocol is terminated and the deblinding factor μ i1 Calculate the final aggregate gradient y z ;
[0035] If U 3 ≠U 4 , then the unblinding factor is μ i1 Send to the aggregation server and continue to step S8.
[0036] It is further defined that the final aggregation gradient y in step S7 is z The calculation formula is:
[0037]
[0038] In the formula, y z is the final aggregate gradient, y i refers to the blinded gradient value, F(μ i1 ) refers to the unblinding factor μ i1 The blinded gradient value output as input to a keyed homomorphic pseudorandom function.
[0039] It is further defined that the final aggregation gradient y in step S10 is z The calculation formula is:
[0040]
[0041] In the formula, y z is the final aggregate gradient, y i refers to the blinded gradient value, F(μ i1) refers to the unblinding factor μ i1 The gradient blinded value output as input to the key homomorphic pseudorandom function, It means that all the unblinding factors are equal to μ i2 The blinded gradient value output as the input of the key homomorphic pseudo-random function, F(μ′) refers to the blinded gradient value output by taking the de-blinding factor μ′ as the input of the key homomorphic pseudo-random function.
[0042] The present invention provides a delay-resilient federated learning security aggregation system, comprising:
[0043] Parameter sending module: used by the client to send online identification parameters to the aggregation server;
[0044] Online client identification module 1: The aggregation server collects online identification parameters of online clients based on the federated learning security aggregation protocol, and generates an online client identity set U according to the online identification parameters. 1 , determine the online client identity set U 1 Whether the threshold requirement is met: If the online client identity set U 1 ≥t, t is the number threshold of online client identities, then continue with S3; otherwise, terminate the federated learning security aggregation protocol;
[0045] Key distribution module: The client generates a shared secret share S according to the threshold secret sharing algorithm ji , and the shared secret share S ji Encryption to generate the secret share C ji , the secret share C ji Send to aggregation server;
[0046] Online client identification module 2: The aggregation server collects the secret shares C of online clients based on the federated learning security aggregation protocol ji , and according to the secret share C ji Generate online client identity set U 2 and the online client secret state share set Determine the online client identity set U 2 Whether the threshold requirement is met: If the online client identity set U 2 ≥t, the aggregation server will set the online client identity set U 2 Broadcast to all clients; otherwise, terminate the federated learning security aggregation protocol;
[0047] Blind data collection module: The client receives the online client secret share set The secret share set of online clients Decrypt and generate a decrypted shared secret share set Calculate the sum of the shared secret shares The sum of the shared secret shares As the input of the key homomorphic pseudorandom function F(·), the client's gradient blinding value y is calculated using the key homomorphic pseudorandom function F(·) i ; The client blinds the gradient value y i Send to aggregation server;
[0048] Online client identification module 3: The aggregation server collects the gradient blinding value y of the online client based on the federated learning security aggregation protocol i , and blind the value y according to the gradient i Generate online client identity set U 3 , determine the online client identity set U 3 Whether the threshold requirement is met: If the online client identity set U 3 ≥t, the aggregation server will set the online client identity set U 3 Broadcast to all clients; otherwise, terminate the federated learning security aggregation protocol;
[0049] Aggregate gradient recovery module I: The client receives the online client identity set U 3 , and initialize the unblinding factor μ i1 , the client traverses the online client identity set U 2 The logical identity of each client in the traversal is calculated, and the deblinding factor μ is generated according to the traversal result. i1 , judge according to the traversal results: if U 3 =U 4 , then the federated learning security aggregation protocol is terminated and the deblinding factor μ i1 Calculate the final aggregate gradient y z ;if U 3 ≠U 4 , then the unblinding factor is μ i1 Send to aggregation server;
[0050] Online client identification module 4: The aggregation server collects the de-blinding factor μ of the online client based on the federated learning secure aggregation protocol i1 , and according to the unblinding factor μ i1 Generate online client identity set U 4 , determine the online client identity set U 4 Whether the threshold requirement is met: If the online client identity set U 4 ≥t, the aggregation server will set the online client identity set U 4 Broadcast to all clients; otherwise, terminate the federated learning security aggregation protocol;
[0051] Aggregate gradient recovery II module: The client receives the online client identity set U 4, and based on the online client identity set U 4 Calculate the deblinding factor 2 and the deblinding factor 3, and send the deblinding factor 2 and the deblinding factor 3 to the aggregation server at the same time;
[0052] Online client identification module 5: The aggregation server collects the de-blinding factor 2 and de-blinding factor 3 of the online client based on the federated learning security aggregation protocol, and generates the online client identity set U according to the de-blinding factor 2 and de-blinding factor 3 of the online client. 5 , determine the online client identity set U 5 Whether the threshold requirement is met: If the online client identity set U 5 ≥t, the federated learning security aggregation protocol is terminated; otherwise, the de-blinding factor 4 is reconstructed and calculated according to the de-blinding factor 2 and de-blinding factor 3 of the online client, and the final aggregation gradient is calculated according to the de-blinding factor 2, de-blinding factor 3 and de-blinding factor 4 to complete the federated learning security aggregation with delay elasticity.
[0053] The present invention provides a computer storage medium, comprising a storage module and an execution module, wherein the storage module stores a program file corresponding to the above-mentioned delay-elastic federated learning security aggregation method, and the execution module is used to execute the program file.
[0054] Compared with the prior art, the technical solution of the present invention is as follows:
[0055] 1. The delay-resilient federated learning security aggregation method of the present invention provides an efficient recovery method through blinding and two-stage aggregate gradient recovery without data loss. Even if a customer is offline (disconnected), only a constant number of interpolation reconstructions are required. It cleverly combines a single mask with a key homomorphic pseudo-random function, significantly reduces communication overhead, forms delay resilience, and improves result recovery efficiency.
[0056] 2. The method of the present invention is different from the double mask method. In the present invention, the secret share only needs to be allocated once between the clients. The present invention divides the sharing into two layers, allowing the client to use the received sharing to blind the local update gradient and use the shared secret share for deblinding. When no client (user) exits, it can also be quickly restored.
[0057] 3. The delay-resilient federated learning security aggregation method of the present invention reduces the complexity of O(n+d) by blinding the data and eliminates the expensive interpolation operation on the server, even if the client is offline (disconnected). The communication overhead is optimized to O(n+d) by the second stage of aggregate gradient recovery. 2 log n+d), where n is the number of participating users, that is, the total number of clients, d is the number of dimensions of the model gradient, and O refers to the representation of the time complexity function.
[0058] 4. The present invention reduces the client's communication overhead by half and reduces the total computational cost of blinding to O(nlog 2 n+d), so that the federated learning security aggregation protocol of the present invention can be deployed in resource-constrained devices and in scenarios involving large-scale histograms, thereby increasing the scope of application. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A schematic diagram of the existing federated learning process framework;
[0060] Figure 2 It is a schematic diagram of the process framework of the federated learning with delay elasticity of the present invention;
[0061] Figure 3 Schematic diagram of the process of phase I of the aggregation gradient recovery;
[0062] Figure 4 Schematic diagram of the process of phase II of the aggregation gradient recovery;
[0063] Figure 5 A schematic diagram of a delay-resilient federated learning security aggregation method of the present invention;
[0064] Figure 6 Schematic diagram of a federated learning security aggregation system with delay resilience according to the present invention. DETAILED DESCRIPTION
[0065] The technical solution of the present invention is further explained below in conjunction with the accompanying drawings and embodiments, but the present invention is not limited to the implementation modes described below.
[0066] The present invention provides a delay-resilient federated learning security aggregation method and system, which provides a more efficient recovery method without data loss, and only requires a constant number of interpolation reconstructions even in the case of client disconnection. Unlike double masking, in the present invention, the client only needs to allocate a share once. In order to achieve delay resilience, the sharing is divided into two layers, allowing the client to blind its local gradient using the received sharing and de-blind using the shared shares. The present invention uses a key homomorphic pseudo-random function as the underlying structure to reduce communication overhead. Although the pseudo-random function used may introduce less noise, we introduce a high-precision training mode to address this challenge in practical applications.
[0067] See also Figure 2 , the present invention is based on a centralized aggregation server ( Figure 2 A secure aggregation method for federated learning with latency resilience is designed based on the server architecture in Figure 2The server in the federated learning is a common training architecture in federated learning. In the aggregation process, the server plays the role of information transfer and aggregation, which can effectively reduce the network delay of each client during the communication process. The method of the present invention improves the traditional single-mask aggregation technology to achieve delay elasticity while reducing the client communication overhead. At the same time, the method also combines the pseudo-random function of the key homomorphism to reduce the client's computing overhead and provide an efficient result recovery method when no user is disconnected.
[0068] Example 1
[0069] See also Figure 5 The delay-elastic federated learning security aggregation method of this embodiment includes the following steps:
[0070] S1: The client sends online identification parameters to the aggregation server;
[0071] S2: The aggregation server collects the online identification parameters of the online clients based on the federated learning security aggregation protocol, and generates the online client identity set U according to the online identification parameters 1 , determine the online client identity set U 1 Whether the threshold requirement is met:
[0072] If the online client identity set U 1 ≥t, t is the number threshold of online client identities, then continue with S3; otherwise, terminate the federated learning security aggregation protocol;
[0073] S3: The client generates a shared secret share S according to the threshold secret sharing algorithm ji , and the shared secret share S ji Encryption to generate the secret share C ji , the secret share C ji Send to aggregation server;
[0074] S4: The aggregation server collects the secret shares C of online clients based on the federated learning secure aggregation protocol ji , and according to the secret share C ji Generate online client identity set U 2 and the online client secret state share set Determine the online client identity set U 2 Whether the threshold requirement is met:
[0075] If the online client identity set U 2 ≥t, the aggregation server will set the online client identity set U 2 Broadcast to all clients and continue S5; otherwise, terminate the federated learning security aggregation protocol;
[0076] S5: The client receives the online client secret share set The secret share set of online clients Decrypt and generate a decrypted shared secret share set Calculate the sum of the shared secret shares The sum of the shared secret shares As the input of the key homomorphic pseudorandom function F(·), the client's gradient blinding value y is calculated using the key homomorphic pseudorandom function F(·) i ; The client blinds the gradient value y i Send to aggregation server;
[0077] S6: The aggregation server collects the blinded gradient value y of the online client based on the federated learning secure aggregation protocol i , and blind the value y according to the gradient i Generate online client identity set U 3 , determine the online client identity set U 3 Whether the threshold requirement is met:
[0078] If the online client identity set U 3 ≥t, the aggregation server will set the online client identity set U 3 Broadcast to all clients and continue S7; otherwise, terminate the federated learning security aggregation protocol;
[0079] S7: The client receives the online client identity set U 3 , and initialize the unblinding factor μ i1 , the client traverses the online client identity set U 2 The logical identity of each client in the traversal is calculated, and the deblinding factor μ is generated according to the traversal result. i1 , judge according to the traversal results:
[0080] If U 3 =U 4 , then the federated learning security aggregation protocol is terminated and the deblinding factor μ i1 Calculate the final aggregate gradient y z ;
[0081] If U 3 ≠U 4 , then the unblinding factor is μ i1 Send to the aggregation server and continue to step S8;
[0082] S8: The aggregation server collects the deblinding factor μ of the online client based on the federated learning secure aggregation protocol i1 , and according to the unblinding factor μ i1 Generate online client identity set U 4, determine the online client identity set U 4 Whether the threshold requirement is met:
[0083] If the online client identity set U 4 ≥t, the aggregation server will set the online client identity set U 4 Broadcast to all clients and continue S9; otherwise, terminate the federated learning security aggregation protocol;
[0084] S9: The client receives the online client identity set U 4 , and based on the online client identity set U 4 Calculate the deblinding factor 2 and the deblinding factor 3, and send the deblinding factor 2 and the deblinding factor 3 to the aggregation server at the same time;
[0085] S10: The aggregation server collects the de-blinding factor 2 and de-blinding factor 3 of the online clients based on the federated learning security aggregation protocol, and generates the online client identity set U according to the de-blinding factor 2 and de-blinding factor 3 of the online clients. 5 , determine the online client identity set U 5 Whether the threshold requirement is met:
[0086] If the online client identity set U 5 ≥t, the federated learning security aggregation protocol is terminated; otherwise, the de-blinding factor 4 is reconstructed and calculated according to the de-blinding factor 2 and de-blinding factor 3 of the online client, and the final aggregation gradient is calculated according to the de-blinding factor 2, de-blinding factor 3 and de-blinding factor 4 to complete the federated learning security aggregation with delay elasticity.
[0087] In the entire method of this embodiment, an efficient recovery method is provided through steps S7-S10. In the case of no data loss, even if a customer is offline (disconnected), only a constant number of interpolation reconstructions are required. The combination of a single mask and a key homomorphic pseudo-random function significantly reduces communication overhead, forms delay resilience, and improves result recovery efficiency.
[0088] In this embodiment, step S1 and step S2 are the system initialization stage; step S3 and step S4 are the key distribution stage; step S5 and step S6 are the blind data collection stage; step S7 and step S8 are the aggregate gradient recovery I stage; step S9 and step S10 are the aggregate gradient recovery II stage.
[0089] Example 2
[0090] This embodiment of the federated learning security aggregation method with delay elasticity is based on the embodiment 1, wherein:
[0091] Step S1 is specifically as follows:
[0092] S1.1: The trusted authority sets the domain space F of the secret share parameter according to the security parameter κ q and the key homomorphic pseudorandom function F(·), and broadcast the domain space F of the secret share parameter q To all clients;
[0093] S1.2: The i-th client generates a key pair locally (sk i , pk i ), sk i refers to the private key of the i-th client, pk i refers to the public key of the i-th client, and the public key pk i Sent to a trusted institution for information registration;
[0094] S1.3: The trusted authority uses the public key pk sent by the i-th client i Generate a logical identity for the i-th client, denoted as client id i , and the client id i Distribute to the i-th client;
[0095] S1.4: The i-th client sends the client id i and public key pk i Sent to the aggregation server, where i∈n, n is the number of clients.
[0096] Among them, the client id of the i-th client i and public key pk i Composition of online identification parameters.
[0097] Step S2 is specifically as follows:
[0098] S2.1: The aggregation server collects the online identification parameters of the online clients based on the federated learning security aggregation protocol, and generates the online client identity set U according to the online identification parameters 1 and online client identity information set
[0099] S2.2: The aggregation server determines the online client identity set U 1 Whether the threshold requirement is met: If the online client identity set U 1 ≥t, broadcast the online client identity information set to all clients And continue with S3, t is the threshold of the number of online client identities; otherwise, terminate the federated learning security aggregation protocol.
[0100] Step S3 is specifically as follows:
[0101] S3.1: The client is based on the logical identity (client id j ) in the domain space F of secret share parameters qSelect Secret S j , S j refers to the secret of the jth client; where the client is identified by its logical identity (client id j ) in the domain space F of secret share parameters q Select Secret S j The process is: the client according to the client id j In the t-order polynomial f(x) = s j +a 1 x+a 2 x+…+a t-1 x t-1 Select Secret S j , where x is a variable, a 1 , a 2 …a t-1 refers to the domain space F of the secret share parameter q The polynomial coefficients are randomly selected from 1 , a 2 …a t-1 ∈F q ; The jth client calculates the share s for the ith client j,i , where the jth client calculates the shared share s for the ith client j,i The calculation method is s j,i = f(i);
[0102] S3.2: The jth client completes the shared secret share s for the i-th client j,i After the calculation of j and the public key PK of the i-th client i Generate a symmetric key K through key negotiation ji ;
[0103] S3.3: Through the symmetric key K ji is the shared secret share S ji Encryption to generate the secret share C ji , and the secret share C ji Sent to the aggregation server.
[0104] Step S4 is specifically as follows:
[0105] S4.1: Aggregation server collects secret shares of online clients based on federated learning secure aggregation protocol And according to the secret share C of the online client ji Generate online client identity set U 2 and the online client secret state share set
[0106] S4.2: The aggregation server determines the online client identity set U 2 Whether the threshold requirement is met: If the online client identity set U 2 ≥t, the aggregation server will set the online client identity set U 2 Broadcast to all clients and set the secret share of online clients Sent to the corresponding online client id j , and continue with S5; otherwise, terminate the federated learning security aggregation protocol.
[0107] Step S5 is specifically as follows:
[0108] S5.1: The client receives the online client secret share set The online client secret share set is encrypted using the non-interactive Diffie-Hel|man key negotiation algorithm. The symmetric key K ji Decrypt and generate a decrypted shared secret share set
[0109] S5.2: The decrypted shared secret share set Aggregate to generate the sum of the shared secret shares The sum of the shared secret shares As the input of the key homomorphic pseudorandom function F(·), the client's gradient blinding value y is calculated using the key homomorphic pseudorandom function i ;
[0110] S5.3: The client blinds the gradient value y i Sent to the aggregation server.
[0111] Among them, the calculation formula for calculating the gradient blinding value of the client using the key homomorphic pseudo-random function in step S5.3 is:
[0112]
[0113] In the formula, y i is the blinded gradient value, It means The gradient blinding value output as the input of the key homomorphic pseudorandom function, x i Refers to the local update gradient held by the i-th client, see Figure 3 and Figure 4 x in 1 ,...x 4 , x 1 ,...x 4 refers to the local update gradient held by the 1st, ..., 4th clients.
[0114] Step S6 is specifically as follows:
[0115] S6.1: The aggregation server collects the blinded gradient value y of the online client based on the federated learning secure aggregation protocol i ; and according to the gradient blinding value y i Generate online client identity set U 3 ;
[0116] S6.2: The aggregation server determines the online client identity set U 3 Whether the threshold requirement is met: If the online client identity set U 3 ≥t, the aggregation server will set the online client identity set U 3 Broadcast to all clients and continue with S7; otherwise, terminate the federated learning security aggregation protocol.
[0117] See also Figure 3 , step S7 specifically comprises:
[0118] S7.1: The client receives the online client identity set U 3 , and initialize the unblinding factor to μ i1 is zero, where the unblinding factor is μ i1 is the local initialization parameter of the i-th client;
[0119] S7.2: The client traverses the online client identity set U 2 The logical identity of each client (client id i ), if the traversed client is online during the blind data collection phase, then μ i1 =μ i1 +S ij , if the traversed client is offline during the blind data collection phase, then μ i1 =μ i1 +S ji , where S ij It refers to the shared secret share sent by the i-th client to the j-th client, S ji It refers to the shared secret share shared by the j-th client to the i-th client, i and j refer to the serial number of the client; i and j∈n;
[0120] S7.2: If U 3 =U 4 , then the federated learning security aggregation protocol is terminated and the deblinding factor μ i1 Calculate the final aggregate gradient y z ;if U 3 ≠U 4 , then the unblinding factor is μ i1 Send to the aggregation server and continue to step S8.
[0121] Among them, the final aggregation gradient y in step S7.2 z The calculation formula is:
[0122]
[0123] In the formula, y z is the final aggregate gradient, y i refers to the blinded gradient value, F(μ i1 ) refers to the unblinding factor μ i1 The blinded gradient value output as input to a keyed homomorphic pseudorandom function.
[0124] Step S8 is specifically as follows:
[0125] S8.1: The aggregation server collects the unblinding factor μ of the online client based on the federated learning secure aggregation protocol i1 , and according to the unblinding factor μ i1 Generate online client identity set U 4 ;
[0126] S8.2: The aggregation server determines the online client identity set U 4 Whether the threshold requirement is met: If the online client identity set U 4 ≥t, the aggregation server will set the online client identity set U 4 Broadcast to all clients and continue S9; otherwise, terminate the federated learning security aggregation protocol.
[0127] See also Figure 4 Step S9 specifically includes: the client receives the online client identity set U 4 , and based on the online client identity set U 4 Calculate the unblinding factor μ i2 and the unblinding factor 3μ i3 ,
[0128] Among them, the unblinding factor is μ i2 The calculation formula is:
[0129]
[0130] Among them, the unblinding factor is 3μ i3 The calculation formula is:
[0131]
[0132] The unblinding factor is μ i2 and the unblinding factor 3μ i3 Sent to the aggregation server at the same time.
[0133] Step S10 is specifically as follows:
[0134] S10.1: The aggregation server collects the unblinding factor μ of the online client based on the federated learning secure aggregation protocol i2 and the unblinding factor 3μ i3 , and according to the online client's unblinding factor μ i2 and the unblinding factor 3μ i3 Generate online client identity set U 5 ;
[0135] S10.2: Determine the online client identity set U 5 Whether the threshold requirement is met: If the online client identity set U 5 ≥t, the federated learning security aggregation protocol is terminated; otherwise, according to the unblinding factor μ of the online client i2 and the unblinding factor 3μ i3 Reconstruct and calculate the unblinding factor 4 μ′, according to the unblinding factor 2 μ i2 , unblinding factor 3μ i3 and the unblinding factor 4 μ′ to calculate the final aggregate gradient y z .
[0136] Among them, the calculation formula of the deblinding factor μ′ is:
[0137]
[0138]
[0139] In the formula, Δ i refers to the intermediate parameter; k refers to the 3 But not U 4 A subset of .
[0140] Among them, the final aggregation gradient y in step S10.2 z The calculation formula is:
[0141]
[0142] In the formula, y z is the final aggregate gradient, y i refers to the blinded gradient value, F(μ i1 ) refers to the unblinding factor μ i1 The gradient blinded value output as input to the key homomorphic pseudorandom function, It means that all the unblinding factors are equal to μ i2 The blinded gradient value output as the input of the key homomorphic pseudo-random function, F(μ′) refers to the blinded gradient value output by taking the de-blinding factor μ′ as the input of the key homomorphic pseudo-random function.
[0143] Example 3
[0144] See also Figure 6 The delay-elastic federated learning security aggregation system of this embodiment is formed based on the delay-elastic federated learning security aggregation method of embodiment 1 or embodiment 2. For the parts not disclosed in this embodiment, please refer to embodiment 1 or embodiment 2, which specifically includes:
[0145] Parameter sending module: used by the client to send online identification parameters to the aggregation server;
[0146] Online client identification module 1: The aggregation server collects online identification parameters of online clients based on the federated learning security aggregation protocol, and generates an online client identity set U according to the online identification parameters. 1 , determine the online client identity set U 1 Whether the threshold requirement is met: If the online client identity set U 1 ≥t, t is the number threshold of online client identities, then continue with S3; otherwise, terminate the federated learning security aggregation protocol;
[0147] Key distribution module: The client generates a shared secret share S according to the threshold secret sharing algorithm ji , and the shared secret share S ji Encryption to generate the secret share C ji , the secret share C ji Send to aggregation server;
[0148] Online client identification module 2: The aggregation server collects the secret shares C of online clients based on the federated learning security aggregation protocol ji , and according to the secret share C ji Generate online client identity set U 2 and the online client secret state share set Determine the online client identity set U 2 Whether the threshold requirement is met: If the online client identity set U 2 ≥t, the aggregation server will set the online client identity set U 2 Broadcast to all clients; otherwise, terminate the federated learning security aggregation protocol;
[0149] Blind data collection module: The client receives the online client secret share set The secret share set of online clients Decrypt and generate a decrypted shared secret share set Calculate the sum of the shared secret shares The sum of the shared secret shares As the input of the key homomorphic pseudo-random function F(·), the client's gradient blinding value y is calculated using the key homomorphic pseudo-random function F(·) i ; The client blinds the gradient value y i Send to aggregation server;
[0150] Online client identification module 3: The aggregation server collects the gradient blinding value y of the online client based on the federated learning security aggregation protocol i , and blind the value y according to the gradient i Generate online client identity set U 3 , determine the online client identity set U 3 Whether the threshold requirement is met: If the online client identity set U 3 ≥t, the aggregation server will set the online client identity set U 3 Broadcast to all clients; otherwise, terminate the federated learning security aggregation protocol;
[0151] Aggregate gradient recovery module I: The client receives the online client identity set U 3 , and initialize the unblinding factor μ i1 , the client traverses the online client identity set U 2 The logical identity of each client in the traversal is calculated, and the deblinding factor μ is generated according to the traversal result. i1 , judge according to the traversal results: if U 3 =U 4 , then the federated learning security aggregation protocol is terminated and the deblinding factor μ i1 Calculate the final aggregate gradient y z ;if U 3 ≠U 4 , then the unblinding factor is μ i1 Send to aggregation server;
[0152] Online client identification module 4: The aggregation server collects the de-blinding factor μ of the online client based on the federated learning secure aggregation protocol i1 , and according to the unblinding factor μ i1 Generate online client identity set U 4 , determine the online client identity set U 4 Whether the threshold requirement is met: If the online client identity set U 4 ≥t, the aggregation server will set the online client identity set U 4 Broadcast to all clients; otherwise, terminate the federated learning security aggregation protocol;
[0153] Aggregate gradient recovery II module: The client receives the online client identity set U 4 , and based on the online client identity set U 4Calculate the deblinding factor 2 and the deblinding factor 3, and send the deblinding factor 2 and the deblinding factor 3 to the aggregation server at the same time;
[0154] Online client identification module 5: The aggregation server collects the de-blinding factor 2 and de-blinding factor 3 of the online client based on the federated learning security aggregation protocol, and generates the online client identity set U according to the de-blinding factor 2 and de-blinding factor 3 of the online client. 5 , determine the online client identity set U 5 Whether the threshold requirement is met: If the online client identity set U 5 ≥t, the federated learning security aggregation protocol is terminated; otherwise, the de-blinding factor 4 is reconstructed and calculated according to the de-blinding factor 2 and de-blinding factor 3 of the online client, and the final aggregation gradient is calculated according to the de-blinding factor 2, de-blinding factor 3 and de-blinding factor 4 to complete the federated learning security aggregation with delay elasticity.
[0155] Example 4
[0156] This embodiment provides a computer storage medium, which includes a storage module and an execution module. The storage module stores a program file corresponding to the delay-elastic federated learning security aggregation method of any one of Embodiment 1 or Embodiment 2, and the execution module is used to execute the program file.
[0157] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present application.
Claims
1. A secure aggregation method for federated learning with delay resilience, characterized in that: The following steps are involved: S1: The client sends online identification parameters to the aggregation server; S2: The aggregation server collects the online identification parameters of the online clients based on the federated learning security aggregation protocol, generates the online client identity set U1 based on the online identification parameters, and determines whether the online client identity set U1 meets the threshold requirements: If the online client identity set U1≥t, t is the number threshold of online client identities, then continue with S3; otherwise, terminate the federated learning security aggregation protocol; S3: The client generates a shared secret share S according to the threshold secret sharing algorithm ji , and the shared secret share S ji Encryption to generate the secret share C ji , the secret share C ji Send to aggregation server; S4: The aggregation server collects the secret shares C of online clients based on the federated learning secure aggregation protocol ji , and according to the secret share C ji Generate online client identity set U2 and online client secret share set Determine whether the online client identity set U2 meets the threshold requirement: If the online client identity set U2 ≥ t, the aggregation server broadcasts the online client identity set U2 to all clients and continues S5; otherwise, the federated learning security aggregation protocol is terminated; S5: The client receives the online client secret share set The secret share set of online clients Decrypt and generate a decrypted shared secret share set Calculate the sum of the shared secret shares The sum of the shared secret shares As the input of the key homomorphic pseudo-random function F(·), the client's gradient blinding value y is calculated using the key homomorphic pseudo-random function F(·) i ; The client blinds the gradient value y i Send to aggregation server; S6: The aggregation server collects the blinded gradient value y of the online client based on the federated learning secure aggregation protocol i , and blind the value y according to the gradient i Generate an online client identity set U3, and determine whether the online client identity set U3 meets the threshold requirement: If the online client identity set U3 ≥ t, the aggregation server broadcasts the online client identity set U3 to all clients and continues S7; Otherwise, the federated learning security aggregation protocol is terminated; S7: The client receives the online client identity set U3 and initializes the deblinding factor μ i1 , the client traverses the logical identity of each client in the online client identity set U2, and generates a deblinding factor μ according to the traversal result i1 , judge according to the traversal results: If U3=U4, the federated learning security aggregation protocol is terminated and the deblinding factor μ is used to i1 Calculate the final aggregate gradient y z ; If U3≠U4, then the unblinding factor is μ i1 Send to the aggregation server and continue to step S8; S8: The aggregation server collects the deblinding factor μ of the online client based on the federated learning secure aggregation protocol i1 , and according to the unblinding factor μ i1 Generate an online client identity set U4 and determine whether the online client identity set U4 meets the threshold requirement: If the online client identity set U4 ≥ t, the aggregation server broadcasts the online client identity set U4 to all clients and continues S9; Otherwise, the federated learning security aggregation protocol is terminated; S9: The client receives the online client identity set U4, calculates the de-blinding factor 2 and the de-blinding factor 3 according to the online client identity set U4, and sends the de-blinding factor 2 and the de-blinding factor 3 to the aggregation server at the same time; S10: The aggregation server collects the de-blinding factor 2 and the de-blinding factor 3 of the online client based on the federated learning security aggregation protocol, generates the online client identity set U5 according to the de-blinding factor 2 and the de-blinding factor 3 of the online client, and determines whether the online client identity set U5 meets the threshold requirement: If the online client identity set U5 ≥ t, the federated learning security aggregation protocol is terminated; otherwise, the de-blinding factor four is reconstructed and calculated according to the de-blinding factor two and de-blinding factor three of the online client, and the final aggregation gradient is calculated according to the de-blinding factor two, de-blinding factor three and de-blinding factor four to complete the federated learning security aggregation with delay elasticity.
2. The method for secure aggregation of federated learning with delay resilience according to claim 1, characterized in that: The step S1 specifically includes: setting the domain space F of the secret share parameter q and the key homomorphic pseudo-random function F(·), and generate a key pair (sk i , pk i ), where sk i refers to the private key of the i-th client, pk i Refers to the public key of the i-th client; according to the public key pk of the i-th client i Generate a logical identity for the i-th client, denoted as client id i ; Set the client id of the i-th client i and public key pk i Sent to the aggregation server, where the online identification parameter refers to the client ID of the i-th client i and public key pk i .
3. The method for secure aggregation of federated learning with delay resilience according to claim 2, characterized in that: The step S3 is specifically as follows: the client uses the logical identity to generate a secret share parameter in the domain space F q A random value is selected from the client as the client's secret; the client generates a shared secret share S by means of a threshold secret sharing algorithm. ji , and according to the symmetric key K ji is the shared secret share S ji Encryption to generate the secret share C ji , the secret share C ji Sent to the aggregation server.
4. The method for secure aggregation of federated learning with delay resilience according to claim 3, characterized in that: The step S5 specifically includes: the client receives the online client secret state share set The secret share set of online clients Decrypt and generate a decrypted shared secret share set The decrypted shared secret share set Aggregate to generate the sum of the shared secret shares The sum of the decrypted shared secret shares As the input of the key homomorphic pseudorandom function F(·), the client's gradient blinding value y is calculated using the key homomorphic pseudorandom function i ; The client blinds the gradient value y i Sent to the aggregation server.
5. The method for secure aggregation of federated learning with delay resilience according to claim 4, characterized in that: The key homomorphic pseudo-random function is used to calculate the client's gradient blinding value y i The calculation formula is: In the formula, y i is the blinded gradient value, It means The gradient blinding value output as the input of the key homomorphic pseudorandom function, x i It refers to the local update gradient held by the i-th client.
6. The method for secure aggregation of federated learning with delay resilience according to claim 4, characterized in that: The step S7 is specifically as follows: the client receives the online client identity set U3, and sets the deblinding factor μ i1 Initialized to zero, where the deblinding factor is μ i1 is the local initialization parameter of the i-th client; the client traverses the logical identity of each client in the online client identity set U2. If the traversed client is online during the blind data collection phase, then μ i1 =μ i1 +S ij , if the traversed client is offline during the blind data collection phase, then μ i1 =μ i1 +S ji , where S ij It refers to the shared secret share sent by the i-th client to the j-th client, S ji It refers to the shared secret share shared by the j-th client to the i-th client, i and j refer to the serial numbers of the clients; If U3=U4, the federated learning security aggregation protocol is terminated and the deblinding factor μ is used to i1 Calculate the final aggregate gradient y z ; If U3≠U4, then the unblinding factor is μ i1 Send to the aggregation server and continue to step S8.
7. The method for secure aggregation of federated learning with delay resilience according to claim 6, characterized in that: The final aggregation gradient y in step S7 z The calculation formula is: In the formula, y z is the final aggregate gradient, y i refers to the blinded gradient value, F(μ i1 ) refers to the unblinding factor μ i1 The blinded gradient value output as input to a keyed homomorphic pseudorandom function.
8. The method for secure aggregation of federated learning with delay resilience according to claim 6, characterized in that: The final aggregation gradient y in step S10 z The calculation formula is: In the formula, y z is the final aggregate gradient, y i refers to the blinded gradient value, F(μ i1 ) refers to the unblinding factor μ i1 The gradient blinded value output as input to the key homomorphic pseudorandom function, It means that all the unblinding factors are 2μ i2 The blinded gradient value output as the input of the key homomorphic pseudo-random function, F(μ′) refers to the blinded gradient value output by taking the de-blinding factor μ′ as the input of the key homomorphic pseudo-random function.
9. A delay-resilient federated learning secure aggregation system, characterized in that include: Parameter sending module: used by the client to send online identification parameters to the aggregation server; Online client identification module 1: The aggregation server collects online identification parameters of online clients based on the federated learning security aggregation protocol, generates an online client identity set U1 based on the online identification parameters, and determines whether the online client identity set U1 meets the threshold requirement: if the online client identity set U1 ≥ t, t is the number threshold of online client identities, then continue with S3; otherwise, terminate the federated learning security aggregation protocol; Key distribution module: The client generates a shared secret share S according to the threshold secret sharing algorithm ji , and the shared secret share S ji Encryption to generate the secret share C ji , the secret share C ji Send to aggregation server; Online client identification module 2: The aggregation server collects the secret shares C of online clients based on the federated learning security aggregation protocol ji , and according to the secret share C ji Generate online client identity set U2 and online client secret share set Determine whether the online client identity set U2 meets the threshold requirement: if the online client identity set U2 ≥ t, the aggregation server broadcasts the online client identity set U2 to all clients; otherwise, terminate the federated learning security aggregation protocol; Blind data collection module: The client receives the online client secret share set The secret share set of online clients Decrypt and generate a decrypted shared secret share set Calculate the sum of the shared secret shares The sum of the shared secret shares As the input of the key homomorphic pseudo-random function F(·), the client's gradient blinding value y is calculated using the key homomorphic pseudo-random function F(·) i ; The client blinds the gradient value y i Send to aggregation server; Online client identification module 3: The aggregation server collects the gradient blinding value y of the online client based on the federated learning security aggregation protocol i ; And according to the gradient blind value y i Generate an online client identity set U3, and determine whether the online client identity set U3 meets the threshold requirement: if the online client identity set U3 ≥ t, the aggregation server broadcasts the online client identity set U3 to all clients; otherwise, terminate the federated learning security aggregation protocol; Aggregate gradient recovery module I: The client receives the online client identity set U3 and initializes the deblinding factor μ i1 , the client traverses the logical identity of each client in the online client identity set U2, and generates a deblinding factor μ according to the traversal result i1 , judge according to the traversal result: if U3=U4, terminate the federated learning security aggregation protocol and use the deblinding factor μ i1 Calculate the final aggregate gradient y z ; If U3≠U4, then the unblinding factor is μ i1 Send to aggregation server; Online client identification module 4: The aggregation server collects the de-blinding factor μ of the online client based on the federated learning secure aggregation protocol i1 , and according to the unblinding factor μ i1 Generate an online client identity set U4, and determine whether the online client identity set U4 meets the threshold requirement: if the online client identity set U4 ≥ t, the aggregation server broadcasts the online client identity set U4 to all clients; otherwise, terminate the federated learning security aggregation protocol; Aggregation gradient recovery II module: the client receives the online client identity set U4, calculates the de-blinding factor 2 and the de-blinding factor 3 according to the online client identity set U4, and sends the de-blinding factor 2 and the de-blinding factor 3 to the aggregation server at the same time; Online client identification module five: The aggregation server collects the de-blinding factor two and de-blinding factor three of the online client based on the federated learning security aggregation protocol, and generates the online client identity set U5 based on the de-blinding factor two and de-blinding factor three of the online client, and determines whether the online client identity set U5 meets the threshold requirement: if the online client identity set U5 ≥ t, the federated learning security aggregation protocol is terminated; otherwise, the de-blinding factor four is reconstructed and calculated based on the de-blinding factor two and de-blinding factor three of the online client, and the final aggregation gradient is calculated based on the de-blinding factor two, de-blinding factor three and de-blinding factor four to complete the federated learning security aggregation with delay elasticity.
10. A computer storage medium, characterized in that: It includes a storage module and an execution module, the storage module stores a program file corresponding to the delay-elastic federated learning security aggregation method described in any one of claims 1 to 8, and the execution module is used to execute the program file.
Citation Information
Patent Citations
Practical federal learning malicious security aggregation method and device
CN117035110A
