A data joint statistics method, device and electronic equipment in privacy computing
By collaborating among multiple encrypted computing nodes and employing privacy-preserving computation algorithms to process data in encrypted form, the problem of low data security in joint data statistics is solved, and secure joint data statistical results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAKONG TSINGJIAO INFORMATION SCI BEIJING LTD
- Filing Date
- 2023-05-17
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies have low data security in joint data statistics, as the initiator may be able to obtain the specific values of the intersecting users.
By collaborating among multiple encrypted computing nodes and employing a pre-defined privacy computing algorithm, data processing is performed to obtain a multi-dimensional data structure M when the data is encrypted. This enables joint data statistics and ensures that none of the participating parties can obtain the intersection ID and its characteristic data.
The joint data statistics process improves data security, ensuring that participants cannot know the intersection ID and its characteristic data, thus achieving joint data statistics in privacy computing.
Smart Images

Figure CN116561802B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of privacy computing technology, and in particular to a data joint statistics method, apparatus and electronic device for privacy computing. Background Technology
[0002] With the widespread application of privacy-preserving computation technologies, especially multi-party secure computation, the demand for joint statistical analysis of secure data based on multi-party participation is increasing. A common scenario for joint statistical analysis is to statistically analyze the joint distribution of certain attributes among users at the intersection of multiple participants.
[0003] Taking two participants, each holding data containing a category attribute, as an example, if participant A's data contains a user ID column and a category attribute column V1, with a total of m categories, and participant B's data contains a user ID column and a category attribute column V2, with a total of n categories, it is necessary to jointly count to obtain a matrix M of size m*n, where Mij represents the number of users in the intersection of the two parties who simultaneously belong to category V1i and category V2j.
[0004] The commonly used approach is to first use hidden query technology to return the attribute values corresponding to the users at the intersection of all participating parties to the initiator. Then, the initiator performs joint statistics on the plaintext, combining the intersection with another attribute of its own users. One problem with this approach is that the initiator will know all the users at the intersection and the specific values of a certain attribute of the users at the intersection in other participating parties. Summary of the Invention
[0005] This application provides a data joint statistics method, apparatus, and electronic device for privacy computing, which aims to solve the problem of low data security in the prior art during data joint statistics.
[0006] This application provides a data joint statistics method for privacy computing, applied to a encrypted computing node. Each of the multiple participants holds multiple IDs and multiple feature data belonging to a category attribute, where the category attribute includes multiple categories. The method includes:
[0007] Through collaboration with other encrypted computation nodes, and using a pre-defined privacy computation algorithm, the following steps are performed when the data is encrypted:
[0008] For each participant, obtain the multiple IDs held by the participant, and multiple feature mapping data corresponding one-to-one with the multiple IDs. The multiple feature mapping data is obtained by mapping the multiple feature data held by the participant to corresponding integer values. The multiple categories included in the category attribute held by the participant correspond one-to-one with the multiple integer values, and there is no 0 among the multiple integer values.
[0009] Based on the multiple IDs held by each participant, the multiple feature mapping data, and the multiple integer values, data processing is performed according to a preset data comparison and calculation method to obtain a multidimensional data structure M. The multiple dimensions of the multidimensional data structure M correspond one-to-one with multiple category attributes. The multidimensional data structure M is the joint statistical result of encrypted data. The joint statistical result is the number of IDs belonging to any combination of the multiple category attributes in the intersection IDs of the multiple participants.
[0010] Furthermore, the multiple participants include N participants P. n Participant P n The category attribute includes multiple categories, the number of which is m. n n takes the value of an integer from 1 to N;
[0011] The process involves performing data processing based on the multiple IDs held by each participant, the multiple feature mapping data, and the multiple integer values, according to a preset data comparison and calculation method, to obtain a multi-dimensional data structure M, including:
[0012] For each ID1 of participant P1, and for every other participant P i The ID1 is matched with the participant P. i The multiple IDs i By comparison, the flag vector of ID1 is obtained. 1-i The flag vector 1-i Includes the multiple IDs i Multiple elements in a one-to-one correspondence, where, for each ID i If the ID i If the value is the same as ID1, the corresponding element is 1; otherwise, it is 0. The value of i is an integer from 2 to N.
[0013] The N-1 flag vectors of ID1 1-i Multiply the corresponding elements to obtain the flag vector for ID1;
[0014] The multiple elements contained in the flag vector flag of ID1 are summed, and the sum is multiplied by the feature mapping data of ID1. The product is then compared with m1 integer values to obtain the flag vector flag1 of ID1. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0.
[0015] The flag vector flag1 of ID1 is copied into a multidimensional data structure M1. The multiple dimensions of the multidimensional data structure M1 correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product;
[0016] For each of the other participants P i Calculate the flag vector of ID1 and the flag vector of participant P. i The inner product of a vector composed of multiple feature mapping data points, and the inner product of this inner product with m i Compare these integer values to obtain the flag vector for ID1. i The flag vector i Includes the m i Multiple elements corresponding to each integer value, wherein for each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0;
[0017] The flag vector of ID1 i Copy into a multidimensional data structure M i The multidimensional data structure M i The multiple dimensions correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product;
[0018] This multidimensional data structure M1 of ID1 is then compared with the multidimensional data structure M. N Multiply the corresponding elements to obtain the multidimensional data structure M' of ID1;
[0019] The corresponding elements of the multidimensional data structures M' of the multiple ID1 of participant P1 are added together to obtain the multidimensional data structure M.
[0020] Furthermore, the multiple participants include a first participant and a second participant. The first participant holds multiple first IDs and multiple first feature data belonging to a first category attribute, and the second participant holds multiple second IDs and multiple second feature data belonging to a second category attribute. The first category attribute includes m1 first categories, and the second category attribute includes m2 second categories. The multiple feature mapping data held by the first participant are multiple first feature mapping data, and the multiple feature mapping data held by the second participant are multiple second feature mapping data. The m1 first categories correspond one-to-one with m1 integer values, and the m2 second categories correspond one-to-one with m2 integer values. There is no 0 among the m1 integer values and the m2 integer values.
[0021] The process involves processing data based on the multiple IDs held by each participant, the multiple feature mapping data, and the multiple integer values according to a preset data comparison and calculation method, to obtain a multidimensional data structure M, including:
[0022] Based on the plurality of first IDs and the plurality of second IDs, the plurality of first feature mapping data and the plurality of second feature mapping data, and the m1 integer values and the m2 integer values, data processing is performed according to a preset data comparison and calculation method to obtain an m1×m2 matrix M, which serves as a multidimensional data structure M. The joint statistical result of the data is the number of IDs that simultaneously belong to either the first category or the second category among the intersection IDs of the plurality of first IDs and the plurality of second IDs.
[0023] Furthermore, based on the plurality of first IDs and the plurality of second IDs, the plurality of first feature mapping data and the plurality of second feature mapping data, and the m1 integer values and the m2 integer values, data processing is performed according to a preset data comparison and calculation method to obtain an m1×m2 matrix M, including:
[0024] For each first ID, the first ID is compared with the plurality of second IDs to obtain a flag vector flag for the first ID. The flag vector flag contains a plurality of elements that correspond one-to-one with the plurality of second IDs. For each second ID, if the second ID is the same as the first ID, the corresponding element is 1, otherwise it is 0.
[0025] The flag vector flag of the first ID is summed, and the sum is multiplied by the first feature mapping data of the first ID. The product is then compared with the m1 integer values to obtain the flag vector flag1 of the first ID. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0.
[0026] The flag vector flag1 of the first ID is copied m2-1 times to obtain the m1×m2 matrix M1 of the first ID;
[0027] Calculate the inner product of the flag vector flag of the first ID and the vector composed of the multiple second feature mapping data, compare the inner product with the m2 integer values to obtain the flag vector flag2 of the first ID. The flag vector flag2 contains multiple elements that correspond one-to-one with the m2 integer values. For each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0.
[0028] The flag vector flag2 of the first ID is copied m1-1 times to obtain the m1×m2 matrix M2 of the first ID;
[0029] Multiply the corresponding elements of the first ID matrix M1 and matrix M2 to obtain the first ID matrix M' of m1×m2;
[0030] Add the corresponding elements of each matrix M' of the multiple first IDs to obtain an m1×m2 matrix M.
[0031] This application also provides a data joint statistics device for privacy computing, applied to a ciphertext computing node. Each of the multiple participants holds multiple IDs and multiple feature data belonging to a category attribute, where the category attribute includes multiple categories. The device is used to achieve data joint statistics in privacy computing by cooperating with other ciphertext computing nodes and employing a preset privacy computing algorithm, when the data is ciphertext. The device includes:
[0032] The data acquisition module is used to acquire, for each participant, the multiple IDs held by that participant, and multiple feature mapping data corresponding one-to-one with the multiple IDs. The multiple feature mapping data is obtained by mapping the multiple feature data held by the participant to corresponding integer values. The multiple categories included in the category attribute held by the participant correspond one-to-one with the multiple integer values, and there is no 0 among the multiple integer values.
[0033] The data statistics module is used to perform data processing based on the multiple IDs held by each participant, the multiple feature mapping data, and the multiple integer values, according to a preset data comparison and calculation method, to obtain a multidimensional data structure M. The multiple dimensions of the multidimensional data structure M correspond one-to-one with multiple category attributes. The multidimensional data structure M is the joint statistical result of encrypted data. The joint statistical result is the number of IDs belonging to any combination of the multiple category attributes in the intersection IDs of the multiple participants.
[0034] Furthermore, the multiple participants include N participants P. n Participant P n The category attribute includes multiple categories, the number of which is m. n n takes the value of an integer from 1 to N;
[0035] The data statistics module is specifically used for each ID1 of participant P1, and for each other participant P. i The ID1 is matched with the participant P. i The multiple IDs i By comparison, the flag vector of ID1 is obtained.1-i The flag vector 1-i Includes the multiple IDs i Multiple elements in a one-to-one correspondence, where, for each ID i If the ID i If the value is the same as ID1, the corresponding element is 1; otherwise, it is 0. The value of i is an integer from 2 to N.
[0036] The N-1 flag vectors of ID1 1-i Multiply the corresponding elements to obtain the flag vector for ID1;
[0037] The multiple elements contained in the flag vector flag of ID1 are summed, and the sum is multiplied by the feature mapping data of ID1. The product is then compared with m1 integer values to obtain the flag vector flag1 of ID1. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0.
[0038] The flag vector flag1 of ID1 is copied into a multidimensional data structure M1. The multiple dimensions of the multidimensional data structure M1 correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product;
[0039] For each of the other participants P i Calculate the flag vector of ID1 and the flag vector of participant P. i The inner product of a vector composed of multiple feature mapping data points, and the inner product of this inner product with m i Compare these integer values to obtain the flag vector for ID1. i The flag vector i Includes the m i Multiple elements corresponding to each integer value, wherein for each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0;
[0040] The flag vector of ID1 i Copy into a multidimensional data structure M i The multidimensional data structure M i The multiple dimensions correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product;
[0041] This multidimensional data structure M1 of ID1 is then compared with the multidimensional data structure M. N Multiply the corresponding elements to obtain the multidimensional data structure M' of ID1;
[0042] The corresponding elements of the multidimensional data structures M' of the multiple ID1 of participant P1 are added together to obtain the multidimensional data structure M.
[0043] Furthermore, the multiple participants include a first participant and a second participant. The first participant holds multiple first IDs and multiple first feature data belonging to a first category attribute, and the second participant holds multiple second IDs and multiple second feature data belonging to a second category attribute. The first category attribute includes m1 first categories, and the second category attribute includes m2 second categories. The multiple feature mapping data held by the first participant are multiple first feature mapping data, and the multiple feature mapping data held by the second participant are multiple second feature mapping data. The m1 first categories correspond one-to-one with m1 integer values, and the m2 second categories correspond one-to-one with m2 integer values. There is no 0 among the m1 integer values and the m2 integer values.
[0044] The data statistics module is specifically used to perform data processing based on the plurality of first IDs and the plurality of second IDs, the plurality of first feature mapping data and the plurality of second feature mapping data, and the m1 integer values and the m2 integer values, according to a preset data comparison and calculation method, to obtain an m1×m2 matrix M as a multidimensional data structure M. The joint statistical result of the data is the number of IDs that simultaneously belong to any first category and any second category among the intersection IDs of the plurality of first IDs and the plurality of second IDs.
[0045] Furthermore, the data statistics module is specifically used to compare each first ID with the plurality of second IDs to obtain a flag vector flag for the first ID. The flag vector flag contains a plurality of elements that correspond one-to-one with the plurality of second IDs. For each second ID, if the second ID is the same as the first ID, the corresponding element is 1; otherwise, it is 0.
[0046] The flag vector flag of the first ID is summed, and the sum is multiplied by the first feature mapping data of the first ID. The product is then compared with the m1 integer values to obtain the flag vector flag1 of the first ID. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0.
[0047] The flag vector flag1 of the first ID is copied m2-1 times to obtain the m1×m2 matrix M1 of the first ID;
[0048] Calculate the inner product of the flag vector flag of the first ID and the vector composed of the multiple second feature mapping data, compare the inner product with the m2 integer values to obtain the flag vector flag2 of the first ID. The flag vector flag2 contains multiple elements that correspond one-to-one with the m2 integer values. For each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0.
[0049] The flag vector flag2 of the first ID is copied m1-1 times to obtain the m1×m2 matrix M2 of the first ID;
[0050] Multiply the corresponding elements of the first ID matrix M1 and matrix M2 to obtain the first ID matrix M' of m1×m2;
[0051] Add the corresponding elements of each matrix M' of the multiple first IDs to obtain an m1×m2 matrix M.
[0052] This 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 the data joint statistics method in any of the above privacy computing methods.
[0053] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the data joint statistics method in any of the above-described privacy computing methods.
[0054] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the above-described privacy computing data joint statistical methods.
[0055] The beneficial effects of this application include:
[0056] In the method provided in this application embodiment, multiple encrypted computing nodes collaborate and employ a preset privacy computing algorithm to achieve joint data statistics when the data is encrypted. This includes obtaining multiple IDs held by each participant and multiple corresponding feature mapping data. Then, based on the multiple IDs of each participant, the multiple feature mapping data, and multiple integer values corresponding to multiple categories included in each category attribute, data processing is performed according to a preset data comparison and calculation method to obtain a multidimensional data structure M. The multidimensional data structure M is the joint statistical result of the encrypted data. Decrypting the multidimensional data structure M yields the joint statistical result, thus realizing joint data statistics in privacy computing. Furthermore, during the joint data statistics process, none of the participants can obtain the intersection ID and the feature data of the intersection ID, improving the data security of the joint data statistics.
[0057] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. Attached Figure Description
[0058] The accompanying drawings are provided to further illustrate the present application and form part of the specification. They are used together with the embodiments of the present application to explain the application and do not constitute a limitation thereof. In the drawings:
[0059] Figure 1 A flowchart of the data joint statistics method in privacy computing provided in the embodiments of this application;
[0060] Figure 2 A flowchart of the data joint statistics method in privacy computing provided in Embodiment 1 of this application;
[0061] Figure 3 A flowchart of the data joint statistics method in privacy computing provided in Embodiment 2 of this application;
[0062] Figure 4 A schematic diagram of the structure of the data joint statistics device in privacy computing provided in the embodiments of this application;
[0063] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0064] To provide a solution for improving data security in joint data statistics, this application provides a method, apparatus, and electronic device for joint data statistics in privacy computing. The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features described in this application can be combined with each other unless otherwise specified.
[0065] This application provides a data joint statistics method for privacy computing, applied to a encrypted computing node. Each participant holds multiple IDs and multiple feature data belonging to a category attribute, where the category attribute includes multiple categories, such as... Figure 1 As shown, the method includes:
[0066] Through collaboration with other encrypted computation nodes, and using a pre-defined privacy computation algorithm, the following steps are performed when the data is encrypted:
[0067] Step 11: For each participant, obtain multiple IDs held by the participant and multiple feature mapping data corresponding to each ID. The multiple feature mapping data is obtained by mapping the multiple feature data held by the participant to corresponding integer values. The multiple categories included in the category attribute held by the participant correspond one-to-one with multiple integer values, and there is no 0 among the multiple integer values.
[0068] Step 12: Based on the multiple IDs held by each participant, multiple feature mapping data, and multiple integer values, perform data processing according to the preset data comparison and calculation method to obtain a multidimensional data structure M. The multiple dimensions of the multidimensional data structure M correspond one-to-one with multiple category attributes. The multidimensional data structure M is the joint statistical result of the encrypted data. The joint statistical result is the number of IDs belonging to any combination of multiple category attributes in the intersection IDs of multiple participants.
[0069] The data joint statistics method provided in the embodiments of this application realizes data joint statistics in privacy computing. Furthermore, during the data joint statistics process, none of the participating parties can know the intersection ID and the characteristic data of the intersection ID, thereby improving the data security of data joint statistics.
[0070] In this embodiment of the application, during the joint data statistics process, multiple encrypted computing nodes adopt a preset privacy computing algorithm, so that statistics can be achieved even when the data is encrypted. The privacy computing algorithm adopted can be any feasible algorithm, such as a secret sharing algorithm.
[0071] The ID held by the participant can be a user ID, and the feature data held can be the feature data of that user ID.
[0072] The method and apparatus provided in this application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0073] Example 1:
[0074] Embodiment 1 of this application provides a method for joint data statistics in privacy computing, wherein multiple participants include N participants P. n The value of n is an integer from 1 to N, that is, the participants P1 to P2. N Participant P n The category attribute includes multiple categories, the number of which is m. n That is, m1 to m N ,like Figure 2 As shown, it includes:
[0075] Step 201: The participants in the joint data statistics will map the feature data they hold to the corresponding integer values to obtain feature mapping data. Specifically, the mapping can be performed according to the pre-established mapping relationship between each category and each integer value included in the category attributes.
[0076] In this embodiment of the application, participant P n Holding multiple IDs with one-to-one correspondence n And multiple feature data belonging to the same category attribute, and the participant P n The category attributes held include m n Each category, participant P n Each piece of feature data held belongs to m n One of the categories.
[0077] Specifically, the mapping correspondence can be m n Each category and m n Each of the integer values corresponds one-to-one, and m n There is no 0 among the integer values, m n Each integer value is distinct; for example, it could be from 1 to m. n Integers.
[0078] In this step, participant P n You can follow m n The first category and m n A one-to-one correspondence between integer values maps multiple feature data belonging to this category attribute into multiple feature mapping data.
[0079] Step 202: The participants in the joint data statistics encrypt the ID and feature mapping data they hold to obtain ciphertext ID and feature mapping data.
[0080] In this embodiment of the application, in order to achieve privacy computing, the held ID and feature mapping data are encrypted. The encryption algorithm used is related to the privacy computing algorithm used. For example, if the privacy computing algorithm used is the secret sharing algorithm, the held data (including ID and feature mapping data) can be split into multiple data fragments according to the number of multiple ciphertext computing nodes participating in the computing, and sent to each ciphertext computing node one by one for subsequent privacy computing.
[0081] The subsequent steps 203-210 involve collaboration among multiple ciphertext computing nodes to perform joint data statistics based on the ciphertext data. For ease of description and understanding, the following steps 203-210 are described as a single execution entity with multiple ciphertext computing nodes as a whole, and the data in the example is plaintext data.
[0082] Step 203: For each ID1 of participant P1, and for each other participant P... i The ID1 is matched with the participant P. i Multiple IDs i By comparison, the flag vector of ID1 is obtained. 1-i The flag vector 1-i Contains multiple IDs i Multiple elements in a one-to-one correspondence, where, for each ID i If the ID i If the value is the same as ID1, the corresponding element is 1; otherwise, it is 0. The value of i is an integer from 2 to N.
[0083] For each of the other participants P i Each of them will obtain a flag vector. 1-i A total of N-1 flag vectors can be obtained. 1-i That is, flag 1-2 To flag 1-N .
[0084] Step 204: Calculate the N-1 flag vectors of ID1. 1-i Multiply the corresponding elements to obtain the flag vector for ID1.
[0085] Step 205: Sum the multiple elements contained in the flag vector of ID1, multiply the sum by the feature mapping data of ID1, and compare the product with m1 integer values to obtain the flag vector flag1 of ID1. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1, otherwise it is 0.
[0086] Step 206: Copy the flag vector flag1 of ID1 into a multidimensional data structure M1. The multiple dimensions of this multidimensional data structure M1 correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product of.
[0087] In this embodiment of the application, the multidimensional data structure can also be understood as a multidimensional data space or a multidimensional array. If the number of participants is 2, then the multidimensional data structure is a two-dimensional data structure, that is, a matrix.
[0088] Step 207: For each of the other participants P i Calculate the flag vector of ID1 and the flag vector of participant P. i The inner product of a vector composed of multiple feature mapping data points, and the inner product of this inner product with m i Compare these integer values to obtain the flag vector for ID1. i The flag vector i Includes m i There are multiple elements corresponding to each integer value. For each integer value, if the integer value is the same as the inner product, the corresponding element is 1; otherwise, it is 0.
[0089] In this step, the value of i is an integer from 2 to N, thus obtaining N-1 flag vectors for ID1. i That is, flag2 to flag N .
[0090] Step 208: Set the flag vector of ID1. i Copy into a multidimensional data structure M i The multidimensional data structure M i The multiple dimensions correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product of.
[0091] In this step, N-1 multidimensional data structures M of ID1 will be obtained. i That is, M2 to M N .
[0092] There is no strict order between steps 205-206 and steps 207-208.
[0093] Step 209: Transfer the multidimensional data structure M1 of ID1 to the multidimensional data structure M N Multiplying the corresponding elements yields the multidimensional data structure M' of ID1.
[0094] For each ID1 of participant P1, the above steps 203 to 209 are executed, resulting in multiple multidimensional data structures M' that correspond one-to-one with multiple ID1.
[0095] Step 210: Add the corresponding elements of the multidimensional data structures M' of the multiple ID1 of participant P1 to obtain the multidimensional data structure M.
[0096] The multidimensional data structure M has multiple dimensions that correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product of the multidimensional data structure M is the joint statistical result of the encrypted data. The joint statistical result is the number of IDs belonging to any combination of the multiple category attributes in the intersection IDs of multiple participants. Any combination of categories includes any category in each category attribute.
[0097] In this embodiment of the application, after multiple ciphertext computing nodes have calculated the joint statistical result of the ciphertext data, they can decrypt the multidimensional data structure M to obtain the joint statistical result of the plaintext data, and send the joint statistical result of the data to the result recipient. For example, the joint statistical result of the data can be returned to any participating party, or it can be sent to other third parties.
[0098] In this embodiment of the application, multiple ciphertext computing nodes can also send the joint statistical results of the ciphertext data to the result recipient. For example, the joint statistical results of the ciphertext data can be returned to any participating party, or it can be sent to other third parties, so that the result recipient can decrypt the multidimensional data structure M to obtain the joint statistical results of the plaintext data.
[0099] Example 2:
[0100] In this embodiment of the application, the multiple participants can be two participants, namely, a first participant and a second participant. The first participant holds multiple first IDs and multiple first feature data belonging to the first category attribute, and the second participant holds multiple second IDs and multiple second feature data belonging to the second category attribute. The first category attribute includes m1 first categories, and the second category attribute includes m2 second categories. The multiple feature mapping data held by the first participant are multiple first feature mapping data, and the multiple feature mapping data held by the second participant are multiple second feature mapping data. The m1 first categories correspond one-to-one with m1 integer values, and the m2 second categories correspond one-to-one with m2 integer values. There is no 0 among the m1 integer values and the m2 integer values.
[0101] Accordingly, regarding the above Figure 1 Step 12 can be specifically described as follows:
[0102] Based on multiple first IDs and multiple second IDs, multiple first feature mapping data and multiple second feature mapping data, as well as m1 integer values and m2 integer values, data processing is performed according to a preset data comparison and calculation method to obtain an m1×m2 matrix M, which serves as a multidimensional data structure M. That is, matrix M is the joint statistical result of the encrypted data. The joint statistical result is the number of IDs that belong to both the first category and the second category in the intersection of multiple first IDs and multiple second IDs.
[0103] The method provided in this application embodiment is described in detail below for a scenario where there are two participants.
[0104] Embodiment 2 of this application provides a method for joint statistical analysis of data in privacy computing, such as... Figure 3 As shown, it includes:
[0105] Step 31: The participants in the joint data statistics will map the feature data they hold to the corresponding integer values to obtain feature mapping data. Specifically, the mapping can be carried out according to the pre-established mapping relationship between each category and each integer value included in the category attributes.
[0106] In this embodiment of the application, the first participant holds multiple first IDs and multiple first feature data belonging to the first category attribute, and the second participant holds multiple second IDs and multiple second feature data belonging to the second category attribute. The first category attribute includes m1 first categories, and the second category attribute includes m2 second categories. Each first feature data held by the first participant belongs to one of the m1 first categories, and each second feature data held by the second participant belongs to one of the m2 second categories.
[0107] Specifically, the mapping correspondence can be a one-to-one correspondence between m1 first categories and m1 integer values, and a one-to-one correspondence between m2 second categories and m2 integer values. Furthermore, there is no 0 among the m1 and m2 integer values, and all m1 integer values are different, for example, they can be integers from 1 to m1. All m2 integer values are different, for example, they can be integers from 1 to m2.
[0108] In this step, the first participant can map the multiple first feature data belonging to the first category attribute to multiple first feature mapping data according to the one-to-one correspondence between m1 first categories and m1 integer values. Similarly, the second participant can map the multiple second feature data belonging to the second category attribute to multiple second feature mapping data according to the one-to-one correspondence between m2 second categories and m2 integer values.
[0109] To facilitate understanding, the following example is provided for description:
[0110] In this example, the multiple first IDs and multiple first feature data belonging to the first category attribute held by the first participant, as well as the first mapped feature data obtained by mapping, can be shown in Table 1 below:
[0111] First ID Category 1 V1 First category mapping data V1 001 b 2 002 a 1 003 b 2 004 c 3
[0112] Table 1
[0113] The multiple corresponding second IDs and multiple second feature data belonging to the second category attribute held by the second participant, as well as the mapped second mapping feature data, can be shown in Table 2 below:
[0114] Second ID Category 2 V2 Second category mapping data V2 001 aa 1 002 bb 2 004 aa 1 005 bb 2
[0115] Table 2
[0116] As can be seen from Table 1 above, the first participant holds 4 IDs (for ease of description, the IDs held by the first participant are referred to as the first IDs), and the first category V1 includes 3 first categories [a,b,c], with 3 corresponding integer values [1,2,3].
[0117] The second participant holds 4 IDs (for ease of description, the IDs held by the second participant are referred to as the second IDs). The second category V2 includes 2 second categories [aa, bb], with 2 corresponding integer values [1, 2].
[0118] Performing this step maps the feature data to corresponding integer values, as shown in Tables 1 and 2 above.
[0119] Step 32: The participants in the joint data statistics encrypt the ID and feature mapping data they hold to obtain ciphertext ID and feature mapping data.
[0120] In this embodiment of the application, in order to achieve privacy computing, the held ID and feature mapping data are encrypted. The encryption algorithm used is related to the privacy computing algorithm used. For example, if the privacy computing algorithm used is the secret sharing algorithm, the held data (including ID and feature mapping data) can be split into multiple data fragments according to the number of multiple ciphertext computing nodes participating in the computing, and sent to each ciphertext computing node one by one for subsequent privacy computing.
[0121] The subsequent steps 33-39 involve collaboration among multiple ciphertext computing nodes to perform joint data statistics based on the ciphertext data. For ease of description and understanding, the following steps 33-39 will be described as a single execution entity with multiple ciphertext computing nodes as a whole, and the data in the example will be plaintext data.
[0122] Step 33: For each first ID, compare the first ID with multiple second IDs to obtain the flag vector of the first ID. The flag vector contains multiple elements that correspond one-to-one with the multiple second IDs. For each second ID, if the second ID is the same as the first ID, the corresponding element is 1; otherwise, it is 0.
[0123] Taking the first ID 001 in Table 1 above as an example, it is compared with the four second IDs in Table 2 above. The comparison result is that it is the same as the first second ID among the four second IDs, but different from the other three second IDs. Accordingly, the flag vector of the first ID 001 is [1,0,0,0].
[0124] Step 34: Sum the multiple elements contained in the flag vector of the first ID, multiply the sum by the first feature mapping data of the first ID, and compare the product with m1 integer values to obtain the flag vector flag1 of the first ID. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0.
[0125] Taking the first ID 001 in Table 1 above as an example, the flag vector of the first ID 001 is [1,0,0,0]. The sum of its multiple elements is 1. The first feature mapping data of the first ID 001 is 2. The product of the two is 2. The product 2 is compared with three integer values [1,2,3]. The comparison result is the same as the second integer value, but different from the first and third integer values. Accordingly, the flag vector flag1 of the first ID 001 is [0,1,0].
[0126] Step 35: Copy the flag vector flag1 of the first ID m2-1 times to obtain the m1×m2 matrix M1 of the first ID.
[0127] Taking the first ID 001 in Table 1 above as an example, the flag vector flag1 of the first ID 001 is [0,1,0], m2 is 2, and then one copy is made to obtain the 3×2 matrix M1 of the first ID 001. The matrix M1 is as follows:
[0128]
[0129] Step 36: Calculate the inner product of the flag vector of the first ID and the vector composed of multiple second feature mapping data. Compare the inner product with m2 integer values to obtain the flag vector flag2 of the first ID. The flag vector flag2 contains multiple elements that correspond one-to-one with the m2 integer values. For each integer value, if the integer value is the same as the inner product, the corresponding element is 1; otherwise, it is 0.
[0130] Taking the first ID 001 in Table 1 above as an example, the flag vector of the first ID 001 is [1,0,0,0], and the vector composed of multiple second feature mapping data is [1,2,1,2]. Calculate the inner product of the two, that is, the sum of the corresponding element-wise multiplication. The inner product result is 1. Compare the inner product 1 with the two integer values [1,2]. The comparison result is the same as the first integer value and different from the second integer value. Accordingly, the flag vector flag2 of the first ID 001 is obtained as [1,0].
[0131] Step 37: Copy the flag vector flag2 of the first ID m1-1 times to obtain the m1×m2 matrix M2 of the first ID.
[0132] Taking the first ID 001 in Table 1 above as an example, the flag vector flag2 of the first ID 001 is [1,0], m1 is 3, and then two copies are made to obtain the 3×2 matrix M2 of the first ID 001. The matrix M2 is as follows:
[0133]
[0134] There is no strict order between steps 34-35 and steps 36-37.
[0135] Step 38: Multiply the corresponding elements of the first ID matrix M1 and matrix M2 to obtain the first ID matrix M' of m1×m2.
[0136] Taking the first ID 001 in Table 1 above as an example, based on the matrices M1 and M2 of the first ID 001, the corresponding elements are multiplied to obtain the m1×m2 matrix M' of the first ID 001 as follows:
[0137]
[0138] For the first ID 002, first ID 003, and first ID 004 in Table 1 above, respectively, perform steps 33-38 to obtain the m1×m2 matrix M' of the first ID 002 as follows:
[0139]
[0140] The m1×m2 matrix M' of the first ID 003 is obtained as follows:
[0141]
[0142] The matrix M' of the first ID 004, which is m1×m2, is obtained as follows:
[0143]
[0144] Step 39: Add the corresponding elements of each matrix M' of the multiple first IDs to obtain an m1×m2 matrix M.
[0145] Matrix M represents the joint statistical results of the encrypted data. The joint statistical results are the number of IDs that belong to both the first category and the second category among the intersection IDs of multiple first IDs and multiple second IDs.
[0146] Following the example shown in Table 1 above, by adding the corresponding elements of each matrix M' of the four first IDs in Table 1, the resulting m1×m2 matrix M is as follows:
[0147]
[0148] In this step, the resulting matrix M is the joint statistical result of the encrypted data (the data in the table above is in plaintext data form for easy understanding).
[0149] The joint statistical results of plaintext data can be represented as follows:
[0150] aa bb a 0 1 b 1 0 c 1 0
[0151] That is, the number of IDs that belong to both the first category and the second category in the intersection of multiple first IDs and multiple second IDs. For example, in the intersection of IDs, the number of IDs that belong to both the first category a and the second category aa is 0, and the number of IDs that belong to both the first category b and the second category aa is 1.
[0152] In this embodiment of the application, multiple ciphertext computing nodes can decrypt matrix M to obtain the plaintext data joint statistical result after calculating the ciphertext data joint statistical result, and send the data joint statistical result to the result recipient. For example, the data joint statistical result can be returned to the first participant or the second participant, or it can be sent to other third parties.
[0153] In this embodiment of the application, multiple ciphertext computing nodes can also send the combined statistical results of the ciphertext data to the result recipient. For example, they can return the combined statistical results of the ciphertext data to the first or second participant, or they can send them to other third parties, so that the result recipient can decrypt the matrix M to obtain the combined statistical results of the plaintext data.
[0154] Based on the same inventive concept, and according to the data joint statistics method in privacy computing provided in the above embodiments of this application, another embodiment of this application also provides a data joint statistics device in privacy computing, applied to a ciphertext computing node. Each of the multiple participants holds multiple IDs and multiple feature data belonging to a category attribute, and the category attribute includes multiple categories. The device is used to achieve data joint statistics in privacy computing by cooperating with other ciphertext computing nodes and employing a preset privacy computing algorithm when the data is ciphertext. Its structural schematic diagram is shown below. Figure 4 As shown, it specifically includes:
[0155] The data acquisition module 41 is used to acquire, for each participant, the multiple IDs held by the participant and the multiple feature mapping data corresponding one-to-one with the multiple IDs. The multiple feature mapping data is obtained by mapping the multiple feature data held by the participant to the corresponding integer values. The multiple categories included in the category attribute held by the participant correspond one-to-one with the multiple integer values, and there is no 0 among the multiple integer values.
[0156] The data statistics module 42 is used to perform data processing based on the multiple IDs held by each participant, the multiple feature mapping data, and the multiple integer values, according to a preset data comparison and calculation method, to obtain a multidimensional data structure M. The multiple dimensions of the multidimensional data structure M correspond one-to-one with multiple category attributes. The multidimensional data structure M is the joint statistical result of encrypted data. The joint statistical result is the number of IDs belonging to any combination of the multiple category attributes in the intersection IDs of the multiple participants.
[0157] Furthermore, the multiple participants include N participants P. n Participant P n The category attribute includes multiple categories, the number of which is m. n n takes the value of an integer from 1 to N;
[0158] The data statistics module 42 is specifically used for each ID1 of participant P1, and for each other participant P1. i The ID1 is matched with the participant P. i The multiple IDs i By comparison, the flag vector of ID1 is obtained.1-i The flag vector 1-i Includes the multiple IDs i Multiple elements in a one-to-one correspondence, where, for each ID i If the ID i If the value is the same as ID1, the corresponding element is 1; otherwise, it is 0. The value of i is an integer from 2 to N.
[0159] The N-1 flag vectors of ID1 1-i Multiply the corresponding elements to obtain the flag vector for ID1;
[0160] The multiple elements contained in the flag vector flag of ID1 are summed, and the sum is multiplied by the feature mapping data of ID1. The product is then compared with m1 integer values to obtain the flag vector flag1 of ID1. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0.
[0161] The flag vector flag1 of ID1 is copied into a multidimensional data structure M1. The multiple dimensions of the multidimensional data structure M1 correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product;
[0162] For each of the other participants P i Calculate the flag vector of ID1 and the flag vector of participant P. i The inner product of a vector composed of multiple feature mapping data points, and the inner product of this inner product with m i Compare these integer values to obtain the flag vector for ID1. i The flag vector i Includes the m i Multiple elements corresponding to each integer value, wherein for each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0;
[0163] The flag vector of ID1 i Copy into a multidimensional data structure M i The multidimensional data structure M i The multiple dimensions correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product;
[0164] This multidimensional data structure M1 of ID1 is then compared with the multidimensional data structure M. N Multiply the corresponding elements to obtain the multidimensional data structure M' of ID1;
[0165] The corresponding elements of the multidimensional data structures M' of the multiple ID1 of participant P1 are added together to obtain the multidimensional data structure M.
[0166] Furthermore, the multiple participants include a first participant and a second participant. The first participant holds multiple first IDs and multiple first feature data belonging to a first category attribute, and the second participant holds multiple second IDs and multiple second feature data belonging to a second category attribute. The first category attribute includes m1 first categories, and the second category attribute includes m2 second categories. The multiple feature mapping data held by the first participant are multiple first feature mapping data, and the multiple feature mapping data held by the second participant are multiple second feature mapping data. The m1 first categories correspond one-to-one with m1 integer values, and the m2 second categories correspond one-to-one with m2 integer values. There is no 0 among the m1 integer values and the m2 integer values.
[0167] The data statistics module 42 is specifically used to perform data processing based on the plurality of first IDs and the plurality of second IDs, the plurality of first feature mapping data and the plurality of second feature mapping data, and the m1 integer values and the m2 integer values, according to a preset data comparison and calculation method, to obtain an m1×m2 matrix M as a multidimensional data structure M. The joint statistical result of the data is the number of IDs that simultaneously belong to any first category and any second category among the intersection IDs of the plurality of first IDs and the plurality of second IDs.
[0168] Furthermore, the data statistics module 42 is specifically used to compare each first ID with the plurality of second IDs to obtain a flag vector flag for the first ID. The flag vector flag contains a plurality of elements that correspond one-to-one with the plurality of second IDs. For each second ID, if the second ID is the same as the first ID, the corresponding element is 1; otherwise, it is 0.
[0169] The flag vector flag of the first ID is summed, and the sum is multiplied by the first feature mapping data of the first ID. The product is then compared with the m1 integer values to obtain the flag vector flag1 of the first ID. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0.
[0170] The flag vector flag1 of the first ID is copied m2-1 times to obtain the m1×m2 matrix M1 of the first ID;
[0171] Calculate the inner product of the flag vector flag of the first ID and the vector composed of the multiple second feature mapping data, compare the inner product with the m2 integer values to obtain the flag vector flag2 of the first ID. The flag vector flag2 contains multiple elements that correspond one-to-one with the m2 integer values. For each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0.
[0172] The flag vector flag2 of the first ID is copied m1-1 times to obtain the m1×m2 matrix M2 of the first ID;
[0173] Multiply the corresponding elements of the first ID matrix M1 and matrix M2 to obtain the first ID matrix M' of m1×m2;
[0174] Add the corresponding elements of each matrix M' of the multiple first IDs to obtain an m1×m2 matrix M.
[0175] The functions of the above modules can be corresponding to Figures 1 to 3 The corresponding processing steps in the process shown will not be repeated here.
[0176] The data joint statistics device for privacy computing provided in the embodiments of this application can be implemented by a computer program. Those skilled in the art should understand that the above-described module division method is only one of many module division methods. Whether it is divided into other modules or not divided into modules, as long as the data joint statistics device for privacy computing has the above-described functions, it should be within the protection scope of this application.
[0177] This application also provides an electronic device, such as... Figure 5 As shown, it includes a processor 51 and a machine-readable storage medium 52, the machine-readable storage medium 52 storing machine-executable instructions that can be executed by the processor 51, the processor 51 being prompted by the machine-executable instructions to implement the data joint statistics method in any of the above privacy computing.
[0178] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the data joint statistics method in any of the above-described privacy computing methods.
[0179] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the above-described privacy computing data joint statistical methods.
[0180] The machine-readable storage medium in the aforementioned electronic device may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0181] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0182] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of devices, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0183] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0184] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0185] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0186] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0187] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A joint statistical method for data in privacy-preserving computation, characterized in that, Applied to encrypted computation nodes, each of the multiple participants holds multiple IDs and multiple feature data belonging to a category attribute, where the category attribute includes multiple categories. The multiple participants include N participants P. n Participant P n The category attribute includes multiple categories, the number of which is m. n The method, wherein n is an integer from 1 to N, includes: Through collaboration with other encrypted computation nodes, and using a pre-defined privacy computation algorithm, the following steps are performed when the data is encrypted: For each participant, obtain the multiple IDs held by the participant, and multiple feature mapping data corresponding one-to-one with the multiple IDs. The multiple feature mapping data is obtained by mapping the multiple feature data held by the participant to corresponding integer values. The multiple categories included in the category attribute held by the participant correspond one-to-one with the multiple integer values, and there is no 0 among the multiple integer values. For each ID1 of participant P1, and for every other participant P i The ID1 is matched with the participant P. i The multiple IDs i By comparison, the flag vector of ID1 is obtained. 1-i The flag vector 1-i Includes the multiple IDs i Multiple elements in a one-to-one correspondence, where, for each ID i If the ID i If the value is the same as ID1, the corresponding element is 1; otherwise, it is 0. The value of i is an integer from 2 to N. The N-1 flag vectors of ID1 1-i Multiply the corresponding elements to obtain the flag vector for ID1; The multiple elements contained in the flag vector flag of ID1 are summed, and the sum is multiplied by the feature mapping data of ID1. The product is then compared with m1 integer values to obtain the flag vector flag1 of ID1. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0. The flag vector flag1 of ID1 is copied into a multidimensional data structure M1. The multiple dimensions of the multidimensional data structure M1 correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product; For each of the other participants P i Calculate the flag vector of ID1 and the flag of the participant P. i The inner product of a vector composed of multiple feature mapping data points, and the inner product of this inner product with m i Compare these integer values to obtain the flag vector for ID1. i The flag vector i Includes the m i Multiple elements corresponding to each integer value, wherein for each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0; The flag vector of ID1 i Copy into a multidimensional data structure M i The multidimensional data structure M i The multiple dimensions correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product; This multidimensional data structure M1 of ID1 is then compared with the multidimensional data structure M. N Multiply the corresponding elements to obtain the multidimensional data structure M' of ID1; Add the corresponding elements of the multidimensional data structures M' of the multiple IDs1 of participant P1 to obtain the multidimensional data structure M. The multiple dimensions of the multidimensional data structure M correspond one-to-one with multiple category attributes. The multidimensional data structure M is the joint statistical result of the encrypted data. The joint statistical result is the number of IDs belonging to any combination of the multiple category attributes in the intersection IDs of the multiple participants.
2. A joint statistical method for data in privacy computing, characterized in that, Applied to a ciphertext computation node, each of multiple participants holds multiple IDs and multiple feature data belonging to a category attribute, where the category attribute includes multiple categories. The multiple participants include a first participant and a second participant. The first participant holds multiple first IDs and multiple first feature data belonging to a first category attribute, and the second participant holds multiple second IDs and multiple second feature data belonging to a second category attribute. The first category attribute includes m1 first categories, and the second category attribute includes m2 second categories. The multiple feature mapping data held by the first participant are multiple first feature mapping data, and the multiple feature mapping data held by the second participant are multiple second feature mapping data. The m1 first categories correspond one-to-one with m1 integer values, and the m2 second categories correspond one-to-one with m2 integer values. The m1 and m2 integer values do not contain 0. The method includes: Through collaboration with other encrypted computation nodes, and using a pre-defined privacy computation algorithm, the following steps are performed when the data is encrypted: For each participant, obtain the multiple IDs held by the participant, and multiple feature mapping data corresponding one-to-one with the multiple IDs. The multiple feature mapping data is obtained by mapping the multiple feature data held by the participant to corresponding integer values. The multiple categories included in the category attribute held by the participant correspond one-to-one with the multiple integer values, and there is no 0 among the multiple integer values. Based on the plurality of first IDs and the plurality of second IDs, the plurality of first feature mapping data and the plurality of second feature mapping data, and the m1 integer values and the m2 integer values, data processing is performed according to a preset data comparison and calculation method to obtain an m1×m2 matrix M, which serves as a multidimensional data structure M. The joint statistical result of the data is the number of IDs that simultaneously belong to either the first category or the second category among the intersection IDs of the plurality of first IDs and the plurality of second IDs.
3. The method as described in claim 2, characterized in that, The process involves performing data processing based on the plurality of first IDs and the plurality of second IDs, the plurality of first feature mapping data and the plurality of second feature mapping data, and the m1 integer values and the m2 integer values, according to a preset data comparison and calculation method, to obtain an m1×m2 matrix M, including: For each first ID, the first ID is compared with the plurality of second IDs to obtain a flag vector flag for the first ID. The flag vector flag contains a plurality of elements that correspond one-to-one with the plurality of second IDs. For each second ID, if the second ID is the same as the first ID, the corresponding element is 1, otherwise it is 0. The flag vector flag of the first ID is summed, and the sum is multiplied by the first feature mapping data of the first ID. The product is then compared with the m1 integer values to obtain the flag vector flag1 of the first ID. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0. The flag vector flag1 of the first ID is copied m2-1 times to obtain the m1×m2 matrix M1 of the first ID; Calculate the inner product of the flag vector flag of the first ID and the vector composed of the multiple second feature mapping data, compare the inner product with the m2 integer values to obtain the flag vector flag2 of the first ID. The flag vector flag2 contains multiple elements that correspond one-to-one with the m2 integer values. For each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0. Duplicate the flag vector flag2 of the first ID m1-1 times to obtain the m1×m2 matrix M2 of the first ID; Multiply the corresponding elements of the first ID matrix M1 and matrix M2 to obtain the first ID matrix M' of m1×m2; Add the corresponding elements of each matrix M' of the multiple first IDs to obtain an m1×m2 matrix M.
4. A data joint statistics device for privacy computing, characterized in that, Applied to encrypted computation nodes, each of the multiple participants holds multiple IDs and multiple feature data belonging to a category attribute, where the category attribute includes multiple categories. The multiple participants include N participants P. n Participant P n The category attribute includes multiple categories, the number of which is m. n The device, where n is an integer from 1 to N, is used to perform joint data statistics in privacy computing by cooperating with other encrypted computing nodes and employing a preset privacy computing algorithm when the data is encrypted. The device includes: The data acquisition module is used to acquire, for each participant, the multiple IDs held by that participant, and multiple feature mapping data corresponding one-to-one with the multiple IDs. The multiple feature mapping data is obtained by mapping the multiple feature data held by the participant to corresponding integer values. The multiple categories included in the category attribute held by the participant correspond one-to-one with the multiple integer values, and there is no 0 among the multiple integer values. The data statistics module is used for each ID1 of participant P1, and for each other participant P. i The ID1 is matched with the participant P. i The multiple IDs i By comparison, the flag vector of ID1 is obtained. 1-i The flag vector 1-i Includes the multiple IDs i Multiple elements in a one-to-one correspondence, where, for each ID i If the ID i If the value is the same as ID1, the corresponding element is 1; otherwise, it is 0. The value of i is an integer from 2 to N. The N-1 flag vectors of ID1 1-i Multiply the corresponding elements to obtain the flag vector for ID1; The multiple elements contained in the flag vector flag of ID1 are summed, and the sum is multiplied by the feature mapping data of ID1. The product is then compared with m1 integer values to obtain the flag vector flag1 of ID1. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0. The flag vector flag1 of ID1 is copied into a multidimensional data structure M1. The multiple dimensions of the multidimensional data structure M1 correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product; For each of the other participants P i Calculate the flag vector of ID1 and the flag of the participant P. i The inner product of a vector composed of multiple feature mapping data points, and the inner product of this inner product with m i Compare these integer values to obtain the flag vector for ID1. i The flag vector i Includes the m i Multiple elements corresponding to each integer value, wherein for each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0; The flag vector of ID1 i Copy into a multidimensional data structure M i The multidimensional data structure M i The multiple dimensions correspond one-to-one with multiple category attributes, and its structure is represented as m1 to m... N The product; This multidimensional data structure M1 of ID1 is then compared with the multidimensional data structure M. N Multiply the corresponding elements to obtain the multidimensional data structure M' of ID1; Add the corresponding elements of the multidimensional data structures M' of the multiple IDs1 of participant P1 to obtain the multidimensional data structure M. The multiple dimensions of the multidimensional data structure M correspond one-to-one with multiple category attributes. The multidimensional data structure M is the joint statistical result of the encrypted data. The joint statistical result is the number of IDs belonging to any combination of the multiple category attributes in the intersection IDs of the multiple participants.
5. A data joint statistics device for privacy computing, characterized in that, An apparatus is applied to a encrypted computing node. Each of multiple participants holds multiple IDs and multiple feature data belonging to a category attribute, where the category attribute includes multiple categories. The multiple participants include a first participant and a second participant. The first participant holds multiple first IDs and multiple first feature data belonging to a first category attribute, and the second participant holds multiple second IDs and multiple second feature data belonging to a second category attribute. The first category attribute includes m1 first categories, and the second category attribute includes m2 second categories. The multiple feature mapping data held by the first participant are multiple first feature mapping data, and the multiple feature mapping data held by the second participant are multiple second feature mapping data. The m1 first categories correspond one-to-one with m1 integer values, and the m2 second categories correspond one-to-one with m2 integer values. None of the m1 or m2 integer values are 0. The apparatus is used to achieve joint data statistics in privacy computing by cooperating with other encrypted computing nodes and employing a preset privacy computing algorithm when the data is encrypted. The apparatus includes: The data acquisition module is used to acquire, for each participant, the multiple IDs held by that participant, and multiple feature mapping data corresponding one-to-one with the multiple IDs. The multiple feature mapping data is obtained by mapping the multiple feature data held by the participant to corresponding integer values. The multiple categories included in the category attribute held by the participant correspond one-to-one with the multiple integer values, and there is no 0 among the multiple integer values. The data statistics module is used to perform data processing based on the plurality of first IDs and the plurality of second IDs, the plurality of first feature mapping data and the plurality of second feature mapping data, and the m1 integer values and the m2 integer values, according to a preset data comparison and calculation method, to obtain an m1×m2 matrix M as a multidimensional data structure M. The joint statistical result of the data is the number of IDs that belong to either the first category or the second category in the intersection of the plurality of first IDs and the plurality of second IDs.
6. The apparatus as claimed in claim 5, characterized in that, The data statistics module is specifically used to compare each first ID with the plurality of second IDs to obtain a flag vector of the first ID. The flag vector contains a plurality of elements that correspond one-to-one with the plurality of second IDs. For each second ID, if the second ID is the same as the first ID, the corresponding element is 1; otherwise, it is 0. The flag vector flag of the first ID is summed, and the sum is multiplied by the first feature mapping data of the first ID. The product is then compared with the m1 integer values to obtain the flag vector flag1 of the first ID. The flag vector flag1 contains multiple elements that correspond one-to-one with the m1 integer values. For each integer value, if the integer value is the same as the product, the corresponding element is 1; otherwise, it is 0. The flag vector flag1 of the first ID is copied m2-1 times to obtain the m1×m2 matrix M1 of the first ID; Calculate the inner product of the flag vector flag of the first ID and the vector composed of the multiple second feature mapping data, compare the inner product with the m2 integer values to obtain the flag vector flag2 of the first ID. The flag vector flag2 contains multiple elements that correspond one-to-one with the m2 integer values. For each integer value, if the integer value is the same as the inner product, the corresponding element is 1, otherwise it is 0. The flag vector flag2 of the first ID is copied m1-1 times to obtain the m1×m2 matrix M2 of the first ID; Multiply the corresponding elements of the first ID matrix M1 and matrix M2 to obtain the first ID matrix M' of m1×m2; Add the corresponding elements of each matrix M' of the multiple first IDs to obtain an m1×m2 matrix M.
7. An electronic device, characterized in that, The device includes a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor being prompted by the machine-executable instructions to: implement the method of claim 1, or implement the method of any one of claims 2-3.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of claim 1, or implements the method of any one of claims 2-3.