Secure Union-Finding Method, Apparatus, Device, and Medium for Federated Learning
Through hash grouping and reverse private membership testing protocols, the problem of inefficient security concurrent tasks in federated learning is solved, and more efficient dataset union construction is achieved.
Patent Information
- Application Number
- CN202210976530.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-15
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-08-15
AI Technical Summary
The security concurrent task execution in existing federated learning is less efficient, mainly due to the high performance losses caused by existing protocols in private membership testing.
The hash function is used to group data and populate it with special virtual items. Combined with the reverse private membership test protocol, the existence of data is judged and the data set is constructed through inadvertent pseudo-random functions and inadvertent transmission protocols.
Effectively reduce the number of transmission bytes and encryption calculation consumption, and improve the execution efficiency of secure convergence tasks.
Smart Images

Figure CN115329377B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence, and particularly relates to a secure union method, device, equipment and medium applied to federated learning. Background Art
[0002] With the rapid development of computer and Internet technologies, the protection of users' personal data privacy has become a very important issue, and the complementary and shared data resources among enterprises are also indispensable. Protecting privacy-preserving data aggregation is also a well-received goal in network security and other communities.
[0003] Currently, there are mainly two methods to perform secure union tasks: One is that users outsource their encrypted data and calculations to a cloud server while maintaining their data privacy. This method requires the support of a powerful secure cloud server and consumes a lot of resources. And there is a risk of data leakage when transmitting data to the cloud server. The other is to construct a PSU protocol, and the participating parties perform data transmission and calculations according to the protocol. For example, Davidson and Cid proposed an efficient protocol based on encrypted Bloom filters and additive homomorphic encryption (AHE). Currently, in the PSU protocol, most of them are constructed based on methods similar to secure intersection because secure intersection (PSI) is relatively mature at present. However, the existing fast private membership tests used in leading PSI protocols are not immediately applicable to calculating PSU, and existing PSU protocols will include richer private membership tests, that is, to judge whether the participating parties are eligible to provide or obtain data to participate in calculations, so it will bring higher performance losses, resulting in low execution efficiency of secure union tasks in federated learning. Summary of the Invention
[0004] Based on this, it is necessary to provide a secure union method, device, equipment and medium applied to federated learning for the above technical problems, so as to solve the problem that the existing secure union protocol will bring higher performance losses, resulting in low execution efficiency of secure union tasks in federated learning.
[0005] In a first aspect, an embodiment of the present invention provides a secure union method applied to federated learning, and the secure union method applied to federated learning includes:
[0006] The sender and the receiver fill the data in their respective data sets into their respective n divided data groups according to the selected hash function, where n>1, and the maximum number of data that each data group can contain is m, where m>1;
[0007] The sender and the receiver use special virtual items to fill each data group of their respective data sets, so that the number of data contained in each data group is m + 1, and the special virtual item is a null value;
[0008] By means of a reverse private membership test protocol, it is determined in turn whether each data in each data group of the sender exists in a certain data group of the receiver, and the judgment index value of each data in each data group of the sender is obtained, and each of the judgment index values is sent to the receiver;
[0009] According to each of the judgment index values, and each data in each data group and the corresponding special virtual item, all the data in the sender's data set that are not in the receiver's data set are determined to form a first data set;
[0010] The union of the first data set and the receiver's data set is obtained to get the union of the sender's data and the receiver's data.
[0011] In a second aspect, an embodiment of the present invention provides a secure union method applied to federated learning. The secure union method applied to federated learning includes:
[0012] The sender and the receiver fill the data in their respective data sets into n data groups divided by themselves according to a selected hash function, where n>1, and the maximum number of data that each data group can contain is m, where m>1;
[0013] The sender and the receiver use special virtual items to fill each data group of their respective data sets, so that the number of data contained in each data group is m + 1, and the special virtual item is a null value;
[0014] By means of a reverse private membership test protocol, it is determined in turn whether each data in each data group of the receiver exists in a certain data group of the sender, and the judgment index value of each data in each data group of the receiver is obtained, and each of the judgment index values is sent to the sender;
[0015] According to each of the judgment index values, and each data in each data group and the corresponding special virtual item, all the data in the receiver's data set that are not in the sender's data set are determined to form a second data set;
[0016] The union of the second data set and the sender's data set is obtained to get the union of the sender's data and the receiver's data.
[0017] In a third aspect, an embodiment of the present invention provides a secure union device applied to federated learning. The secure union device applied to federated learning includes:
[0018] A data filling module, configured to enable a sender and a receiver to fill the data in their respective data sets into n respective divided data groups according to a selected hash function, where n>1, and the maximum number of data that each data group can contain is m, m>1;
[0019] A data padding module, configured to enable the sender and the receiver to use special virtual items to pad each data group of their respective data sets, so that the number of data contained in each data group is m + 1, and the special virtual item is a null value;
[0020] A data judgment module, configured to judge, through a reverse private membership test protocol, whether each data in each data group of the sender exists in a certain data group of the receiver, obtain a judgment index value for each data in each data group of the sender, and send each judgment index value to the receiver;
[0021] A first data set construction module, configured to determine all the data in the sender's data set that are not in the receiver's data set according to each judgment index value, and each data in each data group and the corresponding special virtual item, and construct a first data set;
[0022] A union calculation module, configured to take the union of the first data set and the receiver's data set to obtain the union of the sender's data and the receiver's data.
[0023] In a fourth aspect, an embodiment of the present invention provides a computer device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the secure union method applied to federated learning as described in the first aspect.
[0024] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the secure union method applied to federated learning as described in the first aspect.
[0025] Advantageous effects of the present invention compared with the prior art:
[0026] In the secure union method applied to federated learning of the present invention, during the private membership test, based on the reverse private membership test protocol method, the number of bytes transmitted can be effectively reduced when transmitting polynomial parameters, thereby reducing the computational overhead of the private membership test; at the same time, the present invention uses a simple hash function to group data. Compared with other complex algorithms, it can reduce the computational consumption during encryption, effectively improve the secure union efficiency, and thus improve the execution efficiency of the secure union task in federated learning. Description of the Drawings
[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0028] Figure 1 It is a schematic diagram of an application environment of a secure union method applied to federated learning provided in the first embodiment of the present invention;
[0029] Figure 2 It is a schematic flowchart of a secure union method applied to federated learning provided in the first embodiment of the present invention;
[0030] Figure 3 It is a schematic flowchart of a secure union method applied to federated learning provided in the second embodiment of the present invention;
[0031] Figure 4 It is a schematic structural diagram of a secure union device applied to federated learning provided in the third embodiment of the present invention;
[0032] Figure 5 It is a schematic structural diagram of a computer device provided in the fourth embodiment of the present invention. Detailed implementation manners
[0033] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are presented to thoroughly understand the embodiments of the present invention. However, those skilled in the art should clearly understand that the present invention can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present invention.
[0034] It should be understood that when used in the specification of the present invention and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0035] It should also be understood that the term " / and / or" used in the specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0036] As used in the specification of the present invention and the appended claims, the term "if" may be construed, depending on the context, as "when", "once", "in response to determining", or "in response to detecting". Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, to mean "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]".
[0037] In addition, in the description of the specification of the present invention and the appended claims, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be construed as indicating or implying relative importance.
[0038] Reference to "one embodiment" or "some embodiments" or the like described in the specification of the present invention means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the present invention. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0039] Embodiments of the present invention may acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is a theory, method, technology, and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results.
[0040] Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation / interaction systems, and mechatronics. Artificial intelligence software technologies mainly include several major directions such as computer vision technology, robotics, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0041] It should be understood that the magnitudes of the sequence numbers of the steps in the following embodiments do not mean the order of execution is prior or subsequent. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0042] In order to illustrate the technical solutions of the present invention, the following specific embodiments are used for illustration.
[0043] A secure union method applied to federated learning provided by Embodiment 1 of the present invention can be applied in an application environment such as Figure 1 . The application environment is a secure union system applied to federated learning. The system includes N local clients and at least one central server, where N is an integer greater than 1. Among them, the clients communicate with the server. Among them, the clients include, but are not limited to, clients such as palm computers, desktop computers, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, cloud clients, and personal digital assistants (PDAs). The server can be implemented by an independent server or a server cluster composed of multiple servers.
[0044] See Figure 2 , which is a schematic flowchart of a secure union method applied to federated learning provided by Embodiment 1 of the present invention. The above-mentioned secure union method applied to federated learning can be applied to Figure 1 in the client. The corresponding client connects to the server through a preset Application Programming Interface (API). Each local client sends its own data to other local clients through the central server or receives data from other local clients through the central server. The local client securely unions the received data with its own data through the secure union method applied to federated learning to obtain the union of its own data and the data of other local clients received. As Figure 2 shown, the above-mentioned secure union method applied to federated learning may include the following steps:
[0045] Step S201, the sender and the receiver fill the data in their respective data sets into their respective n data groups according to the selected hash function, where n>1, and the maximum number of data that each data group can contain is m, where m>1.
[0046] The application scenario of this embodiment is federated learning. In the federated learning scenario, secure union based on privacy can effectively solve the problem of data complementarity between enterprises; for example, a social service organization wants to determine the list of cancer patients receiving welfare. Some patients may receive cancer treatment in multiple hospitals. By using the private set union protocol, the union of the cancer patient lists of each hospital can be calculated. At the same time, duplicate patients are deleted without disclosing the detailed information of the patients. Then, a secure set intersection operation can be performed between the obtained union and the welfare vouchers.
[0047] In this embodiment, based on the above scenario, the sender and the receiver are taken as examples for description; for example, the sender S has a set of data X = {x1, x2,...}, and the size of this set of data is n1. Similarly, the receiver R also has a set of data Y = {y1, y2,...}, and the size of this set of data is n2; for the data of the sender S and the receiver R, first, the data of the sender S and the data of the receiver R are divided into n data groups through a hash function, where n > 1, and the data groups are named bin. The maximum number of data that each data group can contain is m, where m > 1.
[0048] In this embodiment, the hash function, also known as the hashing function, is a function that transforms input data of any length into output data of a fixed length through a hashing algorithm. The output value is called the hash value or message digest; simply put, it is a function that compresses an input message of any length into a message digest of a certain fixed length. The mathematical expression is: h = H(M), where H() is a one-way hash function, M is the plaintext of any length, and h is the hash value of a fixed length.
[0049] In this embodiment, the hash function selected is a collision-resistant hash function (CRHF), that is, the Davies-Meyer hash function. The data of the sender S is input into the Davies-Meyer hash function, and the Davies-Meyer hash function divides the data of the sender S into n data groups; the data of the receiver R is input into the Davies-Meyer hash function, and the Davies-Meyer hash function divides the data of the receiver R into n data groups; at the same time, it is set that the maximum number of data that each group can contain is m.
[0050] Fill the data of the sender S into the data groups of the sender S to obtain the data group B S [i], fill the data of the receiver R into the data groups of the receiver R to obtain B R [i], where i > 1; among them, B S [i] represents the i-th data group of the sender, and B R [i] represents the i-th data group of the receiver.
[0051] Step S202, the sender and the receiver use special dummy items to fill each data group of their respective data sets so that the number of data contained in each data group is m + 1, and the special dummy item is a null value.
[0052] In this embodiment, after the data of the sender S and the data of the receiver R are processed through step S201, each piece of data is filled into its respective data group; since the number of data of the sender S and the number of data of the receiver R may be different, after grouping by the hash function, the number of data filled in each data group may also be different; for the convenience of subsequent calculations, the sender S and the receiver R fill special virtual items into each of their respective data groups to make the number of data in the data group reach m + 1. In this embodiment, the special virtual item can be a null value.
[0053] For example, the maximum number of data originally contained in the data group of the sender S is 10, and the maximum number of data originally contained in the data group of the receiver R is also 10. After filling their respective data into the data group according to the hash function, 8 pieces of data are filled in each data group of the sender S, and 9 pieces of data are filled in each data group of the receiver R. Then, through step S202, special virtual items are filled into each data group of the sender S and the receiver R to make the number of data in their respective data groups reach 11.
[0054] In this embodiment, through this step, the number of data in the data group of the sender S and the number of data in the data group of the receiver R both reach m + 1, making the length of the data group of the sender S the same as the length of the data group of the receiver R, which is convenient for subsequent calculations.
[0055] Step S203: Through the reverse private membership test protocol, it is judged in turn whether each piece of data in each data group of the sender exists in a certain data group of the receiver, and the judgment index value of each piece of data in each data group of the sender is obtained, and each judgment index value is sent to the receiver.
[0056] In this embodiment, after processing the data of the sender S and the data of the receiver R through steps S201 and S202, it is necessary to judge whether the data of the sender S exists in a certain data group of the receiver R. The reverse private membership test protocol is used to judge whether the data of the sender S exists in a certain data group of the receiver R. The specific method of the reverse private membership test protocol is as follows:
[0057] (1) The receiver encrypts the receiver's data set according to the Oblivious Pseudo Random Function (OPRF) to obtain the first ciphertext and obtains a random secret key; the sender encrypts the sender's data set according to the Oblivious Pseudo Random Function to obtain the second ciphertext.
[0058] (2) The receiving party constructs a polynomial based on the filled dataset, performs an exclusive-or operation on the polynomial and the first ciphertext to obtain the result of the first exclusive-or operation; and sends the parameters of the polynomial to the sending party;
[0059] (3) The sending party determines the polynomial according to the parameters of the polynomial, performs an exclusive-or operation on the polynomial and the second ciphertext to obtain the result of the second exclusive-or operation;
[0060] (4) Determine whether the result of the first exclusive-or operation is equal to the result of the second exclusive-or operation to determine the judgment index value.
[0061] Among them, the Pseudo Random Function (PRF): is a seemingly random number sequence calculated using a deterministic algorithm. The "pseudo" means that it is not truly random in fact; if the initial value input to the pseudo-random function is the same, then the numerical values of the output random numbers are also the same, etc.
[0062] Oblivious: For example, B takes one from a bunch of datasets of A, but A doesn't know which one B takes. Except for the value B gets, B knows nothing about other data of A.
[0063] In this embodiment, the existing BaRF-OPRF protocol is adopted. This protocol only uses inexpensive symmetric key encryption operations and effectively generates a large number of OPRF instances. Specifically, the amortized cost of each OPRF instance is about 500 bits and is widely used in communications and some symmetric key operations.
[0064] In this embodiment, the sending party S and the receiving party R call a program based on the oblivious pseudo-random function. The sending party S traverses all its data groups B s [i] to obtain the data x j , j > 1. The sending party S provides all the traversed data x j , and the receiving party R provides its data group B R [] and encrypts the data provided by the receiving party R according to the PORF protocol to obtain the first ciphertext q and the random PRF secret key K; the sending party encrypts the provided data according to the OPRF protocol to obtain q * = F k (x j ), where F is the pseudo-random function PRF, and q * is the ciphertext obtained by encrypting the data of the sending party through the pseudo-random function PRF, that is, the second ciphertext.
[0065] The receiving party R constructs a polynomial P(x) according to its own dataset and calculates the result of the first exclusive-or operation of the receiving party R Among them, s is the first XOR operation result of the recipient R, q is the ciphertext constructed by the recipient R correspondingly, and p is a polynomial; the recipient R sends the parameters of the constructed polynomial P(x) to the sender S.
[0066] The sender S determines the polynomial P(x) according to the received parameters of the polynomial P(x), and the sender S calculates the second XOR operation result of the polynomial P(x) and q * of Among them, s * is the second XOR operation result of the sender S.
[0067] The recipient R provides the first XOR operation result s, and the sender provides the second XOR operation result s * , if s = s * , then the judgment index b j is set to 1, that is, the data x j provided by the sender exists in the data set provided by the recipient; if s ≠ s * , then the judgment index b j is set to 0, that is, the data x j provided by the sender does not exist in the data set provided by the recipient.
[0068] Step S204, according to each judgment index value, and each data and the corresponding special virtual item in each data set, determine all the data in the sender's data set that are not in the recipient's data set, and form the first data set.
[0069] In this embodiment, through the above steps, the data that does not exist in the recipient R has been judged, and the corresponding judgment index value is returned. The recipient R then obtains all the data of the sender S that do not exist in the recipient R according to the judgment index b j by the following method:
[0070] Call the program based on the oblivious transfer protocol, take each judgment index value and each data and the corresponding special virtual item in each data set as inputs, and output each data in the sender's data set that is not in the recipient's data set.
[0071] Among them, the oblivious transfer (OT) protocol is a privacy encryption protocol and is open source. An example of this protocol is as follows: First, the sender generates two pairs of different public and private keys and discloses the two public keys, which are called public key 1 and public key 2 respectively. Suppose the receiver hopes to know m1 but does not want the sender to know that he wants m1. The receiver generates a random number k, encrypts k with public key 1, and transmits it to the sender. The sender decrypts the encrypted k with his two private keys, decrypts it with private key 1 to get k1, and decrypts it with private key 2 to get k2. Obviously, only k1 is equal to k, and k2 is a meaningless string of numbers. However, the sender does not know which public key the receiver used for encryption, so he does not know which k he calculated is the real k. The sender performs an exclusive OR operation on m1 and k1, performs an exclusive OR operation on m2 and k2, and transmits the two exclusive OR values to the receiver. Obviously, the receiver can only calculate m1 and cannot infer m2 (because he does not know private key 2 and thus cannot deduce the value of k2), and at the same time the sender also does not know which one he can calculate.
[0072] The sender S takes all its data x j and constructs a data pair {x j , p} with the special virtual item p. The receiver R provides a judgment index b j , calls a program based on the oblivious transfer (OT) protocol, and inputs {x j , p} and b j into the program based on the oblivious transfer (OT) protocol, and outputs all the data that the sender S does not have in the receiver R, which constitutes the first data set Z j .
[0073] Step S205: Take the union of the first data set and the data set of the receiver to obtain the union of the data of the sender and the data of the receiver.
[0074] In this embodiment, through the above steps, the first data set Z composed of all the data that the sender S does not have in the receiver R j , takes the union of the first data set Z j and the data set Y of the receiver R, result = Y ∪ Z, and the union result of the data of the sender S and the data of the receiver R can be obtained.
[0075] The secure union method applied to federated learning in this embodiment. First, during the private membership test, a reverse private membership test protocol method is constructed based on the oblivious transfer (OT) protocol, which can effectively reduce the number of bytes transmitted when transmitting polynomial parameters, thereby reducing the computational overhead of the private membership test. At the same time, this embodiment uses a simple hash function to group data. Compared with other complex algorithms, it can reduce the computational consumption during encryption, thereby effectively improving the secure union efficiency and enhancing the execution efficiency of the secure union task in federated learning.
[0076] See Figure 3 , which is a schematic flowchart of a secure union method applied to federated learning provided in the second embodiment of the present invention. Step S301 in this embodiment is the same as step S201 in the first embodiment, and step S302 is the same as step S202. The differences between this embodiment and the first embodiment are as follows:
[0077] Step 303, through the reverse private membership test protocol, sequentially determine whether each data in each data group of the receiver exists in a certain data group of the sender, obtain the judgment index values of each data in each data group of the receiver, and send each judgment index value to the sender.
[0078] The difference between this step and step S203 in the first embodiment is that the sender S and the receiver R are swapped, so as to determine whether each data in each data group of the receiver R exists in a certain data group of the sender S. The method used is the same as that in the first embodiment and will not be elaborated here.
[0079] Step S304, according to each judgment index value, as well as each data and the corresponding special virtual item in each data group, determine all the data in the receiver's data set that are not in the sender's data set, and form the second data set.
[0080] The difference between this step and step S204 in the first embodiment is that the sender S and the receiver R are swapped, so as to determine all the data in the receiver's data set that are not in the sender's data set and form the second data set. The method used is the same as that in the first embodiment and will not be elaborated here.
[0081] Step S305, take the union of the second data set and the sender's data set to obtain the union of the sender's data and the receiver's data.
[0082] The difference between this step and step S205 in the first embodiment is that the sender S and the receiver R are swapped, and the union of the second data set and the sender's data set is taken to obtain the union of the sender's data and the receiver's data. The method used is the same as that in the first embodiment and will not be elaborated here.
[0083] This embodiment can achieve the same effect as the embodiment of the secure union method applied to federated learning in Embodiment 1, which will not be elaborated here.
[0084] Corresponding to the secure union method applied to federated learning in the above embodiments, Figure 4 The structural block diagram of a secure union device applied to federated learning provided in Embodiment 3 of the present invention is shown. The above secure union device applied to federated learning is applied to a local client in a federated learning environment. The federated learning environment includes N local clients and at least one central server, where N is an integer greater than 1. The corresponding client connects to the server through a preset application programming interface (API). Each local client sends its own data to other local clients or receives data from other local clients through the central server. The local client performs a secure union of the received data with its own data through the secure union device applied to federated learning to obtain the union of its own data and the data of other local clients received. For the sake of simplicity, only the parts related to the embodiments of the present invention are shown.
[0085] See Figure 4 , the secure union device applied to federated learning includes:
[0086] A data filling module 41, configured to enable the sender and the receiver to fill the data in their respective data sets into n data groups divided by themselves according to a selected hash function, where n>1, and the maximum number of data that each data group can contain is m, where m>1;
[0087] A data padding module 42, configured to enable the sender and the receiver to use special virtual items to pad each data group of their respective data sets, so that the number of data contained in each data group is m + 1, and the special virtual item is a null value;
[0088] A data judgment module 43, configured to sequentially judge whether each data in each data group of the sender exists in a certain data group of the receiver through a reverse private membership test protocol, obtain the judgment index value of each data in each data group of the sender, and send each judgment index value to the receiver;
[0089] A first data set construction module 44, configured to determine all the data in the sender's data set that are not in the receiver's data set according to each judgment index value, as well as each data and the corresponding special virtual item in each data group, and construct a first data set;
[0090] A union calculation module 45, configured to perform a union of the first data set and the receiver's data set to obtain the union of the sender's data and the receiver's data.
[0091] Optionally, the above data judgment module 43 includes:
[0092] An encryption unit, configured to encrypt the data set of the receiving party according to an oblivious pseudorandom function to obtain a first ciphertext, and obtain a random secret key; the sending party encrypts the data set of the sending party according to the oblivious pseudorandom function to obtain a second ciphertext;
[0093] A first exclusive-OR operation unit, configured to construct a polynomial by the receiving party according to the padded data set, perform an exclusive-OR operation on the polynomial and the first ciphertext to obtain a first exclusive-OR operation result; and send the parameters of the polynomial to the sending party;
[0094] A second exclusive-OR operation unit, configured to determine a polynomial by the sending party according to the parameters of the polynomial, perform an exclusive-OR operation on the polynomial and the second ciphertext to obtain a second exclusive-OR operation result;
[0095] A judgment index determination unit, configured to determine whether the first exclusive-OR operation result is equal to the second exclusive-OR operation result, and determine a judgment index value.
[0096] Optionally, the above first data set construction module 44 includes:
[0097] A first result judgment unit, configured to judge that if the first exclusive-OR operation result is equal to the second exclusive-OR operation result, then judge that the data of the sending party corresponding to the judgment index exists in the data of the receiving party;
[0098] A second result judgment unit, configured to judge that if the first exclusive-OR operation result is not equal to the second exclusive-OR operation result, then judge that the data of the sending party corresponding to the judgment index does not exist in the data of the receiving party.
[0099] Optionally, the above union calculation module 45 includes:
[0100] A data output unit, configured to call a program based on an oblivious transfer protocol, take each judgment index value and each data and the corresponding special virtual item in each data group as inputs, so as to output each data in the data set of the sending party that is not in the data set of the receiving party.
[0101] It should be noted that for the information interaction, execution process, etc. between the above modules, since they are based on the same concept as the method embodiment of the present invention, their specific functions and the technical effects brought thereby can be specifically referred to in the method embodiment part, and will not be elaborated here.
[0102] Figure 5 This is a schematic structural diagram of a computer device provided in Embodiment 4 of the present invention. As Figure 5 shown, the computer device of this embodiment includes: at least one processor ( Figure 5(only one is shown in the figure), a memory, and a computer program stored in the memory and executable on at least one processor. When the processor executes the computer program, the steps in any of the above-mentioned embodiments of the secure union method applied to federated learning are implemented.
[0103] The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that Figure 5 merely an example of a computer device, which does not constitute a limitation on the computer device. The computer device may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include a network interface, a display screen, and an input device, etc.
[0104] The so-called processor may be a CPU, and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0105] The memory includes a readable storage medium, an internal memory, etc. Among them, the internal memory may be the memory of the client, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be the hard disk of the client, and in some other embodiments, it may also be an external storage device of the client. For example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the client. Further, the memory may also include both the internal storage unit and the external storage device of the client. The memory is used to store the operating system, application programs, boot loaders, data, and other programs, etc. The other programs such as the program code of the computer program. The memory may also be used to temporarily store the data that has been output or will be output.
[0106] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions may be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
[0107] In the embodiments, each functional unit and module can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.
[0108] For the specific working processes of the units and modules in the above device, reference can be made to the corresponding processes in the foregoing method embodiments and will not be elaborated herein. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above method embodiments of the present invention, a computer program can be used to instruct the relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments applied to the secure union method in federated learning can be implemented.
[0109] Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc.
[0110] The computer-readable medium can at least include: any entity or device capable of carrying the computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0111] To implement all or part of the processes in the above method embodiments of the present invention, it can also be completed by a computer program product. When the computer program product runs on the client, the client can implement the steps in the above method embodiments applied to the secure union method in federated learning when executed.
[0112] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0113] Those of ordinary skill in the art will recognize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0114] In the embodiments provided by the present invention, it should be understood that the disclosed device / client and method can be implemented in other ways. For example, the device / client embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0115] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A secure union-finding method applied to federated learning, characterized in that, Including: The sender and the receiver fill the data in their respective data sets into their respective n divided data groups according to a selected hash function, where n > 1, and the maximum number of data that each data group can contain is m, where m > 1; The sender and the receiver use special virtual items to fill each data group of their respective data sets, so that the number of data contained in each data group is m + 1, and the special virtual item is a null value; Through the reverse private membership test protocol, it is successively determined whether each data in each data group of the sender exists in a certain data group of the receiver, and the judgment index value of each data in each data group of the sender is obtained, and each of the judgment index values is sent to the receiver; According to each of the judgment index values, and each data in each data group and the corresponding special virtual item, determine all the data in the sender's data set that are not in the receiver's data set, and form a first data set; Take the union of the first data set and the receiver's data set to obtain the union of the sender's data and the receiver's data; The process of successively determining whether each data in each data group of the sender exists in a certain data group of the receiver through the reverse private membership test protocol, and obtaining the judgment index value of each data in each data group of the sender includes: The receiver encrypts the receiver's data set according to an oblivious pseudorandom function to obtain a first ciphertext, and obtains a random secret key; the sender encrypts the sender's data set according to the oblivious pseudorandom function to obtain a second ciphertext; The receiver constructs a polynomial according to the filled data set, performs an exclusive-or operation on the polynomial and the first ciphertext to obtain a first exclusive-or operation result; and sends the parameters of the polynomial to the sender; The sender determines the polynomial according to the parameters of the polynomial, and performs an exclusive-or operation on the polynomial and the second ciphertext to obtain a second exclusive-or operation result; Judge whether the first exclusive-or operation result is equal to the second exclusive-or operation result to determine the judgment index value.
2. The secure union method applied to federated learning according to claim 1, characterized in that Determining all the data in the sender's data set that are not in the receiver's data set includes: If the first exclusive-or operation result is equal to the second exclusive-or operation result, it is judged that the data of the sender corresponding to the judgment index exists in the data of the receiver; If the first exclusive-or operation result is not equal to the second exclusive-or operation result, it is judged that the data of the sender corresponding to the judgment index does not exist in the data of the receiver.
3. The secure union method applied to federated learning according to claim 1, wherein, According to each of the judgment index values, and each data in each data group and the corresponding special virtual item, determining all the data in the sender's data set that are not in the receiver's data set includes: Call a program based on the oblivious transfer protocol, take each of the judgment index values, each data in each data group and the corresponding special virtual item as inputs, and output each data in the sender's data set that is not in the receiver's data set.
4. A secure union method applied to federated learning, characterized in that, Including: The sender and the receiver fill the data in their respective data sets into their respective n divided data groups according to the selected hash function, where n > 1, and the maximum number of data that each data group can contain is m, m > 1; The sender and the receiver use special virtual items to fill each data group of their respective data sets, so that the number of data contained in each data group is m + 1, and the special virtual item is a null value; Through the reverse private membership test protocol, it is successively determined whether each data in each data group of the receiver exists in a certain data group of the sender, and the judgment index value of each data in each data group of the receiver is obtained, and each of the judgment index values is sent to the sender; According to each of the judgment index values, and each data in each data group and the corresponding special virtual item, all the data in the receiver's data set that are not in the sender's data set are determined to form a second data set; The union of the second data set and the sender's data set is obtained to get the union of the sender's data and the receiver's data; The process of successively determining whether each data in each data group of the receiver exists in a certain data group of the sender through the reverse private membership test protocol to obtain the judgment index value of each data in each data group of the receiver includes: The sender encrypts the sender's data set according to the oblivious pseudorandom function to obtain a third ciphertext, and obtains a random secret key; the receiver encrypts the receiver's data set according to the oblivious pseudorandom function to obtain a fourth ciphertext; The sender constructs a polynomial according to the filled data set, performs an exclusive OR operation on the polynomial and the third ciphertext to obtain a third exclusive OR operation result; and sends the parameters of the polynomial to the receiver; The receiver determines the polynomial according to the parameters of the polynomial, and performs an exclusive OR operation on the polynomial and the fourth ciphertext to obtain a fourth exclusive OR operation result; Judge whether the third exclusive OR operation result is equal to the fourth exclusive OR operation result to determine the judgment index value.
5. The secure union finding method applied to federated learning according to claim 4, wherein Determining all the data in the receiver's data set that are not in the sender's data set includes: If the third exclusive OR operation result is equal to the fourth exclusive OR operation result, it is judged that the data of the receiver corresponding to the judgment index exists in the data of the sender; If the third exclusive OR operation result is not equal to the fourth exclusive OR operation result, it is judged that the data of the receiver corresponding to the judgment index does not exist in the data of the sender.
6. A secure union-finding device applied to federated learning, characterized in that, The secure union device applied to federated learning includes: A data filling module, configured to enable the sender and the receiver to fill the data in their respective data sets into their respective n divided data groups according to the selected hash function, where n > 1, and the maximum number of data that each data group can contain is m, m > 1; A data filling module, configured to enable the sender and the receiver to use special virtual items to fill each data group of their respective data sets, so that the number of data contained in each data group is m + 1, and the special virtual item is a null value; A data judgment module, which is used to judge whether each data in each data group of the sender exists in a certain data group of the receiver in turn through a reverse private membership test protocol, obtain the judgment index value of each data in each data group of the sender, and send each judgment index value to the receiver; A first data set construction module, which is used to determine all the data in the sender's data set that are not in the receiver's data set according to each judgment index value, each data in each data group, and the corresponding special virtual item, and construct a first data set; A union calculation module, which is used to find the union of the first data set and the receiver's data set to obtain the union of the sender's data and the receiver's data; The data judgment module includes: An encryption unit, which is used for the receiver to encrypt the receiver's data set according to an oblivious pseudorandom function to obtain a first ciphertext and obtain a random secret key; the sender encrypts the sender's data set according to an oblivious pseudorandom function to obtain a second ciphertext; A first XOR operation unit, which is used for the receiver to construct a polynomial according to the padded data set, perform an XOR operation on the polynomial and the first ciphertext to obtain a first XOR operation result; and send the parameters of the polynomial to the sender; A second XOR operation unit, which is used for the sender to determine a polynomial according to the parameters of the polynomial, perform an XOR operation on the polynomial and the second ciphertext to obtain a second XOR operation result; A judgment index determination unit, which is used to judge whether the first XOR operation result is equal to the second XOR operation result and determine the judgment index value.
7. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the secure union method for federated learning according to any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the secure union method for federated learning according to any one of claims 1 to 5.
Citation Information
Patent Citations
Federation learning method and system, computer equipment and storage medium
CN111915019A
User label data prediction system, method and device and electronic equipment
CN112085159A