Data transmission method and device, equipment, storage medium and program product
By using the lightweight dual-key ElGamal protocol and intelligent contract mechanism in federated learning, the model parameters are encrypted and transmitted, which solves the privacy leakage problem in federated learning, improves data transmission security and model training efficiency, and achieves high efficiency. Secure computing power network resource transactions.
Patent Information
- Application Number
- CN202411347156.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-25
AI Technical Summary
When training the model through federated learning methods, there is still a method of extracting client computing resource data, resulting in serious privacy leakage problems and data security cannot be guaranteed.
Adopt lightweight dual-key ElGamal protocol and intelligent contract mechanism to generate public keys through the server's private key and the client's private key, encrypted and transmitted model parameters, ensure the security of data transmission, and use the reverse auction mechanism and data Quality-driven strategy, optimized resource transactions and privacy protection.
It effectively reduces the risk of privacy leakage, improves the security of data transmission, reduces communication costs, improves model training efficiency, and realizes trustworthy, fast, low-cost and high-frequency payment computing power network resource transactions.
Smart Images

Figure CN119232458A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, device, equipment, storage medium and program product. Background Art
[0002] With the development of computing power networks, there are many problems such as uneven distribution and lack of circulation of computing power in various regions. How to efficiently aggregate computing power from multiple parties, improve computing power utilization, promote cost reduction and low-carbon development has brought huge challenges. Currently, models can be trained through the method of federated learning to aggregate computing power from multiple parties. Specifically, each client (also known as a computing power network resource provider, edge client, etc.) uses its own computing power resource data to train a local model (also known as a machine learning model) locally, and then uploads the model parameters of its own local model to the central server (also known as a cloud server, server, or Server, etc.). The central server updates the global model (also known as a shared model) by aggregating the model parameters uploaded by each client, and then distributes the model parameters of the updated global model to each client to update the model parameters of the local model of each client. This cycle continues until each model reaches the preset training target. In this way, there is no need for each client to share its own computing power resource data, which can effectively prevent attackers from directly accessing the client's computing power resource data.
[0003] However, when training models through federated learning methods, there are still some methods that can extract the client's computing resource data, such as model inversion attacks, member attacks, and model extraction attacks, which lead to serious privacy leakage problems and cannot guarantee data security. Summary of the invention
[0004] The present application provides a data transmission method, apparatus, device, storage medium and program product, which are used to solve the technical problem that when training a model through a federated learning method, there are still some methods that can extract the client's computing resource data, resulting in serious privacy leakage problems and the inability to ensure data security.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, a data transmission method is provided, which is applied to a target client, and the method includes: obtaining a first private key from a server and a second private key generated by the target client; generating a public key of the target client based on the first private key and the second private key; encrypting model parameters of a local model trained by the target client based on the public key of the target client, and sending the encrypted model parameters to the server, so that the server obtains a global model corresponding to the local model based on the model parameters training.
[0007] In one possible implementation, after sending the encrypted model parameters to the server so that the server obtains the global model corresponding to the local model based on the model parameter training, the method also includes: receiving the aggregated model parameters sent by the server; the aggregated model parameters are obtained by aggregating the model parameters sent by the server to each of multiple clients; the multiple clients include a target client; decrypting the aggregated model parameters based on the second private key; and updating the model parameters of the target client based on the decrypted aggregated model parameters until the local model training is completed.
[0008] In a possible implementation manner, the method further includes: sending a second private key to the server; the second private key is used by the server to decrypt the model parameters sent by the target client.
[0009] In a possible implementation, before encrypting the model parameters of the local model trained by the target client according to the public key of the target client, the method also includes: performing a training update on the local model to obtain the model parameters; a is an integer greater than 1.
[0010] In one possible implementation, before encrypting the model parameters of the local model trained by the target client according to the public key of the target client, the method also includes: determining b model parameters among all model parameters of the target client as model parameters of the target client; b is an integer greater than 1.
[0011] In one possible implementation, the model parameters of the target client are updated based on the decrypted aggregate model parameters until the local model training is completed, and the method also includes: sending the bid information of the target client to the server; the bid information includes: similarity metric EMD and quotation; the bid information is used by the server to determine multiple candidate clients from multiple clients.
[0012] In a second aspect, a data transmission method is provided, which is applied to a server, and the method includes: receiving model parameters of a local model trained respectively and sent by each of a plurality of clients; the model parameters of each client are obtained by encrypting the model parameters of each client based on a public key of each client; the public key of each client is generated based on a first private key of the server and a second private key of each client.
[0013] In one possible implementation, after receiving model parameters of the respectively trained local models sent by each of multiple clients, the method further includes: aggregating the model parameters of each client to obtain aggregated model parameters; encrypting the aggregated model parameters based on the first private key, and sending the encrypted aggregated model parameters to each client.
[0014] In one possible implementation, the method also includes: receiving a second private key sent by each client; decrypting the aggregate model parameters according to the first private key and the second private key of each client; and updating the model parameters of the global model trained by the server based on the decrypted aggregate model parameters until the global model training is completed.
[0015] In a possible implementation, the model parameters of the global model trained by the server are updated based on the decrypted aggregate model parameters until the global model training is completed, and the method also includes: receiving the bidding information sent by the demand side and the bidding information sent by each client; the bidding information includes: the similarity measurement EMD range; the bidding information includes: EMD and quotation; based on the bidding information and the bidding information of each client, determine multiple candidate clients from multiple clients through the trained global model; the EMD of the candidate client is within the EMD range; the quotation of the candidate client is lower than that of the clients other than the multiple candidate clients among the multiple clients; and send a message to the demand side to select multiple candidate clients.
[0016] In a possible implementation, the demander is configured to determine a successful client from multiple candidate clients based on the demander's budget and the bid of each candidate client.
[0017] In a possible implementation, the resource type provided by the multiple clients is the same as the resource type requested by the demander.
[0018] In a third aspect, a data transmission device is provided, which is applied to a target client, and the data transmission device includes: a transmission unit and a processing unit; the transmission unit is used to obtain a first private key from a server and a second private key generated by the target client; the processing unit is used to generate a public key of the target client based on the first private key and the second private key; the processing unit is also used to encrypt model parameters of a local model trained by the target client according to the public key of the target client, and send the encrypted model parameters to the server, so that the server can obtain a global model corresponding to the local model according to the model parameters training.
[0019] In one possible implementation, the transmission unit is also used to receive aggregated model parameters sent by the server; the aggregated model parameters are obtained by aggregating model parameters sent by the server to each of multiple clients; the multiple clients include a target client; the processing unit is also used to decrypt the aggregated model parameters based on the second private key; the processing unit is also used to update the model parameters of the target client based on the decrypted aggregated model parameters until the local model training is completed.
[0020] In a possible implementation, the transmission unit is further used to send a second private key to the server; the second private key is used by the server to decrypt the model parameters sent by the target client.
[0021] In a possible implementation, the processing unit is further used to perform a training update on the local model to obtain model parameters; a is an integer greater than 1.
[0022] In a possible implementation manner, the processing unit is further configured to determine b model parameters among all model parameters of the target client as the model parameters of the target client; b is an integer greater than 1.
[0023] In a possible implementation, the transmission unit is further used to send the bidding information of the target client to the server; the bidding information includes: similarity measurement EMD and quotation; the bidding information is used by the server to determine multiple candidate clients from multiple clients.
[0024] In a fourth aspect, a data transmission device is provided, which is applied to a server, and the data transmission device includes: a transmission unit; a transmission unit, which is used to receive model parameters of local models trained respectively and sent by each of a plurality of clients; the model parameters of each client are obtained by encrypting the model parameters of each client based on the public key of each client; the public key of each client is generated based on the first private key of the server and the second private key of each client.
[0025] In one possible implementation, the data transmission device also includes: a processing unit; a processing unit, used to aggregate the model parameters of each client to obtain aggregated model parameters; the processing unit, also used to encrypt the aggregated model parameters based on the first private key; and a transmission unit, also used to send the encrypted aggregated model parameters to each client.
[0026] In one possible implementation, the transmission unit is further used to receive a second private key sent by each client; the processing unit is further used to decrypt the aggregate model parameters according to the first private key and the second private key of each client; the processing unit is further used to update the model parameters of the global model trained by the server based on the decrypted aggregate model parameters until the global model training is completed.
[0027] In a possible implementation, the transmission unit is further used to receive the bidding information sent by the demand side and the bid information sent by each client; the bidding information includes: the EMD range of the similarity measurement; the bid information includes: EMD and quotation; the processing unit is further used to determine multiple candidate clients from multiple clients through a trained global model based on the bidding information and the bid information of each client; the EMD of the candidate client is within the EMD range; the quotation of the candidate client is lower than that of the clients other than the multiple candidate clients among the multiple clients; the transmission unit is also used to send a message to the demand side to select multiple candidate clients.
[0028] In a possible implementation, the demander is configured to determine a successful client from multiple candidate clients based on the demander's budget and the bid of each candidate client.
[0029] In a possible implementation, the resource type provided by the multiple clients is the same as the resource type requested by the demander.
[0030] In a fifth aspect, an electronic device comprises: a processor and a memory; wherein the memory is used to store one or more programs, and the one or more programs include computer execution instructions. When the electronic device is running, the processor executes the computer execution instructions stored in the memory to enable the electronic device to perform a data transmission method as in the first aspect and the second aspect.
[0031] In a sixth aspect, a computer-readable storage medium storing one or more programs is provided, wherein the one or more programs include instructions, and when the instructions are executed by a computer, the computer executes a data transmission method as in the first aspect and the second aspect.
[0032] In a seventh aspect, a computer program product is provided. When the computer instructions are executed on an electronic device, the electronic device executes a data transmission method as described in the first and second aspects.
[0033] The present application provides a data transmission method, apparatus, device, storage medium and program product, which are applied to data transmission scenarios. When the client needs to transmit model parameters to the server, the first private key from the server and the second private key generated by the target client can be obtained, and the public key of the target client can be generated based on the first private key and the second private key. Furthermore, the model parameters of the local model trained by the target client are encrypted according to the public key of the target client, and the encrypted model parameters are sent to the server, so that the server obtains the global model corresponding to the local model according to the model parameter training. That is, the model parameters are encrypted with the public key obtained based on the private key of the server and the private key of the client, which can achieve the effect of double-key encryption. In this way, the security of the model parameters during transmission can be ensured, and the extraction of the client's computing power resource data by obtaining the model parameters can be avoided.
[0034] Through the above method, the model parameters sent by the client to the server can be encrypted according to the public key generated by the server's private key and the client's private key. Thus, when training the model through the federated learning method, there are still some methods that can extract the client's computing resource data, resulting in serious privacy leakage and the inability to ensure data security. The technical problem is solved, and the security of data transmission is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1A schematic diagram of the structure of a data transmission system provided in an embodiment of the present application;
[0036] Figure 2 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 1 ;
[0037] Figure 3 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 2 ;
[0038] Figure 4 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 3 ;
[0039] Figure 5 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 4 ;
[0040] Figure 6 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 5 ;
[0041] Figure 7 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 6 ;
[0042] Figure 8 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 7 ;
[0043] Fig. 9 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 8 ;
[0044] Fig.10 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 9 ;
[0045] Fig.11 An architectural diagram of a federated learning algorithm training and updating model based on a lightweight dual-key ElGamal protocol provided in an embodiment of the present application;
[0046] Fig.12 An architectural diagram of selecting a winner set provided in an embodiment of the present application;
[0047] Fig.13 A schematic diagram of a data transmission device provided in an embodiment of the present application Figure 1 ;
[0048] Fig.14A schematic diagram of a data transmission device provided in an embodiment of the present application Figure 2 ;
[0049] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0051] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. 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, "at least one" and "plurality" refer to two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0052] At present, although traditional machine learning algorithms have the ability to aggregate computing power from multiple parties, more and more computing network resource providers are unwilling to share resource data due to privacy considerations or competition among peers. In addition, in terms of privacy protection, there are still multiple iterations of machine learning algorithms, which will consume a lot of privacy space, leading to a high risk of privacy leakage, and encryption technology will require a lot of communication and computing resources, making machine learning algorithms inefficient in practical applications.
[0053] Currently, the federated learning algorithm is widely used for computing power transactions between computing power network resource providers and cloud servers. This method enhances the protection of user privacy by allocating machine learning tasks to edge clients and using the edge client data to collaboratively train shared models. Specifically, when using the federated learning algorithm training framework, all clients have a common model structure and training objectives. Each client uses its data to train a machine learning model locally, and then uploads the model parameters of its own local model to the central server. The central server updates the global model by aggregating the model parameters uploaded by each client, and then distributes the updated model parameters of the global model to each client to update its local parameters. This cycle continues until the preset training target is reached.
[0054] Federated learning algorithms can effectively prevent attackers from directly accessing the client's local data. However, there are also some methods that can extract local data information from the training process of federated learning algorithms, such as model inversion attacks, member attacks, and model extraction attacks. In order to obtain the client's local private information, Generative Adversarial Networks (GAN) is used to infer the client's private data from the shared gradient. Therefore, even if the model is trained using federated learning, there are still security issues.
[0055] In the process of federated learning training, in order to effectively reduce the problem of indirect privacy leakage, differential privacy (DP) technology can be used in related technologies to reduce the risk of privacy leakage. DP technology mainly reduces the sensitivity of query results by adding controlled noise. In addition, in related technologies, secure multi-party computing (SMC) technology can also be used to reduce the risk of privacy leakage, and functions can be safely calculated without exposing their inputs.
[0056] These two privacy-preserving algorithms for federated learning can effectively reduce the risk of privacy leakage, but there are still two disadvantages. First, due to the multiple iterations of deep learning algorithms, most DP-based methods consume a lot of privacy protection resources, resulting in a high risk of privacy leakage. Therefore, these methods usually sacrifice the accuracy of some models to balance privacy and practicality. The second disadvantage is that existing SMC-based methods usually require a lot of computing resources when using encryption technologies such as fully homomorphic encryption (FHE), which also leads to reduced efficiency in practical applications. In addition, in the training process of federated learning, the client and the cloud server need to interact multiple times, which also consumes a lot of communication resources. Therefore, when using the privacy-preserving algorithm of federated learning, it is necessary to ensure the efficiency of its calculation and improve the practicality and accuracy of the model.
[0057] In addition, during the computing power trading process, a large amount of resources (such as power resources, bandwidth resources, and computing resources) are consumed when training models on edge clients. Therefore, how to determine the resource trading price is also a crucial challenge.
[0058] To solve the above problems, the present application provides a data transmission method, through the computing power network transaction and protection strategy of lightweight federated learning, a distributed framework is used to solve the problem that computing power network resource suppliers are unwilling to share their resource data. When multiple clients do not share their respective data resources, a machine learning model can be trained together. Each client trains a local model locally and then uploads the model parameters to the central server. The central server aggregates these uploaded parameters to update the global model, and then distributes the parameters of the global model to each client to update the local parameters, so that the cyclic training continues until the training goal is achieved. In this process, the present application can use a lightweight dual-key asymmetric encryption algorithm (ElGamal Cryptosystem, ElGamal) protocol to protect the data transmitted between the client and the server, and at the same time adopt an effective optimization strategy to achieve lightweight, easy-to-use, convenient and efficient privacy protection, and protect the entire process of computing power network resource transactions.
[0059] In addition, through the lightweight federated learning encryption protocol combined with the smart contract mechanism, a transaction bridge is built between the computing power network resource demanders and computing power network resource suppliers. Using the reverse auction mechanism algorithm, a reverse auction strategy based on data quality drive is designed, which can motivate clients to make honest bids, help computing power network resource demanders understand the seller's information, and obtain more ideal results to promote automatic, autonomous and auditable auctions between clients. And use the privacy-preserving federated learning algorithm based on the lightweight encryption protocol to protect the security of the computing power network transaction process through local computing, selective parameter sharing and dynamic participation of the client in the training process. Thereby reducing communication costs, improving model training efficiency, and combining smart contract strategies to achieve a reliable, fast, low-cost, and high-frequency payment transaction process.
[0060] A data transmission method provided in an embodiment of the present application can be applicable to a data transmission system. Figure 1 FIG. 1 shows a schematic diagram of the structure of a data transmission system. Figure 1 As shown, the data transmission system 10 includes: a server 11 and multiple clients. The multiple clients include a target client 12. The server 11 and the multiple clients can be connected in a wired manner or in a wireless manner, which is not limited in the embodiment of the present invention.
[0061] The target client 12 is used to obtain a first private key from the server 11 and a second private key generated by the target client 12, generate a public key of the target client 12 based on the first private key and the second private key, encrypt the model parameters of the local model trained by the target client 12 based on the public key of the target client 12, and send the encrypted model parameters to the server 11, so that the server 11 obtains a global model corresponding to the local model according to the model parameters training.
[0062] The server 11 may be a virtualized server based on cloud computing technology. The client may be a network device including computer equipment, servers, switches, storage devices, chips, and other devices used to provide computing resources.
[0063] A data transmission method provided by an embodiment of the present application is described below in conjunction with the accompanying drawings. Figure 2 As shown, a data transmission method provided in an embodiment of the present application is applied to a target client, and the method includes S201-S204:
[0064] S201. Obtain a first private key from a server and a second private key generated by a target client.
[0065] It is understandable that the target client may have a first private key from the server and a second private key generated by the target client.
[0066] Optionally, before training the global model and the local model of each client in the multiple clients through the federated learning algorithm, the keys of the cloud server and all clients (i.e., Client) can be generated, and all model parameters can be randomly initialized in the same way. The multiple clients can be K. Specifically, a multiplication loop group can be assumed: G = <g>, |G|=p, where G is the general name of the multiplication cycle group, p is a safe prime number, and g is a single element in the multiplication cycle group. Then, for any one of the multiple clients (i.e., the target client), a number x can be randomly selected. i ∈RZ p-1 , where RZ is a real number set, i is the i-th client, i is an integer greater than 0 and less than K, and K is the number of clients. Further, calculate the client's and share the client's
[0067] Furthermore, each client and received The respective sharable secret keys are calculated using formula 1.
[0068]
[0069] Then, each client can calculate its own second private key (i.e. ).
[0070] In a possible implementation, the target client may send a second private key to the server, wherein the second private key is used by the server to decrypt the model parameters sent by the target client.
[0071] Optionally, each client may send its second private key to the server. Further, the server may randomly select a number x S ∈RZ p-1 As the server's key (ie sk S ), calculate and send the server's first private key (i.e. ) to all clients.
[0072] S202: Generate a public key of the target client according to the first private key and the second private key.
[0073] Optionally, each client may generate its own public key (pk) according to the first private key of the server and its own second private key by using Formula 2.
[0074]
[0075] S203. Encrypt the model parameters of the local model trained by the target client according to the public key of the target client.
[0076] Optionally, each client can update its own local model by training multiple times locally based on the local training data set, and then transmit the model parameters to the server based on the lightweight dual-key ElGamal protocol. Specifically, each client can encrypt the model parameters (also referred to as local parameters) of its own local model according to its own public key. The local training data set may include multiple data of the client itself.
[0077] Specifically, in order to protect the privacy of model parameters, the i-th client not only needs to Encrypt it before uploading it to the server, and also ensure that the server can calculate the sum of the ciphertexts sent by each client. Therefore, it is necessary to use the multiplicative homomorphic encryption algorithm to calculate the model parameters of each client through formula 3 to obtain the target parameters
[0078]
[0079] in, is the model parameter of the i-th client, n i is the number of model parameters for the ith client, are the model parameters selected by the i-th client and sent to the server (i.e., shared model parameters).
[0080] Then, each client encrypts the target parameters according to its own public key through Formula 4 (i.e., SelecEnc algorithm) to obtain the encrypted model parameters (i.e., It can also be expressed as ).
[0081]
[0082] Where j is the number of times each client updates its local model before sending its model parameters to the server.
[0083] S204. Send the encrypted model parameters to the server, so that the server can obtain a global model corresponding to the local model through training based on the model parameters.
[0084] Optionally, each client may send its own encrypted model parameters to the server, so that the server can obtain a global model corresponding to the local model through training based on the model parameters.
[0085] Federated learning algorithms are used in many fields. In order to enhance the privacy protection of federated learning algorithms, this application can improve the traditional ElGamal protocol into a lightweight dual-key ElGamal protocol (i.e., a lightweight dual-key encrypted version of the ElGamal protocol), where the two keys are distributed to the cloud server and the client through the Diffie-Hellman key exchange protocol. The lightweight dual-key ElGamal protocol can protect the privacy of the model through lightweight encryption and communication without losing the readiness of federated learning.
[0086] In one design, Figure 3 As shown, a data transmission method provided in an embodiment of the present application, after the above step S204, the method further includes S301-S303:
[0087] S301. Receive aggregation model parameters sent by a server.
[0088] The aggregated model parameters are obtained by aggregating the model parameters sent by the server to each of the multiple clients; the multiple clients include the target client.
[0089] Optionally, the server may aggregate the model parameters received from the M clients to obtain an aggregate model parameter (i.e. ), and sends the aggregate model parameters to each of the M clients. Each client can download the aggregate model parameters (also called aggregated weight vector) from the server.
[0090] S302: Decrypt the aggregation model parameters based on the second private key.
[0091] Optionally, each client may use the ParaAggre algorithm to decrypt the aggregated model parameters and update their own model parameters.
[0092] Specifically, each client can use its own second private key (ie, sk c ), through formula 5, the ciphertext of the aggregation model parameters (i.e. ) to decrypt and obtain the decrypted aggregation model parameters (i.e. It can also be expressed as ).
[0093]
[0094] Among them, U j Represents the set of model parameters uploaded by the client, and t is the number of all model parameters of the client.
[0095] S303: Based on the decrypted aggregate model parameters, update the model parameters of the target client until the local model training is completed.
[0096] Optionally, each client can use the average of the decrypted aggregate model parameters (i.e. ) Update the model parameters of their respective local models, and repeat the above steps S203-S204, and S301-S302 until the local model training is completed (i.e., the local model converges). are the model parameters that client i chooses to share, It is the number of model parameters (also called the number of samples) sent by each of the selected M clients to the server.
[0097] This application can decrypt the aggregate model parameters through the client's private key to update the model parameters of the local model, thereby realizing the update of the local model. The aggregate model parameters can be decrypted through the client's private key, ensuring the secure transmission of the model parameters.
[0098] In one design, Figure 4 As shown, a data transmission method provided in an embodiment of the present application, before the above step S203, the method further includes S401:
[0099] S401, perform training and update on the local model a times to obtain model parameters.
[0100] Here, a is an integer greater than 1.
[0101] Optionally, each client can use the SelecEnc algorithm to select some weight parameters after updating its local model multiple times based on the local training dataset, and upload its ciphertext to the server.
[0102] It should be noted that both the local model and the global model are deep learning models, which use stochastic gradient descent (SGD) (also called gradient) or its variants to optimize the neural network model: In each global traversal (i.e., each training update of the global model), each client i calculates the gradient g on its own local training dataset i , and update their respective local gradient weights according to the gradient, and then the server updates the global gradient weight by aggregating the local gradient weights corresponding to these gradients. That is, the gradient g i is one of the model parameters.
[0103] However, in each global traversal, after all clients update their local gradient weights through SGD, the server needs to calculate the weighted average of their local gradient weights as the global gradient weight, which will increase the number of traversals and complexity of model training.
[0104] In order to reduce the communication cost when training a model using a federated learning algorithm, this application proposes a more efficient gradient update optimization strategy. Specifically, before the server aggregates the model parameters, the number of iterations of the client's local model local training update can be increased on the client side to limit the number of interactions between the client and the server. The gradient update method can be as follows: ω (i) ←(ω (i) -λg i ) μ , M≤K. Where λ is a quantitative or variable, μ is the number of local training updates (i.e., a), M is the number of clients participating in each global update training, and ω (i) is the local weight vector of the local model of the i-th client (ie, the model parameters of the local model).
[0105] This application can avoid the problem of high communication costs when training models using federated learning algorithms by uploading model parameters to the server to update the global model after each local model update, after training and updating the local model a certain number of times. This can reduce communication costs.
[0106] In one design, Figure 5 As shown, a data transmission method provided in an embodiment of the present application, before the above step S203, the method further includes S501:
[0107] S501. Determine b model parameters among all model parameters of the target client as model parameters of the target client.
[0108] Here, b is an integer greater than 1.
[0109] Optionally, each client may use the SelecEnc algorithm to select b model parameters from all its own model parameters and determine them as the model parameters that each client needs to upload to the server.
[0110] Specifically, all model parameters of client i are In order to reduce communication costs, each client only needs to share a small number of model parameters with the server. These model parameters can be randomly selected, or the parameters whose current values are farthest from the local optimal value can be selected (such as model parameters with larger gradients, which indicate that model parameters are more critical).
[0111] Assume that client i starts from ω (i) Selecting a part of the model parameters with a larger gradient can be expressed as: Among them, j is the number of local traversals of each client in each global traversal (i.e., μ), Yes (i) J s model parameters.
[0112] This application can select a part of the model parameters of all the model parameters of the client to upload to the server. The fewer the model parameters, the fewer the communication resources required and the lower the communication cost. In addition, the fewer the model parameters, the faster the model training and updating speed. In this way, the communication cost can be reduced, and the efficiency of the server training and updating the global model and the client training and updating the local model according to the aggregated model parameters can be improved.
[0113] In one design, Figure 6 As shown, a data transmission method provided in an embodiment of the present application, after the above step S204, the method further includes S601:
[0114] S601. Send the bidding information of the target client to the server.
[0115] The bidding information includes: a similarity measure EMD and a quotation (also referred to as a bidding price); the bidding information is used by the server to determine a plurality of candidate clients from a plurality of clients.
[0116] Optionally, when the computing power network resource demander (also referred to as the demander) requires the client to provide computing power network resources, the computing power network resource demander can send bidding information (i.e., publish a task) to the server based on the lightweight dual-key ElGamal protocol. The bidding information includes: similarity measurement (Earth Mover's Distance, EMD) range (i.e., the maximum value of the EMD value passed by the smart contract), resource type (i.e., the resource type of the resource requested by the computing power network resource demander, such as central processing unit (CPU) computing power, graphics processing unit (GPU) computing power, etc.), and total budget.
[0117] Each client can receive the bidding information sent by the demander and forwarded by the server, and determine whether to participate in the bidding (also called auction) according to the bidding information sent by the demander.
[0118] In a possible implementation, the resource type provided by the multiple clients is the same as the resource type requested by the demander.
[0119] Optionally, if the resource type requested by the demander is the same as the resource type that a client can provide, then the client can determine to participate in this bidding. The clients participating in this bidding can send their respective bidding information to the server based on the lightweight dual-key ElGamal protocol. The bidding information includes: EMD, quotation, and resource quantity information.
[0120] Optionally, clients can calculate their own EMD in the following way: First, assuming a K-classification problem, define a contract X and a label space y = [K], where [K] = 1, ..., K, K refers to K samples. Client n i The local training dataset is D i ={x i ,y i }, according to the distribution Distributed in On, we can get D i The EMD (i.e., σ i ) is calculated as Formula 6:
[0121]
[0122] in, Represents the reference distribution, including computing power network resource demanders and clients; Indicates D i The probability of the jth class in .
[0123] It should be noted that EMD is used to measure the similarity between two probability distributions. EMD can be used to evaluate the performance of a model. In this application, the smaller the EMD, the better the performance of the model, which means that more resources are consumed when training the model.
[0124] This application can determine the client to be selected from multiple clients through the server according to the EMD and quotations of multiple clients, that is, the smaller the EMD of the client, the better the performance of the client's local model, and the lower the quotation, the lower the cost of the demand side, and the easier it is for the demand side to be selected by the demand side. In this way, each client can be encouraged to quote honestly, help the demand side understand the information of the seller (ie, the client), and obtain a more ideal bidding result.
[0125] like Figure 7 As shown, a data transmission method provided in an embodiment of the present application is applied to a server, and the method includes S701:
[0126] S701. Receive model parameters of a local model trained respectively and sent by each of a plurality of clients.
[0127] The model parameters of each client are obtained by encrypting the model parameters of each client based on the public key of each client; the public key of each client is generated based on the first private key of the server and the second private key of each client.
[0128] Optionally, the server may receive model parameters of the local model trained by each of the multiple clients. That is, the server may receive the model parameters of the local model trained by each of the M clients. And after receiving the M clients each sent When , notify the K clients except the M clients to stop uploading data.
[0129] It should be noted that this approach is suitable for situations where the computing power and network transmission rate of each client are similar, and it allows some clients to exit without disrupting the training process.
[0130] This application controls the number of clients participating in training by setting a threshold M, thereby reducing communication costs.
[0131] In one design, Figure 8 As shown, a data transmission method provided in an embodiment of the present application, after the above step S701, the method further includes S801-S802:
[0132] S801. Aggregate the model parameters of each client to obtain aggregated model parameters.
[0133] Optionally, the server can use the ParaAggre algorithm to calculate the aggregation weight vector (also called aggregation model parameters) and use sk s Decrypt part of the ciphertext of the aggregation model parameters. Specifically, the server can use Formula 7 to calculate the value of each client among the M clients. Aggregation, get the aggregate model parameters (i.e. It can also be expressed as ).
[0134]
[0135] Among them, U i Represents the set of model parameters uploaded by the client selected by the SelecEnc algorithm. Note that there may be Because clients may share many of the same model parameters.
[0136] S802: Encrypt the aggregate model parameters based on the first private key, and send the encrypted aggregate model parameters to each client.
[0137] Optionally, the server may use the first private key (sk s ), the encrypted aggregate model parameters are obtained by encrypting the partial aggregate values of the aggregate model parameters through formula eight (i.e. It can also be expressed as ), and sends the encrypted aggregate model parameters to each of the M clients.
[0138]
[0139] The present application can aggregate the model parameters sent by each client through the server, and encrypt the aggregated model parameters through the server's private key, so that the client can decrypt the aggregated model parameters to update the local model, ensuring the secure transmission of model parameters during model training.
[0140] In one design, Fig. 9 As shown, a data transmission method provided in an embodiment of the present application further includes S901-S903:
[0141] S901. Receive a second private key sent by each client.
[0142] S902: Decrypt the aggregate model parameters according to the first private key and the second private key of each client.
[0143] Optionally, the server can receive a second private key (sk c ), according to its own first private key (sk S ) and sk c , the public key (pk) is obtained by formula 2. Then, the server can aggregate the model parameters according to pk Decryption.
[0144] S903. Update the model parameters of the global model trained by the server based on the decrypted aggregate model parameters until the global model training is completed.
[0145] Optionally, the server may update the model parameters of the global model trained by the server based on the decrypted aggregate model parameters until the global model training is completed.
[0146] In one design, Fig.10 As shown, a data transmission method provided in an embodiment of the present application, after the above step S802, the method further includes S1001-S1003:
[0147] S1001. Receive the bidding information sent by the demander and the bidding information sent by each client.
[0148] The bidding information includes: similarity measurement EMD range; the tender information includes: EMD and quotation.
[0149] Optionally, the server can receive the bidding information sent by the demander, and send the bidding information sent by the demander to each client (i.e., M clients) that has completed the local model training based on the lightweight dual-key ElGamal protocol. Further, the server receives the respective bidding information sent by the clients determined to participate in this bidding.
[0150] S1002: Based on the bidding information and the bidding information of each client, a plurality of candidate clients are determined from the plurality of clients through the trained global model.
[0151] Among them, the EMD of the candidate client is within the EMD range; the quotation of the candidate client is lower than the clients other than the multiple candidates among the multiple clients.
[0152] Optionally, based on the bidding information and the bidding information of each client, the server may determine multiple candidate clients (ie, a set of winners) from multiple clients through a trained global model (also referred to as a federated learning neural network).
[0153] First, the server can select a client that meets the EMD range set by the platform through the server's smart contract based on the EMD of each client, that is, select a client whose EMD is less than the maximum value of the EMD value passed by the smart contract.
[0154] The server can then select the winner set from the clients that satisfy the EMD range set by the platform by: First, a monotone greedy allocation algorithm is used to maximize the valuation of the requester with a fixed budget in one global iteration. In order to achieve our objective function to maximize the valuation of the requester, a new parameter called the edge contribution is defined. in, refers to the set of winners in the first k-1 iterations; It refers to the contribution of the winner in the first k-1 iterations; If the platform selects client n i , then the incremental contribution of the kth iteration.
[0155] When the server receives multidimensional information (also called bidding information) from all clients that have confirmed to participate in the auction, the server's smart contract will create two sets, namely the winner set and the candidate set. i The edge density is used to select the winner set, and the client n is defined i The edge density (i.e., f(x i ))for: Among them, b i Yes i bid price.
[0156] Therefore, in each iteration, the server will start from N m Select the client n with the largest edge density i , and n i Add to Winners Collection N * middle.
[0157] If several clients have the same edge density, the server will randomly select one of them. According to the greedy mechanism, we can get: Among them, N s It refers to a feasible candidate set (i.e., candidate set) containing s winners.
[0158] In order, the server greedily adds clients to the winner set until the current client n k Violation of budget feasibility mechanisms, which are defined as:
[0159] By looping the above steps, the server finally outputs the winner set N * .
[0160] S1003: Send a message to the demander to select multiple clients to be selected.
[0161] Optionally, the client may send a message for selecting multiple candidate clients to the demander and each of the multiple candidate clients.
[0162] This application can determine the client to be selected from multiple clients through the server according to the EMD and quotations of multiple clients, that is, the smaller the EMD of the client, the better the performance of the client's local model, and the lower the quotation, the lower the cost of the demand side, and the easier it is for the demand side to be selected by the demand side. In this way, each client can be encouraged to quote honestly, help the demand side understand the information of the seller (ie, the client), and obtain a more ideal bidding result.
[0163] In a possible implementation, the demander is configured to determine a successful client from multiple candidate clients based on the demander's budget and the bid of each candidate client.
[0164] Optionally, when receiving the winner set sent by the server, the demander may determine the winning client from the winner set based on the demander's budget and the bid of each candidate client through the following method:
[0165] For each winner n k , similar to the winner selection, the demand side will recalculate the maximum edge density use express The winner set of , assuming l is The index of n l is The client selected in the lth cycle on . Then according to the edge density, the demand side can calculate a quote α k,l So that n k Can replace n l In the new collection Wins in the lth cycle. k,l It can be expressed as: Furthermore, based on the feasibility of the budget, the conditions that the bid price should meet are: Among them, Φ(N * ) means that if n is selected in the first cycle k Total income, Refers to client n k In the lth iteration, the set By looping the above steps, the winner payment set P (i.e. the winning client) is finally output. The demand side then determines the final winning client from the winning clients.
[0166] This application can determine the winning client from the clients according to the client's quotation. The lower the quotation, the lower the cost of the demander, and the easier it is for the client to be selected by the demander. In this way, the demander can obtain a more ideal bidding result.
[0167] like Fig.11 As shown, a framework diagram of a federated learning algorithm training and updating model based on a lightweight dual-key ElGamal protocol is shown. Each of the M clients (i.e., client 1, client 2, ..., client M) can upload their own encrypted model parameters (i.e., ). Further, the cloud server aggregates the encrypted model parameters uploaded by each client to obtain the aggregated model parameters (i.e. ), then the cloud server can encrypt the aggregate model parameters to obtain the encrypted aggregate model parameters (i.e. ). Each of the M clients downloads the encrypted aggregate model parameters from the cloud server. Further, each client can decrypt the encrypted aggregate model parameters to obtain the decrypted aggregate model parameters (i.e. ), and use the average value of the decrypted aggregate model parameters Update the respective local models.
[0168] like Fig.12 As shown, an architecture diagram for selecting a winner set is shown. First, the computing power network resource demander (i.e., User 1, User 2, ..., User N) can send bidding information such as EMD range, total budget and resource type to the cloud server based on the dual-key ElGamal protocol, and then the cloud server can send bidding information to each of the M clients (i.e., Client 1, Client 2, Client 3, ..., Client M) based on the dual-key ElGamal protocol. Further, each client can determine whether to participate in this auction based on the bidding information. Further, the client determined to participate in this auction can send its own bidding information such as bidding price, resource quantity and EMD to the cloud server based on the dual-key ElGamal protocol. Further, based on the bidding information, the federated learning neural network of the cloud server can determine the winner set from the clients participating in this auction based on the smart contract of the cloud server, and based on the dual-key ElGamal protocol. The winner set is sent to the computing power network resource demander and the client participating in this auction respectively.
[0169] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0170] The embodiment of the present application can divide a data transmission method into functional modules according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0171] Fig.13 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of the present application. Fig.13 As shown, a data transmission device 110 is used to improve the security of data transmission, for example, to perform Figure 2 A data transmission method is shown. The data transmission device 110 includes: a transmission unit 1101 and a processing unit 1102.
[0172] Transmission unit 1101 is used to obtain a first private key from a server and a second private key generated by a target client; processing unit 1102 is used to generate a public key of a target client based on the first private key and the second private key; processing unit 1102 is also used to encrypt model parameters of a local model trained by a target client based on the public key of the target client, and send the encrypted model parameters to the server, so that the server can obtain a global model corresponding to the local model based on the model parameters training.
[0173] In one possible implementation, the transmission unit 1101 is also used to receive aggregated model parameters sent by the server; the aggregated model parameters are obtained by aggregating the model parameters sent by the server to each of multiple clients; the multiple clients include a target client; the processing unit 1102 is also used to decrypt the aggregated model parameters based on the second private key; the processing unit 1102 is also used to update the model parameters of the target client based on the decrypted aggregated model parameters until the local model training is completed.
[0174] In a possible implementation, the transmission unit 1101 is further used to send a second private key to the server; the second private key is used by the server to decrypt the model parameters sent by the target client.
[0175] In a possible implementation, the processing unit 1102 is further configured to perform a training update on the local model to obtain model parameters; a is an integer greater than 1.
[0176] In a possible implementation manner, the processing unit 1102 is further configured to determine b model parameters among all model parameters of the target client as the model parameters of the target client; b is an integer greater than 1.
[0177] In a possible implementation, the transmission unit 1101 is further used to send the bidding information of the target client to the server; the bidding information includes: similarity measurement EMD and quotation; the bidding information is used by the server to determine multiple candidate clients from multiple clients.
[0178] Fig.14 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of the present application. Fig.14 As shown, a data transmission device 120 is used to improve the security of data transmission, for example, to perform Figure 3 A data transmission method is shown. The data transmission device 120 includes: a transmission unit 1201.
[0179] Transmission unit 1201 is used to receive model parameters of the local models trained by each client among multiple clients; the model parameters of each client are encrypted by the model parameters of each client based on the public key of each client; the public key of each client is generated based on the first private key of the server and the second private key of each client.
[0180] In one possible implementation, the data transmission device also includes: a processing unit 1202; processing unit 1202 is used to aggregate the model parameters of each client to obtain aggregated model parameters; processing unit 1202 is also used to encrypt the aggregated model parameters based on the first private key; transmission unit 1201 is also used to send the encrypted aggregated model parameters to each client.
[0181] In one possible implementation, the transmission unit 1201 is also used to receive the second private key sent by each client; the processing unit 1202 is also used to decrypt the aggregate model parameters according to the first private key and the second private key of each client; the processing unit 1202 is also used to update the model parameters of the global model trained by the server based on the decrypted aggregate model parameters until the global model training is completed.
[0182] In a possible implementation, the transmission unit 1201 is also used to receive the bidding information sent by the demand side and the bid information sent by each client; the bidding information includes: the similarity measurement EMD range; the bid information includes: EMD and quotation; the processing unit 1202 is also used to determine multiple candidate clients from multiple clients through a trained global model based on the bidding information and the bid information of each client; the EMD of the candidate client is within the EMD range; the quotation of the candidate client is lower than that of the clients other than the multiple candidate clients among the multiple clients; the transmission unit 1201 is also used to send a message to the demand side to select multiple candidate clients.
[0183] In a possible implementation, the demander is configured to determine a successful client from multiple candidate clients based on the demander's budget and the bid of each candidate client.
[0184] In a possible implementation, the resource type provided by the multiple clients is the same as the resource type requested by the demander.
[0185] like Fig.15 As shown, an electronic device 130 is used to improve the rationality of resource allocation, for example, to perform Figure 2 A data transmission method is shown. The electronic device 130 includes a processor 1301, a memory 1302 and a bus 1303. The processor 1301 and the memory 1302 may be connected via the bus 1303.
[0186] The processor 1301 is the control center of the communication device, which can be a processor or a general term for multiple processing elements. For example, the processor 1301 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0187] As an embodiment, the processor 1301 may include one or more CPUs, such as Fig.15 CPU 0 and CPU 1 are shown in .
[0188] The memory 1302 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0189] As a possible implementation, the memory 1302 may exist independently of the processor 1301, and the memory 1302 may be connected to the processor 1301 via a bus 1303 to store instructions or program codes. When the processor 1301 calls and executes the instructions or program codes stored in the memory 1302, a data transmission method provided in an embodiment of the present application can be implemented.
[0190] In another possible implementation, the memory 1302 may also be integrated with the processor 1301 .
[0191] The bus 1303 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.15 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0192] It should be pointed out that Fig.15 The structure shown does not constitute a limitation on the electronic device 130. Fig.15 In addition to the components shown, the electronic device 130 may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0193] As an example, combining Fig.13 The functions implemented by the transmission unit 1101 and the processing unit 1102 in the data transmission device 110 are similar to those Fig.15 The functions of the processor 1301 in the embodiment are the same as those of the embodiment. Fig.14 The functions implemented by the transmission unit 1201 and the processing unit 1202 in the data transmission device 120 are similar to Fig.15 The function of processor 1301 in is the same.
[0194] Optional, such as Fig.15 As shown, the electronic device 130 provided in the embodiment of the present application may further include a communication interface 1304 .
[0195] The communication interface 1304 is used to connect with other devices through a communication network. The communication network may be Ethernet, wireless access network, wireless local area network (WLAN), etc. The communication interface 1304 may include a receiving unit for receiving data and a sending unit for sending data.
[0196] In one design, in the electronic device provided in the embodiment of the present application, the communication interface can also be integrated into the processor.
[0197] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional units is used as an example. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0198] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When a computer executes the instructions, the computer executes each step in the method flow shown in the above method embodiment.
[0199] An embodiment of the present application provides a computer program product. When a computer instruction is executed on an electronic device, the electronic device executes a data transmission method in the above method embodiment.
[0200] Among them, the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk. Random access memory (random access memory, RAM), read-only memory (read-only memory, ROM), erasable programmable read only memory (erasable programmable read only memory, EPROM), registers, hard disks, optical fibers, portable compact disc read-only memory (compact disc read-only memory, CD-ROM), optical storage devices, magnetic storage devices, or the above in a suitable combination, or any other form of computer-readable storage medium known in the art.
[0201] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).
[0202] In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0203] Since the electronic device, computer-readable storage medium, and computer program product in the embodiments of the present application can be applied to the above method, the technical effects that can be obtained can also refer to the above method embodiments, and the embodiments of the present application will not be repeated here.
[0204] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.< / g>
Claims
1. A data transmission method, characterized in that: Applied to a target client, the method comprises: Obtaining a first private key from a server and a second private key generated by the target client; Generate a public key of the target client according to the first private key and the second private key; The model parameters of the local model trained by the target client are encrypted according to the public key of the target client, and the encrypted model parameters are sent to the server, so that the server obtains the global model corresponding to the local model according to the model parameters training.
2. The method according to claim 1, characterized in that After sending the encrypted model parameters to the server so that the server obtains a global model corresponding to the local model through training according to the model parameters, the method further includes: receiving an aggregated model parameter sent by the server; the aggregated model parameter is obtained by aggregating the model parameters sent by the server to each of a plurality of clients; the plurality of clients includes the target client; decrypting the aggregate model parameters based on the second private key; Based on the decrypted aggregated model parameters, the model parameters of the target client are updated until the local model training is completed.
3. The method according to claim 1, characterized in that The method further comprises: The second private key is sent to the server; the second private key is used by the server to decrypt the model parameters sent by the target client.
4. The method according to claim 1, characterized in that: Before encrypting the model parameters of the local model trained by the target client according to the public key of the target client, the method further includes: The local model is trained and updated a times to obtain the model parameters; a is an integer greater than 1.
5. The method according to claim 1, characterized in that Before encrypting the model parameters of the local model trained by the target client according to the public key of the target client, the method further includes: b model parameters among all the model parameters of the target client are determined as the model parameters of the target client; b is an integer greater than 1.
6. The method according to claim 2, characterized in that The method further includes updating the model parameters of the target client based on the decrypted aggregate model parameters until the local model training is completed: The bidding information of the target client is sent to the server; the bidding information includes: a similarity metric EMD and a quotation; the bidding information is used by the server to determine a plurality of candidate clients from the plurality of clients.
7. A data transmission method, characterized in that: Applied to a server, the method comprises: Receive model parameters of the local models trained respectively and sent by each of the multiple clients; the model parameters of each client are obtained by encrypting the model parameters of each client based on the public key of each client; the public key of each client is generated based on the first private key of the server and the second private key of each client.
8. The method according to claim 7, characterized in that After receiving the model parameters of the respectively trained local models sent by each of the multiple clients, the method further includes: Aggregating the model parameters of each client to obtain aggregated model parameters; The aggregate model parameters are encrypted based on the first private key, and the encrypted aggregate model parameters are sent to each client.
9. The method according to claim 8, characterized in that The method further comprises: Receiving a second private key sent by each client; decrypting the aggregate model parameters according to the first private key and the second private key of each client; The model parameters of the global model trained by the server are updated based on the decrypted aggregate model parameters until the global model training is completed.
10. The method according to claim 9, characterized in that The method further comprises: updating the model parameters of the global model trained by the server based on the decrypted aggregate model parameters until the global model training is completed: Receiving the bidding information sent by the demander and the bidding information sent by each client; the bidding information includes: similarity measurement EMD range; the bidding information includes: EMD and quotation; Based on the bidding information and the bidding information of each client, a plurality of selected clients are determined from the plurality of clients by the trained global model; the EMD of the selected clients is within the EMD range; the bid of the selected client is lower than that of the clients other than the plurality of selected clients among the plurality of clients; A message for selecting the multiple candidate clients is sent to the demander.
11. The method according to claim 10, characterized in that The demander is used to determine a successful client from the multiple candidate clients based on the budget of the demander and the quotation of each candidate client.
12. The method according to claim 10, characterized in that The resource types provided by the multiple clients are the same as the resource types requested by the demander.
13. A data transmission device, characterized in that: Applied to a target client, the data transmission device comprises: a transmission unit and a processing unit; The transmission unit is used to obtain a first private key from a server and a second private key generated by the target client; The processing unit is configured to generate a public key of the target client according to the first private key and the second private key; The processing unit is also used to encrypt the model parameters of the local model trained by the target client according to the public key of the target client, and send the encrypted model parameters to the server, so that the server can obtain the global model corresponding to the local model according to the model parameters training.
14. A data transmission device, characterized in that: Applied to a server, the data transmission device comprises: a transmission unit; The transmission unit is used to receive model parameters of the local models trained respectively and sent by each of the multiple clients; the model parameters of each client are obtained by encrypting the model parameters of each client based on the public key of each client; the public key of each client is generated based on the first private key of the server and the second private key of each client.
15. An electronic device, characterized in that: include: Processor and memory; The memory is used to store one or more programs, and the one or more programs include computer-executable instructions. When the electronic device is running, the processor executes the computer-executable instructions stored in the memory to enable the electronic device to perform the method described in any one of claims 1-12.
16. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions which, when executed by a computer, cause the computer to perform the method of any one of claims 1-12.
17. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Federated learning training data privacy enhancement method and system
CN110572253A
Privacy protection federated learning method, system and device in distributed environment and medium
CN116383864A
Federal machine learning method and system considering robustness and privacy protection
CN117828627A
Dual-mode variable key length cryptography system
US20090103726A1
