Sample alignment method and device in federated modeling, medium and electronic equipment
By performing two rounds of randomized encryption and feature rearrangement on the identifier matrix in vertical federated learning, the problem of intersection data leakage during sample alignment is solved, thus achieving data security protection.
Patent Information
- Application Number
- CN202310695779.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-06-12
AI Technical Summary
In existing vertical federated learning, sample alignment methods pose a risk of intersection data leakage and cannot effectively protect the data security of participating parties.
By performing two randomized encryption operations on the identifier matrices of the first and second participants, and then finding the intersection of the randomized encrypted matrices to obtain the intersection index, the feature matrix is further processed by feature rearrangement and fragmentation to obtain the intersection fragments, ensuring that the intersection information is not leaked.
During the sample alignment process, the intersection information is protected from being leaked, improving the data security of the participants and preventing the leakage of intersection data.
Smart Images

Figure CN116684158B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the technical field of privacy computing, and more particularly, embodiments of the present disclosure relate to a sample alignment method in privacy-preserving federated modeling, a sample alignment device in privacy-preserving federated modeling, a computer readable storage medium and an electronic device. BACKGROUND
[0002] This section is intended to provide background information to facilitate a better understanding of embodiments of the present disclosure recited in the claims. The description herein does not constitute admission that the information provided herein is prior art merely because it is included herein.
[0003] Compared with the training of traditional machine learning algorithms, the samples of vertical federated learning belong to different participants, and the coverage of the samples of each participant is different. Therefore, the first step of federated model training is to perform cross-domain sample alignment (i.e., secure intersection). At present, common secure intersection methods include different methods based on RSA, ECDH, and KKRT. However, these methods have a common feature - only the samples outside the intersection are protected from being leaked, and the user identifier (i.e., user ID) within the intersection must be shared among all participants, otherwise subsequent federated training cannot be performed. Due to the sharing process of intersection information, intersection data leakage may occur, and the data security of the participants cannot be ensured. SUMMARY
[0004] The present disclosure provides a sample alignment method in privacy-preserving federated modeling, a sample alignment device in privacy-preserving federated modeling, a computer readable storage medium and an electronic device, which can ensure sample alignment without leaking intersection data information, and is beneficial to improve the data security of each participant.
[0005] According to a first aspect of the present disclosure, a sample alignment method in privacy-preserving federated modeling is provided, applied to a first participant, the method comprising: obtaining a first participant original data matrix; the original data matrix comprising an identifier matrix and a feature matrix; performing out-of-order encryption processing on the first participant identifier matrix and the second participant identifier matrix, and performing intersection on the first participant identifier matrix and the second participant identifier matrix after out-of-order encryption processing to obtain an intersection index; performing feature rearrangement and fragmentation processing on the feature matrix and the index sequence of the identifier in the identifier matrix after out-of-order encryption processing to obtain a first participant feature matrix fragment and a second participant feature matrix fragment; and determining an intersection fragment from the first participant feature matrix fragment and the second participant feature matrix fragment according to the intersection index.
[0006] In an embodiment, the first participant identification matrix and the second participant identification matrix are subjected to a disorderly encryption process, and an intersection index is obtained by intersecting the first participant identification matrix and the second participant identification matrix subjected to the disorderly encryption process, comprising: subjecting the first participant identification matrix to a first disorderly encryption, and sending the first participant identification matrix subjected to the first disorderly encryption to a second participant; receiving the second participant identification matrix subjected to the first disorderly encryption sent by the second participant; subjecting the second participant identification matrix subjected to the first encryption to a second disorderly encryption, and sending the second participant identification matrix subjected to the second disorderly encryption to the second participant; receiving the first participant identification matrix subjected to the second disorderly encryption sent by the second participant, and obtaining the intersection index by intersecting the first participant identification matrix subjected to the second disorderly encryption and the second participant identification matrix subjected to the second disorderly encryption.
[0007] In an embodiment, the first participant identification matrix is subjected to a first disorderly encryption, and the first participant identification matrix subjected to the first disorderly encryption is sent to a second participant, comprising: subjecting the first participant original data matrix to a first random rearrangement by row; extracting the first participant identification matrix from the first participant original data matrix subjected to the first random rearrangement; subjecting the first participant identification matrix to a first commutative encryption, and sending the first participant identification matrix subjected to the first commutative encryption to the second participant.
[0008] In an embodiment, the second participant identification matrix subjected to the first encryption is subjected to a second disorderly encryption, and the second participant identification matrix subjected to the second disorderly encryption is sent to the second participant, comprising: subjecting the second participant identification matrix subjected to the first commutative encryption to a second random rearrangement by row; subjecting the second participant identification matrix subjected to the second random rearrangement to a second commutative encryption, and sending the second participant identification matrix subjected to the second commutative encryption to the second participant.
[0009] In an embodiment, the first participant identification matrix and the second participant identification matrix subjected to the disorderly encryption process are intersected to obtain an intersection index, comprising: subjecting the first participant identification matrix subjected to the second commutative encryption and the second participant identification matrix subjected to the second commutative encryption to intersection to obtain an intersection index of the first participant identification matrix subjected to the second encryption and the second participant identification matrix subjected to the second encryption.
[0010] In an embodiment, the feature rearrangement and fragmentation of the index sequence identified in the feature matrix and the scrambled and encrypted identification matrix of the second participant includes: performing feature rearrangement and fragmentation on the index sequence identified in the second-time randomly rearranged first participant identification matrix and the second participant feature matrix to obtain the first participant feature matrix fragment at the second participant.
[0011] In an embodiment, the feature rearrangement and fragmentation of the index sequence identified in the first participant feature matrix and the second-time randomly rearranged first participant identification matrix includes: receiving a first-time randomly rearranged index sequence sent by the second participant; the first-time randomly rearranged index sequence is obtained by rearranging a pre-generated random rearrangement index sequence with the index sequence identified in the first participant original data matrix identification matrix after the second-time random rearrangement; receiving a first participant first random fragment pre-generated, and rearranging the first participant first random fragment with the first-time randomly rearranged index sequence to obtain the first participant feature matrix fragment at the first participant.
[0012] In an embodiment, the feature rearrangement and fragmentation of the index sequence identified in the first participant feature matrix and the second-time randomly rearranged first participant identification matrix includes: receiving a first-time randomly rearranged index sequence sent by the second participant; the first-time randomly rearranged index sequence is obtained by rearranging a pre-generated random rearrangement index sequence with the index sequence identified in the first participant original data matrix identification matrix after the second-time random rearrangement; receiving a first participant first random fragment pre-generated, and rearranging the first participant first random fragment with the first-time randomly rearranged index sequence to obtain the first participant feature matrix fragment at the first participant.
[0013] In an embodiment, the determining the second participant's fragments of the first participant's feature matrix according to the first participant's difference value matrix, the second participant's difference value matrix, the pre-generated second participant's first random fragments and the first random rearrangement index sequence comprises: summing the first participant's difference value matrix and the second participant's difference value matrix to obtain a sum matrix; rearranging the sum matrix according to the index sequence identified in the second participant's identification matrix after the second random rearrangement to obtain a first transformation matrix; rearranging the second participant's first random fragments according to the first random rearrangement index sequence to obtain a second transformation matrix; and taking the sum of the first transformation matrix and the second transformation matrix as the second participant's fragments of the first participant's feature matrix.
[0014] In an embodiment, the determining the intersection fragments from the first participant's fragments of the feature matrix and the second participant's fragments of the feature matrix according to the intersection index comprises: querying the first participant's fragments of the feature matrix and the second participant's fragments of the feature matrix according to the intersection index, and splicing the query results to obtain the intersection fragments.
[0015] According to a second aspect of the present disclosure, there is provided an apparatus for sample alignment in anonymous federated modeling, the apparatus comprising: a data acquisition module configured to obtain a first participant's original data matrix; the original data matrix comprising an identification matrix and a feature matrix; a first data processing module configured to perform disorder encryption processing on a first participant's identification matrix and a second participant's identification matrix, and to obtain an intersection index by performing intersection on the first participant's identification matrix and the second participant's identification matrix after the disorder encryption processing; a second data processing module configured to perform feature rearrangement and fragmentation processing on the feature matrix and the index sequence identified in the identification matrix after the disorder encryption processing, to obtain first participant's fragments of the feature matrix and second participant's fragments of the feature matrix; and a third data processing module configured to determine intersection fragments from the first participant's fragments of the feature matrix and the second participant's fragments of the feature matrix according to the intersection index.
[0016] According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program, the computer program being executable by a processor to implement any of the above methods.
[0017] According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory storing executable instructions of the processor; wherein the processor is configured to perform any of the above methods by executing the executable instructions.
[0018] According to the sample alignment method in the anonymous federated modeling, the device, the storage medium and the electronic equipment of the embodiment of the present disclosure, the first participant identification matrix and the second participant identification matrix are encrypted twice in disorder, and then the intersection of the first participant identification matrix and the second participant identification matrix after the twice disorder encryption is obtained. The intersection index of the first participant identification matrix and the second participant identification matrix after the twice disorder encryption is obtained, and then the feature rearrangement and fragmentation processing are performed on the index sequence of the feature matrix and the identification in the identification matrix after the disorder encryption processing, to obtain the fragments of the first participant feature matrix and the fragments of the second participant feature matrix. Then, the intersection fragments are determined from the fragments of the first participant feature matrix and the fragments of the second participant feature matrix according to the intersection index. In this way, the participant cannot know the real intersection information (intersection ID and intersection feature), which can protect the intersection information while ensuring that the information outside the intersection is not leaked, and is conducive to improving the data security of the participant. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A schematic diagram of a secure intersection algorithm architecture in the embodiment of the present disclosure is shown.
[0020] Figure 2 A flowchart of a sample alignment method in anonymous federated modeling in the embodiment of the present disclosure is shown.
[0021] Figure 3 A sub-flowchart of a sample alignment method in anonymous federated modeling in the embodiment of the present disclosure is shown.
[0022] Figure 4 A sub-flowchart of a sample alignment method in anonymous federated modeling in the embodiment of the present disclosure is shown.
[0023] Figure 5 A sub-flowchart of a sample alignment method in anonymous federated modeling in the embodiment of the present disclosure is shown.
[0024] Figure 6 A sub-flowchart of a sample alignment method in anonymous federated modeling in the embodiment of the present disclosure is shown.
[0025] Figure 7 A sub-flowchart of a sample alignment method in anonymous federated modeling in the embodiment of the present disclosure is shown.
[0026] Figure 8 A sub-flowchart of a sample alignment method in anonymous federated modeling in the embodiment of the present disclosure is shown.
[0027] Figure 9 A sub-flowchart of a sample alignment method in anonymous federated modeling in the embodiment of the present disclosure is shown.
[0028] Figure 10 FIG. 1 shows a schematic diagram of a device for sample alignment in a privacy-preserving federated modeling according to an embodiment of the present disclosure.
[0029] Figure 11 FIG. 1 shows a schematic diagram of a device for sample alignment in a privacy-preserving federated modeling according to an embodiment of the present disclosure.
[0030] In the drawings, identical or corresponding reference signs indicate identical or corresponding parts. DETAILED DESCRIPTION
[0031] Example embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.
[0032] The accompanying drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure. In the drawings:
[0033] The following terms appearing herein are explained:
[0034] Secure intersection: is an algorithm for computing the intersection of two sets. The algorithm is based on the idea of hash tables, which map all elements in a set to different buckets using hash tables. Then, each element in the second set is traversed, and the hash table is searched to see if the element exists in the first set. If it exists, the element is added to the result set.
[0035] Commutative encryption: If an encryption algorithm satisfies E k1 (E k2 (m)) = E k2 (E k1 (m), then the encryption algorithm is a commutative encryption algorithm. Commonly used commutative encryption algorithms include SRA and Pohlig-Hellman exponential cipher.
[0036] The following will be described with an example of two participants performing a private set intersection.
[0037] The following will be described with an example of two participants performing a private set intersection.Figure 1 A schematic diagram of a system architecture 100 is shown, which can include a first participant 110 and a second participant 120. Among them, the first participant 110 and the second participant 120 can generally refer to a background system (such as a secure intersection service system) that provides a secure intersection service, the first participant 110 and the second participant 120 can obtain respective original data matrices, and perform out-of-order encryption processing on the respective original data matrices, and then perform intersection on the out-of-order encrypted first participant identification matrix and the out-of-order encrypted second participant identification matrix to obtain the intersection index of the out-of-order encrypted first participant identification matrix and the out-of-order encrypted second participant identification matrix, and then perform feature rearrangement and fragmentation processing on the index sequence identified in the feature matrix and the out-of-order encrypted identification matrix to obtain the first participant feature matrix fragment and the second participant feature matrix fragment, and then determine the intersection fragment from the first participant feature matrix fragment and the second participant feature matrix fragment according to the intersection index. The first participant 110 and the second participant 120 can be connected through wired or wireless communication links to interact with each other.
[0038] The following will be described in conjunction with Figure 2 The sample alignment method in the anonymous federated modeling in the present exemplary embodiment will be described, Figure 2 An exemplary flow of the sample alignment method in the anonymous federated modeling is shown, which can include the following steps S210 to S240 when applied to the first participant:
[0039] Step S210, obtaining a first participant original data matrix; the original data matrix includes an identification matrix and a feature matrix;
[0040] Step S220, performing out-of-order encryption processing on the first participant identification matrix and the second participant identification matrix, and performing intersection on the out-of-order encrypted first participant identification matrix and the out-of-order encrypted second participant identification matrix to obtain the intersection index;
[0041] Step S230, performing feature rearrangement and fragmentation processing on the index sequence identified in the feature matrix and the out-of-order encrypted identification matrix to obtain the first participant feature matrix fragment and the second participant feature matrix fragment;
[0042] Step S240, determining the intersection fragment from the first participant feature matrix fragment and the second participant feature matrix fragment according to the intersection index.
[0043] In the sample alignment method in the above anonymous federation modeling, the intersection index of the first participant identification matrix and the second participant identification matrix is obtained by performing two times of disorder encryption on the first participant identification matrix and the second participant identification matrix, and then performing intersection operation on the first participant identification matrix and the second participant identification matrix after the two times of disorder encryption. Then, the feature rearrangement and fragmentation processing are performed on the index sequence of the identification in the feature matrix and the identification matrix after the disorder encryption processing, to obtain the fragments of the first participant feature matrix and the fragments of the second participant feature matrix. Then, the intersection fragments are determined from the fragments of the first participant feature matrix and the fragments of the second participant feature matrix according to the intersection index. In this way, the participant cannot know the real intersection information (intersection ID and intersection feature), which can protect the intersection information while ensuring that the information outside the intersection is not leaked, and is conducive to improving the data security of the participant.
[0044] The following will be specifically described. Figure 2 The following will be specifically described.
[0045] Referring to Figure 2 In step S210, the first participant original data matrix is obtained.
[0046] The original data matrix includes an identification matrix and a feature matrix.
[0047] The original data matrix includes at least one set of sample data, and the sample data includes a unique identification matrix for identifying each object in the first participant, and a feature matrix corresponding to the unique identification matrix.
[0048] In actual application, the participants can be two, that is, the first participant and the second participant corresponding to the first participant; here, the first participant can also be understood as the sending end, and correspondingly, the second participant can be understood as the receiving end.
[0049] Referring to Figure 2 In step S220, the first participant identification matrix and the second participant identification matrix are subjected to disorder encryption processing, and the intersection index is obtained by performing intersection operation on the first participant identification matrix and the second participant identification matrix after the disorder encryption processing.
[0050] The disorder encryption includes two steps of disorder and encryption; here, the disorder can be understood as rearrangement; the first participant performs disorder encryption processing on the first participant identification matrix and the second participant identification matrix, which can be that the first participant performs first time disorder encryption processing on the first participant identification matrix, and then performs second time disorder encryption processing on the second participant identification matrix which is subjected to the first time disorder encryption processing at the second participant and sent by the second participant; here, the operation of the second participant is symmetrical to the operation of the first participant.
[0051] In particular, with reference to Figure 3 The step S220 can further include steps S310-S340.
[0052] The step S310 includes first disorder encryption of the first end identification matrix, and sending the first disorder encrypted first participant identification matrix to the second participant.
[0053] The encryption can be any one of RSA, ECDH, and KKRT, which is not limited herein.
[0054] In order to protect the information outside the intersection and the intersection information at the same time, and reduce the calculation amount, the encryption in this step can be first for the identification matrix in the original data matrix. The field of the identification matrix can be understood as the primary key, such as ID, ID card, mobile phone number, etc., which is not limited herein.
[0055] In an embodiment, with reference to Figure 4 The step S310 can further include steps S410-S430.
[0056] The step S410 includes first random rearrangement of the first participant original data matrix by row.
[0057] The random rearrangement can be achieved by generating a random rearrangement index sequence. Specifically, a random rearrangement index sequence can be generated first, and then the first participant original data matrix is rearranged by row according to the random rearrangement index sequence, so that the first participant original data matrix rearranged by row is obtained.
[0058] The step S420 includes extracting the first participant identification matrix from the first participant original data matrix after the first random rearrangement.
[0059] The first participant identification matrix is the ID column in the first participant original data matrix. For example, if the first participant original data matrix and the second participant original data matrix both have an ID card column, then the ID card column is the first participant identification matrix. For another example, if the first participant original data matrix and the second participant original data matrix both have a mobile phone number column, then the mobile phone number column is the first participant identification matrix.
[0060] The step S430 includes first exchangeable encryption of the first participant identification matrix, and sending the first exchangeable encrypted first participant identification matrix to the second participant.
[0061] For example, the first participant original data matrix is D1, the first participant generated key is k1, the first participant identification matrix is [ID], and the random rearrangement index sequence is p1. The first participant original data matrix rearranged by the random rearrangement index sequence p1 is p1, D1[p1], and the first participant identification matrix in the rearranged first participant original data matrix is commutatively encrypted, and the first commutative encryption of the first participant identification matrix is E k1 (D1[p1][ID]).
[0062] To improve the security of the original data matrix, the commutative encryption algorithm can be used. Thus, since the participants (the first participant and the second participant) encrypt the data, and the participants cannot decrypt the intersection data, the alignment ID cannot be derived from the alignment result.
[0063] In step S320, the first commutative encryption of the second participant identification matrix sent by the second participant is received.
[0064] The operations of the second participant and the first participant are symmetrical. When the first participant obtains the first participant original data matrix, the second participant obtains the second participant original data matrix. When the first participant performs the first random rearrangement on the first participant original data matrix, the second participant performs the first random rearrangement on the second participant original data matrix. When the first participant extracts the first participant identification matrix from the first randomly rearranged first participant original data matrix, the second participant extracts the second participant identification matrix from the first randomly rearranged second participant original data matrix. When the first participant performs the first commutative encryption on the first participant identification matrix and sends the first commutative encryption of the first participant identification matrix to the second participant, the second participant also performs the first commutative encryption on the second participant identification matrix and sends the first commutative encryption of the second participant identification matrix to the first participant.
[0065] For example, the second participant original data matrix is D2, the second participant generated key is k2, the second participant identification matrix is [ID], and the random rearrangement index sequence is p2. The second participant original data matrix rearranged by the random rearrangement index sequence p2 is p2, D2[p2], and the second participant identification matrix in the rearranged second participant original data matrix is commutatively encrypted, and the first commutative encryption of the second participant identification matrix is E k2 (D2[p2][ID]); that is, the first commutative encryption of the second participant identification matrix sent by the second participant and received by the first participant is E k2(D2[p2][ID]).
[0066] Step S330, the second participant identification matrix after the first encryption is secondly reordered and encrypted, and the second participant identification matrix after the second reordering and encryption is sent to the second participant.
[0067] Wherein, the encryption can adopt any one of RSA, ECDH, and KKRT encryption algorithm, which is not limited here.
[0068] In order to further protect the information outside the intersection and the intersection information, and reduce the calculation amount, the encryption in this step can be the second encryption of the identification matrix in the second participant original data matrix; the field of the second participant identification matrix can be understood as the primary key, such as ID, ID card, mobile phone number, etc., which is not limited here.
[0069] In an embodiment, referring to Figure 5 , the above step S330 can further include steps S510 and S520:
[0070] Step S510, the second participant identification matrix after the first exchangeable encryption is secondly randomly rearranged by row.
[0071] Wherein, the random rearrangement can be realized by randomly generating a random rearrangement index sequence. Specifically, the random rearrangement index sequence can be generated first, and then the second participant identification matrix after the first exchangeable encryption is rearranged by row according to the random rearrangement index sequence, so that the second participant identification matrix after the first exchangeable encryption and secondly randomly rearranged by row can be obtained.
[0072] For example, the second participant identification matrix after the first exchangeable encryption is E k2 (D2[p2][ID]), and the random rearrangement index sequence is p3, then this step can be represented as: p3, E k2 (D2[p2][ID])[p3], that is, the second participant identification matrix after the second random rearrangement obtained in this step is E k2 (D2[p2][ID])[p3].
[0073] Step S520, the second participant identification matrix after the second random rearrangement is secondly exchangeably encrypted, and the second participant identification matrix after the second exchangeable encryption is sent to the second participant.
[0074] For example, the second participant identification matrix after the second random rearrangement is E k2 (D2[p2][ID])[p3], and the key generated by the first participant is k1, then the second participant identification matrix after the second exchangeable encryption obtained in this step is Ek1 (E k2 (D2[p2][ID])[p3])。
[0075] Step S340, receiving the second time disordered encrypted first participant identification matrix sent by the second participant, and performing intersection operation on the second time disordered encrypted first participant identification matrix and the second time disordered encrypted second participant identification matrix to obtain the intersection index.
[0076] Wherein, the operation of the second participant is the same as that of the first participant. The first participant performs second time random rearrangement on the first time exchangeable encrypted second participant identification matrix by row, and performs second time exchangeable encryption on the second time random rearranged second participant identification matrix, and then sends the second time exchangeable encrypted second participant identification matrix to the second participant. The second participant also performs second time random rearrangement on the first time exchangeable encrypted first participant identification matrix by row, and performs second time exchangeable encryption on the second time random rearranged first participant identification matrix, and then sends the second time exchangeable encrypted first participant identification matrix to the first participant.
[0077] For example, the first time exchangeable encrypted first participant identification matrix is E k1 (D1[p1][ID]), the random rearrangement index sequence is p4, and the key generated by the second participant is k2. Therefore, the second time exchangeable encrypted first participant identification matrix received in this step is E k2 (E k1 (D1[p1][ID])[p4]).
[0078] Since the identification matrix is encrypted, the final obtained is the intersection index of the second time encrypted first participant identification matrix and the second time encrypted second participant identification matrix. Specifically, the above step S340 of "performing intersection operation on the second time disordered encrypted first participant identification matrix and the second time disordered encrypted second participant identification matrix to obtain the intersection index" can include the following steps:
[0079] Performing intersection operation on the second time exchangeable encrypted first participant identification matrix and the second time exchangeable encrypted second participant identification matrix to obtain the intersection index of the second time encrypted first participant identification matrix and the second time encrypted second participant identification matrix.
[0080] For example, the second time encrypted first participant identification matrix sent by the second participant and received by the first participant is E k2 (E k1 (D1[p1][ID])[p4], and the matrix obtained by the first participant after performing second time exchangeable encryption on the second participant identification matrix is Ek1 (E k2 (D2[p2][ID])[p3]), then the intersection index of the first participant identifier matrix and the second participant identifier matrix obtained in this step is E. k2 (E k1 (D1[p1][ID])[p4])|E k1 (E k2 (D2[p2][ID])[p3]).
[0081] Similarly, the second participant receives the second encrypted second participant identifier matrix sent by the first participant, which is E. k1 (E k2 (D2[p2][ID])[p3]), the matrix obtained by the second participant after performing a second commutative encryption on the identifier matrix of the first participant is E. k2 (E k1 (D1[p1][ID])[p4]), therefore, the intersection index of the first participant's identifier matrix and the second participant's identifier matrix obtained by the second participant is also E. k2 (E k1 (D1[p1][ID])[p4])|E k1 (E k2 (D2[p2][ID])[p3]).
[0082] Continue to refer to Figure 2 In step S230, the index sequences identified in the feature matrix and the identifier matrix after disordered encryption are subjected to feature rearrangement and fragmentation processing to obtain fragments of the feature matrix of the first participant and fragments of the feature matrix of the second participant.
[0083] The feature matrix includes the feature matrix of the first participant and the feature matrix of the second participant; the index sequence identified in the identifier matrix is the index sequence identified in the identifier matrix after the second random rearrangement, including the index sequence identified in the identifier matrix of the first participant after the second random rearrangement and the index sequence identified in the identifier matrix of the second participant after the second random rearrangement.
[0084] When the feature matrix is the feature matrix of the first participant, the index sequence identified in the identifier matrix is the index sequence identified in the identifier matrix of the first participant after the second random rearrangement; when the feature matrix is the feature matrix of the second participant, the index sequence identified in the identifier matrix is the index sequence identified in the identifier matrix of the second participant after the second random rearrangement.
[0085] For details, please refer to Figure 6 The above step S230 may further include the following steps S610 and S620:
[0086] Step S610, performing feature rearrangement and fragmentation processing on the index sequence identified in the first participant feature matrix and the first participant identification matrix after the second random rearrangement, to obtain the first participant feature matrix in the first participant's fragments.
[0087] The feature rearrangement and fragmentation processing can be completed through "feature rearrangement-secret sharing". For details, refer to Figure 7 The above step S610 can further include the following steps S710 and S720:
[0088] Step S710, receiving the first random rearrangement index sequence sent by the second participant.
[0089] The first random rearrangement index sequence is obtained by rearranging the pre-generated random rearrangement index sequence with the index sequence identified in the first participant original data matrix after the second random rearrangement.
[0090] For example, the index sequence identified in the first participant identification matrix after the second random rearrangement is [p4], and the pre-generated random rearrangement index sequence is [p5]. Then, the first random rearrangement index sequence obtained in this step can be represented as: p6=p5[p4]. Here, the random rearrangement index sequence [p5] can be generated by introducing a semi-trusted third party.
[0091] Step S720, receiving the pre-generated first random fragment of the first participant, and rearranging the first random fragment of the first participant with the first random rearrangement index sequence to obtain the first participant feature matrix in the first participant's fragments.
[0092] The first random fragment of the first participant can be obtained by generating a random matrix through the introduction of a semi-trusted third party. Specifically, the semi-trusted third party can first generate a random matrix x', then rearrange the random matrix x' with a randomly generated random rearrangement index sequence p5 to obtain a matrix x=x'[p5], and then fragment x and x' according to additive secret sharing <x> 1, <x>2, <x'1>, <x'2>, and finally, <x>1, <x'1> is sent to the first participant, p5, <x>2, <x' >2 is sent to the second participant. Here, the first participant's first random piece can be <x' >1 described above.
[0093] The first participant's feature matrix at the first participant's piece can be represented as <f' >1 = <x' >1 [p6].
[0094] It should be noted that the index sequence identified in the first participant's identification matrix after the second random rearrangement is input by the second participant, and therefore, when the first participant performs the above step S610 (steps S710 and S720), the second participant cooperates with the first participant to perform a step symmetrical to the following step S620 (steps S810 to S840), and further, the second participant's feature matrix at the first participant's piece <f' >2 = y' + z is obtained; where z = <x' >2 [p6], y' = y [p4], and y = <x' >2 [p4] + <x' >1 [p4]. <y> 1+ <y> 2, <y> 1= <f> 1- <x> 1, <y> 2= <f> 2- <x>2; wherein, [p4] is the index sequence of the first participant identification matrix after the second random rearrangement; <f>1 and <f>2 are a third additive secret sharing matrix and a fourth additive secret sharing matrix obtained by performing additive secret sharing on the above-mentioned first participant feature matrix, respectively; <x>1 and <x>2 are random shards generated by the semi-trusted third party mentioned above.
[0095] Step S620, the index sequence identified in the second participant identification matrix after the second random rearrangement and the second participant feature matrix are subjected to feature rearrangement and fragmentation processing, to obtain the first participant feature matrix in the second participant's shard.
[0096] The feature rearrangement and fragmentation processing can be completed by "feature rearrangement-secret sharing". For details, refer to Figure 8 The above step S620 can further include the following steps S810 to S840:
[0097] Step S810, rearrange the pre-generated random rearrangement index sequence with the index sequence identified in the second participant identification matrix after the second random rearrangement, to obtain a one-time random rearrangement index sequence, and send the one-time random rearrangement index sequence to the second participant.
[0098] The random rearrangement index sequence can be generated by introducing a semi-trusted third party. For example, the index sequence identified in the second participant identification matrix after the second random rearrangement is [p3], and the pre-generated random rearrangement index sequence is [p7], then the two-time random rearrangement index sequence obtained in this step can be represented as: p8=p7[p3]. Here, the random rearrangement index sequence [p7] can be generated by introducing a semi-trusted third party.
[0099] Step S820, determine the difference between the first additive secret sharing matrix of the second participant feature matrix and the pre-generated first random shard of the second participant, to obtain the first participant difference matrix.
[0100] The first additive secret sharing matrix can be obtained by additive secret sharing of the second participant feature matrix. For example, the second participant feature matrix is D2[p2][feature], and the additive secret sharing of the second participant feature matrix obtains the first additive secret sharing matrix <D2[p2][feature]>1 and the second additive secret sharing matrix <D2[p2][feature]>2. Further, the first participant can send <D2[p2][feature]>2 to the second participant for subsequent use.
[0101] The second participant first random shard can be obtained by introducing a semi-trusted third party to generate a random matrix; specifically, the semi-trusted third party can first generate a random matrix x0', then rearrange the random matrix x0' with the randomly generated random rearrangement index sequence p7 to obtain the matrix x0=x0'[p7], and then fragment x0, x0' according to additive secret sharing <x0> 3, <x0>4, <x0'3, <x0'4, and finally, <x0>3, <x0' >3 is sent to the first participant, and p7, <x0>4, <x0' >4 is sent to the second party. Here, the first random piece of the second party can be the above <x0>3.
[0102] The first participant variance matrix can be represented as <y0>1 = <D2[p2][feature]>2- <x0>3.
[0103] Step S830, receiving the second participant difference matrix.
[0104] The second participant difference matrix is obtained according to the second additive secret sharing matrix of the second participant feature matrix and the pre-generated first participant second random fragment.
[0105] The second participant operates the same as the first participant. The first participant determines the difference between the first additive secret sharing matrix of the second participant feature matrix and the pre-generated second participant first random fragment, to obtain the first participant difference matrix; the second participant also determines the difference between the second additive secret sharing matrix of the second participant feature matrix and the pre-generated first participant second random fragment, to obtain the second participant difference matrix.
[0106] The second additive secret sharing matrix can be obtained by additive secret sharing of the second participant feature matrix, for example: the second participant feature matrix is D2[p2][feature], the first additive secret sharing matrix <D2[p2][feature]>1 and the second additive secret sharing matrix <D2[p2][feature]>2 are obtained by additive secret sharing of the second participant feature matrix, further, the first participant can send <D2[p2][feature]>2 to the second participant for subsequent use.
[0107] The first participant second random fragment can be obtained by introducing a semi-trusted third party to generate a random matrix; specifically, the semi-trusted third party can first generate a random matrix x0', then rearrange the random matrix x0' with a randomly generated random rearrangement index sequence p7 to obtain a matrix x0=x0'[p7], and then fragmentize x0, x0' according to additive secret sharing <x0> 3, <x0>4, <x0'3, <x0'4, and finally, <x0>3, <x0' >3 sends to the first participant, p7, <x0>4, <x0' >4 is sent to the second participant. Here, the second random piece of the first participant can be the above <x0>4.
[0108] The second participant variance matrix can be represented as <y0>2 = <D2[p2][feature]>1- <x0>4.
[0109] Step S840, determining the first participant feature matrix in the second participant's pieces according to the first participant variance matrix, the second participant variance matrix, the pre-generated second participant first random pieces and the one-time random rearrangement index sequence.
[0110] Wherein, the first participant feature matrix in the second participant's pieces is obtained by performing four arithmetic operations on the second participant variance matrix, the first participant variance matrix, the pre-generated second participant feature matrix in the first participant's pieces and the one-time random rearrangement index sequence; for details, refer to Figure 9 The above step S840 can further include the following steps S910 to S940:
[0111] Step S910, summing the first participant variance matrix and the second participant variance matrix to obtain a sum matrix.
[0112] Taking the above example as an example, this step can be represented as y0= x0+ y0. <y0> 1+ <y0>2.
[0113] Step S920, rearranging the and matrix with the index sequence identified in the second participant identification matrix after the second random rearrangement to obtain a first transformation matrix.
[0114] For example, the index sequence identified in the second participant identification matrix after the second random rearrangement is [p4], and the matrix is y0= <y0> 1+ <y0>2. Then, the first transformation matrix can be expressed as y0' = y0[p4].
[0115] In step S930, the second participant rearranges the first random fragments of the second participant by using a random rearrangement index sequence to obtain a second transformation matrix.
[0116] The first random fragments of the second participant can be obtained by introducing a semi-trusted third party to generate a random matrix; specifically, the semi-trusted third party can first generate a random matrix x0', then rearrange the random matrix x0' by using a randomly generated random rearrangement index sequence p7 to obtain a matrix x0 = x0'[p7], and then fragment x0, x0' according to additive secret sharing to obtain <x0> 3, <x0>4, <x0'3, <x0'4, and finally, <x0>3, <x0' >3 sends to the first participant, and p 11 , <x0>4, <x0'>4 is sent to the second participant. Here, the second participant's first random piece can be <x0'>4.
[0117] With the above example, the second random rearranged index sequence is [p8], and the second participant's second random piece is <x0'>4, then the second transformation matrix can be represented as z0 = <x0'>4[p8].
[0118] Step S940, the sum of the first transformation matrix and the second transformation matrix is taken as the first participant's feature matrix in the second participant's piece.
[0119] With the above example, the first participant's feature matrix in the second participant's piece is <f0'>1 = y0' + z0.
[0120] In practical applications, when the input of the first participant (the local end) is the feature matrix, the input of the second participant (the opposite end) is the index sequence identified in the second participant's identification matrix after the second random rearrangement; the first participant's fragmentation result and the second participant's fragmentation result are the results of fragmenting the first participant's feature matrix with the index sequence identified in the second participant's identification matrix after the second random rearrangement of the second participant.
[0121] It should be noted that the second participant's feature matrix is input by the second participant, so when the first participant performs the above step S620 (steps S810 to S840), the second participant cooperates with the first participant to perform the steps symmetrical to the above step S610 (steps S710 and S720), and then the second participant's feature matrix in the second participant's piece <f0'>2 = <x0'>3[p8] is obtained.
[0122] Continuing to refer to Figure 2 , in step S240, the intersection piece is determined from the first participant's feature matrix piece and the second participant's feature matrix piece according to the intersection index.
[0123] Among them, the first participant's feature matrix and the index sequence identified in the first participant's identification matrix after the second random rearrangement are subjected to feature rearrangement and fragmentation processing, the first participant's feature matrix in the first participant's piece is output at the first participant, and the second participant's feature matrix in the first participant's piece is output at the second participant.
[0124] The index sequence identified in the second participant's identification matrix after the second random rearrangement and the second participant's feature matrix are subjected to feature rearrangement and fragmentation processing, the first participant's feature matrix in the second participant's piece is output at the first participant, and the second participant's feature matrix in the second participant's piece is output at the second participant.
[0125] The first participant feature matrix at the first participant and the second participant feature matrix at the first participant are not spliced, nor are the first participant feature matrix at the second participant and the second participant feature matrix at the second participant spliced; instead, the first participant feature matrix at the first participant and the first participant feature matrix at the second participant are spliced, or the second participant feature matrix at the first participant and the second participant feature matrix at the second participant are spliced; therefore, the intersection of the feature matrices cannot be obtained, but the intersection fragments of the feature matrices are obtained; further, the participants cannot know the intersection of the real feature matrices, and the purpose of protecting privacy is achieved.
[0126] Specifically, the above step S240 can further include the following steps:
[0127] According to the intersection index, the first participant feature matrix at the first participant and the first participant feature matrix at the second participant are queried, and the query results are spliced to obtain the intersection fragments.
[0128] For example, [ind1] is the index of the intersection element in the first participant identification matrix, [ind2] is the index of the intersection element in the second participant identification matrix, the result of the first participant feature rearrangement-secret sharing is <D1[p1][feature][p4]>1 and <D2[p2][feature][p3]>1, and the result of the second participant feature rearrangement-secret sharing is <D1[p1][feature][p4]>2 and <D2[p2][feature][p3]>2; then, the alignment of the features and the splicing in this step can be represented as [<D1[p1][feature][p4]>1[ind1], <D2[p2][feature][p3]>1[ind2]].
[0129] After introducing the sample alignment method in the example anonymous federated modeling of the present disclosure, next, with reference to Figure 10 The sample alignment device in the example anonymous federated modeling of the present disclosure is described.
[0130] With reference to Figure 10 As shown in the figure, the sample alignment device 1000 in the anonymous federated modeling includes:
[0131] The data acquisition module 1010 is configured to obtain a first participant original data matrix; the original data matrix includes an identification matrix and a feature matrix;
[0132] The first data processing module 1020 is configured to perform out-of-order encryption processing on the first participant identification matrix and the second participant identification matrix, and to obtain an intersection index by performing intersection operation on the first participant identification matrix and the second participant identification matrix after the out-of-order encryption processing.
[0133] The second data processing module 1030 is configured to perform feature rearrangement and fragmentation processing on the index sequence identified in the feature matrix and the identification matrix after the out-of-order encryption processing, to obtain a first participant feature matrix fragment and a second participant feature matrix fragment.
[0134] The third data processing module 1040 is configured to determine an intersection fragment from the first participant feature matrix fragment and the second participant feature matrix fragment according to the intersection index.
[0135] In an embodiment, the first data processing module 1020 is configured to perform first out-of-order encryption on the first participant identification matrix, and send the first participant identification matrix after the first out-of-order encryption to the second participant; receive the second participant identification matrix after the first out-of-order encryption sent by the second participant; perform second out-of-order encryption on the second participant identification matrix after the first encryption, and send the second participant identification matrix after the second out-of-order encryption to the second participant; receive the first participant identification matrix after the second out-of-order encryption sent by the second participant, and perform intersection operation on the first participant identification matrix after the second out-of-order encryption and the second participant identification matrix after the second out-of-order encryption to obtain the intersection index.
[0136] In an embodiment, the first data processing module 1020 is configured to perform first out-of-order encryption on the first participant identification matrix, and send the first participant identification matrix after the first out-of-order encryption to the second participant, including: performing first random rearrangement on the first participant original data matrix by row; extracting the first participant identification matrix from the first participant original data matrix after the first random rearrangement; performing first commutative encryption on the first participant identification matrix, and sending the first participant identification matrix after the first commutative encryption to the second participant.
[0137] In an embodiment, the first data processing module 1020 is configured to perform second random rearrangement on the second participant identification matrix after the first commutative encryption by row; performing second commutative encryption on the second participant identification matrix after the second random rearrangement, and sending the second participant identification matrix after the second commutative encryption to the second participant.
[0138] In an implementation, the first data processing module 1020 is configured to: perform intersection operation on the second time commutative encrypted first participant identification matrix and the second time commutative encrypted second participant identification matrix to obtain intersection index of the second time encrypted first participant identification matrix and the second time encrypted second participant identification matrix.
[0139] In an implementation, the second data processing module 1030 is configured to: perform feature rearrangement and fragmentation processing on the index sequence identified in the second time randomly rearranged first participant identification matrix and the first participant feature matrix to obtain the first participant feature matrix fragments at the first participant; perform feature rearrangement and fragmentation processing on the index sequence identified in the second time randomly rearranged second participant identification matrix and the second participant feature matrix to obtain the first participant feature matrix fragments at the second participant.
[0140] In an implementation, the second data processing module 1030 is configured to: receive the first time randomly rearranged index sequence sent by the second participant; the first time randomly rearranged index sequence is obtained by rearranging the pre-generated random rearrangement index sequence with the index sequence identified in the identification matrix of the second time randomly rearranged first participant original data matrix; receive the pre-generated first participant first random fragment, and rearrange the first participant first random fragment with the first time randomly rearranged index sequence to obtain the first participant feature matrix fragments at the first participant.
[0141] In an implementation, the second data processing module 1030 is configured to: rearrange the pre-generated random rearrangement index sequence with the index sequence identified in the second time randomly rearranged second participant identification matrix to obtain the first time randomly rearranged index sequence, and send the first time randomly rearranged index sequence to the second participant; determine the difference between the first additive secret sharing matrix of the second participant feature matrix and the pre-generated second participant first random fragment to obtain the first participant difference matrix; receive the second participant difference matrix; the second participant difference matrix is obtained according to the second additive secret sharing matrix of the second participant feature matrix and the pre-generated first participant second random fragment; determine the first participant feature matrix fragments at the second participant according to the first participant difference matrix, the second participant difference matrix, the pre-generated second participant first random fragment and the first time randomly rearranged index sequence.
[0142] In an implementation, the second data processing module 1030 is configured to: sum the first participant variance matrix and the second participant variance matrix to obtain a sum matrix; rearrange the sum matrix with the index sequence of the second participant identifier matrix after the second random rearrangement to obtain a first transformation matrix; rearrange the second participant first random pieces with the index sequence after the first random rearrangement to obtain a second transformation matrix; and take the sum of the first transformation matrix and the second transformation matrix as the pieces of the first participant feature matrix at the second participant.
[0143] In an implementation, the third data processing module 1040 is configured to: query the pieces of the first participant feature matrix at the first participant and the pieces of the first participant feature matrix at the second participant according to the intersection index, and splice the query results to obtain the intersection pieces.
[0144] The specific details of the above-described apparatus are described in detail in the method part implementation, and the undisclosed details can be referred to the implementation content of the method part, and thus will not be described again.
[0145] The exemplary embodiments of the present disclosure also provide a computer readable storage medium, which can be implemented in the form of a program product, and includes program code for causing an electronic device to perform the steps described in the above "Exemplary Method" section according to various exemplary embodiments of the present disclosure when the program product is run on the electronic device. In an alternative implementation, the program product can be implemented in the form of a portable compact disc read-only memory (CD-ROM) and includes program code, and can be run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus or device.
[0146] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0147] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0148] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0149] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0150] Exemplary embodiments of this disclosure also provide an electronic device, which may be, for example, the terminal 110 and server 120 described above. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as program code. The processor executes these executable instructions to perform the sample alignment method in the stealth federated modeling of this exemplary embodiment, such as executing... Figure 2 The method and steps.
[0151] The following is for reference. Figure 10 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 10 The electronic device 1000 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0152] like Figure 11 As shown, the electronic device 1100 may include: a processor 1110, a memory 1120, a bus 1130, an I / O (input / output) interface 1140, and a network adapter 1150.
[0153] The memory 1120 can include volatile memory, such as RAM 1121, on-chip cache memory 1122, and / or the like, as well as non-volatile memory, such as ROM 1123. The memory 1120 can also include one or more program modules 1124, such as an operating system, one or more application programs, other program modules, and program data, and can include an implementation of a network environment, for example, in each of, or a combination of, these examples. For example, the program modules 1124 can include the modules of the sample alignment apparatus 1000 in the federated anonymization modeling described above.
[0154] The bus 1130 serves to connect the various components of the electronic device 1100 and can include a data bus, an address bus, and a control bus.
[0155] The electronic device 1100 can communicate with one or more external devices 2000 (such as a keyboard, a mouse, a peripheral controller, etc.) via the I / O interface 1140.
[0156] The electronic device 1100 can communicate with one or more networks via the network adapter 1150, which can provide, for example, a mobile communication solution such as 3G / 4G / 5G, or a wireless communication solution such as a wireless local area network, Bluetooth, near field communication, etc. The network adapter 1150 can communicate with other modules of the electronic device 1100 via the bus 1130.
[0157] Although Figure 11 Other hardware and / or software modules can also be included in the electronic device 1100, as depicted in FIG. 11, including but not limited to a display, microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0158] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. Indeed, according to the example embodiments of the present disclosure, the features and functionalities of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functionalities of one module or unit described above can be further divided into embodied by multiple modules or units.
[0159] Those skilled in the art can understand that each aspect of the disclosure can be implemented as a system, a method or a program product. Therefore, each aspect of the disclosure can be specifically implemented as follows: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system" here. Those skilled in the art will easily conceive other embodiments of the disclosure after considering the specification and practicing the invention disclosed here. The present application is intended to cover any variations, uses or adaptations of the disclosure that follow the general principles of the disclosure and include common knowledge or conventional technical means in the art that are not disclosed by the disclosure. The specification and embodiments are only considered exemplary, and the true scope and spirit of the disclosure are indicated by the claims.
[0160] It should be understood that the present disclosure is not limited to the precise structures as herein described and illustrated in the drawings, and that various modifications and changes can be made without departing from its scope. The scope of the present disclosure is defined only by the appended claims. < / x0> < / y0> < / y0> < / x0> < / x0> < / x> < / x> < / f> < / f> < / x> < / f> < / y> < / x> < / f> < / y> < / y> < / y> < / x> < / x> < / x> < / x>
Claims
1. A sample alignment method in anonymous federated modeling, applied to the first participant, characterized in that, The method comprises the following steps: obtaining a first participant original data matrix; the original data matrix comprises an identification matrix and a feature matrix; performing disorder encryption processing on the first participant identification matrix and the second participant identification matrix, and performing intersection operation on the first participant identification matrix and the second participant identification matrix after the disorder encryption processing to obtain an intersection index, comprising the following steps: performing first disorder encryption on the first participant identification matrix, and sending the first participant identification matrix after the first disorder encryption to a second participant; receiving the second participant identification matrix after the first disorder encryption sent by the second participant; performing second disorder encryption on the second participant identification matrix after the first disorder encryption, and sending the second participant identification matrix after the second disorder encryption to the second participant; receiving the first participant identification matrix after the second disorder encryption sent by the second participant, and performing intersection operation on the first participant identification matrix after the second disorder encryption and the second participant identification matrix after the second disorder encryption to obtain the intersection index; performing feature rearrangement and fragmentation processing on the feature matrix and the index sequence identified in the identification matrix after the disorder encryption processing to obtain a first participant feature matrix fragment and a second participant feature matrix fragment; determining an intersection fragment from the first participant feature matrix fragment and the second participant feature matrix fragment according to the intersection index.
2. The method of claim 1, wherein, The method of performing first disorder encryption on the first participant identification matrix, and sending the first participant identification matrix after the first disorder encryption to a second participant, comprises the following steps: performing first random rearrangement on the first participant original data matrix by row; extracting the first participant identification matrix from the first participant original data matrix after the first random rearrangement; performing first commutative encryption on the first participant identification matrix, and sending the first participant identification matrix after the first commutative encryption to the second participant.
3. The method of claim 1, wherein, The method of performing second disorder encryption on the second participant identification matrix after the first disorder encryption, and sending the second participant identification matrix after the second disorder encryption to the second participant, comprises the following steps: performing second random rearrangement on the second participant identification matrix after the first commutative encryption by row; performing second commutative encryption on the second participant identification matrix after the second random rearrangement, and sending the second participant identification matrix after the second commutative encryption to the second participant.
4. The method of claim 3, wherein, The method of performing intersection operation on the first participant identification matrix after the second disorder encryption and the second participant identification matrix after the second disorder encryption to obtain the intersection index, comprises the following steps: performing intersection operation on the first participant identification matrix after the second commutative encryption and the second participant identification matrix after the second commutative encryption to obtain the intersection index of the first participant identification matrix after the second encryption and the second participant identification matrix after the second encryption.
5. The method of claim 1, wherein, The feature rearrangement and fragmentation processing is performed on the index sequence identified in the feature matrix and the identification matrix after the disorder encryption processing, to obtain a first participant feature matrix fragment and a second participant feature matrix fragment, including: The feature rearrangement and fragmentation processing is performed on the index sequence identified in the first participant feature matrix and the first participant identification matrix after the second random rearrangement, to obtain the first participant feature matrix fragment at the first participant. The feature rearrangement and fragmentation processing is performed on the index sequence identified in the second participant identification matrix after the second random rearrangement and the second participant feature matrix, to obtain the second participant feature matrix fragment at the first participant.
6. The method of claim 5, wherein, The feature rearrangement and fragmentation processing is performed on the index sequence identified in the first participant feature matrix and the first participant identification matrix after the second random rearrangement, to obtain the first participant feature matrix fragment at the first participant, including: The first random rearrangement index sequence is obtained by rearranging the pre-generated random rearrangement index sequence with the index sequence identified in the first participant original data matrix identification matrix after the second random rearrangement; The first participant first random fragment is received, and the first participant first random fragment is rearranged with the first random rearrangement index sequence, to obtain the first participant feature matrix fragment at the first participant.
7. The method of claim 5, wherein, The feature rearrangement and fragmentation processing is performed on the index sequence identified in the second participant identification matrix after the second random rearrangement and the second participant feature matrix, to obtain the second participant feature matrix fragment at the first participant, including: The first random rearrangement index sequence is obtained by rearranging the pre-generated random rearrangement index sequence with the index sequence identified in the second participant identification matrix after the second random rearrangement, and the first random rearrangement index sequence is sent to the second participant; The first participant difference matrix is obtained by determining the difference between the first additive secret sharing matrix of the second participant feature matrix and the pre-generated second participant first random fragment; The second participant difference matrix is received, and the second participant difference matrix is obtained according to the second additive secret sharing matrix of the second participant feature matrix and the pre-generated first participant second random fragment; The second participant feature matrix fragment at the first participant is determined according to the first participant difference matrix, the second participant difference matrix, the pre-generated second participant first random fragment and the first random rearrangement index sequence.
8. The method of claim 7, wherein, The second participant feature matrix fragment at the first participant is determined according to the first participant difference matrix, the second participant difference matrix, the pre-generated second participant first random fragment and the first random rearrangement index sequence, including: The sum matrix is obtained by summing the first participant difference matrix and the second participant difference matrix; The first transformation matrix is obtained by rearranging the sum matrix with the index sequence identified in the second participant identification matrix after the second random rearrangement; The second participant feature matrix fragment at the first participant is obtained by rearranging the first transformation matrix with the first random rearrangement index sequence. rearranging the second participant first random fragments according to the one-time random rearrangement index sequence to obtain a second transformation matrix; summing the first transformation matrix and the second transformation matrix as the second participant feature matrix fragments at the first participant.
9. The method of claim 5, wherein, The determining the intersection fragments from the first participant feature matrix fragments and the second participant feature matrix fragments according to the intersection index includes: querying the first participant feature matrix fragments at the first participant and the second participant feature matrix fragments at the first participant according to the intersection index, and splicing the query results to obtain the intersection fragments.
10. An apparatus for aligning samples in federated modeling, comprising: including: a data acquisition module configured to acquire a first participant original data matrix; The original data matrix includes an identification matrix and a feature matrix; The first data processing module is configured to reorder and encrypt the first participant identification matrix and the second participant identification matrix, and find the intersection of the reordered and encrypted first participant identification matrix and the reordered and encrypted second participant identification matrix to obtain the intersection index, including: first reordering and encrypting the first participant identification matrix, and sending the first reordering and encrypted first participant identification matrix to the second participant; receiving the first reordering and encrypted second participant identification matrix sent by the second participant; second reordering and encrypting the first reordering and encrypted second participant identification matrix, and sending the second reordering and encrypted second participant identification matrix to the second participant; receiving the second reordering and encrypted first participant identification matrix sent by the second participant, and finding the intersection of the second reordering and encrypted first participant identification matrix and the second reordering and encrypted second participant identification matrix to obtain the intersection index; The second data processing module is configured to perform feature rearrangement and fragmentation processing on the index sequence of the identification in the feature matrix and the reordered and encrypted identification matrix to obtain the first participant feature matrix fragments and the second participant feature matrix fragments. The third data processing module is configured to determine the intersection fragments from the first participant feature matrix fragments and the second participant feature matrix fragments according to the intersection index.
11. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the method of any one of claims 1-9.
12. An electronic device, comprising: including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method of any one of claims 1-9 by executing the executable instructions.
Citation Information
Patent Citations
Sample alignment method, device and equipment, and storage medium
CN114091067A
Multi-party data intersection calculation method and device and electronic equipment
CN114722049A