Two-party joint feature processing method, device and system based on privacy protection
By using the collaboration of random representation and mapping function to calculate differences and intermediate functions in joint feature processing of two parties for privacy protection, the problems of high communication volume and data leakage in the existing technology are solved, and efficient feature mapping and privacy are achieved. Protect.
Patent Information
- Application Number
- CN202111074303.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-14
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-09-14
AI Technical Summary
In machine learning, existing technologies are difficult to effectively reduce communication volume in privacy-preserving two-party joint feature processing, leading to problems of data leakage and low computational efficiency.
Through the collaboration between the first and second parties, random representations and mapping functions are obtained and processed, differences are calculated and processed locally, and intermediate functions and slices are obtained to ensure that the embedded representation of the feature mapped to the target space does not directly leak the mapping function to reduce communication volume.
It achieves efficient mapping of features to a shared target space without leaking the mapping function, reduces communication volume, and improves privacy protection and computing efficiency.
Smart Images

Figure CN113688425B
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the computer field, and in particular, to a two-party joint feature processing method, device, and system based on privacy protection. Background Art
[0002] Secure multi-party computing is also called multi-party secure computing, which means that multiple parties jointly calculate the result of a function without disclosing the input data of each party in the function, and the result of the calculation is made public to one or more of the parties. A typical application of secure multi-party computing is joint statistical analysis and machine learning of privacy-preserving multi-party data. Secure multi-party computing allows the participating parties to calculate statistical results and machine learning results based on the joint data of all parties without exposing their original data. The function of the multi-party secure computing is a statistical operation function and a machine learning algorithm.
[0003] In machine learning, privacy protection-based joint feature processing between two parties is often involved. One party has the feature representation of each of multiple features in its corresponding feature space, and the other party has the mapping function corresponding to each feature. The above-mentioned joint feature processing is used to map the feature representation of the corresponding feature to the shared target space through the mapping function corresponding to each feature, and sum the mapping results. Summary of the invention
[0004] One or more embodiments of the present specification describe a two-party joint feature processing method, device and system based on privacy protection, with low communication volume.
[0005] In a first aspect, a two-party joint feature processing method based on privacy protection is provided, wherein the first party has a feature representation of each feature of g features in its corresponding feature space, and the second party has g mapping functions corresponding to the g features, respectively, and each mapping function is used to map the feature representation of the corresponding feature to a shared target space. The method is performed by the first party and includes:
[0006] Obtain g first random representations in the feature space of each of the g features, and a second random representation in the target space; the g first random representations, the second random representations, the g third random functions held by the second party, and the fourth random representation in the target space satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space;
[0007] For any feature, a first difference is calculated based on the feature representation of the feature and the corresponding first random representation;
[0008] Sending the first difference to the second party, so that the second party performs local processing on a mapping function and a third random function corresponding to the feature according to the first difference to obtain a first intermediate function;
[0009] receiving the first intermediate function from the second party;
[0010] According to the first intermediate function, the g first random representations and the second random representation, a local calculation corresponding to the preset relationship is performed to obtain a first slice; the sum of the first slice and the second slice obtained by the second party is equal to the sum of the embedded representations of the g features respectively mapped in the target space.
[0011] In one possible implementation, the feature is represented as a one-hot encoded vector.
[0012] Furthermore, the target space is an m-dimensional space, the g features include a first feature, the feature space corresponding to the first feature is an n-dimensional space, and the mapping function corresponding to the first feature is used to multiply the n-dimensional one-hot encoding vector with the n*m-dimensional mapping matrix.
[0013] Further, the calculating a first difference between the feature representation based on the feature and the corresponding first random representation includes:
[0014] Determine the first digit whose value is 1 in the feature representation of the feature;
[0015] Determine a second digit whose value is 1 in the first random representation of the feature;
[0016] The difference between the first digit and the second digit is calculated to obtain the first difference.
[0017] In a possible implementation, obtaining g first random representations in the feature space of each of the g features and a second random representation in the target space includes:
[0018] Obtain from a third party g first random representations in a feature space of each of the g features generated by the third party, and a second random representation in a target space.
[0019] In a possible implementation, the preset relationship includes: the sum of results of correspondingly processing the g first random representations using the g third random functions is equal to the sum of the second random representation and the fourth random representation.
[0020] Furthermore, the local calculation includes:
[0021] For each of the g features, use the first intermediate function to process the first random representation to obtain a single processing result;
[0022] The sum of each single processing result is calculated to obtain the total processing result;
[0023] The total processing result and the second random representation are summed to obtain the first fragment.
[0024] In a second aspect, a two-party joint feature processing method based on privacy protection is provided, wherein a first party has a feature representation of each feature of g features in its corresponding feature space, and a second party has g mapping functions corresponding to the g features, each mapping function is used to map the feature representation of the corresponding feature to a shared target space, and the method includes:
[0025] The first party obtains g first random representations in the feature space of each of the g features and a second random representation in the target space;
[0026] The second party obtains g third random functions and a fourth random representation in the target space; the g first random representations, the second random representation, the g third random functions, and the fourth random representation satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space;
[0027] The first party calculates a first difference value based on a feature representation of the feature and a corresponding first random representation for any feature;
[0028] The first party sends the first difference to the second party;
[0029] The second party performs a preset transformation on the mapping function corresponding to the feature according to the first difference to obtain a transformation function, and performs local processing according to the transformation function and a third random function to obtain a first intermediate function;
[0030] The second party sends the first intermediate function to the first party;
[0031] The first party performs a local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations, and the second random representation to obtain a first shard;
[0032] The second party determines a second slice according to the fourth random representation; the sum of the first slice and the second slice is equal to the sum of the embedded representations of the g features respectively mapped in the target space.
[0033] In a possible implementation, the first party obtains g first random representations in the feature space of each of the g features, including:
[0034] The first party obtains, from the third party, g first random representations in the feature space of each of the g features generated by the third party;
[0035] The second party obtains g third random functions and a fourth random representation in the target space, including:
[0036] The second party obtains, from the third party, g third random functions generated by the third party and a fourth random representation in the target space.
[0037] In a possible implementation manner, the preset transformation satisfies:
[0038] The processing result of the transformation function on the first random representation is the same as the processing result of the mapping function on the feature representation of the corresponding feature.
[0039] Further, the mapping function corresponds to a mapping vector, and the preset transformation corresponds to cyclically shifting the mapping vector left by a first difference bit.
[0040] In a possible implementation, the preset relationship includes: the sum of results of correspondingly processing the g first random representations using the g third random functions is equal to the sum of the second random representation and the fourth random representation.
[0041] Furthermore, the local calculation includes:
[0042] The first party processes the first random representation using the first intermediate function for each of the g features to obtain a single processing result;
[0043] The sum of each single processing result is calculated to obtain the total processing result;
[0044] Performing a sum calculation on the total processing result and the second random representation to obtain the first fragment;
[0045] Determining the second fragment includes:
[0046] The second party determines the fourth random representation as the second fragment.
[0047] In a third aspect, a two-party joint feature processing device based on privacy protection is provided, wherein the first party has a feature representation of each feature of g features in its corresponding feature space, and the second party has g mapping functions corresponding to the g features, each mapping function is used to map the feature representation of the corresponding feature to a shared target space, and the device is set on the first party, including:
[0048] an acquisition unit, configured to acquire g first random representations in the feature space of each of the g features, and a second random representation in the target space; the g first random representations, the second random representations, the g third random functions held by the second party, and the fourth random representation in the target space satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space;
[0049] a difference calculation unit, configured to calculate, for any feature, a first difference based on a feature representation of the feature and a first random representation obtained by the corresponding acquisition unit;
[0050] A sending unit, configured to send the first difference obtained by the difference calculation unit to the second party, so that the second party performs local processing on a mapping function and a third random function corresponding to the feature according to the first difference to obtain a first intermediate function;
[0051] a receiving unit, configured to receive the first intermediate function from the second party;
[0052] A shard calculation unit is used to perform local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations obtained by the acquisition unit, and the second random representation to obtain a first shard; the sum of the first shard and the second shard obtained by the second party is equal to the sum of the embedded representations of the g features respectively mapped in the target space.
[0053] In a fourth aspect, a two-party joint feature processing system based on privacy protection is provided, wherein a first party has a feature representation of each of g features in its corresponding feature space, and a second party has g mapping functions corresponding to the g features, each mapping function is used to map the feature representation of the corresponding feature to a shared target space, and the system includes:
[0054] The first party is used to obtain g first random representations in the feature space of each of the g features and a second random representation in the target space;
[0055] The second party is used to obtain g third random functions and a fourth random representation in the target space; the g first random representations, the second random representations, the g third random functions, and the fourth random representation satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space;
[0056] The first party is further configured to calculate a first difference value based on a feature representation of the feature and a corresponding first random representation for any feature; and send the first difference value to the second party;
[0057] The second party is further configured to perform a preset transformation on a mapping function corresponding to the feature according to the first difference to obtain a transformation function, and perform local processing according to the transformation function and a third random function to obtain a first intermediate function; and send the first intermediate function to the first party;
[0058] The first party is further configured to perform a local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations, and the second random representation to obtain a first shard;
[0059] The second party is further used to determine a second slice according to the fourth random representation; the sum of the first slice and the second slice is equal to the sum of the embedded representations of the g features respectively mapped in the target space.
[0060] In a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of the first aspect or the second aspect.
[0061] In a sixth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect or the second aspect is implemented.
[0062] Through the method, device and system provided by the embodiments of this specification, first, the first party obtains g first random representations in the feature space of each of g features, and a second random representation in the target space; the second party obtains g third random functions and a fourth random representation in the target space; the g first random representations, the second random representation, the g third random functions and the fourth random representation satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space; then the first party calculates a first difference based on the feature representation of the feature and the corresponding first random representation for any feature; sends the first difference to the second party; then the second party performs a preset transformation on the mapping function corresponding to the feature according to the first difference to obtain a transformation function, and performs local processing according to the transformation function and the third random function to obtain a first intermediate function; sends the first intermediate function to the first party; finally, the first party performs a local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations and the second random representation to obtain a first shard; the second party determines a second shard according to the fourth random representation; the sum of the first shard and the second shard is equal to the sum of the embedded representations of the g features respectively mapped in the target space. As can be seen from the above, the embodiments of the present specification do not directly use the mapping function to map the feature representation of the corresponding feature, but the second party first locally processes the mapping function and the third random function corresponding to the feature according to the first difference to obtain the first intermediate function, and then sends the first intermediate function to the first party. Since the first intermediate function contains the random amount, the mapping function will not be leaked to the first party. The first party locally calculates according to the first intermediate function to obtain the first fragment, and the second party obtains the second fragment, which has a lower communication volume. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0064] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;
[0065] Figure 2 A schematic diagram showing an interaction method of two-party joint feature processing based on privacy protection according to an embodiment;
[0066] Figure 3 A schematic block diagram of a two-party joint feature processing device based on privacy protection according to an embodiment is shown;
[0067] Figure 4 A schematic block diagram of a two-party joint feature processing system based on privacy protection according to an embodiment is shown. DETAILED DESCRIPTION
[0068] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0069] Figure 1 This is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification. This implementation scenario involves two-party joint feature processing based on privacy protection. Figure 1 , let A i and B is an Abelian group, where i = 1, ..., g. The first party has The second party has Among them, Map(A i ,B) represents the method used to implement i The mapping space of the mapping from B to B. In the embodiment of this specification, by joint feature processing of the two parties, the first party and the second party obtain In B and shared form. It can be understood that Indicates that the first party obtains shards, Indicates that the second party obtains shards, and The sum is
[0070] In the present specification embodiment, the above x i 、f i and can have a specific meaning. In one example, Indicates that each feature in the g features corresponds to its feature space A i The feature representation in , for example, x 1 Represents feature 1 in its corresponding feature space A 1 The feature representation in x 2 Indicates that feature 2 corresponds to feature space A 2 The feature representation in , ...x g Represents feature g in its corresponding feature space A g The feature representation in . represents the g mapping functions corresponding to the g features, each mapping function is used to map the feature representation of the corresponding feature to the shared target space B, for example, f 1 Represents the mapping function corresponding to feature one, f 2 represents the mapping function corresponding to feature 2, ...f g Represents the mapping function corresponding to feature g. It means that the feature representation of the corresponding feature is mapped to the shared target space B through each mapping function, and the embedded representation of g features is obtained, and then the embedded representation is summed. For example, f 1 (x 1 ) represents the embedding representation of feature A mapped in the target space B, f 2 (x 2 ) represents the embedding representation of feature 2 mapping in the target space B, …f g (x g ) represents the embedding representation of feature g mapping in the target space B.
[0071] It can be understood that the feature space corresponding to each feature can be called the feature domain. Indicates that each feature domain is embedded independently and then summed up, which can be referred to as multi-domain embedding and sum. In deep learning, it is often necessary to embed discrete features, that is, to correspond each category to a trainable vector of preset dimensions.
[0072] The features mentioned in the embodiments of this specification generally refer to discrete features, also called classification features, whose corresponding feature space contains a finite number of feature values. For example, the feature values of discrete features are shown in Table 1.
[0073] Table 1: Examples of eigenvalues of discrete features
[0074] User Number gender nationality Education 0 male Chinese Undergraduate 1 male Full master 2 female Mongolian PhD 3 male return College
[0075] As shown in Table 1, the feature of gender includes two possible feature values, male and female; the feature of ethnicity includes a limited number of possible feature values, for example, including Han, Manchu, Mongolian, Hui, etc.; the feature of education includes a limited number of possible feature values, for example, including undergraduate, master, doctoral, college, etc.
[0076] Discrete features can be represented by an integer value. For example, for gender, 0 can represent male and 1 can represent female, or 1 can represent male and 2 can represent female, etc.
[0077] Discrete features can also use a vector as their feature representation. Usually, one-hot encoding is used to obtain the encoding vector corresponding to the feature value as its feature representation. Taking gender as an example, (0, 1) can represent male and (1, 0) can represent female.
[0078] One-hot encoding is also known as one-bit effective encoding. The method is to use an N-bit state register to encode N states. Each state has its own independent register bit, and at any time, only one of them is valid. One-hot encoding is the representation of categorical variables as binary vectors. The categorical values are mapped to integer values. Then, each integer value is represented as a binary vector, in which the positions except the above integer value are 1, and the other positions are all zero values.
[0079] In the embodiments of this specification, the two-party joint feature processing based on privacy protection belongs to secure multi-party computing. Secure multi-party computing is also called multi-party secure computing, that is, multiple parties jointly calculate the result of a function without disclosing the input data of each party of this function, and the result of the calculation is disclosed to one or more of the parties. A typical application of secure multi-party computing is the joint statistical analysis and machine learning of multi-party data with privacy protection. Secure multi-party computing allows the participating parties to calculate statistical results and machine learning results based on the joint data of all parties without exposing their respective original data.
[0080] And shared form: In two-party secure computing, it is often necessary to store an integer x from 0 to N-1 in the form of x=x_L+x_Rmod N in a distributed manner between A and B, so that A does not know x_R and B does not know x_L.
[0081] In an example, A and B are two parties involved in a bilateral secure computation. Let G be a finite Abelian group. The sum-sharing form in G means storing an element x in G in the form of a+b in both A and B. Among them, a in G is stored in A and is invisible to B; b in G is stored in B and is invisible to A; the addition in a+b refers to the addition in the Abelian group G. The secure computation in the sum-sharing form requires that A and B calculate the value of x in f: G1→G2 through some secure interactions, and store it in the form of sum-sharing in both A and B.
[0082] The first party and the second party are merely used to distinguish between the two parties. The first party may also be referred to as party P1 and the second party as party P2, or the first party may be referred to as party A and the second party may be referred to as party B, etc.
[0083] It is understandable that private data may be any data that is not convenient to be disclosed, including but not limited to data representing the user's personal information, or business secrets, etc.
[0084] In the embodiments of the present specification, in the two-party joint feature processing based on privacy protection, instead of directly mapping the feature representation of the corresponding feature to the shared target space B through each mapping function, obtaining the embedded representation of g features mapped respectively in the target space, and then summing up the embedded representations, the mapping function is transformed and the properties of the transformation are used to determine the sharding of the final result, which has a lower communication volume.
[0085] Figure 2 A schematic diagram of a method for two-party joint feature processing based on privacy protection according to an embodiment is shown. The method can be based on Figure 1 In the implementation scenario shown, the first party has a feature representation of each of the g features in its corresponding feature space, and the second party has g mapping functions corresponding to the g features, each mapping function is used to map the feature representation of the corresponding feature to the shared target space. Figure 2 As shown, the method for two-party joint feature processing based on privacy protection in this embodiment includes the following steps: Step 21, the first party obtains g first random representations in the feature space of each of g features, and a second random representation in the target space; Step 22, the second party obtains g third random functions and a fourth random representation in the target space; the g first random representations, the second random representations, the g third random functions and the fourth random representations satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space; Step 23, the first party calculates a first difference based on the feature representation of any feature and the corresponding first random representation; Step 24, the first party The first difference is sent to the second party; step 25, the second party performs a preset transformation on the mapping function corresponding to the feature according to the first difference to obtain a transformation function, and performs local processing according to the transformation function and the third random function to obtain a first intermediate function; step 26, the second party sends the first intermediate function to the first party; step 27, the first party performs a local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations and the second random representation to obtain a first shard; step 28, the second party determines the second shard according to the fourth random representation; the sum of the first shard and the second shard is equal to the sum of the embedded representations of the g features respectively mapped in the target space. The specific execution method of each of the above steps is described below.
[0086] First, in step 21, the first party obtains g first random representations in the feature space of each of the g features, and a second random representation in the target space. It can be understood that each feature has its corresponding feature space, and there are g feature spaces for g features. A first random representation is obtained from each feature space, and there are g first random representations corresponding to the g feature spaces. There is only one target space, so there is only one second random representation.
[0087] In one example, the feature is represented as a one-hot encoding vector. It can be understood that the one-hot encoding vector consists of 0s and 1s, and has only one 1.
[0088] Furthermore, the target space is an m-dimensional space, the g features include a first feature, the feature space corresponding to the first feature is an n-dimensional space, and the mapping function corresponding to the first feature is used to multiply the n-dimensional one-hot encoding vector with the n*m-dimensional mapping matrix.
[0089] In one example, the first party obtains g first random representations in the feature space of each of the g features and a second random representation in the target space, including:
[0090] The first party obtains from the third party g first random representations in the feature space of each of the g features generated by the third party, and a second random representation in the target space.
[0091] Then in step 22, the second party obtains g third random functions and a fourth random representation in the target space; the g first random representations, the second random representations, the g third random functions and the fourth random representations satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space. It can be understood that each feature has its corresponding mapping space, and there are g mapping spaces for g features, and a third random function is obtained from each mapping space, and g mapping spaces correspond to g third random functions. There is only one target space, so there is only one fourth random representation.
[0092] In one example, the second party obtains g third random functions and a fourth random representation in the target space, including:
[0093] The second party obtains, from the third party, g third random functions generated by the third party and a fourth random representation in the target space.
[0094] In this embodiment of the present specification, the third party may first generate the aforementioned g first random representations, second random representations, g third random functions, and fourth random representations that satisfy the preset relationship, and then send the g first random representations and the second random representations to the first party, and send the g third random functions and the fourth random representation to the second party.
[0095] In one example, the preset relationship includes: the sum of results of correspondingly processing the g first random representations using the g third random functions is equal to the sum of the second random representation and the fourth random representation.
[0096] For example, the third party is a semi-trusted third party that randomly generates a i in A i ,h i in Map(A i ,B),u in B,v in B, satisfying And a i and u are sent to the first party, and h i and v are sent to the second party. It can be understood that the value of i ranges from 1 to g, with a total of g features, A i Represents the feature space corresponding to the i-th feature, Map(A i ,B) represents the mapping space corresponding to the i-th feature, B represents the target space, a i represents the first random representation, u represents the second random representation, and h i The third random function, v represents the fourth random representation.
[0097] Next, in step 23, the first party calculates a first difference value for any feature based on the feature representation of the feature and the corresponding first random representation. It can be understood that g features correspond to g first differences.
[0098] In one example, the features are represented as one-hot encoded vectors.
[0099] The calculating a first difference between the feature representation based on the feature and the corresponding first random representation includes:
[0100] Determine the first digit whose value is 1 in the feature representation of the feature;
[0101] Determine a second digit whose value is 1 in the first random representation of the feature;
[0102] The difference between the first digit and the second digit is calculated to obtain the first difference.
[0103] For example, the feature representation of this feature is (0, 1, 0, 0), which is recorded as the 0th, 1st, 2nd, and 3rd bits from low to high, among which the value of 1 is the 2nd bit, that is, the first digit is 2; the first random representation of this feature is (0, 0, 0, 1), among which the value of 1 is the 0th bit, that is, the second digit is 0; calculate the difference between the first digit 2 and the second digit 0, and obtain the first difference as 2.
[0104] If x i Represents the feature representation of the i-th feature, a i represents the first random representation of the i-th feature, A i represents the feature space of the i-th feature, then the aforementioned g first differences can be expressed by the formula:
[0105] Then in step 24, the first party sends the first difference to the second party. It can be understood that the first party sends g first difference corresponding to g features to the second party.
[0106] Since the first difference is calculated by the feature representation of the feature and the corresponding first random representation, the feature representation of the feature will not be leaked.
[0107] Then in step 25, the second party performs a preset transformation on the mapping function corresponding to the feature according to the first difference to obtain a transformation function, and performs local processing according to the transformation function and the third random function to obtain a first intermediate function. It can be understood that the first intermediate function belongs to the mapping space of the corresponding feature.
[0108] In one example, the preset transformation satisfies:
[0109] The processing result of the transformation function on the first random representation is the same as the processing result of the mapping function on the feature representation of the corresponding feature.
[0110] In this example, by satisfying certain conditions of the preset transformation, the calculation of the processing result of the mapping function on the feature representation can be converted into a calculation using the transformation function. In addition, the first intermediate function is obtained by local processing based on the transformation function and the third random function, which can prevent the leakage of private data.
[0111] The conditions satisfied by the above preset transformation can be expressed by the formula: Among them, f i Represents the mapping function corresponding to the i-th feature, x i The feature representation representing the i-th feature, represents the transformation function corresponding to the i-th feature, a i Represents the first random representation corresponding to the i-th feature.
[0112] Further, the mapping function corresponds to a mapping vector, and the preset transformation corresponds to cyclically shifting the mapping vector left by a first difference bit.
[0113] The embodiment of this specification utilizes the cyclic shift invariance of the vector to implement the preset transformation. It can be understood that if the number of digits with a value of 1 in the feature representation of the feature is the first digit, and the number of digits with a value of 1 in the first random representation of the feature is the second digit, the difference between the first digit and the second digit is calculated to obtain the first difference, and the mapping vector is cyclically shifted left by the first difference bit to obtain the shift vector, then the value of the second digit of the shift vector is the same as the value of the first digit of the mapping vector.
[0114] For example, the first digit is 2, the second digit is 0, the first difference is 2, the mapping vector is (1,2,3,4), and the mapping vector is circularly shifted left by 2 bits to obtain the shift vector (3,4,1,2). The value of the second digit of the shift vector is 2, and the value of the first digit of the mapping vector is also 2, which are the same.
[0115] In the embodiment of this specification, there are g first intermediate functions, corresponding to g features respectively, which are expressed by the formula: Among them, i represents the i-th feature among g features, x i -a i represents the first difference, f i represents the mapping function, L represents the preset transformation, h i Represents the third random function, Map(A i ,B) represents the mapping space.
[0116] Then in step 26, the second party sends the first intermediate function to the first party. It can be understood that the second party sends g first intermediate functions corresponding to g features to the first party.
[0117] Since the first intermediate function is obtained by performing a preset transformation on the mapping function corresponding to the feature according to the first difference, and performing local processing based on the transformation function and the third random function, the mapping function corresponding to the feature will not be leaked.
[0118] Then in step 27, the first party performs local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations and the second random representation to obtain a first shard. It can be understood that the specific method of the above local calculation is related to the preset relationship.
[0119] In one example, the preset relationship includes: the sum of the results of processing the g first random representations using the g third random functions is equal to the sum of the second random representation and the fourth random representation. Among them, a i represents the first random representation, u represents the second random representation, and h i The third random function, v represents the fourth random representation.
[0120] Furthermore, the local calculation includes:
[0121] For each of the g features, use the first intermediate function to process the first random representation to obtain a single processing result;
[0122] The sum of each single processing result is calculated to obtain the total processing result;
[0123] The total processing result and the second random representation are summed to obtain the first fragment.
[0124] Combined with the previous example, the first intermediate function is expressed as a i represents the first random representation, u represents the second random representation, and the first shard can be expressed by the formula:
[0125] Finally, in step 28, the second party determines the second slice according to the fourth random representation; the sum of the first slice and the second slice is equal to the sum of the embedded representations of the g features respectively mapped in the target space. It can be understood that the determination methods of the first slice and the second slice are interrelated, and the determination method is not unique as long as the sum of the two is equal to the sum of the embedded representations.
[0126] In one example, determining the second fragment includes:
[0127] The second party determines the fourth random representation as the second fragment.
[0128] Combining the previous example, v represents the fourth random representation, and the second shard can be represented as v.
[0129] According to the conditions satisfied by the above preset transformation And the aforementioned preset relationship You can get the sum of the first and second fragments That is to say, it is equal to the sum of the embedded representations of the g features respectively mapped into the target space.
[0130] According to the method provided by the embodiments of the present specification, first, the first party obtains g first random representations in the feature space of each of g features, and a second random representation in the target space; the second party obtains g third random functions and a fourth random representation in the target space; the g first random representations, the second random representation, the g third random functions and the fourth random representation satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space; then, for any feature, the first party calculates a first difference based on the feature representation of the feature and the corresponding first random representation; the first difference is sent to the second party; then, the second party performs a preset transformation on the mapping function corresponding to the feature according to the first difference to obtain a transformation function, and performs local processing according to the transformation function and the third random function to obtain a first intermediate function; the first intermediate function is sent to the first party; finally, the first party performs a local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations and the second random representation to obtain a first shard; the second party determines a second shard according to the fourth random representation; the sum of the first shard and the second shard is equal to the sum of the embedded representations of the g features respectively mapped in the target space. As can be seen from the above, the embodiments of the present specification do not directly use the mapping function to map the feature representation of the corresponding feature, but the second party first locally processes the mapping function and the third random function corresponding to the feature according to the first difference to obtain the first intermediate function, and then sends the first intermediate function to the first party. Since the first intermediate function contains the random amount, the mapping function will not be leaked to the first party. The first party locally calculates according to the first intermediate function to obtain the first fragment, and the second party obtains the second fragment, which has a lower communication volume.
[0131] According to an embodiment of another aspect, a two-party joint feature processing device based on privacy protection is also provided, wherein the first party has a feature representation of each of g features in its corresponding feature space, and the second party has g mapping functions corresponding to the g features respectively, and each mapping function is used to map the feature representation of the corresponding feature to a shared target space. The device is set on the first party, and the device is used to execute the action performed by the first party in the method provided in the embodiment of this specification. Figure 3 FIG. 1 is a schematic block diagram of a two-party joint feature processing device based on privacy protection according to an embodiment. Figure 3 As shown, the device 300 includes:
[0132] The acquisition unit 31 is used to acquire g first random representations in the feature space of each of the g features, and a second random representation in the target space; the g first random representations, the second random representations, the g third random functions held by the second party, and the fourth random representation in the target space satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space;
[0133] A difference calculation unit 32, configured to calculate a first difference for any feature based on a feature representation of the feature and a corresponding first random representation obtained by the obtaining unit 31;
[0134] A sending unit 33, configured to send the first difference obtained by the difference calculation unit 32 to the second party, so that the second party performs local processing on a mapping function and a third random function corresponding to the feature according to the first difference to obtain a first intermediate function;
[0135] A receiving unit 34, configured to receive the first intermediate function from the second party;
[0136] The shard calculation unit 35 is used to perform local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations obtained by the acquisition unit 31, and the second random representation to obtain a first shard; the sum of the first shard and the second shard obtained by the second party is equal to the sum of the embedded representations of the g features respectively mapped in the target space.
[0137] Optionally, as an embodiment, the feature is represented as a one-hot encoded vector.
[0138] Furthermore, the target space is an m-dimensional space, the g features include a first feature, the feature space corresponding to the first feature is an n-dimensional space, and the mapping function corresponding to the first feature is used to multiply the n-dimensional one-hot encoding vector with the n*m-dimensional mapping matrix.
[0139] Further, the difference calculation unit 32 includes:
[0140] A first determining subunit, used to determine the first digit whose value is 1 in the feature representation of the feature;
[0141] A second determination subunit, used to determine a second digit whose value is 1 in the first random representation of the feature;
[0142] The difference calculation subunit is used to calculate the difference between the first digit obtained by the first determination subunit and the second digit obtained by the second determination subunit to obtain the first difference.
[0143] Optionally, as an embodiment, the acquisition unit 31 is specifically configured to acquire, from a third party, g first random representations in a feature space of each of g features generated by the third party, and a second random representation in a target space.
[0144] Optionally, as an embodiment, the preset relationship includes: the sum of results of correspondingly processing the g first random representations using the g third random functions is equal to the sum of the second random representation and the fourth random representation.
[0145] Furthermore, the sharding calculation unit 35 includes:
[0146] a single processing subunit, configured to process the first random representation using the first intermediate function for each feature in the g features to obtain a single processing result;
[0147] A first summing subunit is used to sum the individual processing results obtained by the individual processing subunits to obtain a total processing result;
[0148] The second summing subunit is used to sum the total processing result obtained by the first summing subunit and the second random representation to obtain the first fragment.
[0149] The device provided in the embodiments of this specification does not directly use a mapping function to map the feature representation of the corresponding feature, but the second party first locally processes the mapping function and the third random function corresponding to the feature according to the first difference to obtain a first intermediate function, and then sends the first intermediate function to the first party. Since the first intermediate function contains a random amount, the mapping function will not be leaked to the first party. The first party locally calculates according to the first intermediate function to obtain a first fragment, and the second party obtains a second fragment, which has a lower communication volume.
[0150] According to an embodiment of another aspect, a two-party joint feature processing system based on privacy protection is also provided, wherein the first party has a feature representation of each of g features in its corresponding feature space, and the second party has g mapping functions corresponding to the g features respectively, and each mapping function is used to map the feature representation of the corresponding feature to a shared target space, and the system is used to execute the actions performed by the first party and the second party in the method provided in the embodiment of this specification. Figure 4 FIG. 1 is a schematic block diagram of a two-party joint feature processing system based on privacy protection according to an embodiment. Figure 4 As shown, the system 400 includes:
[0151] The first party 41 is used to obtain g first random representations in the feature space of each of the g features and a second random representation in the target space;
[0152] The second party 42 is used to obtain g third random functions and a fourth random representation in the target space; the g first random representations, the second random representations, the g third random functions and the fourth random representation satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space;
[0153] The first party 41 is further configured to calculate a first difference value based on a feature representation of the feature and a corresponding first random representation for any feature, and send the first difference value to the second party 42;
[0154] The second party 42 is further configured to perform a preset transformation on the mapping function corresponding to the feature according to the first difference to obtain a transformation function, and perform local processing on the transformation function and the third random function to obtain a first intermediate function; and send the first intermediate function to the first party 41;
[0155] The first party 41 is further configured to perform a local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations, and the second random representation to obtain a first shard;
[0156] The second party 42 is further used to determine a second slice according to the fourth random representation; the sum of the first slice and the second slice is equal to the sum of the embedded representations of the g features respectively mapped in the target space.
[0157] The system provided in the embodiments of this specification does not directly use a mapping function to map the feature representation of the corresponding feature, but the second party 42 first locally processes the mapping function and the third random function corresponding to the feature according to the first difference to obtain a first intermediate function, and then sends the first intermediate function to the first party 41. Since the first intermediate function contains a random amount, the mapping function will not be leaked to the first party 41. The first party 41 locally calculates according to the first intermediate function to obtain a first fragment, and the second party 42 obtains a second fragment, which has a lower communication volume.
[0158] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described.
[0159] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 The method described.
[0160] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0161] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A two-party joint feature processing method based on privacy protection, wherein a first party has a feature representation of each feature in g features in its corresponding feature space, and a second party has g mapping functions corresponding to the g features, each mapping function is used to map the feature representation of the corresponding feature to a shared target space, and the method is performed by the first party, including: Obtain g first random representations in the feature space of each of the g features, and a second random representation in the target space; the g first random representations, the second random representations, the g third random functions held by the second party, and the fourth random representation in the target space satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space; For any feature, a first difference is calculated based on the feature representation of the feature and the corresponding first random representation; Sending the first difference to the second party, so that the second party performs local processing on a mapping function and a third random function corresponding to the feature according to the first difference to obtain a first intermediate function; receiving the first intermediate function from the second party; According to the first intermediate function, the g first random representations and the second random representation, a local calculation corresponding to the preset relationship is performed to obtain a first slice; the sum of the first slice and the second slice obtained by the second party is equal to the sum of the embedded representations of the g features respectively mapped in the target space; The step of calculating a first difference between the feature representation based on the feature and the corresponding first random representation includes: Determine the first digit whose value is 1 in the feature representation of the feature; Determine a second digit whose value is 1 in the first random representation of the feature; The difference between the first digit and the second digit is calculated to obtain the first difference.
2. The method of claim 1, wherein: The features are represented as one-hot encoded vectors.
3. The method of claim 2, wherein: The target space is an m-dimensional space, the g features include a first feature, the feature space corresponding to the first feature is an n-dimensional space, and the mapping function corresponding to the first feature is used to multiply the n-dimensional one-hot encoding vector with the n*m-dimensional mapping matrix.
4. The method of claim 1, wherein: The obtaining of g first random representations in the feature space of each of the g features and a second random representation in the target space includes: Obtain from a third party g first random representations in a feature space of each of the g features generated by the third party, and a second random representation in a target space.
5. The method of claim 1, wherein: The preset relationship includes: the sum of results of correspondingly processing the g first random representations using the g third random functions is equal to the sum of the second random representation and the fourth random representation.
6. The method of claim 5, wherein: The local calculation includes: For each of the g features, use the first intermediate function to process the first random representation to obtain a single processing result; The sum of each single processing result is calculated to obtain the total processing result; The total processing result and the second random representation are summed to obtain the first fragment.
7. A two-party joint feature processing method based on privacy protection, wherein the first party has a feature representation of each of g features in its corresponding feature space, and the second party has g mapping functions corresponding to the g features, each mapping function is used to map the feature representation of the corresponding feature to a shared target space, the method comprising: The first party obtains g first random representations in the feature space of each of the g features and a second random representation in the target space; The second party obtains g third random functions and a fourth random representation in the target space; the g first random representations, the second random representation, the g third random functions, and the fourth random representation satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space; The first party calculates a first difference value based on a feature representation of the feature and a corresponding first random representation for any feature; The first party sends the first difference to the second party; The second party performs a preset transformation on the mapping function corresponding to the feature according to the first difference to obtain a transformation function, and performs local processing according to the transformation function and a third random function to obtain a first intermediate function; The second party sends the first intermediate function to the first party; The first party performs a local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations, and the second random representation to obtain a first shard; The second party determines a second slice according to the fourth random representation; the sum of the first slice and the second slice is equal to the sum of the embedded representations of the g features respectively mapped in the target space; The step of calculating a first difference between the feature representation based on the feature and the corresponding first random representation includes: Determine the first digit whose value is 1 in the feature representation of the feature; Determine a second digit whose value is 1 in the first random representation of the feature; The difference between the first digit and the second digit is calculated to obtain the first difference.
8. The method of claim 7, wherein: The first party obtains g first random representations in the feature space of each of the g features, including: The first party obtains, from the third party, g first random representations in the feature space of each of the g features generated by the third party; The second party obtains g third random functions and a fourth random representation in the target space, including: The second party obtains, from the third party, g third random functions generated by the third party and a fourth random representation in the target space.
9. The method of claim 7, wherein: The preset transformation satisfies: The processing result of the transformation function on the first random representation is the same as the processing result of the mapping function on the feature representation of the corresponding feature.
10. The method of claim 9, wherein: The mapping function corresponds to a mapping vector, and the preset transformation corresponds to cyclically shifting the mapping vector left by a first difference bit.
11. The method of claim 7, wherein: The preset relationship includes: the sum of results of correspondingly processing the g first random representations using the g third random functions is equal to the sum of the second random representation and the fourth random representation.
12. The method of claim 11, wherein: The local calculation includes: The first party processes the first random representation using the first intermediate function for each of the g features to obtain a single processing result; The sum of each single processing result is calculated to obtain the total processing result; Performing a sum calculation on the total processing result and the second random representation to obtain the first fragment; Determining the second fragment includes: The second party determines the fourth random representation as the second fragment.
13. A two-party joint feature processing device based on privacy protection, wherein the first party has a feature representation of each of g features in its corresponding feature space, and the second party has g mapping functions corresponding to the g features, each mapping function is used to map the feature representation of the corresponding feature to a shared target space, the device is set on the first party, and includes: an acquisition unit, configured to acquire g first random representations in the feature space of each of the g features, and a second random representation in the target space; the g first random representations, the second random representations, the g third random functions held by the second party, and the fourth random representation in the target space satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space; a difference calculation unit, configured to calculate, for any feature, a first difference based on a feature representation of the feature and a first random representation obtained by the corresponding acquisition unit; A sending unit, configured to send the first difference obtained by the difference calculation unit to the second party, so that the second party performs local processing on a mapping function and a third random function corresponding to the feature according to the first difference to obtain a first intermediate function; a receiving unit, configured to receive the first intermediate function from the second party; A shard calculation unit is used to perform a local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations obtained by the acquisition unit, and the second random representation to obtain a first shard; the sum of the first shard and the second shard obtained by the second party is equal to the sum of the embedded representations of the g features respectively mapped in the target space; Wherein, the difference calculation unit includes: A first determining subunit, used to determine the first digit whose value is 1 in the feature representation of the feature; A second determination subunit, used to determine a second digit whose value is 1 in the first random representation of the feature; The difference calculation subunit is used to calculate the difference between the first digit obtained by the first determination subunit and the second digit obtained by the second determination subunit to obtain the first difference.
14. The device of claim 13, wherein: The features are represented as one-hot encoded vectors.
15. The device of claim 14, wherein: The target space is an m-dimensional space, the g features include a first feature, the feature space corresponding to the first feature is an n-dimensional space, and the mapping function corresponding to the first feature is used to multiply the n-dimensional one-hot encoding vector with the n*m-dimensional mapping matrix.
16. The device of claim 13, wherein: The acquisition unit is specifically used to acquire, from a third party, g first random representations in a feature space of each of the g features generated by the third party, and a second random representation in a target space.
17. The device of claim 13, wherein: The preset relationship includes: the sum of results of correspondingly processing the g first random representations using the g third random functions is equal to the sum of the second random representation and the fourth random representation.
18. The device of claim 17, wherein: The sharding computing unit comprises: a single processing subunit, configured to process the first random representation using the first intermediate function for each feature in the g features to obtain a single processing result; A first summing subunit is used to sum the individual processing results obtained by the individual processing subunits to obtain a total processing result; The second summing subunit is used to sum the total processing result obtained by the first summing subunit and the second random representation to obtain the first fragment.
19. A two-party joint feature processing system based on privacy protection, wherein the first party has a feature representation of each of g features in its corresponding feature space, and the second party has g mapping functions corresponding to the g features, each mapping function is used to map the feature representation of the corresponding feature to a shared target space, the system comprising: The first party is used to obtain g first random representations in the feature space of each of the g features and a second random representation in the target space; The second party is used to obtain g third random functions and a fourth random representation in the target space; the g first random representations, the second random representations, the g third random functions, and the fourth random representation satisfy a preset relationship, wherein the g third random functions and the g mapping functions correspond to the same mapping space; The first party is further configured to calculate a first difference value based on a feature representation of the feature and a corresponding first random representation for any feature; and send the first difference value to the second party; The second party is further configured to perform a preset transformation on a mapping function corresponding to the feature according to the first difference to obtain a transformation function, and perform local processing according to the transformation function and a third random function to obtain a first intermediate function; and send the first intermediate function to the first party; The first party is further configured to perform a local calculation corresponding to the preset relationship according to the first intermediate function, the g first random representations, and the second random representation to obtain a first shard; The second party is further used to determine a second slice according to the fourth random representation; the sum of the first slice and the second slice is equal to the sum of the embedded representations of the g features respectively mapped in the target space; The step of calculating a first difference between the feature representation based on the feature and the corresponding first random representation includes: Determine the first digit whose value is 1 in the feature representation of the feature; Determine a second digit whose value is 1 in the first random representation of the feature; The difference between the first digit and the second digit is calculated to obtain the first difference.
20. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 12.
21. A computing device, comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 12 is implemented.
