Data intersection method and device, equipment and medium
By encoding the unencrypted information of the receiver and sender into encoded vectors in federated learning, selecting target vector pairs and performing encrypted intersection processing, the problem of high computational resource consumption in privacy intersection is solved, improving computational efficiency and shortening time.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENGDOUSHI SHANGHAI SCI & TECH DEV CO LTD
- Filing Date
- 2022-06-14
- Publication Date
- 2026-04-24
Smart Images

Figure CN117278235B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of federated learning technology, specifically to a data intersection method and apparatus, electronic equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] Federated learning, also known as consortium learning or alliance learning, aims to enable multiple participants to use data and perform machine learning modeling while meeting the requirements of user privacy protection, data security, and government regulations.
[0003] In federated learning, it is often necessary to identify data shared by multiple participants, such as user information shared by multiple internet service providers. Typically, to determine shared data without the participants sharing their own data, privacy-preserving intersection operations can be performed within the federated learning system. That is, two parties holding their respective datasets are allowed to perform an intersection operation on their sets, allowing one or both parties to obtain the intersection result, but neither party can know any information about the other party's dataset outside the intersection.
[0004] However, in existing cryptographic implementations, privacy intersection operations involve a large amount of computation and communication, consuming significant computational and communication resources, and taking a long time to complete.
[0005] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0006] This disclosure provides a data intersection method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
[0007] According to one aspect of this disclosure, a data intersection method is provided, applied to a receiver in a federated learning task, the federated learning task further including a sender communicatively connected to the receiver. The method includes: encoding multiple first unencrypted messages from the receiver to generate multiple first encoded vectors; in response to receiving multiple second encoded vectors from the sender, selecting at least one target vector pair based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors, wherein the multiple second encoded vectors are generated based on the multiple second unencrypted messages from the sender, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold; generating a first intersection result based on the at least one target vector pair; based on the first intersection result, performing encrypted intersection processing on the unencrypted messages in both the multiple first unencrypted messages and the multiple second unencrypted messages that are not included in the first intersection result to obtain a second intersection result; and determining a target intersection result based on the first intersection result and the second intersection result, wherein the target intersection result is the feature information of the same user in the multiple first unencrypted messages and the multiple second unencrypted messages.
[0008] According to another aspect of this disclosure, a data intersection method is provided, applied to a sender in a federated learning task, the federated learning task further including a receiver communicatively connected to the sender. The method includes: encoding multiple pieces of second unencrypted information from the sender to generate multiple second encoded vectors; sending the multiple second encoded vectors to the receiver, causing the receiver to perform: filtering at least one target vector pair based on the similarity between multiple first encoded vectors and multiple second encoded vectors, wherein the multiple first encoded vectors are generated based on the multiple pieces of first unencrypted information from the receiver, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold; generating a first intersection result based on the at least one target vector pair; performing encrypted intersection processing on the unencrypted information in both the multiple first unencrypted information and the multiple second unencrypted information that is not included in the first intersection result, based on the first intersection result, to obtain a second intersection result; and determining a target intersection result based on the first intersection result and the second intersection result, wherein the target intersection result is the feature information of the same user in the multiple first unencrypted information and the multiple second unencrypted information.
[0009] According to another aspect of this disclosure, a data intersection apparatus is provided, applied to a receiver in a federated learning task, the federated learning task further including a sender communicatively connected to the receiver. The apparatus includes: an encoding module configured to: encode multiple first unencrypted messages from the receiver to generate multiple first encoded vectors; and a vector matching module configured to: in response to receiving multiple second encoded vectors from the sender, filter at least one target vector pair based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors, wherein the multiple second encoded vectors are generated based on the multiple second unencrypted messages from the sender, and the first encoded vector in each target vector pair is selected as the first encoded vector. The similarity between a first encoded vector and a second encoded vector is greater than or equal to a preset threshold; a first intersection module is configured to generate a first intersection result based on at least one target vector pair; a second intersection module is configured to perform encrypted intersection processing on unencrypted information not included in the first intersection result from multiple first unencrypted information and multiple second unencrypted information, based on the first intersection result, to obtain a second intersection result; and a target intersection module is configured to determine a target intersection result based on the first intersection result and the second intersection result, wherein the target intersection result is the feature information of the same user from multiple first unencrypted information and multiple second unencrypted information.
[0010] According to another aspect of this disclosure, a data intersection apparatus is provided, applied to a sender in a federated learning task, the federated learning task further including a receiver communicatively connected to the sender. The apparatus includes: an encoding module configured to: encode multiple pieces of second unencrypted information from the sender to generate multiple second encoded vectors; and a first sending module configured to: send the multiple second encoded vectors to the receiver, causing the receiver to: select at least one target vector pair based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors, wherein the multiple first encoded vectors are selected based on the similarity between the multiple second encoded vectors from the receiver. The method involves generating a first coded vector and a second coded vector in each target vector pair from unencrypted information, where the similarity is greater than or equal to a preset threshold; generating a first intersection result based on at least one target vector pair; performing encrypted intersection processing on unencrypted information not included in the first intersection result from multiple first unencrypted information and multiple second unencrypted information to obtain a second intersection result; and determining a target intersection result based on the first and second intersection results, wherein the target intersection result is the feature information of the same user in multiple first unencrypted information and multiple second unencrypted information.
[0011] According to another aspect of this disclosure, a federated learning system is provided, including a data intersection device for a receiver in a federated learning task as described in this disclosure and a data intersection device for a sender in a federated learning task as described in this disclosure.
[0012] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a data intersection method as described in this disclosure.
[0013] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the data intersection method as described in this disclosure.
[0014] According to another aspect of this disclosure, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the data intersection method as described in this disclosure.
[0015] According to one or more embodiments of this disclosure, the computational and communication resources required for data intersection operations in federated learning tasks can be reduced, the efficiency of data intersection operations can be improved, and the time required for data intersection operations can be shortened.
[0016] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0017] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0018] Figure 1 A flowchart of a data intersection method according to an exemplary embodiment of the present disclosure is shown;
[0019] Figure 2 An embodiment according to this disclosure is shown in Figure 1 The flowchart illustrates an exemplary process for selecting at least one target vector pair based on the similarity between multiple first encoding vectors and multiple second encoding vectors in the method.
[0020] Figure 3 An embodiment according to this disclosure is shown in Figure 1 The flowchart illustrates an exemplary process for selecting at least one target vector pair based on the similarity between multiple first encoding vectors and multiple second encoding vectors in the method.
[0021] Figure 4 An embodiment according to this disclosure is shown in Figure 1 A flowchart illustrating an exemplary process in which, based on a first intersection result, encryption and intersection processing is performed on unencrypted information that is not included in the first intersection result from both multiple first unencrypted information and multiple second unencrypted information;
[0022] Figure 5 A flowchart of a data intersection method according to an exemplary embodiment of the present disclosure is shown;
[0023] Figure 6 A structural block diagram of a data intersection apparatus according to an exemplary embodiment of the present disclosure is shown;
[0024] Figure 7 A structural block diagram of a data intersection apparatus according to an exemplary embodiment of the present disclosure is shown;
[0025] Figure 8 A structural block diagram of a federated learning system according to an exemplary embodiment of the present disclosure is shown;
[0026] Figure 9 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0028] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0029] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0030] In the following description of federated learning, two terms will be used:
[0031] (1) Sender: In the federated learning framework, the role of encrypting and transmitting the data it owns to other participants. For example, encrypting the data it owns and transmitting the encrypted data to other participants.
[0032] (2) Receiver: In federated learning, the role that receives data owned by other participants (e.g., the sender as defined above) for computation, such as receiving encrypted data owned by other participants.
[0033] Privacy intersection allows two parties, each holding their own set, to jointly compute the intersection of two sets. After the operation is completed, one or both parties should obtain the correct intersection without receiving any information from the other party's set outside the intersection.
[0034] For example, when calculating the actual effectiveness of online advertising, it is necessary to calculate how many users who viewed the advertisement ultimately viewed the corresponding product page or ultimately purchased the corresponding product or service. Therefore, it is necessary to calculate the intersection of user information that viewed the advertisement (held by the advertiser) and user information that completed the corresponding transaction (held by the merchant), but it is also desirable to protect the privacy of user information of the advertiser or merchant.
[0035] In existing privacy intersection methods, firstly, the sender and receiver among the participating parties encrypt their respective data; then, the sender sends the encrypted data to the receiver; next, the receiver performs an intersection operation on the received encrypted data from the sender and its own encrypted data to obtain an encrypted intersection result; finally, the receiver deduces the unencrypted intersection result based on the encrypted intersection result. In existing cryptographic implementations, the encryption operation is computationally intensive, and the generated encrypted data is also quite long, resulting in significant communication overhead, and the computational cost of performing the intersection operation on the encrypted data is also substantial.
[0036] To address the aforementioned issues, this disclosure provides a data intersection method applied to a receiver in a federated learning task. The federated learning task also includes a sender connected in communication with the receiver. The method includes: encoding multiple pieces of first unencrypted information from the receiver to generate multiple first encoded vectors; responding to receiving multiple second encoded vectors from the sender, selecting at least one target vector pair based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors, wherein the multiple second encoded vectors are generated based on the multiple pieces of second unencrypted information from the sender, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold; generating a first intersection result based on the at least one target vector pair; based on the first intersection result, performing encrypted intersection processing on the unencrypted information in both the multiple first unencrypted information and the multiple second unencrypted information that is not included in the first intersection result, to obtain a second intersection result; and determining a target intersection result based on the first intersection result and the second intersection result, wherein the target intersection result is the feature information corresponding to the same user in the multiple first unencrypted information and the multiple second unencrypted information.
[0037] Figure 1 A flowchart of a data intersection method 100 according to an exemplary embodiment of the present disclosure is shown. According to some embodiments, method 100 can be applied to a receiver in a federated learning task.
[0038] In step S101, the multiple first unencrypted messages from the receiver are encoded to generate multiple first encoded vectors.
[0039] According to some embodiments, the receiver is the role of receiving data owned by other participants (e.g., the sender as defined above) through encrypted transmission, while the sender is the role of transmitting its owned data to other participants in encrypted form. For example, in the online advertising example described above, the receiver is the merchant, and the sender is the advertising sender.
[0040] According to some embodiments, the multiple first unencrypted messages may be user information owned by the recipient, wherein each first unencrypted message corresponds to a user. For example, in the embodiment described above for calculating the actual effect of online advertising, the first unencrypted message is user information owned by the merchant, such as user ID, user identity information, etc.
[0041] According to some embodiments, encoding multiple first unencrypted messages from the recipient to generate multiple first encoded vectors includes: extracting one or more features of the first unencrypted messages through encoding, such as features characterizing the digital or symbolic content of the first unencrypted messages, wherein each feature corresponds to a component of the first encoded vector.
[0042] At step S102, in response to receiving multiple second encoded vectors from the sender, at least one target vector pair is selected based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors.
[0043] According to some embodiments, multiple second encoded vectors are generated based on multiple second unencrypted messages from the sender. According to some embodiments, the multiple second unencrypted messages may be user information owned by the receiver, wherein each second unencrypted message corresponds to a user. For example, in the embodiments described above for calculating the actual effect of online advertising, the second unencrypted messages are user information owned by the advertising sender, such as user ID, user identity information, etc.
[0044] According to some embodiments, similar to the first encoded vector, the sender encodes multiple pieces of second unencrypted information to generate multiple second encoded vectors. According to some embodiments, encoding multiple pieces of second unencrypted information to generate multiple second encoded vectors includes: extracting one or more features from the second unencrypted information through encoding, for example, features characterizing the digital or symbolic content of the second unencrypted information, wherein each feature corresponds to a component of the second encoded vector. According to some embodiments, the receiver and sender use the same or similar encoding methods to enable subsequent target vector pair filtering.
[0045] According to some embodiments, the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold. According to some embodiments, selecting at least one target vector pair based on the similarity between multiple first encoded vectors and multiple second encoded vectors includes: calculating the similarity between multiple first encoded vectors and multiple second encoded vectors, and determining whether a first encoded vector and a second encoded vector constitute a target vector pair by judging whether the similarity between a first encoded vector and a second encoded vector is greater than or equal to a preset threshold.
[0046] In step S103, a first intersection result is generated based on at least one target vector pair.
[0047] According to some embodiments, generating a first intersection result based on at least one target vector pair includes: determining the first intersection result based on a first encoded vector in at least one target vector pair.
[0048] In step S104, based on the first intersection result, the unencrypted information that was not included in the first intersection result among the multiple first unencrypted information and multiple second unencrypted information is encrypted and intersected to obtain the second intersection result.
[0049] According to some embodiments, the receiver receives encrypted information from the sender, wherein the encrypted information is generated based on unencrypted information in a plurality of second unencrypted information that is not included in the first intersection result, and the second intersection result is calculated based on the unencrypted information in the plurality of first unencrypted information that is not included in the first intersection result and the encrypted information from the sender.
[0050] In step S105, the target intersection result is determined based on the first intersection result and the second intersection result.
[0051] According to some embodiments, the target intersection result is the characteristic information of the same user among multiple first unencrypted messages and multiple second unencrypted messages. For example, in the embodiment described above for calculating the actual effect of online advertising, the target intersection result is the intersection of user information owned by the advertiser and the merchant.
[0052] According to some embodiments, the first intersection result and the second intersection result are merged to obtain the target intersection result.
[0053] In the data intersection method described in this disclosure, by calculating the similarity between the encoding vectors of both parties, a portion of the information shared by both parties is pre-screened before the encrypted intersection process, reducing the amount of information that needs to be processed in the encrypted intersection process. This reduces the computational and communication resources occupied by the data intersection operation in the federated learning task, improves the efficiency of the data intersection operation, and shortens the time required for the data intersection operation.
[0054] It should be understood that although the above embodiments only describe a scenario with two participants (i.e., one sender and one receiver), the method can be applied to scenarios with multiple participants (e.g., multiple senders and one receiver), that is, to calculate the intersection of the information possessed by multiple participants.
[0055] For example, in a scenario with multiple senders and one receiver, the receiver can receive encoded vectors from multiple senders for pre-screening based on similarity. Furthermore, the receiver can perform encrypted intersection processing on the unencrypted information from the receiver and multiple senders that is not included in the first intersection result to obtain an encrypted intersection result, thereby obtaining the target intersection result.
[0056] According to some embodiments, selecting at least one target vector pair based on the similarity between multiple first encoded vectors and multiple second encoded vectors includes: for each first encoded vector, calculating the similarity between the first encoded vector and each second encoded vector in the corresponding set of second encoded vectors; in response to the similarity between the first encoded vector and the second encoded vector being greater than or equal to a preset threshold, setting the first encoded vector and the second encoded vector as a target vector pair, and deleting the second encoded vector from the set of second encoded vectors corresponding to the first encoded vector to generate the set of second encoded vectors corresponding to the next first encoded vector; and in response to the similarity between the first encoded vector and each second encoded vector in the corresponding set of second encoded vectors being less than a preset threshold, setting the set of second encoded vectors corresponding to the next first encoded vector as the set of second encoded vectors corresponding to the first encoded vector, wherein the set of second encoded vectors corresponding to the first first encoded vector among the multiple first encoded vectors is all vectors among the multiple second encoded vectors.
[0057] Figure 2 An embodiment according to this disclosure is shown in Figure 1 The flowchart illustrates an exemplary process in which at least one target vector pair is selected based on the similarity between multiple first encoding vectors and multiple second encoding vectors (step S102).
[0058] In step S201, for each first encoding vector, the similarity between the first encoding vector and each second encoding vector in the corresponding set of second encoding vectors is calculated.
[0059] According to some embodiments, the similarity between each first coding vector and each second coding vector in the corresponding set of second coding vectors is calculated sequentially according to the order of the first coding vectors among multiple first coding vectors.
[0060] In step S202, in response to the similarity between the first encoding vector and the second encoding vector being greater than or equal to a preset threshold, the first encoding vector and the second encoding vector are set as a pair of target vectors, and the second encoding vector is deleted from the set of second encoding vectors corresponding to the first encoding vector to generate the set of second encoding vectors corresponding to the next first encoding vector.
[0061] In the embodiments described in this disclosure, if a first encoding vector and a second encoding vector are successfully matched (i.e., the similarity between the first encoding vector and the second encoding vector is greater than or equal to a preset threshold), it can be considered that the matching process between the first encoding vector and the second encoding vector has been completed. Therefore, the similarity between subsequent encoding vectors and the second encoding vector is no longer calculated.
[0062] According to some embodiments, for a first encoded vector, the similarity between the first encoded vector and each of the second encoded vectors in the corresponding set of second encoded vectors is calculated one by one. After calculating the similarity between the first encoded vector and each of the second encoded vectors, it is determined whether the similarity between the first encoded vector and the second encoded vector is greater than or equal to a preset threshold. According to some embodiments, if the similarity between the first encoded vector and a second encoded vector is greater than or equal to the preset threshold, the first encoded vector and the second encoded vector are set as a target vector pair, and the similarity between the first encoded vector and the remaining second encoded vectors in the corresponding set of second encoded vectors is no longer calculated.
[0063] According to other embodiments, the similarity between the first encoding vector and all second encoding vectors in the corresponding set of second encoding vectors can be calculated first, and then it can be determined whether the first encoding vector matches all second encoding vectors in the corresponding set of second encoding vectors.
[0064] In step S203, in response to the fact that the similarity between the first encoding vector and each of the second encoding vectors in the corresponding second encoding vector set is less than a preset threshold, the second encoding vector set corresponding to the next first encoding vector is set as the second encoding vector set corresponding to the first encoding vector, wherein the second encoding vector set corresponding to the first first encoding vector among the multiple first encoding vectors is all the vectors among the multiple second encoding vectors.
[0065] In the embodiments described in this disclosure, if none of the second coding vectors in the corresponding second coding vector set match the first coding vector, then the similarity between the subsequent coding vectors and the second coding vectors in the corresponding second coding vector set is calculated.
[0066] As per reference Figure 2 In the described embodiment, since each first encoded vector is matched with each second encoded vector in the corresponding set of second encoded vectors, the matching vectors among multiple first encoded vectors and multiple second encoded vectors can be screened as comprehensively as possible, so as to minimize the amount of information that needs to be processed in the subsequent encryption intersection process.
[0067] According to some embodiments, selecting at least one target vector pair based on the similarity between multiple first encoded vectors and multiple second encoded vectors includes: for each first encoded vector, calculating the similarity between the first encoded vector and each second encoded vector in the corresponding set of second encoded vectors; sorting the second encoded vectors in the corresponding set of second encoded vectors in descending order according to the similarity between the first encoded vector and each second encoded vector in the corresponding set of second encoded vectors; in response to the first encoded vector and the first second encoded vector in the corresponding set of second encoded vectors having a similarity greater than or equal to a preset threshold, setting the first encoded vector and the first second encoded vector as a target vector pair; and setting the set of second encoded vectors corresponding to the next first encoded vector as the set of second encoded vectors from the second to the last in the set of second encoded vectors corresponding to the first encoded vector, wherein the set of second encoded vectors corresponding to the first first encoded vector among multiple first encoded vectors is all vectors in the set of second encoded vectors.
[0068] Figure 3 An embodiment according to this disclosure is shown in Figure 1 The flowchart illustrates an exemplary process in which at least one target vector pair is selected based on the similarity between multiple first encoding vectors and multiple second encoding vectors (step S102).
[0069] In step S301, for each first encoding vector, the similarity between the first encoding vector and each second encoding vector in the corresponding set of second encoding vectors is calculated.
[0070] According to some embodiments, the similarity between each first coding vector and each second coding vector in the corresponding set of second coding vectors is calculated sequentially according to the order of the first coding vectors among multiple first coding vectors.
[0071] In step S302, the second coding vectors in the corresponding second coding vector set are sorted in descending order based on the similarity between the first coding vector and each second coding vector in the corresponding second coding vector set.
[0072] According to some embodiments, after completing the descending sorting step in step S302, the first second coding vector in the corresponding second coding vector set is the second coding vector in the corresponding second coding vector set that has the highest similarity to the first coding vector.
[0073] In step S303, in response to the first encoding vector having a similarity to the first second encoding vector in the corresponding set of second encoding vectors being greater than or equal to a preset threshold, the first encoding vector and the first second encoding vector are set as a pair of target vectors.
[0074] According to some embodiments, in response to the first encoding vector having a similarity of less than a preset threshold with the first second encoding vector in the corresponding set of second encoding vectors, it is considered that the first encoding vector does not match the first second encoding vector.
[0075] In step S304, the set of second encoding vectors corresponding to the next first encoding vector is set as the set of second encoding vectors from the second to the last one in the set of second encoding vectors corresponding to the first first encoding vector, wherein the set of second encoding vectors corresponding to the first first encoding vector among the multiple first encoding vectors is all the vectors in the second encoding vector.
[0076] As per reference Figure 3 In the described embodiment, since for a first encoding vector, only the first encoding vector is matched with the second encoding vector with the highest similarity in the corresponding set of second encoding vectors, and the next first encoding vector is not matched with the second encoding vector with the highest similarity, the efficiency of matching encoding vectors by similarity can be improved, thereby completing the pre-screening process faster.
[0077] According to some embodiments, the similarity between multiple first coding vectors and multiple second coding vectors includes the cosine similarity of the similarity between the multiple first coding vectors and multiple second coding vectors.
[0078] According to some embodiments, cosine similarity is the cosine value of the angle between two vectors in a vector space. The closer the cosine value is to 1, the closer the angle between the vectors is to 0 degrees, that is, the more similar the two vectors are.
[0079] According to some embodiments, performing encrypted intersection processing on unencrypted information that is not included in the first intersection result from both a plurality of first unencrypted information and a plurality of second unencrypted information includes: sending a second encoded vector from at least one target vector pair to a sender; performing an encryption operation on the first unencrypted information that is not included in the first intersection result from the plurality of first unencrypted information to generate first encrypted information; in response to receiving second encrypted information from the sender, performing an intersection operation on the first encrypted information and the second encrypted information to obtain an encrypted intersection result, wherein the second encrypted information is generated based on the second unencrypted information that is not included in the first intersection result from the plurality of second unencrypted information; and decrypting the encrypted intersection result to obtain the second intersection result.
[0080] Figure 4 An embodiment according to this disclosure is shown in Figure 1The flowchart illustrates an exemplary process in which, based on the first intersection result, unencrypted information that is not included in the first intersection result is encrypted and intersected (step S104) from both multiple first unencrypted information and multiple second unencrypted information.
[0081] At step S401, the second encoded vector of at least one target vector pair is sent to the sender.
[0082] According to some embodiments, instead of the second encoding vector, the first intersection result determined by the receiver based on the first encoding vector in at least one target vector pair can also be sent to the sender.
[0083] In step S402, encryption operations are performed on the first unencrypted information that is not included in the first intersection result among the multiple first unencrypted information to generate first encrypted information.
[0084] In step S403, in response to receiving the second encrypted information from the sender, an intersection operation is performed on the first encrypted information and the second encrypted information to obtain the encrypted intersection result.
[0085] According to some embodiments, the second encrypted information is generated based on second unencrypted information from a plurality of second unencrypted information that was not included in the first intersection result. According to some embodiments, the sender performs encryption operations on the second unencrypted information from the plurality of second unencrypted information that was not included in the first intersection result to generate the second encrypted information. According to some embodiments, the receiver and the sender use the same or similar encryption operation methods.
[0086] In step S404, the encrypted intersection result is decrypted to obtain the second intersection result.
[0087] Therefore, in the embodiments described in this disclosure, in the process of obtaining the second intersection result, it is only necessary to encrypt the unencrypted information that is not included in the first intersection result from both the multiple first unencrypted information and the multiple second unencrypted information, and it is only necessary to receive the unencrypted information that is not included in the first intersection result from both of the multiple second unencrypted information. This reduces the amount of communication between the receiver and the sender, the amount of computation for the receiver regarding encryption, intersection and decryption, and the amount of computation for the sender regarding encryption.
[0088] According to some embodiments, multiple first unencrypted information pieces correspond one-to-one with multiple first encoded vectors, and generating a first intersection result based on at least one target vector pair includes: filtering out the first unencrypted information pieces corresponding to the first encoded vectors in at least one target vector pair as the first intersection result.
[0089] According to some embodiments, encoding multiple first unencrypted messages from the recipient to generate multiple first encoding vectors includes: encoding each first unencrypted message to generate a first encoding vector corresponding to that first unencrypted message.
[0090] According to some embodiments, encoding multiple first unencrypted messages from the recipient includes: for each first unencrypted message, in response to determining that the first unencrypted message includes a character portion, generating one or more character components included in a first encoding vector corresponding to the first unencrypted message based on the character portion of the first unencrypted message; and / or, in response to determining that the first unencrypted message includes a numeric portion, generating one or more numeric components included in a first encoding vector corresponding to the first unencrypted message based on the numeric portion of the first unencrypted message.
[0091] According to some embodiments, the first unencrypted information includes a character portion and / or a numeric portion. For example, for the information "qsdsde7668850112", the character portion is "qsdsde" and the numeric portion is "7668850112".
[0092] According to some embodiments, encoding multiple first unencrypted messages from the recipient further includes: extracting character and / or numeric portions from the first unencrypted messages so that corresponding components can be generated for the character and / or numeric portions respectively in subsequent processing.
[0093] According to some embodiments, the character component includes a character count component and a character content component. Generating one or more character components of the first encoded vector corresponding to the first unencrypted information based on the character portion of the first unencrypted information includes: performing deduplication processing on the character portion of the first unencrypted information to generate a non-repeating character portion of the first unencrypted information; calculating the character count of the non-repeating character portion as the character count component of the first encoded vector corresponding to the first unencrypted information; and converting the non-repeating character portion based on a preset character content conversion rule to generate the character content component of the first encoded vector corresponding to the first unencrypted information.
[0094] According to some embodiments, deduplication of the character portion of the first unencrypted information to generate a non-repeating character portion of the first unencrypted information includes: for each character in the character portion, determining whether the portion of the character portion preceding the character includes a character identical to the character; wherein, if the portion of the character portion preceding the character includes a character identical to the character, the character is deleted from the character portion; and if the portion of the character portion preceding the character does not include a character identical to the character, the character is retained.
[0095] According to some embodiments, the preset character content conversion rule is ASCII code-number conversion.
[0096] For example, for the information "qsdsde7668850112", the non-repeating character part of the information is "qsde", the corresponding character number component is 4, and the character content component is "113 115 100 101".
[0097] According to some embodiments, the digital component includes a digital length component, a digital content component, and a digital number component. Generating one or more digital components of the first encoded vector corresponding to the first unencrypted information based on the digital portion of the first unencrypted information includes: determining the digital length component of the first encoded vector corresponding to the first unencrypted information based on the length of the digital portion of the first unencrypted information; performing deduplication processing on the digital portion of the first unencrypted information to generate a non-repeating digital portion of the first unencrypted information; generating the digital content component of the first encoded vector corresponding to the first unencrypted information based on the non-repeating digital portion of the first unencrypted information; and calculating the number of digits in the non-repeating digital portion as the digital number component of the first encoded vector corresponding to the first unencrypted information.
[0098] According to some embodiments, deduplication of the digital portion of the first unencrypted information to generate a non-repeating digital portion of the first unencrypted information includes: for each number in the digital portion, determining whether the portion of the digital portion preceding the number includes a number identical to the number, wherein if the portion of the digital portion preceding the number includes a number identical to the number, the number is deleted from the digital portion, and if the portion of the digital portion preceding the number does not include a number identical to the number, the number is retained.
[0099] According to some embodiments, generating a digital content component of a first encoded vector corresponding to the first unencrypted information based on the non-repeating digital portion of the first unencrypted information includes: sorting the non-repeating digital portion of the first unencrypted information in ascending order to generate a digital content component of a first encoded vector corresponding to the first unencrypted information.
[0100] For example, for the information "qsdsde7668850112", the non-repeating digit part of the information is "7685012", the corresponding digit length component is "10", the digit content component is "0125678", and the digit number component is "7".
[0101] According to some embodiments, encrypting first unencrypted information that is not included in the first intersection result among multiple first unencrypted information includes: for each first unencrypted information, generating obfuscated data corresponding to the first unencrypted information based on the length of the first unencrypted information or the length of the digital portion of the first unencrypted information; and performing encryption operations on the first unencrypted information and the obfuscated data corresponding to the first unencrypted information to generate first encrypted information corresponding to the first unencrypted information.
[0102] In the embodiments described in this disclosure, by adaptively generating obfuscated data for encryption, the problems of large computational load and excessively long encrypted information caused by traditional encryption processing are avoided.
[0103] According to some embodiments, the encryption operation for the first unencrypted information and the obfuscated data corresponding to the first unencrypted information includes: performing an XOR operation on the numerical part of the first unencrypted information and the obfuscated data corresponding to the first unencrypted information; and / or, encrypting the character part of the first unencrypted information according to a preset character encryption rule.
[0104] According to some embodiments, the preset character encryption rules include: for each character in the first unencrypted information, converting the character into ASCII code according to the character-ASCII code conversion rules; adding the ASCII code to the preset character encryption value to obtain the encrypted ASCII code; and converting the encrypted ASCII code into the encrypted character corresponding to the character according to the ASCII code-character conversion rules.
[0105] For example, the first unencrypted information is "A123456789A", where the number part of the first unencrypted information is "123456789" (decimal, corresponding to binary "0001 0010 0011 0100 0101 0110 0111 10001001"), and the corresponding obfuscated data is "0000000001" (decimal, corresponding to binary "0000 0000 0000 0000 0000 0000 0000 0000 0000 0001"), which has the same length as the number part of the first unencrypted information. The corresponding preset character encryption value is "1", therefore, the encrypted information is "B123456788B".
[0106] According to some embodiments, the data intersection method described in this disclosure further includes sending the target intersection result to the sender. According to other embodiments, the target intersection result may not be sent to the sender to ensure the privacy of the target intersection result.
[0107] This disclosure also provides a data intersection method applied to a sender in a federated learning task, the federated learning task also including a receiver connected in communication with the sender. The method includes: encoding multiple pieces of second unencrypted information from the sender to generate multiple second encoded vectors; sending the multiple second encoded vectors to the receiver, so that the receiver performs: filtering at least one target vector pair based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors, wherein the multiple first encoded vectors are generated based on the multiple pieces of first unencrypted information from the receiver, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold; generating a first intersection result based on the at least one target vector pair; performing encrypted intersection processing on the unencrypted information in both the multiple first unencrypted information and the multiple second unencrypted information that is not included in the first intersection result, based on the first intersection result, to obtain a second intersection result; and determining a target intersection result based on the first intersection result and the second intersection result, wherein the target intersection result is the feature information of the same user in the multiple first unencrypted information and the multiple second unencrypted information.
[0108] Figure 5 A flowchart of a data intersection method 500 according to an exemplary embodiment of the present disclosure is shown.
[0109] In step S501, the multiple unencrypted second messages from the sender are encoded to generate multiple second encoded vectors.
[0110] According to some embodiments, as referenced above Figure 1 As described, the receiver is the role of receiving data owned by other participants (e.g., the sender as defined above) through encrypted transmission, while the sender is the role of transmitting its owned data to other participants in encrypted form. For example, in the online advertising example described above, the receiver is the merchant, and the sender is the advertising sender.
[0111] According to some embodiments, the multiple unencrypted second messages may be user information owned by the sender, wherein each unencrypted second message corresponds to a user. For example, in the embodiment described above for calculating the actual effect of online advertising, the second unencrypted information is user information owned by the advertising sender, such as user ID, user identity information, etc.
[0112] According to some embodiments, the process of encoding multiple unencrypted second messages from the sender can be similar to that described in the reference. Figure 1 The process of encoding multiple unencrypted messages from the recipient is the same or similar.
[0113] In step S502, multiple second encoded vectors are sent to the receiver.
[0114] According to some embodiments, the sender sends multiple second encoded vectors to the receiver, causing the receiver to perform as described in the reference. Figure 1 The steps S102 to S105 are described.
[0115] According to some embodiments, the data intersection method described in this disclosure further includes: in response to receiving a second encoded vector from at least one target vector pair from the receiver, performing an encryption operation on unencrypted information in a plurality of second unencrypted information that is not included in the first intersection result to generate second encrypted information; and sending the second encrypted information to the receiver so that the receiver generates the target intersection result between the sender and the receiver.
[0116] According to some embodiments, such as reference Figure 4 As described in step S401, instead of the second encoded vector, the sender can receive the first intersection result from the receiver.
[0117] According to some embodiments, such as reference Figure 4 As described in steps S403-S404, in response to receiving second encrypted information from the sender, the receiver performs an intersection operation on the first and second encrypted information to obtain an encrypted intersection result, and then decrypts the encrypted intersection result to obtain a second intersection result. According to some embodiments, the receiver obtains the target intersection result based on the first and second intersection results.
[0118] According to some embodiments, multiple unencrypted second messages correspond one-to-one with multiple second encoded vectors.
[0119] According to some embodiments, encoding multiple second unencrypted messages from the sender to generate multiple second encoding vectors includes: encoding each second unencrypted message to generate a second encoding vector corresponding to that second unencrypted message.
[0120] According to some embodiments, encoding multiple second unencrypted messages from the sender includes: for each second unencrypted message, in response to determining that the second unencrypted message includes a character portion, generating one or more character components included in the second encoding vector corresponding to the second unencrypted message based on the character portion of the second unencrypted message; and / or, for each second unencrypted message, in response to determining that the second unencrypted message includes a number portion, generating one or more number components included in the second encoding vector corresponding to the second unencrypted message based on the number portion of the second unencrypted message.
[0121] According to some embodiments, the process of generating one or more character components of the second encoding vector corresponding to the second unencrypted information based on the character portion of the second unencrypted information can be the same as or similar to the process of generating one or more character components of the first encoding vector corresponding to the first unencrypted information based on the character portion of the first unencrypted information.
[0122] According to some embodiments, the process of generating one or more digital components of the second encoded vector corresponding to the second unencrypted information based on the digital portion of the second unencrypted information can be the same as or similar to the process of generating one or more digital components of the first encoded vector corresponding to the first unencrypted information based on the digital portion of the first unencrypted information.
[0123] According to some embodiments, the character component includes a character count component and a character content component. Generating one or more character components of the second encoded vector corresponding to the second unencrypted information based on the character portion of the second unencrypted information includes: performing deduplication processing on the character portion of the second unencrypted information to generate a non-repeating character portion of the second unencrypted information; calculating the character count of the non-repeating character portion as the character count component of the second encoded vector corresponding to the second unencrypted information; and converting the non-repeating character portion based on a preset character content conversion rule to generate the character content component of the second encoded vector corresponding to the second unencrypted information.
[0124] According to some embodiments, the digital component includes a digital length component, a digital content component, and a digital number component. Generating one or more digital components of the second encoded vector corresponding to the second unencrypted information based on the digital portion of the second unencrypted information includes: determining the digital length component of the second encoded vector corresponding to the second unencrypted information based on the length of the digital portion of the second unencrypted information; performing deduplication processing on the digital portion of the second unencrypted information to generate a non-repeating digital portion of the second unencrypted information; generating the digital content component of the second encoded vector corresponding to the second unencrypted information based on the non-repeating digital portion of the second unencrypted information; and calculating the digital number of the non-repeating digital portion as the digital number component of the second encoded vector corresponding to the second unencrypted information.
[0125] According to some embodiments, the similarity between multiple second-coded vectors includes the cosine similarity of the similarity between multiple second-coded vectors.
[0126] According to some embodiments, encrypting unencrypted information in a plurality of second unencrypted information that is not included in the first intersection result includes: for each second unencrypted information, generating obfuscated data corresponding to the second unencrypted information based on the length of the second unencrypted information or the length of the digital portion of the second unencrypted information; and performing encryption operations on the second unencrypted information and the obfuscated data corresponding to the second unencrypted information to generate second encrypted information corresponding to the second unencrypted information.
[0127] According to some embodiments, the process of encrypting the unencrypted information in multiple second unencrypted information that is not included in the first intersection result can be the same as or similar to the process of encrypting the unencrypted information in multiple first unencrypted information that is not included in the first intersection result described above.
[0128] According to some embodiments, the data intersection method described in this disclosure further includes: receiving a target intersection result from a receiver.
[0129] Figure 6 A structural block diagram of a data intersection apparatus 600 according to an exemplary embodiment of the present disclosure is shown. According to some embodiments, the data intersection apparatus 600 is applied to a receiver in a federated learning task, which also includes a sender communicatively connected to the receiver.
[0130] like Figure 6 The data intersection device 600 includes: an encoding module 601 configured to encode multiple first unencrypted messages from the receiver to generate multiple first encoded vectors; and a vector matching module 602 configured to, in response to receiving multiple second encoded vectors from the sender, filter at least one target vector pair based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors, wherein the multiple second encoded vectors are generated based on the multiple second unencrypted messages from the sender, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold. Intersection module 603 is configured to: generate a first intersection result based on at least one target vector pair; second intersection module 604 is configured to: perform encrypted intersection processing on unencrypted information that is not included in the first intersection result from multiple first unencrypted information and multiple second unencrypted information, based on the first intersection result, to obtain a second intersection result; and target intersection module 605 is configured to: determine a target intersection result based on the first intersection result and the second intersection result, wherein the target intersection result is the feature information of the same user from multiple first unencrypted information and multiple second unencrypted information.
[0131] Figure 7A structural block diagram of a data intersection apparatus 700 according to an exemplary embodiment of the present disclosure is shown. According to some embodiments, the data intersection apparatus 700 is applied to a sender in a federated learning task, which also includes a receiver communicatively connected to a receiver.
[0132] like Figure 7 As shown, the data intersection device 700 includes: an encoding module 701 configured to: encode multiple pieces of second unencrypted information from the sender to generate multiple second encoded vectors; and a first sending module 702 configured to: send the multiple second encoded vectors to a receiver, causing the receiver to perform: filtering at least one target vector pair based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors, wherein the multiple first encoded vectors are generated based on the multiple pieces of first unencrypted information from the receiver, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold; generating a first intersection result based on the at least one target vector pair; performing encrypted intersection processing on the unencrypted information in both the multiple first unencrypted information and the multiple second unencrypted information that is not included in the first intersection result, based on the first intersection result, to obtain a second intersection result; and determining a target intersection result based on the first intersection result and the second intersection result, wherein the target intersection result is the feature information of the same user in the multiple first unencrypted information and the multiple second unencrypted information.
[0133] Figure 8 A structural block diagram of a federated learning system 800 according to an exemplary embodiment of the present disclosure is shown.
[0134] like Figure 8 As shown, the federated learning system 800 includes a first data intersection device 801 and a second data intersection device 802.
[0135] According to some embodiments, the first data intersection device 801 may be a reference Figure 6 The described data intersection device 600, and the second data intersection device 802 can be a reference. Figure 7 The described data intersection device 700.
[0136] According to another aspect of this disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the data intersection method described above.
[0137] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to cause the computer to perform the above-described data intersection method.
[0138] According to another aspect of this disclosure, a computer program product is also provided, including a computer program, wherein the computer program, when executed by a processor, implements the above-described data intersection method.
[0139] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0140] See Figure 9 The following description serves as a structural block diagram of the electronic device 900 disclosed herein, which is an example of a hardware device applicable to various aspects of this disclosure. The electronic device can be different types of computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the disclosure described and / or claimed herein.
[0141] Figure 9 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. (As follows) Figure 9 As shown, the electronic device 900 may include at least one processor 901, working memory 902, I / O device 904, display device 905, storage device 906 and communication interface 907 that are capable of communicating with each other via system bus 903.
[0142] Processor 901 may be a single processing unit or multiple processing units, and all processing units may include single or multiple computing units or multiple cores. Processor 901 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuits, and / or any device that manipulates signals based on operating instructions. Processor 901 may be configured to acquire and execute computer-readable instructions stored in working memory 902, storage device 906, or other computer-readable media, such as program code of operating system 902a, program code of application program 902b, etc.
[0143] Working memory 902 and storage device 906 are examples of computer-readable storage media for storing instructions that are executed by processor 901 to perform the various functions described above. Working memory 902 may include both volatile and non-volatile memory (e.g., RAM, ROM, etc.). Furthermore, storage device 906 may include hard disk drives, solid-state drives, removable media including external and removable drives, memory cards, flash memory, floppy disks, optical disks (e.g., CDs, DVDs), storage arrays, network-attached storage, storage area networks, etc. Working memory 902 and storage device 906 may be collectively referred to herein as memory or computer-readable storage media, and may be non-transitory media capable of storing computer-readable, processor-executable program instructions as computer program code that can be executed by processor 901 as a specific machine configured to perform the operations and functions described in the examples herein.
[0144] I / O device 904 may include input devices and / or output devices. Input devices may be any type of device capable of inputting information to electronic device 900, and may include, but are not limited to, a mouse, keyboard, touch screen, trackpad, trackball, joystick, microphone, and / or remote control. Output devices may be any type of device capable of presenting information, and may include, but are not limited to, video / audio output terminals, vibrators, and / or printers.
[0145] The communication interface 907 allows the electronic device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and / or chipsets, such as Bluetooth™ devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices and / or the like.
[0146] The application program 902b in working register 902 can be loaded to execute the various methods and processes described above, such as method 100 and / or 500. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 900 via storage device 906 and / or communication interface 907. When the computer program is loaded and executed by processor 901, one or more steps of the encryption methods described above can be performed.
[0147] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0148] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0149] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0150] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0151] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0152] A computing system may include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other.
[0153] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0154] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. A data intersection method, the method being applied to a receiver in a federated learning task, the federated learning task further including a sender communicatively connected to the receiver, the method comprising: The multiple unencrypted messages from the receiver are encoded to generate multiple first encoded vectors; In response to receiving multiple second encoded vectors from the sender, at least one target vector pair is selected based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors, wherein the multiple second encoded vectors are generated based on multiple second unencrypted information from the sender, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold. Based on the at least one target vector pair, generate a first intersection result; Based on the first intersection result, the unencrypted information that was not included in the first intersection result from either the plurality of first unencrypted information or the plurality of second unencrypted information is subjected to encrypted intersection processing to obtain a second intersection result; and Based on the first intersection result and the second intersection result, a target intersection result is determined, wherein the target intersection result is the feature information of the same user in the plurality of first unencrypted information and the plurality of second unencrypted information.
2. The method as described in claim 1, wherein, The step of selecting at least one target vector pair based on the similarity between the plurality of first encoded vectors and the plurality of second encoded vectors includes: For each first encoded vector, calculate the similarity between the first encoded vector and each second encoded vector in the corresponding set of second encoded vectors; In response to the similarity between the first encoding vector and the second encoding vector being greater than or equal to a preset threshold, the first encoding vector and the second encoding vector are set as a pair of target vectors, and the second encoding vector is deleted from the set of second encoding vectors corresponding to the first encoding vector to generate the set of second encoding vectors corresponding to the next first encoding vector. as well as In response to the fact that the similarity between the first encoded vector and each of the corresponding second encoded vectors in the second encoded vector set is less than a preset threshold, the second encoded vector set corresponding to the next first encoded vector is set as the second encoded vector set corresponding to the first encoded vector. Wherein, the set of second encoding vectors corresponding to the first first encoding vector among the plurality of first encoding vectors is all the vectors among the plurality of second encoding vectors.
3. The method as described in claim 1, wherein, The step of selecting at least one target vector pair based on the similarity between the plurality of first encoded vectors and the plurality of second encoded vectors includes: For each first encoded vector, calculate the similarity between the first encoded vector and each second encoded vector in the corresponding set of second encoded vectors; Based on the similarity between the first encoding vector and each second encoding vector in the corresponding second encoding vector set, the second encoding vectors in the corresponding second encoding vector set are sorted in descending order; In response to the first encoded vector having a similarity greater than or equal to a preset threshold with a first second encoded vector in the corresponding set of second encoded vectors, the first encoded vector and the first second encoded vector are set as a target vector pair; and Set the set of second encoded vectors corresponding to the next first encoded vector to the second encoded vectors from the second to the last in the set of second encoded vectors corresponding to the first encoded vector. Wherein, the set of second encoding vectors corresponding to the first first encoding vector among the plurality of first encoding vectors is all the vectors in the second encoding vector.
4. The method of claim 1, wherein, The encryption and intersection process for the unencrypted information that is not included in the first intersection result from either the plurality of first unencrypted information or the plurality of second unencrypted information includes: Send the second encoded vector from the at least one target vector pair to the sender; Encryption operations are performed on the first unencrypted information that is not included in the first intersection result among the multiple first unencrypted information to generate first encrypted information; In response to receiving second encrypted information from the sender, an intersection operation is performed on the first encrypted information and the second encrypted information to obtain an encrypted intersection result, wherein the second encrypted information is generated based on second unencrypted information from the plurality of second unencrypted information that is not included in the first intersection result; and The encrypted intersection result is decrypted to obtain the second intersection result.
5. The method of claim 1, wherein, The plurality of first unencrypted information pieces correspond one-to-one with the plurality of first encoded vectors, and the step of generating a first intersection result based on the at least one target vector pair includes: The first unencrypted information corresponding to the first encoded vector in the at least one target vector pair is selected as the first intersection result.
6. The method of claim 5, wherein, The encoding of the multiple unencrypted messages from the recipient includes: For each first unencrypted message, in response to determining that the first unencrypted message includes a character portion, based on the character portion of the first unencrypted message, one or more character components included in the first encoded vector corresponding to the first unencrypted message are generated; and / or, In response to determining that the first unencrypted information includes a digital portion, one or more digital components included in the first encoded vector corresponding to the first unencrypted information are generated based on the digital portion of the first unencrypted information.
7. The method of claim 6, wherein, The character component includes a character count component and a character content component, and the step of generating one or more character components of the first encoding vector corresponding to the first unencrypted information based on the character portion of the first unencrypted information includes: The character portion of the first unencrypted information is deduplicated to generate a non-repeating character portion of the first unencrypted information; Calculate the number of characters in the non-repeating character portion, and use this as the character count component of the first encoded vector corresponding to the first unencrypted information; and Based on preset character content conversion rules, the non-repeating character portion is converted to generate the character content component of the first encoded vector corresponding to the first unencrypted information.
8. The method of claim 6, wherein, The digital components include a digital length component, a digital content component, and a digital number component, and the step of generating one or more digital components of the first encoded vector corresponding to the first unencrypted information based on the digital portion of the first unencrypted information includes: Based on the length of the digital portion of the first unencrypted information, determine the digital length component of the first encoded vector corresponding to the first unencrypted information; The digital portion of the first unencrypted information is deduplicated to generate a non-repeating digital portion of the first unencrypted information; Based on the non-repeating digital portion of the first unencrypted information, a digital content component of the first encoded vector corresponding to the first unencrypted information is generated; and The number of digits in the non-repeating digit portion is calculated and used as the digit component of the first encoded vector corresponding to the first unencrypted information.
9. The method according to any one of claims 1-8, wherein, The similarity between the plurality of first encoding vectors and the plurality of second encoding vectors includes the cosine similarity between the similarities of the plurality of first encoding vectors and the plurality of second encoding vectors.
10. The method according to any one of claims 1-8, wherein, The encryption operation on the first unencrypted information that is not included in the first intersection result from multiple first unencrypted information includes: For each piece of first unencrypted information, based on the length of the first unencrypted information or the length of the numerical portion of the first unencrypted information, obfuscated data corresponding to the first unencrypted information is generated; and Encryption operations are performed on the first unencrypted information and the obfuscated data corresponding to the first unencrypted information to generate the first encrypted information corresponding to the first unencrypted information.
11. The method of any one of claims 1-8, further comprising: The intersection result of the target is sent to the sender.
12. A data intersection method, said method being applied to a sender in a federated learning task, said federated learning task further including a receiver communicatively connected to said sender, said method comprising: The sender's multiple unencrypted second messages are encoded to generate multiple second encoded vectors; Send the plurality of second encoded vectors to the receiver so that the receiver performs: Based on the similarity between multiple first encoded vectors and multiple second encoded vectors, at least one target vector pair is selected, wherein the multiple first encoded vectors are generated based on multiple first unencrypted information from the receiver, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold. Based on the at least one target vector pair, generate a first intersection result; Based on the first intersection result, the unencrypted information that was not included in the first intersection result from either the plurality of first unencrypted information or the plurality of second unencrypted information is subjected to encrypted intersection processing to obtain a second intersection result; and Based on the first intersection result and the second intersection result, a target intersection result is determined, wherein the target intersection result is the feature information of the same user in the plurality of first unencrypted information and the plurality of second unencrypted information.
13. The method of claim 12, further comprising: In response to receiving a second encoded vector from the at least one target vector pair from the receiver, an encryption operation is performed on the unencrypted information in the plurality of second unencrypted information that is not included in the first intersection result to generate second encrypted information; as well as The second encrypted information is sent to the receiver so that the receiver generates the target intersection result between the sender and the receiver.
14. The method of claim 12, wherein, Each of the multiple unencrypted second pieces of information corresponds one-to-one with each of the multiple second encoded vectors.
15. The method of claim 14, wherein, The encoding of the multiple unencrypted second messages from the sender includes: For each piece of second unencrypted information, in response to determining that the second unencrypted information includes a character portion, based on the character portion of the second unencrypted information, one or more character components included in the second encoded vector corresponding to the second unencrypted information are generated; and / or, For each second unencrypted message, in response to determining that the second unencrypted message includes a digital portion, one or more digital components included in the second encoding vector corresponding to the second unencrypted message are generated based on the digital portion of the second unencrypted message.
16. The method of claim 15, wherein, The character component includes a character number component and a character content component, and the step of generating one or more character components of the second encoding vector corresponding to the second unencrypted information based on the character portion of the second unencrypted information includes: The character portion of the second unencrypted information is deduplicated to generate a non-repeating character portion of the second unencrypted information; Calculate the number of characters in the non-repeating character portion, and use this as the character count component of the second encoded vector corresponding to the second unencrypted information; and Based on preset character content conversion rules, the non-repeating character portion is converted to generate the character content component of the second encoded vector corresponding to the second unencrypted information.
17. The method of claim 15, wherein, The digital components include a digital length component, a digital content component, and a digital number component, and the generation of one or more digital components of the second encoded vector corresponding to the second unencrypted information based on the digital portion of the second unencrypted information includes: Based on the length of the digital portion of the second unencrypted information, determine the digital length component of the second encoded vector corresponding to the second unencrypted information; The digital portion of the second unencrypted information is deduplicated to generate a non-repeating digital portion of the second unencrypted information; Based on the non-repeating digital portion of the second unencrypted information, a digital content component of the second encoded vector corresponding to the second unencrypted information is generated; and The number of digits in the non-repeating digit portion is calculated and used as the digit component of the second encoded vector corresponding to the second unencrypted information.
18. The method according to any one of claims 12-17, wherein, The similarity between the plurality of second coding vectors includes the cosine similarity between the plurality of second coding vectors and the plurality of second coding vectors.
19. The method according to any one of claims 12-17, wherein, The encryption operation on the unencrypted information in the plurality of second unencrypted information that is not included in the first intersection result includes: For each piece of second unencrypted information, based on the length of the second unencrypted information or the length of the numerical portion of the second unencrypted information, obfuscated data corresponding to the second unencrypted information is generated; and Encryption operations are performed on the second unencrypted information and the obfuscated data corresponding to the second unencrypted information to generate the second encrypted information corresponding to the second unencrypted information.
20. The method of any one of claims 12-17, further comprising: Receive the target intersection result from the receiver.
21. A data intersection apparatus, the apparatus being applied to a receiver in a federated learning task, the federated learning task further comprising a sender communicatively connected to the receiver, the apparatus comprising: The encoding module is configured to: encode multiple first unencrypted messages from the receiver to generate multiple first encoding vectors; The vector matching module is configured to: in response to receiving multiple second encoded vectors from the sender, filter out at least one target vector pair based on the similarity between the multiple first encoded vectors and the multiple second encoded vectors, wherein the multiple second encoded vectors are generated based on multiple second unencrypted information from the sender, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold. The first intersection module is configured to generate a first intersection result based on the at least one target vector pair; The second intersection module is configured to: based on the first intersection result, perform encrypted intersection processing on the unencrypted information that was not included in the first intersection result from either the plurality of first unencrypted information or the plurality of second unencrypted information, to obtain a second intersection result; and The target intersection module is configured to: determine a target intersection result based on the first intersection result and the second intersection result, wherein the target intersection result is the feature information of the same user in the plurality of first unencrypted information and the plurality of second unencrypted information.
22. A data intersection apparatus, the apparatus being applied to a sender in a federated learning task, the federated learning task further comprising a receiver communicatively connected to the sender, the apparatus comprising: The encoding module is configured to encode multiple unencrypted second messages from the sender to generate multiple second encoding vectors; as well as The first sending module is configured to send the plurality of second encoded vectors to the receiver, so that the receiver performs the following: Based on the similarity between multiple first encoded vectors and multiple second encoded vectors, at least one target vector pair is selected, wherein the multiple first encoded vectors are generated based on multiple first unencrypted information from the receiver, and the similarity between the first encoded vector and the second encoded vector in each target vector pair is greater than or equal to a preset threshold. Based on the at least one target vector pair, generate a first intersection result; Based on the first intersection result, the unencrypted information that was not included in the first intersection result from either the plurality of first unencrypted information or the plurality of second unencrypted information is subjected to encrypted intersection processing to obtain a second intersection result; and Based on the first intersection result and the second intersection result, a target intersection result is determined, wherein the target intersection result is the feature information of the same user in the plurality of first unencrypted information and the plurality of second unencrypted information.
23. A federated learning system, comprising the data intersection apparatus as described in claim 21 and the data intersection apparatus as described in claim 22.
24. An electronic device, comprising: At least one processor; as well as A memory that is communicatively connected to the at least one processor; in The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-20.
25. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-20.
26. A computer program product comprising a computer program, wherein, The computer program, when executed by a processor, implements the method of any one of claims 1-20.
Citation Information
Patent Citations
Joint authentication method suitable for dynamic connection scene and server
CN110381509A
Data processing method and device
CN112269904A