A method, device and electronic device for calculating intersection of multiple samples
By receiving and processing the ciphertext position mapping array sent by the participant equipment in the multi-party sample interleave calculation, the sample interleave calculation is realized, which solves the problem of low efficiency in the existing technology, improves the calculation efficiency and ensures data security.
Patent Information
- Application Number
- CN202210600587.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2042-05-30
AI Technical Summary
The existing multi-party sample interception calculation method is low in efficiency and has a large amount of calculation, resulting in low calculation efficiency.
By receiving the ciphertext position mapping array sent by multiple participants, multiplying the same position elements, generating the ciphertext product array, and obtaining the sample intersection through decryption, realizing the sample interception calculation.
Implementing element product calculation in the ciphertext state avoids the risk of leaking the sample sets held by the participant device, improves computing efficiency, and reduces dependence on complex cryptography-based computing processes.
Smart Images

Figure CN115021907B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of multi-party secure computing, and in particular to a multi-party sample intersection computing method, device and electronic device. Background Art
[0002] In the data fusion calculation process involving multiple data sources, the traditional data calculation method has the risk of data leakage. The use of multi-party secure computing technology can directly calculate on encrypted data. Although it sacrifices a certain degree of computing efficiency, it realizes data sharing and ensures security.
[0003] In multi-party secure computing technology, sample intersection calculations between multiple participants are often involved, that is, calculating the intersection of sample sets held by multiple participants. Moreover, since it is privacy computing, each participant is required to only obtain the sample intersection during the sample intersection calculation process, and cannot know the sample sets held by other participants.
[0004] At present, among the multi-party sample intersection calculation methods, the cryptographic intersection method is usually used. This method is a general method and generally does not limit the data type and length of the intersection field. The general method has high adaptability, but requires a large amount of calculation, resulting in low efficiency of the intersection calculation. Summary of the invention
[0005] The embodiments of the present application provide a multi-party sample intersection calculation method, device and electronic device to solve the problem of low efficiency of multi-party sample intersection calculation in the prior art.
[0006] The present application embodiment provides a multi-party sample intersection calculation method, which is applied to a ciphertext calculation device, including:
[0007] Receive ciphertext position mapping arrays respectively sent by multiple participant devices, where the ciphertext position mapping array sent by each participant device is obtained by encrypting the generated position mapping array by the participant device, and the position mapping array is generated by the participant device based on the complete sample set, the sample set held by the participant device, and an array created with a length equal to the number of samples in the complete sample set, according to a one-to-one correspondence between the element positions of the created array and the samples in the complete sample set, wherein in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by the participant device are non-zero preset values, and the elements at other positions are 0;
[0008] Multiply the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples in the full sample set, wherein the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays;
[0009] The ciphertext product array is sent to the participating device, so that the participating device decrypts the ciphertext product array to obtain a product array, and forms a sample intersection with samples corresponding to all non-zero positions in the product array.
[0010] Furthermore, before receiving the ciphertext position mapping arrays respectively sent by the multiple participating devices, the method further includes:
[0011] A specified arrangement order of all samples included in the sample set is sent to the multiple participant devices, where the specified arrangement order represents a one-to-one correspondence between element positions of the created array and samples of the sample set.
[0012] Furthermore, the non-zero preset value is 1.
[0013] The embodiment of the present application further provides a multi-party sample intersection calculation method, which is applied to each participant device among multiple participant devices, including:
[0014] Based on the sample set, the sample set held by itself, and the created array with the length of the number of samples of the sample set, a position mapping array is generated according to the one-to-one correspondence between the element positions of the created array and the samples of the sample set. In the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0;
[0015] Encrypt the generated position mapping array to obtain a ciphertext position mapping array;
[0016] Sending the ciphertext position mapping array to a ciphertext computing device, so that the ciphertext computing device multiplies the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples of the full sample set, wherein the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays;
[0017] Receiving the ciphertext product array from the ciphertext computing device;
[0018] Decrypting the ciphertext product array to obtain a product array;
[0019] The samples corresponding to all non-zero positions in the product array are formed into a sample intersection.
[0020] Furthermore, before generating the position mapping array according to the one-to-one correspondence between the element positions of the created array and the samples of the entire sample set, the method further includes:
[0021] Receiving a specified arrangement order of all samples included in the sample set sent by the ciphertext computing device, wherein the specified arrangement order represents a one-to-one correspondence between element positions of the created array and samples of the sample set; or
[0022] Through message interaction with other participating devices, the one-to-one correspondence between the element positions of the created array and the samples in the entire sample set is negotiated.
[0023] Furthermore, the non-zero preset value is 1.
[0024] The embodiment of the present application also provides a multi-party sample intersection calculation device, which is applied to a ciphertext calculation device, including:
[0025] An array receiving module, used for receiving ciphertext position mapping arrays respectively sent by a plurality of participating devices, wherein the ciphertext position mapping array sent by each participating device is obtained by encrypting the generated position mapping array by the participating device, and the position mapping array is generated by the participating device based on the complete set of samples, the sample set held by itself, and an array created with a length equal to the number of samples in the complete set of samples, according to a one-to-one correspondence between the element positions of the created array and the samples in the complete set of samples, wherein in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0;
[0026] a multiplication calculation module, configured to multiply the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples of the full sample set, wherein the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays;
[0027] The array sending module is used to send the ciphertext product array to the participating device, so that the participating device decrypts the ciphertext product array to obtain the product array, and forms a sample intersection with the samples corresponding to all non-zero positions in the product array.
[0028] Furthermore, the array sending module is also used to send a specified arrangement order of all samples contained in the entire sample set to the multiple participating devices before the array receiving module receives the ciphertext position mapping arrays sent by the multiple participating devices respectively, and the specified arrangement order represents a one-to-one correspondence between the element positions of the created array and the samples of the entire sample set.
[0029] Furthermore, the non-zero preset value is 1.
[0030] The embodiment of the present application further provides a multi-party sample intersection calculation device, which is applied to each participant device among multiple participant devices, including:
[0031] An array generation module is used to generate a position mapping array based on the sample set, the sample set held by itself, and the created array with a length equal to the number of samples of the sample set, according to the one-to-one correspondence between the element positions of the created array and the samples of the sample set, wherein in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0;
[0032] An array encryption module is used to encrypt the generated position mapping array to obtain a ciphertext position mapping array;
[0033] an array sending module, configured to send the ciphertext position mapping array to a ciphertext computing device, so that the ciphertext computing device multiplies the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples of the full sample set, wherein the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays;
[0034] An array receiving module, used for receiving the ciphertext product array from the ciphertext computing device;
[0035] An array decryption module, used for decrypting the ciphertext product array to obtain a product array;
[0036] The intersection calculation module is used to form a sample intersection by combining the samples corresponding to all non-zero positions in the product array.
[0037] Further, the array receiving module is further used to receive a specified arrangement order of all samples included in the sample set sent by the ciphertext computing device before the array generating module generates the position mapping array according to the one-to-one correspondence between the element positions of the created array and the samples of the sample set, wherein the specified arrangement order represents the one-to-one correspondence between the element positions of the created array and the samples of the sample set; or
[0038] Through message interaction with other participating devices, the one-to-one correspondence between the element positions of the created array and the samples in the entire sample set is negotiated.
[0039] Furthermore, the non-zero preset value is 1.
[0040] An embodiment of the present application also provides an electronic device, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to: implement any of the above-mentioned multi-party sample intersection calculation methods applied to a ciphertext calculation device, or implement any of the above-mentioned multi-party sample intersection calculation methods applied to a participant device.
[0041] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements any of the above-mentioned multi-party sample intersection calculation methods applied to a ciphertext calculation device, or implements any of the above-mentioned multi-party sample intersection calculation methods applied to a participating party device.
[0042] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned multi-party sample intersection calculation methods applied to a ciphertext calculation device, or execute any of the above-mentioned multi-party sample intersection calculation methods applied to a participant device.
[0043] The beneficial effects of this application include:
[0044] In the method provided in the embodiment of the present application, for the case where there is a full set of samples to be intersected, a one-to-one correspondence between the element positions of the array and the samples of the full set of samples is pre-established, and each participating device generates a position mapping array based on the sample set held by itself, wherein, in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0, and the elements at the same positions in multiple position mapping arrays are multiplied, and the result of one position is non-zero, indicating that the elements at the same position in the multiple position mapping arrays are all non-zero, that is, multiple participating devices all hold the samples corresponding to the position, and the samples belong to the samples in the sample intersection, and then the sample intersection is calculated, and the element product calculation is implemented in the ciphertext state, which can meet the requirement of not leaking the sample set held by the participating device, and because there is no need to adopt a complex calculation process based on cryptography, the calculation efficiency is improved.
[0045] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:
[0047] Figure 1 A flowchart of a multi-party sample intersection calculation method applied to a ciphertext calculation device provided in an embodiment of the present application;
[0048] Figure 2A flowchart of a multi-party sample intersection calculation method applied to a participant device provided in an embodiment of the present application;
[0049] Figure 3 A flowchart of a multi-party sample intersection calculation method provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of the structure of a multi-party sample intersection calculation device applied to a ciphertext calculation device provided in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of the structure of a multi-party sample intersection calculation device applied to a participant device provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to provide an implementation scheme to improve the efficiency of multi-party sample intersection calculation, the embodiments of the present application provide a multi-party sample intersection calculation method, device and electronic device. The preferred embodiments of the present application are described below in conjunction with the drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments in the present application and the features in the embodiments can be combined with each other if there is no conflict.
[0054] The present application embodiment provides a multi-party sample intersection calculation method, which is applied to a ciphertext calculation device, such as Figure 1 As shown, including:
[0055] Step 11, receiving ciphertext position mapping arrays sent by multiple participating devices respectively, wherein the ciphertext position mapping array sent by each participating device is obtained by encrypting the generated position mapping array by the participating device, and the position mapping array is generated by the participating device based on the complete sample set, the sample set held by itself, and an array created with a length equal to the number of samples in the complete sample set, according to a one-to-one correspondence between the element positions of the created array and the samples in the complete sample set, wherein in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0;
[0056] Step 12: multiply the elements at the same position in multiple ciphertext position mapping arrays received from multiple participating devices to obtain a ciphertext product array with a length equal to the number of samples in the full sample set, where the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays;
[0057] Step 13: Send the ciphertext product array to the participating device, so that the participating device decrypts the ciphertext product array to obtain the product array, and forms a sample intersection with the samples corresponding to all non-zero positions in the product array.
[0058] Accordingly, the embodiment of the present application also provides a multi-party sample intersection calculation method, which is applied to each participant device in multiple participant devices, such as Figure 2 As shown, including:
[0059] Step 21, based on the sample set, the sample set held by itself, and the created array with a length equal to the number of samples of the sample set, a position mapping array is generated according to a one-to-one correspondence between the element positions of the created array and the samples of the sample set. In the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0;
[0060] Step 22, encrypt the generated position mapping array to obtain a ciphertext position mapping array;
[0061] Step 23: Send a ciphertext position mapping array to the ciphertext calculation device, so that the ciphertext calculation device multiplies the elements at the same position in multiple ciphertext position mapping arrays received from multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples in the full sample set, and the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays;
[0062] Step 24, receiving the ciphertext product array from the ciphertext calculation device;
[0063] Step 25, decrypt the ciphertext product array to obtain a product array;
[0064] Step 26: The samples corresponding to all non-zero positions in the product array are combined into a sample intersection.
[0065] The above-mentioned multi-party sample intersection calculation method provided in the embodiment of the present application is adopted. For the case where there is a full set of samples for the samples to be intersected, a one-to-one correspondence between the element position of the array and the samples of the full set of samples is pre-established, and each participating device generates a position mapping array based on the sample set held by itself, wherein, in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0, and the elements at the same positions in multiple position mapping arrays are multiplied, and the result of one position is non-zero, indicating that the elements at the same position in the multiple position mapping arrays are all non-zero, that is, multiple participating devices all hold the samples corresponding to the position, and the sample belongs to the samples in the sample intersection, and then the sample intersection is calculated, and the element product calculation is implemented in the ciphertext state, which can meet the requirement of not leaking the sample set held by the participating device, and since there is no need to adopt a complex calculation process based on cryptography, the calculation efficiency is improved.
[0066] The above-mentioned multi-party sample intersection calculation method provided in the embodiment of the present application can be applied to the scenario where the samples held by multiple participating devices exist in the complete set of samples, for example, mobile phone numbers, the complete set of mobile phone numbers is a set of 11 digits; for example, the name of a disease, the disease can be described by ICD10 code, and the complete set is all disease codes contained in the ICD10 code.
[0067] The method and device provided by the present application are described in detail below with reference to the accompanying drawings using specific embodiments.
[0068] An embodiment of the present application provides a multi-party sample intersection calculation method, which is applied to a ciphertext calculation device and multiple participant devices, each participant device holds a sample set to be intersected, and the samples held by the multiple participant devices have a complete sample set. For example, the complete sample set is S, there are k participant devices, and the sample sets held are S1, S2, ..., Sk, respectively. The samples included in the sample sets S1, S2, ..., Sk may be different, but are all included in the complete sample set S.
[0069] The above methods, such as Figure 3 As shown, the following steps may be included:
[0070] Step 31: Each participant device obtains a one-to-one correspondence between the element position of an array whose length is the number of samples in the entire sample set and the samples in the entire sample set.
[0071] In this step, multiple participating devices can negotiate the one-to-one correspondence between the element positions of the array and the samples of the entire sample set through message interaction.
[0072] The ciphertext computing device may also determine a one-to-one correspondence between the element positions of the array and the samples of the entire sample set, and the participating device receives the correspondence sent by the ciphertext computing device.
[0073] In an embodiment of the present application, a specified arrangement order of all samples contained in the entire sample set can be used to represent a one-to-one correspondence between the element positions of an array representing the number of samples in the entire sample set and the samples in the entire sample set. More specifically, the specified arrangement order of all samples is the same as the order of the element positions in the array, i.e., a one-to-one correspondence.
[0074] Example 1: Assume that the sample set is S = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], which contains 15 samples in total, arranged in a specified order, and there are 3 participating devices. The sample sets held by each participating device are as follows:
[0075] S1 = [1,3,4,6,8];
[0076] S2 = [3,4,5,8];
[0077] S3=[2,3,6,8,11,15].
[0078] Step 32: Each participant device creates an array Li whose length is the number of samples in the entire sample set.
[0079] The initial values of the elements in the created array can all be 0.
[0080] Step 33, each participating device generates a position mapping array based on the complete sample set, the sample set it holds, and the created array whose length is the number of samples of the complete sample set, according to the one-to-one correspondence between the element positions of the created array and the samples of the complete sample set. In the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set it holds are non-zero preset values, and the elements at other positions are 0.
[0081] Furthermore, the non-zero preset value may be 1.
[0082] In this step, it can also be understood as mapping each sample in the sample set held by itself to the entire sample set, and setting the element value at the corresponding position in the array to 1. The resulting position mapping array is a 0-1 array with the same length as the entire sample set.
[0083] According to the above example 1, the location mapping array obtained by each participating device is as follows:
[0084] L1=[1,0,1,1,0,1,0,1,0,0,0,0,0,0,0];
[0085] L2=[0,0,1,1,1,0,0,1,0,0,0,0,0,0,0];
[0086] L3=[0,1,1,0,0,1,0,1,0,0,1,0,0,0,1].
[0087] Step 34: Each participant device encrypts the generated location mapping array to obtain a ciphertext location mapping array.
[0088] After encrypting the elements in the position mapping array, the elements contained in the obtained ciphertext position mapping array may be some random numbers, thereby achieving the purpose of hiding the sample set.
[0089] Step 35: Each participant device sends a ciphertext position mapping array to the ciphertext calculation device.
[0090] Step 36: After receiving the ciphertext position mapping array, the ciphertext calculation device multiplies the elements at the same position in multiple ciphertext position mapping arrays received from multiple participating devices to obtain a ciphertext product array with a length equal to the number of samples in the full set of samples. The element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays.
[0091] The specific calculation can be done using the following formula:
[0092]
[0093] Among them, R is the ciphertext product array, It is the nth element of the sample set Li held by the i-th participant device.
[0094] Step 37: The ciphertext calculation device sends the ciphertext product array to the participating device.
[0095] Specifically, the ciphertext product array may be sent directly to each participating device, or may be sent to a designated device, which then forwards it to each participating device.
[0096] Step 38: After receiving the ciphertext product array from the ciphertext calculation device, the participant device decrypts the ciphertext product array to obtain a product array.
[0097] The resulting product array is a 0-1 array.
[0098] According to the above example 1, the product array obtained by the participating device after decrypting the ciphertext product array is as follows:
[0099] R=[0,0,1,0,0,0,0,1,0,0,0,0,0,0,0].
[0100] Step 39: The participating device forms a sample intersection with the samples corresponding to all non-zero positions in the product array.
[0101] According to Example 1 above, the elements at positions 3 and 8 in the product array are 1, and the samples corresponding to positions 3 and 8 are 3 and 8 respectively, so the obtained sample intersection is [3,8].
[0102] By adopting the above-mentioned multi-party sample intersection calculation method provided in the embodiment of the present application, in the process of calculating the intersection, the ciphertext calculation device only needs to perform multiplication operations. Compared with the complex calculation process based on cryptography in the prior art, the execution efficiency is higher, thereby improving the efficiency of the multi-party intersection calculation.
[0103] Moreover, when adding or reducing the number of participants, the calculation logic for plaintext and ciphertext does not change, which can more flexibly support the participation of multiple parties and improve the flexibility of multi-party intersection calculation.
[0104] Based on the same inventive concept, according to the multi-party sample intersection calculation method applied to the ciphertext calculation device provided in the above embodiment of the present application, correspondingly, another embodiment of the present application also provides a multi-party sample intersection calculation device, which is applied to the ciphertext calculation device, and its structural schematic diagram is shown as follows: Figure 4 As shown, specifically including:
[0105] An array receiving module 41 is used to receive ciphertext position mapping arrays sent by multiple participating devices, wherein the ciphertext position mapping array sent by each participating device is obtained by encrypting the generated position mapping array by the participating device, and the position mapping array is generated by the participating device based on the complete sample set, the sample set held by itself, and an array created with a length equal to the number of samples in the complete sample set, according to a one-to-one correspondence between the element positions of the created array and the samples in the complete sample set, wherein in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0;
[0106] A multiplication calculation module 42 is used to multiply the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples of the full sample set, wherein the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays;
[0107] The array sending module 43 is used to send the ciphertext product array to the participating device, so that the participating device decrypts the ciphertext product array to obtain the product array, and forms a sample intersection with the samples corresponding to all non-zero positions in the product array.
[0108] Furthermore, the array sending module 43 is also used to send a specified arrangement order of all samples contained in the entire sample set to the multiple participating devices before the array receiving module 41 receives the ciphertext position mapping arrays sent by the multiple participating devices respectively, and the specified arrangement order represents a one-to-one correspondence between the element positions of the created array and the samples of the entire sample set.
[0109] Furthermore, the non-zero preset value is 1.
[0110] Based on the same inventive concept, according to the multi-party sample intersection calculation method applied to the participant device provided in the above embodiment of the present application, correspondingly, another embodiment of the present application also provides a multi-party sample intersection calculation device, which is applied to each participant device in the multiple participant devices, and its structural schematic diagram is shown as follows: Figure 5 As shown, specifically including:
[0111] An array generation module 51 is used to generate a position mapping array based on the sample set, the sample set held by itself, and the created array with a length equal to the number of samples of the sample set, according to a one-to-one correspondence between the element positions of the created array and the samples of the sample set, wherein in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0;
[0112] An array encryption module 52 is used to encrypt the generated position mapping array to obtain a ciphertext position mapping array;
[0113] An array sending module 53 is used to send the ciphertext position mapping array to the ciphertext calculation device, so that the ciphertext calculation device multiplies the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length of the number of samples of the full set of samples, and the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays;
[0114] An array receiving module 54, configured to receive the ciphertext product array from the ciphertext computing device;
[0115] An array decryption module 55, used to decrypt the ciphertext product array to obtain a product array;
[0116] The intersection calculation module 56 is used to form a sample intersection by combining the samples corresponding to all non-zero positions in the product array.
[0117] Further, the array receiving module 54 is further configured to receive a specified arrangement order of all samples included in the sample set sent by the ciphertext computing device before the array generating module 51 generates the position mapping array according to the one-to-one correspondence between the element positions of the created array and the samples of the sample set, wherein the specified arrangement order represents the one-to-one correspondence between the element positions of the created array and the samples of the sample set; or
[0118] Through message interaction with other participating devices, the one-to-one correspondence between the element positions of the created array and the samples in the entire sample set is negotiated.
[0119] Furthermore, the non-zero preset value is 1.
[0120] The functions of the above modules can correspond to Figures 1 to 3 The corresponding processing steps in the shown process will not be repeated here.
[0121] The multi-party sample intersection calculation device provided in the embodiment of the present application can be implemented by a computer program. Those skilled in the art should be able to understand that the above module division method is only one of many module division methods. If it is divided into other modules or not divided into modules, as long as the multi-party sample intersection calculation device has the above functions, it should be within the protection scope of the present application.
[0122] The present application also provides an electronic device, such as Figure 6 As shown, it includes a processor 61 and a machine-readable storage medium 62, and the machine-readable storage medium 62 stores machine-executable instructions that can be executed by the processor 61. The processor 61 is prompted by the machine-executable instructions to: implement any of the above-mentioned multi-party sample intersection calculation methods applied to ciphertext calculation devices, or implement any of the above-mentioned multi-party sample intersection calculation methods applied to participant devices.
[0123] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements any of the above-mentioned multi-party sample intersection calculation methods applied to a ciphertext calculation device, or implements any of the above-mentioned multi-party sample intersection calculation methods applied to a participating party device.
[0124] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned multi-party sample intersection calculation methods applied to a ciphertext calculation device, or execute any of the above-mentioned multi-party sample intersection calculation methods applied to a participant device.
[0125] The machine-readable storage medium in the electronic device may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor.
[0126] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0127] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0128] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0129] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A multi-party sample intersection calculation method, characterized in that: Applied to ciphertext computing devices, including: Receive ciphertext position mapping arrays respectively sent by multiple participant devices, where the ciphertext position mapping array sent by each participant device is obtained by encrypting the generated position mapping array by the participant device, and the position mapping array is generated by the participant device based on the complete sample set, the sample set held by the participant device, and an array created with a length equal to the number of samples in the complete sample set, according to a one-to-one correspondence between the element positions of the created array and the samples in the complete sample set, wherein in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by the participant device are non-zero preset values, and the elements at other positions are 0; Multiply the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples in the full sample set, wherein the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays; The ciphertext product array is sent to the participating device, so that the participating device decrypts the ciphertext product array to obtain a product array, and forms a sample intersection with samples corresponding to all non-zero positions in the product array.
2. The method according to claim 1, characterized in that Before receiving the ciphertext position mapping arrays respectively sent by the multiple participant devices, the method further includes: A specified arrangement order of all samples included in the sample set is sent to the multiple participant devices, where the specified arrangement order represents a one-to-one correspondence between element positions of the created array and samples of the sample set.
3. The method according to claim 1, characterized in that The non-zero preset value is 1.
4. A multi-party sample intersection calculation method, characterized in that: Applied to each of the plurality of party devices, including: Based on the sample set, the sample set held by itself, and the created array with the length of the number of samples of the sample set, a position mapping array is generated according to the one-to-one correspondence between the element positions of the created array and the samples of the sample set. In the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0; Encrypt the generated position mapping array to obtain a ciphertext position mapping array; Sending the ciphertext position mapping array to a ciphertext computing device, so that the ciphertext computing device multiplies the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples of the full sample set, wherein the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays; Receiving the ciphertext product array from the ciphertext computing device; Decrypting the ciphertext product array to obtain a product array; The samples corresponding to all non-zero positions in the product array are formed into a sample intersection.
5. The method according to claim 4, characterized in that Before generating the position mapping array according to the one-to-one correspondence between the element positions of the created array and the samples of the entire sample set, the method further includes: Receiving a specified arrangement order of all samples included in the sample set sent by the ciphertext computing device, wherein the specified arrangement order represents a one-to-one correspondence between element positions of the created array and samples of the sample set; or Through message interaction with other participating devices, the one-to-one correspondence between the element positions of the created array and the samples in the entire sample set is negotiated.
6. The method according to claim 4, characterized in that The non-zero preset value is 1.
7. A multi-party sample intersection calculation device, characterized in that: Applied to ciphertext computing devices, including: An array receiving module, used for receiving ciphertext position mapping arrays respectively sent by a plurality of participating devices, wherein the ciphertext position mapping array sent by each participating device is obtained by encrypting the generated position mapping array by the participating device, and the position mapping array is generated by the participating device based on the complete set of samples, the sample set held by itself, and an array created with a length equal to the number of samples in the complete set of samples, according to a one-to-one correspondence between the element positions of the created array and the samples in the complete set of samples, wherein in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0; a multiplication calculation module, configured to multiply the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples of the full sample set, wherein the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays; The array sending module is used to send the ciphertext product array to the participating device, so that the participating device decrypts the ciphertext product array to obtain the product array, and forms a sample intersection with the samples corresponding to all non-zero positions in the product array.
8. A multi-party sample intersection calculation device, characterized in that: Applied to each of the plurality of party devices, including: An array generation module is used to generate a position mapping array based on the sample set, the sample set held by itself, and the created array with a length equal to the number of samples of the sample set, according to the one-to-one correspondence between the element positions of the created array and the samples of the sample set, wherein in the generated position mapping array, the elements at the corresponding positions of the samples contained in the sample set held by itself are non-zero preset values, and the elements at other positions are 0; An array encryption module is used to encrypt the generated position mapping array to obtain a ciphertext position mapping array; an array sending module, configured to send the ciphertext position mapping array to a ciphertext computing device, so that the ciphertext computing device multiplies the elements at the same position in the multiple ciphertext position mapping arrays received from the multiple participant devices to obtain a ciphertext product array with a length equal to the number of samples of the full sample set, wherein the element at each position in the ciphertext product array is the product of the elements at the same position in the multiple ciphertext position mapping arrays; An array receiving module, used for receiving the ciphertext product array from the ciphertext computing device; An array decryption module, used for decrypting the ciphertext product array to obtain a product array; The intersection calculation module is used to form a sample intersection by combining the samples corresponding to all non-zero positions in the product array.
9. An electronic device, characterized in that: The invention comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement any of the methods described in claims 1-3, or to implement any of the methods described in claims 4-6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the method described in any one of claims 1 to 3, or implements the method described in any one of claims 4 to 6.
Citation Information
Patent Citations
Intersection calculation method for privacy protection
CN105205406A
A privacy protection set intersection calculation method and system based on polynomial representation
CN109886029A