Data processing method, device, computer equipment and storage medium
By using two types of servers in federated learning to perform data verification and confidence scoring on encrypted gradient information shared by clients, the problem of data insecurity caused by malicious participants and network attacks in federated learning is solved, and the efficiency of model training is improved. Security and stability.
Patent Information
- Application Number
- CN202410911332.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-07-09
AI Technical Summary
In the federated learning process, there is a risk of malicious participants or being attacked by network viruses, which makes the model training data unsafe and unreliable, affecting the security and generalization ability of model training.
Two types of servers are used for data verification. Through normalized verification and similarity analysis of encrypted gradient information, the confidence score is determined to ensure the security and accuracy of the encrypted gradient information shared by the client and avoid single-type server attacks. resulting in a data breach.
It improves the security of the federated learning process and the accuracy of data verification, prevents malicious gradient information from affecting model training, and ensures the stability and security of model training.
Smart Images

Figure CN118468353B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically to a data processing method, device, computer equipment and storage medium. Background Art
[0002] With the development of machine learning technology, a machine learning method called Federated Learning (FL) has emerged. It allows multiple participants to collaboratively train a common model through shared model training data without sharing original data, thereby improving the performance and generalization ability of the model while protecting the privacy and security of each participant's original data. However, among the multiple participants, there may be malicious participants or participants attacked by network viruses. The model training data shared by these participants is unsafe and unreliable, which will affect the subsequent model training and cause model training failure.
[0003] In the related technology, during the process of federated learning, a single type of server is set up to protect the privacy of the model training data shared by each participant. However, after the single type of server is attacked by a network, there is a risk that the model training data may be leaked or tampered with.
[0004] Therefore, in the related technology, there is a risk of shared model training data being leaked or tampered with during the federated learning process, and the security is low. Summary of the invention
[0005] The embodiments of the present application provide a data processing method, apparatus, computer device, and storage medium, which can improve the security of federated learning.
[0006] According to one aspect of the present application, an embodiment of the present application provides a data processing method, including:
[0007] Obtaining encrypted gradient information sent by each client, where the encrypted gradient information is generated by encrypting gradient information generated after each client performs stage training on the model;
[0008] Generate first ciphertext gradient information according to the encrypted gradient information, and send the first ciphertext gradient information to a verification server;
[0009] Receiving normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determining normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information;
[0010] Determine the training gradient information of the model in the current training phase, generate second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and send the second ciphertext gradient information to the verification server;
[0011] Receiving similarity information returned by the verification server after verifying the second ciphertext gradient information, the similarity information being similarity information between the training gradient information and the target encrypted gradient information;
[0012] A confidence score corresponding to the target encrypted gradient information is determined according to the similarity information, and global gradient information used by each client for training the model in the next stage is determined according to the confidence score and the target encrypted gradient information.
[0013] According to one aspect of the present application, an embodiment of the present application provides a data processing device, including:
[0014] An acquisition module, used to acquire encrypted gradient information sent by each client, wherein the encrypted gradient information is generated by encrypting gradient information generated after each client performs stage training on the model;
[0015] A first sending module, configured to generate first ciphertext gradient information according to the encrypted gradient information, and send the first ciphertext gradient information to a verification server;
[0016] A first receiving module, configured to receive normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determine normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information;
[0017] A second sending module, used to determine the training gradient information of the model in the current training stage, generate second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and send the second ciphertext gradient information to the verification server;
[0018] A second receiving module is used to receive similarity information returned by the verification server after verifying the second ciphertext gradient information, wherein the similarity information is similarity information between the training gradient information and the target encrypted gradient information;
[0019] A determination module is used to determine the confidence score corresponding to the target encrypted gradient information according to the similarity information, and to determine the global gradient information used by each client for the next stage of training the model according to the confidence score and the target encrypted gradient information.
[0020] In some embodiments, the first sending module includes a first gradient encryption submodule, a second gradient encryption submodule, a partial gradient decryption submodule, and a generation submodule;
[0021] A first gradient encryption submodule, configured to perform a multiplication homomorphic operation on the encrypted gradient information to obtain first encrypted gradient information;
[0022] A second gradient encryption submodule, used to determine a first random noise corresponding to the first encrypted gradient information, and perform an additive homomorphic operation on the first encrypted gradient information and the first random noise to obtain second encrypted gradient information;
[0023] a partial gradient decryption submodule, configured to partially decrypt the second encrypted gradient information using a pre-assigned first key to obtain partially decrypted gradient information;
[0024] The first generating submodule is used to generate first ciphertext gradient information according to the second encrypted gradient information and the partially decrypted gradient information.
[0025] In some embodiments, the second gradient encryption submodule is used to:
[0026] Determine a plurality of sub-first encrypted gradient information of the first encrypted gradient information;
[0027] Determine a sub-first random noise of each sub-first encrypted gradient information in the first random noise;
[0028] An additive homomorphic operation is performed on each sub-first encrypted gradient information and the corresponding sub-first random noise to obtain target first encrypted gradient information corresponding to each sub-first encrypted gradient information, and the target first encrypted gradient information is determined as the second encrypted gradient information.
[0029] In some embodiments, the first sending module further includes a first sending submodule, configured to send the first ciphertext gradient information to the verification server according to a secure communication link with the verification server, so that the verification server determines the second encrypted gradient information and the partial decrypted gradient information in the first ciphertext gradient information;
[0030] Partially decrypting the second encrypted gradient information by using a pre-assigned second key to obtain first decrypted gradient information, wherein the first key and the second key are an associated key pair, and are used to decrypt two different parts of the second encrypted gradient information respectively;
[0031] Fully decrypting the second encrypted gradient information according to the first decrypted gradient information and the partial decrypted gradient information to obtain second decrypted gradient information;
[0032] Normalized verification information corresponding to the encrypted gradient information is determined according to the second decrypted gradient information.
[0033] In some implementations, the first receiving module is configured to:
[0034] removing noise from the normalized verification information according to the first random noise to obtain target normalized verification information;
[0035] The encrypted gradient information whose target normalized verification information is a preset value is determined as the normalized target encrypted gradient information.
[0036] In some embodiments, the second sending module includes a first encryption submodule, a second encryption submodule, a partial decryption submodule, and a second generation submodule;
[0037] A first encryption submodule, configured to perform a multiplication homomorphic operation on the training gradient information and the target encrypted gradient information to obtain first encrypted information;
[0038] A second encryption submodule, used to determine a second random noise corresponding to the first encrypted information, and perform an additive homomorphic operation on the first encrypted information and the second random noise to obtain second encrypted information;
[0039] A partial decryption submodule, used to partially decrypt the second encrypted information using a pre-assigned first key to obtain partial decrypted information;
[0040] The second generating submodule is used to generate second ciphertext gradient information according to the second encrypted information and the partial decrypted information.
[0041] In some implementations, the second encryption submodule is configured to:
[0042] Determine a plurality of sub-first encrypted information corresponding to the first encrypted information;
[0043] Determining, in the second random noise, a sub-second random noise corresponding to each sub-first encrypted information;
[0044] Performing an additive homomorphic operation on each sub-first encrypted information and the corresponding sub-second random noise to obtain target first encrypted information corresponding to each sub-first encrypted information;
[0045] Performing an addition homomorphic operation on all of the target first encrypted information to obtain second encrypted information.
[0046] In some embodiments, the second sending module further includes a second sending submodule, configured to send the second ciphertext gradient information to the verification server according to a secure communication link with the verification server, so that the verification server determines the second encrypted information and the partial decrypted information in the second ciphertext gradient information;
[0047] Decrypting part of the second encrypted information by using a pre-assigned second key to obtain first decrypted information, wherein the first key and the second key are an associated key pair, and are used to decrypt two different parts of the second encrypted information respectively;
[0048] Fully decrypting the second encrypted information according to the first decryption information and the partial decryption information to obtain second decrypted information;
[0049] Similarity information between the training gradient information and the target encrypted gradient information is determined according to the second decrypted information.
[0050] In some implementations, the second receiving module is configured to:
[0051] According to the similarity information, determining abnormal encrypted gradient information with the smallest similarity in the target encrypted gradient information;
[0052] Determining a target similarity between the abnormal encrypted gradient information and each of the target encrypted gradient information;
[0053] The confidence score corresponding to each target encrypted gradient information is calculated according to the target similarity and the preset plaintext modulus.
[0054] In some embodiments, a determination module is used to:
[0055] Determining the sum of the confidence scores corresponding to all the target encrypted gradient information according to the confidence scores;
[0056] Determine a target confidence score corresponding to each target encrypted gradient information according to the sum of the confidence scores, the preset plaintext modulus and the confidence score corresponding to each target encrypted gradient information;
[0057] Multiply each of the target encrypted gradient information by the target confidence score to obtain updated ciphertext gradient information corresponding to each of the target encrypted gradient information;
[0058] Adding each of the updated ciphertext gradient information to obtain global ciphertext gradient information;
[0059] The global ciphertext gradient information is partially decrypted according to a pre-assigned first key to obtain the global gradient information used by each client for training the model in the next stage.
[0060] According to one aspect of the present application, an embodiment of the present application provides a computer-readable storage medium, which stores multiple instructions, and the instructions are suitable for a processor to load to execute the data processing method provided by the embodiment of the present application.
[0061] According to one aspect of the present application, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the computer program, the data processing method provided in the embodiment of the present application is implemented.
[0062] In an embodiment of the present application, the encrypted gradient information sent by each client is obtained, and the encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model; first ciphertext gradient information is generated according to the encrypted gradient information, and the first ciphertext gradient information is sent to a verification server; normalized verification information returned by the verification server after verifying the first ciphertext gradient information is received, and normalized target encrypted gradient information is determined in the encrypted gradient information according to the normalized verification information; the training gradient information of the model in the current training stage is determined, and second ciphertext gradient information is generated according to the training gradient information and the target encrypted gradient information, and the second ciphertext gradient information is sent to the verification server; similarity information returned by the verification server after verifying the second ciphertext gradient information is received, and the similarity information is the similarity information between the training gradient information and the target encrypted gradient information; a confidence score corresponding to the target encrypted gradient information is determined according to the similarity information, and global gradient information used by each client for the next stage of model training is determined according to the confidence score and the target encrypted gradient information. In this way, during the process of federated learning, the encrypted gradient information shared by the client is verified through two types of servers. The normalized verification information obtained through data verification can determine whether the encrypted gradient information is normalized, thereby filtering out the encrypted gradient information that is not normalized. The similarity information obtained through data verification can determine the confidence score corresponding to the target encrypted gradient information. According to the confidence score, the global gradient information for the next stage of model training can be more accurately determined. Compared with the related art that only uses a single type of server to protect the data of the federated learning process, the present application can avoid the leakage of encrypted gradient information caused by the attack of a single type of server, and can perform security detection and identification on the encrypted gradient information, thereby improving the security of the federated learning process.
[0063] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0065] Figure 1 It is a schematic diagram of a system framework corresponding to the data processing method of the system of the embodiment of the present application;
[0066] Figure 2 It is a schematic diagram of an application scenario of the data processing method provided in an embodiment of the present application;
[0067] Figure 3 It is a flowchart of a data processing method provided in an embodiment of the present application;
[0068] Figure 4 is a flowchart of step 220 provided in an embodiment of the present application;
[0069] Figure 5 It is a schematic diagram of the process of normalized verification performed by the verification server provided in the embodiment of the present application;
[0070] Figure 6 is a flowchart of step 240 provided in an embodiment of the present application;
[0071] Figure 7 It is a schematic diagram of a process of similarity verification performed by a verification server provided in an embodiment of the present application;
[0072] Figure 8 is another flow chart of the data processing method provided in the embodiment of the present application;
[0073] Fig. 9 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0074] Fig.10 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0075] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0076] It can be understood that in the specific implementation of the present application, related model data such as the corresponding gradient information of the model is involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards.
[0077] It should be noted that in some processes described in the specification, claims and the above-mentioned drawings, multiple steps appearing in a specific order are included, but it should be clearly understood that these steps may not be executed in the order in which they appear in this document or may be executed in parallel. The step numbers are only used to distinguish different steps, and the numbers themselves do not represent any execution order. In addition, descriptions such as "first", "second" or "target" in this document are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0078] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0079] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:
[0080] A client is a machine that accesses other people's information on the network. The client part is exclusive to the object and is responsible for executing foreground functions and interacting with the object. In this application, it can be understood as a sending device.
[0081] A server is a machine that provides information for people to access. The server part is the information and functions shared by multiple objects, and performs background services. In this application, it can be understood as a receiving device.
[0082] Federated Learning (FL), also known as Federated Machine Learning, is a machine learning framework that can effectively help multiple institutions use data and conduct machine learning modeling while meeting the requirements of user privacy protection, data security, and government regulations.
[0083] Federated learning is a distributed machine learning technology that allows multiple parties to collaboratively train a common model without sharing the original data, thereby improving the performance and generalization ability of the model while protecting the privacy and security of the data.
[0084] Federated learning solves the problem of different data owners collaborating without exchanging data by designing a virtual model. The virtual model is the optimal model for all parties to aggregate data together, and each region serves local goals based on the model.
[0085] Gradient information is an important concept in mathematics and machine learning, especially in optimization algorithms. Gradient information usually refers to the partial derivative of the objective function (such as loss function or cost function) with respect to the model parameters, which describes the direction and speed of change of the function at a certain point. In this application, gradient information can be specifically a vector.
[0086] Fully Homomorphic Encryption (FHE) is a cryptographic technology that allows arbitrary arithmetic or logical operations to be performed directly on encrypted data while maintaining the encryption state of the data. The basic principle of fully homomorphic encryption is to use a special encryption scheme to make the result of the operation on the ciphertext the same as the result of the same operation on the plaintext and then encrypting the result. This technology uses homomorphic transformation to make the data in the ciphertext state to get the same result as the plaintext operation, just need to ensure the homomorphic correspondence characteristics of the operation rules. For example, fully homomorphic encryption includes additive homomorphism and multiplicative homomorphism. If the operation between data satisfies f(A)+f(B)=f(A+B), we call this encryption function additive homomorphism. If the operation between data satisfies f(A)×f(B)=f(A×B), we call this encryption function multiplicative homomorphism. If an encryption function satisfies both additive homomorphism and multiplicative homomorphism, it is called fully homomorphic encryption. Then this encryption function is used to complete various encrypted operations (addition, subtraction, multiplication, division, polynomial evaluation, exponential, logarithmic, trigonometric functions).
[0087] Two-trapdoor fully homomorphic encryption is an advanced cryptographic technique that allows complex computations to be performed directly on encrypted data without first decrypting the data. The core of this technique is its ability to handle two trapdoors, thereby enhancing the security and flexibility of encrypted data.
[0088] In this application, a two-trapdoor fully homomorphic encryption method is used to process data, that is, two different types of independent servers are used to form two trapdoors, thereby increasing the security and flexibility of the data processing process.
[0089] First, let’s describe the technical problems existing in related technologies:
[0090] With the development of machine learning technology, federated learning has emerged as a machine learning method that allows multiple participants to collaboratively train a common model through shared model training data without sharing original data, thereby improving the performance and generalization ability of the model while protecting the privacy and security of each participant's original data. However, among the multiple participants, there may be malicious participants or participants attacked by network viruses. The model training data shared by these participants is unsafe and unreliable, which will affect the subsequent model training and cause model training failure.
[0091] In the related technology, during the process of federated learning, a single type of server is set up to protect the privacy of the model training data shared by each participant. However, after the single type of server is attacked by a network, there is a risk that the model training data may be leaked or tampered with.
[0092] Therefore, in the related technology, there is a risk of shared model training data being leaked or tampered with during the federated learning process, and the security is low.
[0093] In order to solve the above technical problems, an embodiment of the present application provides a federated learning solution based on data verification of two types of servers. During the federated learning process, the encrypted gradient information shared by the client is verified by two types of servers. The normalized verification information obtained through the data verification can determine whether the encrypted gradient information is normalized, thereby filtering out the encrypted gradient information that is not normalized. The similarity information obtained through the data verification can determine the confidence score corresponding to the target encrypted gradient information. According to the confidence score, the global gradient information for the next stage of model training can be more accurately determined. Compared with the related art that only uses a single type of server to protect the data of the federated learning process, the present application can avoid the leakage of encrypted gradient information caused by the attack of a single type of server, and can perform security detection and identification on the encrypted gradient information, thereby improving the security of the federated learning process.
[0094] The data processing method, apparatus, computer device and storage medium provided in the embodiments of the present application are described in detail below.
[0095] The embodiments of the present application provide a data processing method, device, computer equipment and storage medium. Specifically, the embodiments of the present application will be described from the dimension of a data processing device, which can be integrated in a computer device, and the computer device can be a server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, etc.
[0096] See also Figure 1 , Figure 1 Schematic diagram of the system framework corresponding to the data processing method of the system of the embodiment of the present application. The data processing method provided by the embodiment of the present application can be applied to the system framework.
[0097] The server 110 may be a device that executes a data processing method.
[0098] The terminal 140 includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, etc. In addition, it can be a single device or a collection of multiple devices. For example, multiple desktop computers are interconnected through a local area network, share a display, etc. to work together, and together constitute a terminal 140. The terminal 140 can communicate with the Internet 130 in a wired or wireless manner to exchange data.
[0099] The server 110 refers to a computer system that can provide certain services to the terminal 140. Compared with the ordinary terminal 140, the server 110 has higher requirements in terms of stability, security, performance, etc. The server 110 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0100] The gateway 120 is also called an internetwork connector or a protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. The gateway is a translator between two systems that use different communication protocols, data formats or languages, or even completely different architectures. At the same time, the gateway can also provide filtering and security functions. The message sent by the terminal 140 to the server 110 must be sent to the corresponding server 110 through the gateway 120. The message sent by the server 110 to the terminal 140 must also be sent to the corresponding terminal 140 through the gateway 120.
[0101] The data processing method in the embodiment of the present application can be applied to a variety of scenarios, such as model training, model data sharing, model upgrade, etc. The scenarios to which the data processing method in the present application is applied are not limited here.
[0102] See also Figure 2 , Figure 2 It is a schematic diagram of an application scenario of the data processing method provided in an embodiment of the present application.
[0103] like Figure 2 As shown in the figure, the application scenario of federated learning includes a communication server, a verification server, multiple clients and a distribution network.
[0104] The distribution network is used to distribute public parameters and keys. For example, the distribution network can distribute public parameters to a communication server, a verification server, and multiple clients. The distribution network can send a first key and a third key to the communication server, send a second key to the verification server, and send a corresponding fourth key to each client. The fourth keys sent to different clients are different.
[0105] Specifically, the public parameters can be obtained by calculating the security parameters through the public parameter algorithm. The security parameters can be pre-set parameters. The public parameters can include the ring dimension parameters. , plaintext modulus 、Ciphertext modulus , Special modulus 、First ring parameters and the second ring parameters These parameters can be represented by a set, namely the common parameters , where the first ring parameter and the second ring parameters is in the polynomial ring A probability distribution with a small bound on .
[0106] In mathematics, the polynomial ring is an important concept in algebra. It is a ring consisting of a variable (or multiple variables) and a coefficient field (usually a real number field, a complex number field, or a finite field, etc.). The elements in a polynomial ring are polynomials, which are expressions obtained by adding, subtracting, and multiplying variables and coefficients a finite number of times. The ring dimension (Krull dimension) of a polynomial ring refers to the maximum length of the prime ideal chain in the polynomial ring. For a polynomial ring R[x_1,x_2, ..., x_n], where R is a ring, its ring dimension is equal to n.
[0107] The plaintext modulus usually refers to the mathematical space or range of the original data before the encryption operation. In homomorphic encryption, the plaintext modulus determines the representation range and possible operations of the encrypted data (ciphertext).
[0108] The ciphertext modulus is the mathematical space or range that the data is in after the encryption operation. In the CKKS (Cheon-Kim-Kim-Song) homomorphic encryption algorithm, the ciphertext modulus is generated through a rescaling process and is used to approximate the addition and multiplication operations of the encrypted data while maintaining a certain level of security.
[0109] The CKKS homomorphic encryption algorithm is an approximate computing homomorphic encryption algorithm that allows specific mathematical operations to be performed directly on encrypted data without decrypting the data first. Its goal is to perform approximate calculations, allowing a certain degree of error, thereby improving computing efficiency while maintaining data privacy. The CKKS homomorphic encryption algorithm implements the encryption and decryption process by mapping the complex vector space to a polynomial quotient ring. It supports floating-point operations and reduces the expansion problem during ciphertext calculations through relinearization and rescaling techniques to improve computing efficiency.
[0110] The special modulus is used for subsequent evaluation key generation.
[0111] It should be noted that the above public parameters will be used in the subsequent data encryption, decryption and key generation processes, which will be introduced in the subsequent content.
[0112] The distribution network can generate the first key, the second key, the third key and the fourth key through the public parameters. The distribution network can be understood as an independent server, such as a distribution server. The distribution server can first generate a private key, a public key and an evaluation key through public parameters and a key generation algorithm. Among them, the private key and the public key are related to each other. For example, the data can be encrypted by the public key to obtain the encrypted data, and the private key can decrypt the encrypted data. The private key and the evaluation key are related to each other. For example, the data can be encrypted by the evaluation key to obtain the encrypted data, and the private key can decrypt the encrypted data.
[0113] For example, the private key is , from the first ring parameters The public key is pk, which is obtained by ciphertext modulus and the first ring parameters The specific calculation method is:
[0114] .
[0115] in, is from the polynomial ring A polynomial randomly obtained from , is the parameter from the second loop A polynomial randomly obtained from , It is a modulo operation.
[0116] The evaluation key is , you can use the private key 、Ciphertext modulus , Special modulus and the second ring parameters Generate, the specific calculation method is:
[0117] .
[0118] in, is from the polynomial ring A polynomial randomly obtained from , is the second ring parameter A polynomial randomly obtained from .
[0119] The distribution network can use the public key pk and the evaluation key Sent to the communication server, authentication server, and each client.
[0120] The distribution network can use the key partitioning algorithm to distribute the private key Divide and obtain multiple pairs of keys, such as the key pair , which is the first key and the second key , where the first key and the second key It is used to decrypt two different parts of the same encrypted data respectively, that is, the communication server can use the first key Decrypt part of the encrypted data, and the verification server can use the second key Decrypt the remainder of the encrypted data.
[0121] The distribution network can use the key partitioning algorithm to distribute the private key Divide and obtain the key pair , which is the third key and the fourth key , where the third key and the fourth key It is used to decrypt two different parts of the same encrypted data separately, that is, the communication server can use the third key To decrypt part of the encrypted data, client 1 can use the fourth key Decrypt the remainder of the encrypted data.
[0122] The distribution network can obtain the key pair between each client and the communication server through the key partitioning algorithm, such as , key pair The key pair corresponding to the communication server and client 1. is the corresponding key pair between the communication server and the client n. That is, the distribution network will Send to the communication server, the fourth key Sent to the corresponding clients respectively.
[0123] It should be noted that in subsequent data processing, the client, communication server, and verification server all need to use their own stored keys (private keys) and public keys. The specific usage process will be described in detail later.
[0124] Combination Figure 2 The entire data processing process between the client and the communication server, and between the communication server and the verification server in this application is as follows:
[0125] The communication server can distribute the model to each client, which can be understood as an initial model. Then each client can train the local model according to the training sample data stored locally, so that the gradient information generated during the stage training process of the model is generated locally on each client. After each client undergoes t rounds of iterative training, each client generates the gradient information of the model locally, and then each client encrypts the local gradient information through an encryption algorithm to obtain encrypted gradient information, and each client then sends the encrypted gradient information to the communication server.
[0126] After receiving the encrypted gradient information, the communication server may generate first ciphertext gradient information according to the encrypted gradient information, and send the first ciphertext gradient information to the verification server.
[0127] The verification server verifies the first ciphertext gradient information to obtain normalized verification information, and then sends the normalized verification information to the communication server.
[0128] The communication server receives the normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determines the normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information; determines the training gradient information of the model in the current training phase, and generates the second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and sends the second ciphertext gradient information to the verification server,
[0129] After receiving the second encrypted gradient information, the verification server verifies the second encrypted gradient information to obtain similarity information between the training gradient information and the target encrypted gradient information.
[0130] The communication server trains the gradient information and the target encrypted gradient information to obtain similarity information; the confidence score corresponding to the target encrypted gradient information is determined based on the similarity information, and the global gradient information used by each client for the next stage of model training is determined based on the confidence score and the target encrypted gradient information. The communication server then sends the global gradient information to each client, and each client can fully decrypt the global gradient information locally to obtain the target training gradient information for the next stage of model training. The target training gradient information can be used to guide the training direction of each client locally for the model.
[0131] From the above content, it can be seen that in the embodiment of the present application, by setting up two types of independent servers, namely a communication server and a verification server, it is possible to verify the encrypted gradient information sent by the client, thereby ensuring the security of subsequent data processing, thereby ensuring the security of the entire federated learning process.
[0132] In addition, in the embodiment of the present application, each time the verification server and the communication server jointly verify the data, the number of data transmissions between the two is two, which greatly improves the communication efficiency between the servers.
[0133] See also Figure 3 , Figure 3 : is a flow chart of a data processing method provided by an embodiment of the present application. The data processing method can be executed by a data processing device, and the data processing device can be integrated in a communication server, that is, the execution subject of the entire data processing method is the communication server. The data processing method may include the following steps:
[0134] Step 210: Obtain the encrypted gradient information sent by each client, where the encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model;
[0135] Step 220: Generate first ciphertext gradient information according to the encrypted gradient information, and send the first ciphertext gradient information to the verification server;
[0136] Step 230: receiving normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determining normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information;
[0137] Step 240: determine the training gradient information of the model in the current training phase, generate second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and send the second ciphertext gradient information to the verification server;
[0138] Step 250: receiving similarity information returned by the verification server after verifying the second ciphertext gradient information, where the similarity information is similarity information between the training gradient information and the target encrypted gradient information;
[0139] Step 260: Determine the confidence score corresponding to the target encrypted gradient information based on the similarity information, and determine the global gradient information used by each client for the next stage of model training based on the confidence score and the target encrypted gradient information.
[0140] Steps 210 to 260 will be described in detail below.
[0141] In step 210, the encrypted gradient information sent by each client is obtained, and the encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model.
[0142] Among them, each client can encrypt the gradient information generated after the local model is trained in a stage, thereby generating encrypted gradient information.
[0143] Combination Figure 2 Corresponding to the content description, the specific principle of each client encrypting the original data to obtain the encrypted data is as follows:
[0144] For example, each client can encrypt the original data with the public key pk to obtain the encrypted data. First, the CKKS homomorphic encryption algorithm is used to encrypt the input length The floating point plaintext vector Encode it into an integer coefficient polynomial , where the floating point plaintext vector is the original data, the integer coefficient polynomial To encrypt data, , is the field of real numbers, , is a polynomial ring. Then the coefficient polynomial is rectified by the public key pk Encryption is performed, and the specific calculation method is:
[0145] .
[0146] in is a floating point plaintext vector The corresponding encrypted data, also called ciphertext, is a vector. and are the two components of the public key pk, For the parameters from the first ring A polynomial randomly obtained from , and For the parameters from the second ring A polynomial randomly obtained from , and Ciphertext The two components in , specifically the ciphertext components, together constitute the ciphertext .
[0147] In the present application, each client encrypts local gradient information to obtain encrypted gradient information, and sends the encrypted gradient information to the communication server. The communication server receives the encrypted gradient information sent by each client.
[0148] For example, the gradient information corresponding to each client is , the encrypted gradient information after encrypting the gradient information is The communication server receives the encrypted gradient information sent by each client. , for example, the encrypted gradient information sent by client 1 is , the encrypted gradient information sent by client 2 is , the encrypted gradient information sent by client i is .
[0149] In step 220, first ciphertext gradient information is generated according to the encrypted gradient information, and the first ciphertext gradient information is sent to the verification server.
[0150] Among them, the communication server needs to perform homomorphic encryption operation on the encrypted gradient information to obtain the first ciphertext gradient information to ensure the security of the encrypted gradient information.
[0151] Please also read Figure 4 , Figure 4 220 is a flowchart of step 220 provided in an embodiment of the present application. In some implementations, generating first ciphertext gradient information according to the encrypted gradient information includes the following steps:
[0152] Step 301: Perform a multiplication homomorphic operation on the encrypted gradient information to obtain first encrypted gradient information;
[0153] Step 302: determine the first random noise corresponding to the first encrypted gradient information, and perform an additive homomorphic operation on the first encrypted gradient information and the first random noise to obtain second encrypted gradient information;
[0154] Step 303: partially decrypt the second encrypted gradient information using the pre-assigned first key to obtain partially decrypted gradient information;
[0155] Step 304: Generate first ciphertext gradient information according to the second encrypted gradient information and part of the decrypted gradient information.
[0156] Steps 301 to 304 will be described in detail below.
[0157] In step 301, a multiplication homomorphic operation is performed on the encrypted gradient information to obtain first encrypted gradient information.
[0158] Among them, for a certain encrypted gradient information, it corresponds to multiple components, such as ,in, To encrypt the gradient information, Encrypt the gradient information for its children, to is the client number. Each sub-encrypted gradient information has multiple components and can be expressed as .in, The number in the encrypted gradient information of a sub-sub. to The number of the component that encrypts the gradient information for a sub-element.
[0159] Each sub-encrypted gradient information can be multiplied homomorphically to obtain the sub-first encrypted gradient information corresponding to each sub-encrypted gradient information, and multiple sub-first encrypted gradient information constitute the first encrypted gradient information. For example, the quadratic power of the sub-encrypted gradient information is determined to obtain the sub-first encrypted gradient information , then the sub-first encrypts the gradient information The first encrypted gradient information is constructed.
[0160] Combination Figure 2 Corresponding to the content description, the principle of multiplication homomorphic operation is as follows:
[0161] Homomorphic multiplication algorithm inputs two ciphertexts , output ciphertext ,in and is a randomly obtained polynomial, and Ciphertext The ciphertext component of and Ciphertext The ciphertext component of and Ciphertext The ciphertext component.
[0162] In this application, the first encrypted gradient information can be As ciphertext and ciphertext .
[0163] In step 302, first random noise corresponding to the first encrypted gradient information is determined, and an addition homomorphic operation is performed on the first encrypted gradient information and the first random noise to obtain second encrypted gradient information.
[0164] In order to protect the gradient information in the first encrypted gradient information, the first encrypted gradient information may be encrypted again using the first random noise, thereby protecting the gradient information, and the second encrypted gradient information is obtained after encryption.
[0165] In some implementations, performing an additive homomorphic operation on the first encrypted gradient information and the first random noise to obtain the second encrypted gradient information includes:
[0166] (1.1) determining a plurality of sub-first encrypted gradient information of the first encrypted gradient information;
[0167] (1.2) determining a sub-first random noise of each sub-first encrypted gradient information in the first random noise;
[0168] (1.3) Performing an additive homomorphic operation on each sub-first encrypted gradient information and the corresponding sub-first random noise to obtain target first encrypted gradient information corresponding to each sub-first encrypted gradient information, and determining the target first encrypted gradient information as the second encrypted gradient information.
[0169] For example, the first encrypted gradient information can be expressed as , is a plurality of sub-first encrypted gradient information of the first encrypted gradient information, and the relationship between the first encrypted gradient information and the plurality of sub-first encrypted gradient information can be expressed as: .
[0170] The first random noise may be a noise polynomial, which can be specifically obtained from the polynomial loop. The first random noise includes multiple sub-first random noises, that is, each sub-first encrypted gradient information corresponds to a sub-first random noise.
[0171] For example, the first encrypted gradient information is , which corresponds to the first random noise , sub-first random noise Corresponding These components, , that is, the amount of sub-first encrypted gradient information, sub-first random noise The amount is The first encrypted gradient information Each component of corresponds to a sub-first random noise.
[0172] According to each sub-first encrypted gradient information and the corresponding sub-first random noise, an additive homomorphic operation is performed to obtain the target first encrypted gradient information corresponding to each sub-first encrypted gradient information, for example, it can be specifically expressed as ,in The target first encrypted gradient information is used as the target first encrypted gradient information. Finally, the target first encrypted gradient information is determined as the second encrypted gradient information.
[0173] The principle of homomorphic addition is: homomorphic addition adds two ciphertexts into Add to get the output .
[0174] In this application, the first encrypted gradient information Equivalent to ciphertext , the sub-first random noise corresponding to the sub-first encrypted gradient information Equivalent to ciphertext .
[0175] In step 303, the second encrypted gradient information is partially decrypted using the pre-allocated first key to obtain partially decrypted gradient information.
[0176] It can be understood that the first key and the second key are an associated key pair, the first key can partially decrypt the second encrypted gradient information, and the second key can decrypt the remaining part of the second encrypted gradient information. The partially decrypted gradient information can be expressed as .
[0177] Combination Figure 2 The corresponding content can be obtained through the first key Combined with the partial decryption algorithm, the second encrypted gradient information is partially decrypted to obtain partially decrypted gradient information. The specific principle of the partial decryption algorithm is as follows:
[0178] The partial decryption algorithm takes as input the ciphertext Partially decrypted to ciphertext The specific decryption method is ,in The second ring parameter A polynomial randomly obtained from .
[0179] In this application, the second encrypted gradient information Equivalent to ciphertext , partially decrypted gradient information Equivalent to .
[0180] In step 304, first ciphertext gradient information is generated according to the second encrypted gradient information and part of the decrypted gradient information.
[0181] Finally, the second encrypted gradient information and the corresponding partially decrypted gradient information can be used to generate a ciphertext pair. For example, the ciphertext pair can be expressed as ,in, Indicates the specific number of components corresponding to the encrypted gradient information, and the maximum value is , so there are a total of For ciphertext pairs, these ciphertext pairs can be determined as first ciphertext gradient information.
[0182] It can be seen from step 301 to step 304 that, in the communication server, by performing a fully homomorphic encryption operation on the encrypted gradient information and setting a first random noise encryption for each component in the encrypted gradient information, the security of the gradient information in the encrypted gradient information can be ensured and the gradient information can be prevented from being leaked.
[0183] The communication server may send the first ciphertext gradient information to the verification server. Specifically, the first ciphertext gradient information may be sent to the verification server via a secure communication link between the communication server and the verification server.
[0184] Please also read Figure 5 , Figure 5 It is a flowchart of normalized verification performed by the verification server provided in an embodiment of the present application.
[0185] In some implementations, after receiving the first ciphertext gradient information, the verification server may further decrypt and verify the first ciphertext gradient information. The verification server may perform the following steps:
[0186] Step 401, determining second encrypted gradient information and part of decrypted gradient information in first ciphertext gradient information;
[0187] Step 402: partially decrypt the second encrypted gradient information using a pre-assigned second key to obtain first decrypted gradient information, wherein the first key and the second key are an associated key pair, and are used to decrypt two different parts of the second encrypted gradient information respectively;
[0188] Step 403: Fully decrypt the second encrypted gradient information according to the first decrypted gradient information and the partially decrypted gradient information to obtain second decrypted gradient information;
[0189] Step 404: Determine normalized verification information corresponding to the encrypted gradient information according to the second decrypted gradient information.
[0190] The following will describe in detail steps 401 to 404 from the perspective of the verification server.
[0191] In step 401, second encrypted gradient information and part of decrypted gradient information are determined from first ciphertext gradient information.
[0192] For example, the first ciphertext gradient information is , from which the second encrypted gradient information can be determined and partially decrypted gradient information , wherein the first ciphertext gradient information may include a plurality of ciphertext pairs consisting of second encrypted gradient information and partial decrypted gradient information, and the number of ciphertext pairs is consistent with the number of components of the corresponding encrypted gradient information.
[0193] In step 402, the second encrypted gradient information is partially decrypted using a pre-assigned second key to obtain first decrypted gradient information, wherein the first key and the second key are an associated key pair for respectively decrypting two different parts of the second encrypted gradient information.
[0194] In combination with the above content, it can be known that the second key can partially decrypt the second encrypted gradient information, for example, decrypt the part of the second encrypted gradient information except the part decrypted by the first key, so as to obtain the first decrypted gradient information. Specifically, the partial decryption algorithm and the second key can be used to partially decrypt the second encrypted gradient information, so as to obtain the first decrypted gradient information. The first decrypted gradient information can be expressed as The principle of some decryption algorithms has been described above.
[0195] In step 403, the second encrypted gradient information is fully decrypted according to the first decrypted gradient information and the partial decrypted gradient information to obtain second decrypted gradient information.
[0196] After obtaining the first decrypted gradient information and the partially decrypted gradient information, the second encrypted gradient information can be fully decrypted by a full decryption algorithm to obtain the second decrypted gradient information. The second decrypted gradient information can be expressed as . Combined Figure 2 The content described, the principle of the full decryption algorithm is as follows:
[0197] Enter ciphertext and its two parts decrypted ciphertext , output the fully decrypted plaintext , then decode is a floating point plaintext vector .
[0198] In this full decryption, the first decryption gradient information Equivalent to ciphertext , partially decrypted gradient information Equivalent to ciphertext , the second encrypted gradient information Equivalent to ciphertext . Second, decrypt the gradient information Equivalent to a polynomial with integer coefficients .
[0199] That is, by encrypting the second gradient information Full decryption can obtain the second decrypted gradient information masked by the first random noise . Second, decrypt the gradient information It can be a polynomial power. Through the multiplication homomorphic operation principle in the fully encrypted homomorphic algorithm, we can get , .in, The number of any component in the second decrypted gradient information , is the sub-second decrypted gradient information of the second decrypted gradient information, It can be the relevant results calculated by sub-encrypted gradient information, for The corresponding noise.
[0200] In step 404, normalized verification information corresponding to the encrypted gradient information is determined according to the second decrypted gradient information.
[0201] From the above content, it can be known that a certain gradient encryption information corresponds to a plurality of sub-encrypted gradient information, each sub-encrypted gradient information corresponds to a second decrypted gradient information, and each second decrypted gradient information has a plurality of sub-second decrypted gradient information.
[0202] Therefore, the sub-second decrypted gradient information of all the second decrypted gradient information can be added together to obtain the normalized verification information corresponding to the encrypted gradient information. The specific calculation method is:
[0203] , where the normalized verification information is .
[0204] Among them, for example, the first sub-second decryption gradient information Until The second decryption gradient information Add all together to get the normalized verification information of a certain encrypted gradient information.
[0205] It can be seen from steps 401 to 404 that the verification server can be used to verify the second encrypted gradient information, thereby obtaining normalized verification information corresponding to each encrypted gradient information. The normalized verification information is used to verify whether the encrypted gradient information is normalized. The encrypted gradient information without normalization will not be used in the subsequent model training process, which can prevent the model from being affected by malicious gradient information to ensure stability in the subsequent model training process.
[0206] During the data transmission process between the communication server and the verification server, the data transmitted is encrypted, which can ensure the security of data transmission. In addition, the communication server and the verification server are two independent servers, which can prevent one of the servers from being attacked by the network and causing gradient information leakage. Therefore, the security of the federated learning process can be further improved by using two different types of independent servers.
[0207] In step 230, the normalized verification information returned by the verification server after verifying the first ciphertext gradient information is received, and the normalized target encrypted gradient information is determined in the encrypted gradient information according to the normalized verification information.
[0208] The communication server may receive normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and then determine which encrypted gradient information is normalized and which encrypted gradient information is not normalized based on the normalized verification information.
[0209] In some implementations, determining normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information includes:
[0210] (1.1) removing noise from the normalized verification information according to the first random noise to obtain target normalized verification information;
[0211] (1.2) The encrypted gradient information whose target normalized verification information is a preset value is determined as the normalized target encrypted gradient information.
[0212] For example, for the normalized verification information of a certain encrypted gradient information, noise removal can be performed in the following way: .
[0213] Among them, the noise of the first sub-second decryption gradient information can be Until The noise of the second decryption gradient information Add all together to get the sum of the first noise, and then normalize the verification information Subtract the sum of the first noise , thereby obtaining the target normalization verification information .
[0214] Then determine the target normalization verification information Is the value of the preset value "1"? If it is the preset value "1", the encrypted gradient information corresponding to the target normalization verification information has been normalized, and the data can be used for model training later. If the value of is not the preset value "1", then the encrypted gradient information corresponding to the target normalized verification information is not normalized and the encrypted gradient information needs to be discarded.
[0215] In this way, it can be ensured that before the next stage of model training, abnormal encrypted gradient information can be eliminated to avoid affecting the training of the model.
[0216] In step 240, the training gradient information of the model in the current training phase is determined, and second ciphertext gradient information is generated according to the training gradient information and the target encrypted gradient information, and the second ciphertext gradient information is sent to the verification server.
[0217] The training gradient information can be understood as the gradient information that guides each client to perform training in the current training phase. When all clients train their local models, they can adjust the model parameters according to the gradient information to adjust the model training direction.
[0218] Then, the second ciphertext gradient information can be generated through the training gradient information and the target encrypted gradient information. The second ciphertext gradient information is used to re-verify the target encrypted gradient information, so as to determine some abnormal data that have a certain impact on the model training.
[0219] Please also read Figure 6 , Figure 6 It is a flowchart of step 240 provided in an embodiment of the present application.
[0220] In some implementations, generating the second ciphertext gradient information according to the training gradient information and the target encrypted gradient information may include the following steps:
[0221] Step 501: Perform a multiplication homomorphic operation on the training gradient information and the target encrypted gradient information to obtain first encrypted information;
[0222] Step 502: determine the second random noise corresponding to the first encrypted information, and perform an additive homomorphic operation on the first encrypted information and the second random noise to obtain the second encrypted information;
[0223] Step 503: partially decrypt the second encrypted information using the pre-assigned first key to obtain partially decrypted information;
[0224] Step 504: Generate second ciphertext gradient information according to the second encrypted information and part of the decrypted information.
[0225] Steps 501 to 504 will be described in detail below.
[0226] In step 501, a multiplication homomorphic operation is performed on the training gradient information and the target encrypted gradient information to obtain first encrypted information.
[0227] For example, the training gradient information can be expressed as , a target encrypted gradient information can be expressed as ,in, For training gradient information The component of is the sub-training gradient information, Encrypting gradient information for the target , encrypting the gradient information for the sub-goal.
[0228] Each sub-training gradient information It includes multiple components, expressed as . Each sub-goal encrypts the gradient information It includes multiple components, expressed as .in, is the number of the component, for example arrive .
[0229] First, perform a multiplication homomorphic operation on the training gradient information and the target encrypted gradient information. For example, determine the sub-target encrypted gradient information corresponding to each sub-training gradient information, and then perform a multiplication homomorphic operation on the two to obtain the sub-first encrypted information, which can be expressed as: Among them, the first encrypted information is A plurality of sub-first encrypted information may constitute the first encrypted information. The principle of multiplication homomorphic operation has been described above.
[0230] In step 502, a second random noise corresponding to the first encrypted information is determined, and an additive homomorphic operation is performed on the first encrypted information and the second random noise to obtain second encrypted information.
[0231] In order to protect the gradient information in the first encrypted information, the first encrypted information may be encrypted again using the second random noise, thereby protecting the gradient information, and the second encrypted information is obtained after encryption.
[0232] In some implementations, performing an additive homomorphic operation on the first encrypted information and the second random noise to obtain the second encrypted information includes:
[0233] (1.1) determining a plurality of sub-first encrypted information corresponding to the first encrypted information;
[0234] (1.2) determining the sub-second random noise corresponding to each sub-first encrypted information in the second random noise;
[0235] (1.3) performing an additive homomorphic operation on each sub-first encrypted information and the corresponding sub-second random noise to obtain the target first encrypted information corresponding to each sub-first encrypted information;
[0236] (1.4) Performing an addition homomorphic operation on all target first encrypted information to obtain second encrypted information.
[0237] The first encrypted information may include multiple sub-first encrypted information, which are expressed as: , where the first encrypted information is .
[0238] The second random noise may be a noise polynomial, which can be specifically obtained from the polynomial loop. The second random noise includes multiple sub-second random noises, that is, each sub-first encrypted information corresponds to a sub-second random noise. For example, the sub-first encrypted information is , which corresponds to the second random noise , sub-second random noise Corresponding These components, , that is, the number of sub-first encrypted information, and the number of sub-second random noise The amount is The first encrypted information Each component of corresponds to a sub-second random noise.
[0239] Then, an additive homomorphic operation is performed on each sub-first encrypted information and the corresponding sub-second random noise to obtain the target first encrypted information corresponding to each sub-first encrypted information. For example, it can be expressed as , where the target first encrypted information is .
[0240] Finally, add homomorphic operations are performed on all target first encrypted information to obtain second encrypted information. For example, it can be expressed as: ,in, Encrypt all target first encrypted information corresponding to the gradient information of a certain target respectively, is the second encrypted information. Please refer to the above for the principle of addition homomorphic operation.
[0241] In step 503, the second encrypted information is partially decrypted using the pre-assigned first key to obtain partially decrypted information.
[0242] It can be understood that the first key and the second key are an associated key pair, the first key can partially decrypt the second encrypted information, and the second key can decrypt the remaining part of the second encrypted information. The partially decrypted information can be expressed as . Please refer to the above for the principle of the partial decryption algorithm.
[0243] In step 504, second ciphertext gradient information is generated according to the second encrypted information and part of the decrypted information.
[0244] Finally, the second encrypted information and the corresponding partial decrypted information can be used to generate a ciphertext pair. For example, the ciphertext pair can be expressed as , there are Σ pairs of ciphertext pairs in total, and these ciphertext pairs can be determined as the second ciphertext gradient information.
[0245] It can be seen from steps 501 to 504 that, in the communication server, by performing a fully homomorphic encryption operation on the target encrypted gradient information and setting a second random noise encryption for each component in the target encrypted gradient information, the security of the gradient information in the target encrypted gradient information can be guaranteed and the gradient information can be prevented from being leaked.
[0246] The communication server may send the second ciphertext gradient information to the verification server. Specifically, the second ciphertext gradient information may be sent to the verification server via a secure communication link between the communication server and the verification server.
[0247] Please also read Figure 7 , Figure 7 It is a flowchart of similarity verification performed by the verification server provided in an embodiment of the present application.
[0248] In some implementations, sending the second ciphertext gradient information to the verification server may include the following steps:
[0249] Step 601, determining second encrypted information and part of decrypted information in second ciphertext gradient information;
[0250] Step 602: partially decrypt the second encrypted information using a pre-assigned second key to obtain first decrypted information, wherein the first key and the second key are an associated key pair, and are used to decrypt two different parts of the second encrypted information respectively;
[0251] Step 603: Fully decrypt the second encrypted information according to the first decryption information and the partial decryption information to obtain second decrypted information;
[0252] Step 604: Determine similarity information between the training gradient information and the target encrypted gradient information based on the second decrypted information.
[0253] The following will describe in detail steps 601 to 604 from the perspective of the verification server.
[0254] In step 601, second encrypted information and partial decrypted information are determined in second ciphertext gradient information.
[0255] For example, the second ciphertext gradient information is , from which the second encrypted information can be determined and partially decrypted gradient information .
[0256] In step 602, the second encrypted information is partially decrypted using a pre-assigned second key to obtain first decrypted information, wherein the first key and the second key are an associated key pair for respectively decrypting two different parts of the second encrypted information.
[0257] Combined with the above content, it can be known that the second key can partially decrypt the second encrypted information, for example, decrypt the part of the second encrypted information except the part decrypted by the first key, so as to obtain the first decrypted information. Specifically, the partial decryption algorithm and the second key can be used to partially decrypt the second encrypted information, so as to obtain the first decrypted information. The principle of some decryption algorithms has been described above.
[0258] In step 603, the second encrypted information is fully decrypted according to the first decryption information and the partial decryption information to obtain the second decrypted information.
[0259] Specifically, the second encrypted information can be fully decrypted by combining the first decrypted information and the partial decrypted information through a full decryption algorithm to obtain the second decrypted information. The second decrypted information can be expressed as , where the polynomial power in the second decrypted information is obtained, that is, , through the multiplication homomorphic operation in the fully encrypted homomorphic algorithm, we can get , that is, through the polynomial power The components in the sub-training gradient information of the training gradient information and the components in the sub-target encrypted gradient information of the target encrypted gradient information can be determined, thereby achieving full decryption of the second encrypted information to obtain the second decrypted information.
[0260] Step 604: Determine similarity information between the training gradient information and the target encrypted gradient information based on the second decrypted information.
[0261] From the above content, it can be known that a certain first encrypted information corresponds to a plurality of sub-first encrypted information, each sub-first encrypted information corresponds to a second decrypted information, and each second decrypted information has a plurality of sub-second decrypted information.
[0262] Therefore, the sub-second decrypted information of all the second decrypted information can be added together to obtain the similarity information corresponding to the added first encrypted information, that is, the similarity information between the training gradient information and the target encrypted gradient information. The specific calculation method is:
[0263] .
[0264] in, is the similarity information between the training gradient information and the target encrypted gradient information, and the first sub-second decrypted information Until the τth sub-second decryption information Add all together to get the similarity information between the training gradient information and the target encrypted gradient information.
[0265] It can be seen from steps 601 to 604 that the verification server can be used to perform similarity verification on the training gradient information and the target encrypted gradient information to obtain similarity information. The similarity information is used to determine the confidence score for verifying the target encrypted gradient information. The confidence score is used to determine the importance of the impact of the target encrypted gradient information on subsequent model training. Therefore, in the process of subsequent model training, different weights are set for different target encrypted gradient information, which can avoid the model from being affected by abnormal gradient information, so as to ensure stability in the subsequent model training process.
[0266] During the data transmission process between the communication server and the verification server, the data transmitted is encrypted, which can ensure the security of data transmission. In addition, the communication server and the verification server are two independent servers, which can prevent one of the servers from being attacked by the network and causing gradient information leakage. Therefore, the security of the federated learning process can be further improved by using two different types of independent servers.
[0267] In step 250, similarity information returned by the verification server after verifying the second ciphertext gradient information is received, where the similarity information is similarity information between the training gradient information and the target encrypted gradient information.
[0268] Among them, the similarity information can be understood as a similarity value. When the similarity value is smaller, it means that the target encrypted gradient information and the training gradient information are closer, which means that the client corresponding to the target encrypted gradient information may have a large change in the training direction of the model. Therefore, the target encrypted gradient information has little guiding significance in the subsequent model training process.
[0269] In step 260, the confidence score corresponding to the target encrypted gradient information is determined based on the similarity information, and the global gradient information used by each client for the next stage of model training is determined based on the confidence score and the target encrypted gradient information.
[0270] Among them, the confidence score corresponding to the target encrypted gradient information is determined according to the similarity information. For example, the confidence score of the target encrypted gradient information with large similarity information can be set higher, and the confidence score of the target encrypted gradient information with small similarity information can be set lower.
[0271] In some implementations, determining a confidence score corresponding to the target encrypted gradient information according to the similarity information includes:
[0272] (1.1) According to the similarity information, determine the abnormal encrypted gradient information with the smallest similarity in the target encrypted gradient information;
[0273] (1.2) determining the target similarity between the abnormal encrypted gradient information and each target encrypted gradient information;
[0274] (1.3) Calculate the confidence score corresponding to each target encrypted gradient information based on the target similarity and the preset plaintext modulus.
[0275] Among them, the abnormal encrypted gradient information with the smallest similarity is determined in the target encrypted gradient information, and the abnormal encrypted gradient information can be used as a measurement standard. If the target similarity between the target encrypted gradient information and the abnormal encrypted gradient information is small, the target encrypted gradient information can be understood as having a high confidence. If the target similarity between the target encrypted gradient information and the abnormal encrypted gradient information is large, the target encrypted gradient information can be understood as having a low confidence.
[0276] For a specific method of calculating the target similarity between the abnormal encrypted gradient information and each target encrypted gradient information, please refer to the similarity information calculation method between the above target encrypted gradient information and the training gradient information, which will not be repeated here.
[0277] Finally, the confidence score corresponding to each target encrypted gradient information can be calculated based on the target similarity and the preset plaintext modulus.
[0278] For example, the confidence score corresponding to the target encrypted gradient information can be obtained by subtracting the target similarity from the preset plaintext modulus and then multiplying it by the benchmark credit score. .in, is the target similarity, Score the confidence level, is the plaintext modulus, Baseline credit score.
[0279] In some embodiments, after determining the confidence score corresponding to each target encrypted gradient information, the communication server may determine the credit score of the client corresponding to the target encrypted gradient information according to the confidence score, the benchmark credit score, and the sum of the confidence score. For example, the credit score of the client corresponding to the target encrypted gradient information may be determined by dividing the confidence score by the sum of the confidence scores and then multiplying the confidence score by the benchmark credit score.
[0280] In this way, the lower the credit score of a client, the more likely it is to be a malicious client. When the credit score is lower than the preset score threshold, the communication server can not use the data related to the gradient information of the client in the subsequent model training stage to prevent it from interfering with the model training, so as to ensure the security of the federated learning process.
[0281] After obtaining the confidence score corresponding to each target encrypted gradient information, the weight value (target confidence score) corresponding to each target encrypted gradient information can be further determined based on the confidence score. Finally, the global gradient information used by each client for the next stage of model training can be determined through the weight value and the target encrypted gradient information.
[0282] In some embodiments, the global gradient information for each client to train the model in the next stage is determined based on the confidence score and the target encrypted gradient information, including:
[0283] (2.1) Determine the sum of the confidence scores corresponding to all target encrypted gradient information based on the confidence scores;
[0284] (2.2) Determine the target confidence score corresponding to each target encrypted gradient information based on the sum of the confidence scores, the preset plaintext modulus and the confidence score corresponding to each target encrypted gradient information;
[0285] (2.3) Multiply each target encrypted gradient information by the target confidence score to obtain the updated ciphertext gradient information corresponding to each target encrypted gradient information;
[0286] (2.4) Add each updated ciphertext gradient information to obtain the global ciphertext gradient information;
[0287] (2.5) The global ciphertext gradient information is partially decrypted according to the pre-assigned first key to obtain the global gradient information used by each client for the next stage of model training.
[0288] The sum of the confidence scores is calculated as: .in is the sum of the confidence scores, arrive The confidence score corresponding to each target encrypted gradient information.
[0289] Divide the confidence score by the sum of the confidence scores, and then multiply by the inscription modulus to get the target confidence score corresponding to the target encrypted gradient information. The specific calculation method is: ,in Score the target confidence.
[0290] Then multiply each target encrypted gradient information by the target confidence score to obtain the updated ciphertext gradient information corresponding to each target encrypted gradient information. For example, the target encrypted gradient information corresponding to client 1 is , the target confidence score corresponding to client 1 is , you can Multiply , then the target encrypted gradient information is obtained The corresponding updated ciphertext gradient information.
[0291] Add each updated ciphertext gradient information to get the global ciphertext gradient information, for example, the global gradient ciphertext . It can be understood as encrypted gradient information for each target.
[0292] Finally, the global ciphertext gradient information is partially decrypted according to the pre-assigned first key to obtain the global gradient information used by each client for the next stage of model training. For example, the partial decryption algorithm and the third key can be used to partially decrypt the global ciphertext gradient information, combined with Figure 2 The key content described in the third key includes If you want to calculate the global gradient information of client 1 for the next stage of model training, you can use the third key The global ciphertext gradient information is partially decrypted to obtain the global gradient information used by client 1 for the next stage of model training. If the global gradient information used by client i for the next stage of model training is to be calculated, the third key The global ciphertext gradient information is partially decrypted to obtain the global gradient information used by client i for the next stage of model training.
[0293] In some embodiments, the communication server may send the global gradient information and global ciphertext gradient information used by each client for the next stage of model training to the corresponding client. After receiving the corresponding global gradient information, each client may decrypt the global gradient information using the locally stored fourth key, thereby obtaining the target training gradient information used by each client for the next stage of model training.
[0294] For example, taking a client 1 as an example, after receiving the global gradient information sent by the communication server, the client 1 can use the fourth key The global ciphertext gradient information is partially decrypted by the partial decryption algorithm to obtain the partially decrypted global ciphertext gradient information, and then the global ciphertext gradient information is fully decrypted by combining the partially decrypted global ciphertext gradient information and the global gradient information through the full decryption algorithm to obtain the target training gradient information, which is plaintext information.
[0295] Client 1 can subsequently use the target training gradient information to train the local model in the next stage. Specifically, the training parameters can be generated according to the sum of the confidence scores sent by the verification server, the preset learning rate and the target training gradient information. For example, the training parameters can be expressed as: ,in is the preset learning rate, Train gradient information for the target.
[0296] After training the model through the training parameters, client 1 will generate new gradient information locally, and then encrypt the new gradient information to obtain encrypted data, and then send the encrypted data to the communication server. It should be noted that the process of client 1 processing global gradient information is applicable to any client.
[0297] The above are relevant implementation methods of the data processing method provided in this application, which also introduces the data processing methods of the client and the verification server.
[0298] As can be seen from the above content, in an embodiment of the present application, by obtaining the encrypted gradient information sent by each client, the encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model; generating the first ciphertext gradient information according to the encrypted gradient information, and sending the first ciphertext gradient information to the verification server; receiving the normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determining the normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information; determining the training gradient information of the model in the current training stage, and generating the second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and sending the second ciphertext gradient information to the verification server; receiving the similarity information returned by the verification server after verifying the second ciphertext gradient information, the similarity information is the similarity information between the training gradient information and the target encrypted gradient information; determining the confidence score corresponding to the target encrypted gradient information according to the similarity information, and determining the global gradient information used by each client for the next stage of training of the model according to the confidence score and the target encrypted gradient information. In this way, during the process of federated learning, the encrypted gradient information shared by the client is verified through two types of servers. The normalized verification information obtained through data verification can determine whether the encrypted gradient information is normalized, thereby filtering out the encrypted gradient information that is not normalized. The similarity information obtained through data verification can determine the confidence score corresponding to the target encrypted gradient information. According to the confidence score, the global gradient information for the next stage of model training can be more accurately determined. Compared with the related art that only uses a single type of server to protect the data of the federated learning process, the present application can avoid the leakage of encrypted gradient information caused by the attack of a single type of server, and can perform security detection and identification on the encrypted gradient information, thereby improving the security of the federated learning process.
[0299] In addition, it should be noted that in the embodiment of the present application, each time the verification server and the communication server jointly verify the data, the number of data transmissions between the two is two, which greatly improves the communication efficiency between the servers.
[0300] Please also read Figure 8 , Figure 8 1 is another flow chart of the data processing method provided by the embodiment of the present application. The execution subject of the data processing method may be a communication server, and the data processing method may include the following steps:
[0301] Step 701: Obtain the encrypted gradient information sent by each client, where the encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model;
[0302] Step 702: Perform a multiplication homomorphic operation on the encrypted gradient information to obtain first encrypted gradient information;
[0303] Step 703: determine the first random noise corresponding to the first encrypted gradient information, and perform an additive homomorphic operation on the first encrypted gradient information and the first random noise to obtain second encrypted gradient information;
[0304] Step 704: partially decrypt the second encrypted gradient information using the pre-assigned first key to obtain partially decrypted gradient information;
[0305] Step 705: Generate first ciphertext gradient information according to the second encrypted gradient information and part of the decrypted gradient information, and send the first ciphertext gradient information to the verification server;
[0306] Step 706: Receive normalized verification information returned by the verification server after verifying the first ciphertext gradient information;
[0307] Step 707: remove noise from the normalized verification information according to the first random noise to obtain target normalized verification information;
[0308] Step 708: Determine the encrypted gradient information whose target normalized verification information is a preset value as the normalized target encrypted gradient information;
[0309] Step 709: determine the training gradient information of the model in the current training phase, perform a multiplication homomorphic operation on the training gradient information and the target encrypted gradient information to obtain first encrypted information;
[0310] Step 710: determine the second random noise corresponding to the first encrypted information, and perform an additive homomorphic operation on the first encrypted information and the second random noise to obtain the second encrypted information;
[0311] Step 711: partially decrypt the second encrypted information using the pre-assigned first key to obtain partially decrypted information;
[0312] Step 712: Generate second ciphertext gradient information according to the second encrypted information and part of the decrypted information, and send the second ciphertext gradient information to the verification server;
[0313] Step 713: Receive similarity information returned by the verification server after verifying the second ciphertext gradient information, where the similarity information is similarity information between the training gradient information and the target encrypted gradient information.
[0314] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the data processing method above, and will not be repeated here.
[0315] Please also read Fig. 9 , Fig. 9It is a structural diagram of a data processing device provided in an embodiment of the present application.
[0316] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0317] like Fig. 9 As shown, the data processing device 800 may include:
[0318] An acquisition module 810 is used to acquire the encrypted gradient information sent by each client, where the encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model;
[0319] A first sending module 820, configured to generate first ciphertext gradient information according to the encrypted gradient information, and send the first ciphertext gradient information to a verification server;
[0320] The first receiving module 830 is used to receive the normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determine the normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information;
[0321] The second sending module 840 is used to determine the training gradient information of the model in the current training phase, generate second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and send the second ciphertext gradient information to the verification server;
[0322] A second receiving module 850 is used to receive similarity information returned by the verification server after verifying the second ciphertext gradient information, where the similarity information is similarity information between the training gradient information and the target encrypted gradient information;
[0323] The determination module 860 is used to determine the confidence score corresponding to the target encrypted gradient information according to the similarity information, and determine the global gradient information used by each client for the next stage of model training according to the confidence score and the target encrypted gradient information.
[0324] In some embodiments, the first sending module 820 includes a first gradient encryption submodule, a second gradient encryption submodule, a partial gradient decryption submodule, and a generation submodule;
[0325] A first gradient encryption submodule, used for performing a multiplication homomorphic operation on the encrypted gradient information to obtain first encrypted gradient information;
[0326] A second gradient encryption submodule, used to determine a first random noise corresponding to the first encrypted gradient information, and perform an additive homomorphic operation on the first encrypted gradient information and the first random noise to obtain second encrypted gradient information;
[0327] A partial gradient decryption submodule, used to partially decrypt the second encrypted gradient information using a pre-assigned first key to obtain partially decrypted gradient information;
[0328] The first generating submodule is used to generate first ciphertext gradient information according to the second encrypted gradient information and part of the decrypted gradient information.
[0329] In some embodiments, the second gradient encryption submodule is used to:
[0330] Determine a plurality of sub-first encrypted gradient information of the first encrypted gradient information;
[0331] Determine a sub-first random noise for each sub-first encrypted gradient information in the first random noise;
[0332] An additive homomorphic operation is performed on each sub-first encrypted gradient information and the corresponding sub-first random noise to obtain target first encrypted gradient information corresponding to each sub-first encrypted gradient information, and the target first encrypted gradient information is determined as the second encrypted gradient information.
[0333] In some embodiments, the first sending module 820 further includes a first sending submodule, configured to send the first ciphertext gradient information to the verification server according to a secure communication link with the verification server, so that the verification server determines the second encrypted gradient information and the partially decrypted gradient information in the first ciphertext gradient information;
[0334] Partially decrypting the second encrypted gradient information by using a pre-assigned second key to obtain first decrypted gradient information, wherein the first key and the second key are an associated key pair, and are used to decrypt two different parts of the second encrypted gradient information respectively;
[0335] Fully decrypting the second encrypted gradient information according to the first decrypted gradient information and the partial decrypted gradient information to obtain second decrypted gradient information;
[0336] Normalized verification information corresponding to the encrypted gradient information is determined according to the second decrypted gradient information.
[0337] In some implementations, the first receiving module 830 is configured to:
[0338] removing noise from the normalized verification information according to the first random noise to obtain target normalized verification information;
[0339] The encrypted gradient information whose target normalized verification information is a preset value is determined as the normalized target encrypted gradient information.
[0340] In some embodiments, the second sending module 840 includes a first encryption submodule, a second encryption submodule, a partial decryption submodule, and a second generation submodule;
[0341] A first encryption submodule, used for performing a multiplication homomorphic operation on the training gradient information and the target encrypted gradient information to obtain first encrypted information;
[0342] A second encryption submodule, used to determine a second random noise corresponding to the first encrypted information, and perform an additive homomorphic operation on the first encrypted information and the second random noise to obtain the second encrypted information;
[0343] A partial decryption submodule, used to partially decrypt the second encrypted information using a pre-assigned first key to obtain partially decrypted information;
[0344] The second generating submodule is used to generate second ciphertext gradient information according to the second encrypted information and part of the decrypted information.
[0345] In some implementations, the second encryption submodule is configured to:
[0346] Determine a plurality of sub-first encrypted information corresponding to the first encrypted information;
[0347] Determining the sub-second random noise corresponding to each sub-first encrypted information in the second random noise;
[0348] Performing an additive homomorphic operation on each sub-first encrypted information and the corresponding sub-second random noise to obtain target first encrypted information corresponding to each sub-first encrypted information;
[0349] Performing an addition homomorphic operation on all target first encrypted information to obtain second encrypted information.
[0350] In some embodiments, the second sending module 840 further includes a second sending submodule, configured to send the second ciphertext gradient information to the verification server according to a secure communication link with the verification server, so that the verification server determines the second encrypted information and the partial decrypted information in the second ciphertext gradient information;
[0351] Decrypting part of the second encrypted information by using a pre-assigned second key to obtain first decrypted information, wherein the first key and the second key are an associated key pair, and are used to decrypt two different parts of the second encrypted information respectively;
[0352] Fully decrypting the second encrypted information according to the first decrypted information and the partial decrypted information to obtain second decrypted information;
[0353] Similarity information between the training gradient information and the target encrypted gradient information is determined based on the second decrypted information.
[0354] In some implementations, the second receiving module 850 is configured to:
[0355] According to the similarity information, determining the abnormal encrypted gradient information with the smallest similarity in the target encrypted gradient information;
[0356] determining a target similarity between the abnormal encrypted gradient information and each target encrypted gradient information;
[0357] The confidence score corresponding to each target encrypted gradient information is calculated based on the target similarity and the preset plaintext modulus.
[0358] In some implementations, the determination module 860 is configured to:
[0359] Determine the sum of the confidence scores corresponding to all target encrypted gradient information according to the confidence scores;
[0360] Determine the target confidence score corresponding to each target encrypted gradient information according to the sum of the confidence scores, the preset plaintext modulus and the confidence score corresponding to each target encrypted gradient information;
[0361] Multiply each target encrypted gradient information by the target confidence score to obtain the updated ciphertext gradient information corresponding to each target encrypted gradient information;
[0362] Add each updated ciphertext gradient information to obtain the global ciphertext gradient information;
[0363] The global ciphertext gradient information is partially decrypted according to the pre-assigned first key to obtain the global gradient information used by each client for the next stage of model training.
[0364] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the data processing method above, and will not be repeated here.
[0365] As can be seen from the above, in the embodiment of the present application, the acquisition module 810 acquires the encrypted gradient information sent by each client, and the encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model; the first sending module 820 generates the first ciphertext gradient information according to the encrypted gradient information, and sends the first ciphertext gradient information to the verification server; the first receiving module 830 receives the normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determines the normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information; the second sending module 840 determines the current The training gradient information of the model in the training phase is obtained, and the second ciphertext gradient information is generated according to the training gradient information and the target encrypted gradient information, and the second ciphertext gradient information is sent to the verification server; the second receiving module 850 receives the similarity information returned by the verification server after verifying the second ciphertext gradient information, and the similarity information is the similarity information between the training gradient information and the target encrypted gradient information; the determination module 860 determines the confidence score corresponding to the target encrypted gradient information according to the similarity information, and determines the global gradient information used by each client for the next stage of training of the model according to the confidence score and the target encrypted gradient information. In this way, during the process of federated learning, the encrypted gradient information shared by the client is verified through two types of servers. The normalized verification information obtained through data verification can determine whether the encrypted gradient information is normalized, thereby filtering out the encrypted gradient information that is not normalized. The similarity information obtained through data verification can determine the confidence score corresponding to the target encrypted gradient information. According to the confidence score, the global gradient information for the next stage of model training can be more accurately determined. Compared with the related art that only uses a single type of server to protect the data of the federated learning process, the present application can avoid the leakage of encrypted gradient information caused by the attack of a single type of server, and can perform security detection and identification on the encrypted gradient information, thereby improving the security of the federated learning process.
[0366] The present application also provides a computer device, which may be a server. Fig.10 As shown, it shows a schematic diagram of the structure of the server involved in the embodiment of the present application, specifically:
[0367] The server may include one or more processing core processors 901, one or more computer-readable storage media memories 902, a power supply 903, an input unit 904 and other components. Those skilled in the art will appreciate that Fig.10 The server structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0368] The processor 901 is the control center of the server, which uses various interfaces and lines to connect various parts of the entire server, and executes various functions of the server and processes data by running or executing software programs and / or modules stored in the memory 902, and calling data stored in the memory 902, thereby controlling the server as a whole. Optionally, the processor 901 may include one or more processing cores; preferably, the processor 901 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 901.
[0369] The memory 902 can be used to store software programs and modules. The processor 901 executes various functional applications and data processing by running the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 902 may also include a memory controller to provide the processor 901 with access to the memory 902.
[0370] The computer device also includes a power supply 903 for supplying power to various components. Optionally, the power supply 903 can be logically connected to the processor 901 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 903 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0371] The computer device may further include an input unit 904, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0372] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 901 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 902 according to the following instructions, and the processor 901 will run the application programs stored in the memory 902, thereby implementing the various method steps provided in the aforementioned embodiments, as follows:
[0373] Obtain the encrypted gradient information sent by each client. The encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model.
[0374] Generate first ciphertext gradient information according to the encrypted gradient information, and send the first ciphertext gradient information to the verification server;
[0375] Receiving normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determining normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information;
[0376] Determine the training gradient information of the model in the current training phase, generate second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and send the second ciphertext gradient information to the verification server;
[0377] Receiving similarity information returned by the verification server after verifying the second ciphertext gradient information, the similarity information being similarity information between the training gradient information and the target encrypted gradient information;
[0378] The confidence score corresponding to the target encrypted gradient information is determined based on the similarity information, and the global gradient information used by each client for the next stage of model training is determined based on the confidence score and the target encrypted gradient information.
[0379] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the data processing method above, and will not be repeated here.
[0380] As can be seen from the above, in an embodiment of the present application, by obtaining the encrypted gradient information sent by each client, the encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model; generating the first ciphertext gradient information according to the encrypted gradient information, and sending the first ciphertext gradient information to the verification server; receiving the normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determining the normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information; determining the training gradient information of the model in the current training stage, and generating the second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and sending the second ciphertext gradient information to the verification server; receiving the similarity information returned by the verification server after verifying the second ciphertext gradient information, the similarity information is the similarity information between the training gradient information and the target encrypted gradient information; determining the confidence score corresponding to the target encrypted gradient information according to the similarity information, and determining the global gradient information used by each client for the next stage of model training according to the confidence score and the target encrypted gradient information. In this way, during the process of federated learning, the encrypted gradient information shared by the client is verified through two types of servers. The normalized verification information obtained through data verification can determine whether the encrypted gradient information is normalized, thereby filtering out the encrypted gradient information that is not normalized. The similarity information obtained through data verification can determine the confidence score corresponding to the target encrypted gradient information. According to the confidence score, the global gradient information for the next stage of model training can be more accurately determined. Compared with the related art that only uses a single type of server to protect the data of the federated learning process, the present application can avoid the leakage of encrypted gradient information caused by the attack of a single type of server, and can perform security detection and identification on the encrypted gradient information, thereby improving the security of the federated learning process.
[0381] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0382] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any data processing method provided in the embodiment of the present application. For example, the instructions can execute the following steps:
[0383] Obtain the encrypted gradient information sent by each client. The encrypted gradient information is generated by encrypting the gradient information generated after each client performs stage training on the model.
[0384] Generate first ciphertext gradient information according to the encrypted gradient information, and send the first ciphertext gradient information to the verification server;
[0385] Receiving normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determining normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information;
[0386] Determine the training gradient information of the model in the current training phase, generate second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and send the second ciphertext gradient information to the verification server;
[0387] Receiving similarity information returned by the verification server after verifying the second ciphertext gradient information, the similarity information being similarity information between the training gradient information and the target encrypted gradient information;
[0388] The confidence score corresponding to the target encrypted gradient information is determined based on the similarity information, and the global gradient information used by each client for the next stage of model training is determined based on the confidence score and the target encrypted gradient information.
[0389] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the data processing method above, and will not be repeated here.
[0390] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the data processing method provided in various optional implementations provided in the above embodiments.
[0391] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0392] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0393] Since the instructions stored in the computer-readable storage medium can execute the steps in any data processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any data processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0394] The above is a detailed introduction to a data processing method, device, computer equipment and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data processing method, characterized in that: include: Obtaining encrypted gradient information sent by each client, where the encrypted gradient information is generated by encrypting gradient information generated after each client performs stage training on the model; Generate first ciphertext gradient information according to the encrypted gradient information, and send the first ciphertext gradient information to a verification server; Receiving normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determining normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information; Determine the training gradient information of the model in the current training phase, generate second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and send the second ciphertext gradient information to the verification server; Receiving similarity information returned by the verification server after verifying the second ciphertext gradient information, the similarity information being similarity information between the training gradient information and the target encrypted gradient information; A confidence score corresponding to the target encrypted gradient information is determined according to the similarity information, and global gradient information used by each client for training the model in the next stage is determined according to the confidence score and the target encrypted gradient information.
2. The data processing method according to claim 1, characterized in that: The step of generating first ciphertext gradient information according to the encrypted gradient information includes: Performing a multiplication homomorphic operation on the encrypted gradient information to obtain first encrypted gradient information; Determine a first random noise corresponding to the first encrypted gradient information, and perform an additive homomorphic operation on the first encrypted gradient information and the first random noise to obtain second encrypted gradient information; Partially decrypting the second encrypted gradient information using a pre-assigned first key to obtain partially decrypted gradient information; The first ciphertext gradient information is generated according to the second encrypted gradient information and the partially decrypted gradient information.
3. The data processing method according to claim 2, characterized in that: The performing an additive homomorphic operation on the first encrypted gradient information and the first random noise to obtain second encrypted gradient information includes: Determine a plurality of sub-first encrypted gradient information of the first encrypted gradient information; Determine a sub-first random noise for each sub-first encrypted gradient information in the first random noise; An additive homomorphic operation is performed on each sub-first encrypted gradient information and the corresponding sub-first random noise to obtain target first encrypted gradient information corresponding to each sub-first encrypted gradient information, and the target first encrypted gradient information is determined as the second encrypted gradient information.
4. The data processing method according to claim 2, characterized in that: The sending the first ciphertext gradient information to the verification server includes: Sending the first ciphertext gradient information to the verification server according to a secure communication link with the verification server, so that the verification server determines the second encrypted gradient information and the partial decrypted gradient information in the first ciphertext gradient information; Partially decrypting the second encrypted gradient information by using a pre-assigned second key to obtain first decrypted gradient information, wherein the first key and the second key are an associated key pair, and are used to decrypt two different parts of the second encrypted gradient information respectively; Fully decrypting the second encrypted gradient information according to the first decrypted gradient information and the partial decrypted gradient information to obtain second decrypted gradient information; Normalized verification information corresponding to the encrypted gradient information is determined according to the second decrypted gradient information.
5. The data processing method according to claim 2, characterized in that: The determining of normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information includes: removing noise from the normalized verification information according to the first random noise to obtain target normalized verification information; The encrypted gradient information whose target normalized verification information is a preset value is determined as the normalized target encrypted gradient information.
6. The data processing method according to claim 1, characterized in that: The generating second ciphertext gradient information according to the training gradient information and the target encrypted gradient information includes: Performing a multiplication homomorphic operation on the training gradient information and the target encrypted gradient information to obtain first encrypted information; Determine a second random noise corresponding to the first encrypted information, and perform an additive homomorphic operation on the first encrypted information and the second random noise to obtain second encrypted information; Partially decrypting the second encrypted information using a pre-assigned first key to obtain partially decrypted information; Second ciphertext gradient information is generated according to the second encrypted information and the partial decrypted information.
7. The data processing method according to claim 6, characterized in that: The performing an additive homomorphic operation on the first encrypted information and the second random noise to obtain the second encrypted information includes: Determine a plurality of sub-first encrypted information corresponding to the first encrypted information; Determining, in the second random noise, a sub-second random noise corresponding to each sub-first encrypted information; Performing an additive homomorphic operation on each sub-first encrypted information and the corresponding sub-second random noise to obtain target first encrypted information corresponding to each sub-first encrypted information; Performing an addition homomorphic operation on all of the target first encrypted information to obtain second encrypted information.
8. The data processing method according to claim 6, characterized in that: The sending the second ciphertext gradient information to the verification server includes: Sending the second ciphertext gradient information to the verification server according to a secure communication link with the verification server, so that the verification server determines the second encrypted information and the partial decrypted information in the second ciphertext gradient information; Decrypting part of the second encrypted information by using a pre-assigned second key to obtain first decrypted information, wherein the first key and the second key are an associated key pair, and are used to decrypt two different parts of the second encrypted information respectively; Fully decrypting the second encrypted information according to the first decryption information and the partial decryption information to obtain second decrypted information; Similarity information between the training gradient information and the target encrypted gradient information is determined according to the second decrypted information.
9. The data processing method according to claim 1, characterized in that: Determining the confidence score corresponding to the target encrypted gradient information according to the similarity information includes: According to the similarity information, determining abnormal encrypted gradient information with the smallest similarity in the target encrypted gradient information; Determining a target similarity between the abnormal encrypted gradient information and each of the target encrypted gradient information; The confidence score corresponding to each target encrypted gradient information is calculated according to the target similarity and the preset plaintext modulus.
10. The data processing method according to claim 9, characterized in that: Determining the global gradient information used by each client for training the model in the next stage according to the confidence score and the target encrypted gradient information includes: Determining the sum of the confidence scores corresponding to all the target encrypted gradient information according to the confidence scores; Determine a target confidence score corresponding to each target encrypted gradient information according to the sum of the confidence scores, the preset plaintext modulus and the confidence score corresponding to each target encrypted gradient information; Multiply each of the target encrypted gradient information by the target confidence score to obtain updated ciphertext gradient information corresponding to each of the target encrypted gradient information; Adding each of the updated ciphertext gradient information to obtain global ciphertext gradient information; The global ciphertext gradient information is partially decrypted according to a pre-assigned first key to obtain the global gradient information used by each client for training the model in the next stage.
11. A data processing device, characterized in that: include: An acquisition module, used to acquire encrypted gradient information sent by each client, wherein the encrypted gradient information is generated by encrypting gradient information generated after each client performs stage training on the model; A first sending module, configured to generate first ciphertext gradient information according to the encrypted gradient information, and send the first ciphertext gradient information to a verification server; A first receiving module, configured to receive normalized verification information returned by the verification server after verifying the first ciphertext gradient information, and determine normalized target encrypted gradient information in the encrypted gradient information according to the normalized verification information; A second sending module, used to determine the training gradient information of the model in the current training stage, generate second ciphertext gradient information according to the training gradient information and the target encrypted gradient information, and send the second ciphertext gradient information to the verification server; A second receiving module is used to receive similarity information returned by the verification server after verifying the second ciphertext gradient information, wherein the similarity information is similarity information between the training gradient information and the target encrypted gradient information; A determination module is used to determine the confidence score corresponding to the target encrypted gradient information according to the similarity information, and to determine the global gradient information used by each client for the next stage of training the model according to the confidence score and the target encrypted gradient information.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the data processing method according to any one of claims 1 to 10.
13. A computer device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the computer program, the data processing method according to any one of claims 1 to 10 is implemented.
