A method for data aggregation, related device, equipment and storage medium
Patent Information
- Application Number
- CN202210181433.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-02-25
AI Technical Summary
In joint data analysis of relational databases, traditional methods centrally store sensitive data in closed domains, resulting in high data consistency maintenance costs and the need for manual review, which increases review costs.
By independently processing local data tables on each device, obtaining grouped aggregation statements, performing group processing, and exchanging the results to generate aggregation results, the risk of data leakage and manual review are avoided, and maintenance costs are reduced.
It realizes the grouping and aggregation of data, avoids the risk of data leakage, reduces maintenance costs, and improves the security and efficiency of data processing.
Smart Images

Figure CN114547082B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data aggregation method, related devices, equipment and storage medium. Background Art
[0002] In the relational database query function, it can support grouping and deduplication operations. This type of query can group the fields that need to be summarized and analyzed according to the specified fields in the database, and then use the aggregation function to perform the summary operation. This process occurs frequently in online analytical processing (OLAP) queries.
[0003] Since different institutions or departments store data independently, traditional OLAP needs to aggregate these scattered data for analysis when conducting joint data analysis. Currently, when performing group aggregation, dedicated storage clusters and computing clusters can be used to ensure that sensitive data submitted on the computing cluster is written to the storage cluster in the closed domain.
[0004] The inventors have found that the existing solutions have at least the following problems: although storing sensitive data in a closed domain can protect data privacy, centrally storing the sensitive data of each participant in the closed domain will result in a high cost for maintaining data consistency. In addition, manual review needs to be triggered when exporting data from the closed area, thereby increasing the cost of manual review. Summary of the invention
[0005] The embodiments of the present application provide a method, related apparatus, device and storage medium for data aggregation. In the present application, each device independently processes the local data table, so on the one hand, the risk of data leakage is avoided from the root, and on the other hand, the whole process does not need to trigger manual review, thereby saving data maintenance costs.
[0006] In view of this, the present application provides, on one hand, a data aggregation method, which is applied to a first device, where the first device stores a first data table, including:
[0007] Obtaining a first grouping and aggregation statement, wherein the first grouping and aggregation statement is used to request grouping and aggregation processing of the data table according to a first preset field;
[0008] According to the first grouping aggregation statement, the first data table is grouped to obtain K grouping results, wherein each of the K grouping results includes identification information, and the K grouping results are used to generate T grouping results, where K is an integer greater than or equal to 1, and T is an integer greater than or equal to K;
[0009] Sending T grouping results to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the T grouping results, to obtain T aggregation results, wherein the second data table is stored in the second device;
[0010] Receiving T aggregation results sent by the second device;
[0011] A first target data table is generated according to the T aggregation results and the T grouping results, wherein the first target data table includes the grouping aggregation results for the first preset field.
[0012] Another aspect of the present application provides a data aggregation device, which is applied to a first device, and the first device stores a first data table. The data aggregation device includes:
[0013] An acquisition module, used for acquiring a first grouping and aggregation statement, wherein the first grouping and aggregation statement is used for requesting to perform grouping and aggregation processing on the data table according to a first preset field;
[0014] a processing module, configured to perform grouping processing on the first data table according to the first grouping aggregation statement to obtain K grouping results, wherein each of the K grouping results includes identification information, and the K grouping results are used to generate T grouping results, where K is an integer greater than or equal to 1, and T is an integer greater than or equal to K;
[0015] a sending module, configured to send T grouping results to the second device, so that the second device performs grouping aggregation processing on the second data table according to the identification information included in each grouping result in the T grouping results, to obtain T aggregation results, wherein the second data table is stored in the second device;
[0016] A receiving module, used to receive T aggregation results sent by the second device;
[0017] A generation module is used to generate a first target data table according to T aggregation results and T grouping results, wherein the first target data table includes grouping aggregation results for a first preset field.
[0018] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0019] An acquisition module is specifically used to acquire an original grouping aggregation statement, wherein the original grouping aggregation statement includes a first value field and a second value field, the first value field belongs to a first data table, and the second value field belongs to a second data table;
[0020] A first group aggregation statement is generated according to the original group aggregation statement, wherein the first group aggregation statement includes a second value field, and the second value field is included in the first preset field, and the original group aggregation statement is also used for the second device to generate a second group aggregation statement, and the second group aggregation statement includes a first value field, and the first value field is included in the second preset field.
[0021] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0022] The receiving module is further used to receive P grouping results sent by the second device, wherein the P grouping results are obtained after the second device performs grouping processing on the second data table according to the second grouping aggregation statement, each of the P grouping results includes identification information, and P is an integer greater than or equal to 1;
[0023] The processing module is further used to perform grouping and aggregation processing on the first data table according to the identification information included in each grouping result in the P grouping results to obtain P aggregation results;
[0024] The sending module is further used to send P aggregation results to the second device, so that the second device generates a second target data table according to the P aggregation results and the P grouping results, wherein the second target data table includes the aggregation results of the first data table and the second data table for the second preset field;
[0025] The receiving module is further used to receive a second target data table sent by a second device;
[0026] The generation module is also used to generate the first target data table according to the T aggregation results and the T grouping results, and then combine the first target data table and the second target data table to obtain a total data table.
[0027] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0028] The acquisition module is further used to acquire the intersection of identifiers between the first original data table and the second original data table, wherein the first original data table is stored in the first device and the second original data table is stored in the second device;
[0029] The acquisition module is also used to acquire the first data table from the first original data table according to the identifier intersection, wherein the first identification field of the first data table corresponds to the identifier intersection, and the identifier intersection is also used to acquire the second data table from the second original data table, and the second identification field of the second data table corresponds to the identifier intersection.
[0030] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0031] A processing module, specifically configured to obtain a first grouping field from a first grouping aggregation statement, wherein the first grouping field corresponds to at least one type of group information, and the first grouping field is included in a first preset field;
[0032] K grouping results are generated according to at least one type of grouping information included in the first grouping field, wherein the same grouping result among the K grouping results has the same grouping information.
[0033] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0034] The sending module is specifically used to send K grouping results to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the K grouping results to obtain K aggregation results.
[0035] In one possible design, in another implementation of another aspect of the embodiment of the present application, the K grouping results include a first grouping result;
[0036] A sending module, specifically configured to divide the first grouping result into a plurality of grouping results, wherein identification information included in each of the plurality of grouping results does not overlap;
[0037] Each grouping result is sent to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result to obtain T aggregation results.
[0038] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0039] The receiving module is specifically used to receive the first aggregation result sent by the second device, wherein the first aggregation result includes target group information and aggregation value, the target group information is obtained after the second device encrypts the original group information, and the target group information corresponds to the second grouping field of the second data table.
[0040] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0041] The receiving module is specifically used to receive the first aggregation result sent by the second device, wherein the first aggregation result includes original group information and target value, the target value is obtained after the second device encrypts the aggregation value using a public key, and the original group information corresponds to the second grouping field of the second data table.
[0042] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0043] The receiving module is specifically used to receive the first aggregation result sent by the second device, wherein the first aggregation result includes target group information and target value, the target group information is obtained after the second device encrypts the original group information, and the target value is obtained after the second device encrypts the aggregate value using a public key, and the target group information corresponds to the second grouping field of the second data table.
[0044] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0045] The processing module is also used to add the target values in the first aggregation result and the second aggregation result based on the homomorphic encryption algorithm to obtain an encrypted value if the first aggregation result and the second aggregation result include the same target group information.
[0046] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0047] A generation module, specifically used to obtain R encrypted values according to T aggregation results, where R is an integer greater than or equal to 1 and less than or equal to T;
[0048] Sending the R encrypted values to the second device, so that the second device decrypts the R encrypted values using a private key to obtain R decrypted values, wherein the private key and the public key are generated by the second device;
[0049] Receiving R decrypted values sent by the second device;
[0050] A first target data table is generated according to the R decrypted values and the T grouping results.
[0051] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0052] a receiving module, specifically used to receive a first aggregation result sent by a second device, wherein the first aggregation result includes target group information and a first target value, the target group information is obtained after the second device encrypts the original group information, the first target value is the sum of the first original value and the first random value, the target group information corresponds to the second grouping field of the second data table, and the first original value corresponds to the second value field of the second data table;
[0053] Receive a second aggregation result sent by a second device, wherein the second aggregation result includes target group information and a second target value, the second target group information is obtained after the second device encrypts the second original group information, the second target value is the sum of the second original value and the second random value, the second target group information corresponds to the second grouping field of the second data table, and the second original value corresponds to the second value field of the second data table.
[0054] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0055] A generating module, specifically configured to obtain a sum of random numbers from a second device based on an oblivious transfer protocol, wherein the sum of random numbers is a sum of random values from the 1st to the Nth random number, and N is an integer greater than 1;
[0056] Obtaining a first target value from the first aggregation result, and obtaining a second target value from the second aggregation result;
[0057] Determine the target original value according to the first target value, the second target value, the sum of random numbers and the total number of historical random numbers, wherein the total number of historical random numbers is the sum of the random values from the 1st to the Mth, and M is an integer greater than or equal to 1 and less than N;
[0058] A first target data table is generated according to the target original value, target group information and T grouping results.
[0059] Another aspect of the present application provides a computer device, including: a memory, a processor, and a bus system;
[0060] Wherein, the memory is used to store programs;
[0061] The processor is used to execute the program in the memory, and the processor is used to execute the above-mentioned methods according to the instructions in the program code;
[0062] The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
[0063] Another aspect of the present application provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer is enabled to execute the above-mentioned methods.
[0064] Another aspect of the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided by the above aspects.
[0065] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0066] In an embodiment of the present application, a method for data aggregation is provided. First, a first device obtains a first grouping aggregation statement, and the first device stores a first data table. Then, the first device performs grouping processing on the first data table according to the first grouping aggregation statement to obtain a grouping result. Next, the first device sends these grouping results to the second device, so that the second device performs grouping aggregation processing on the second data table according to the identification information included in each grouping result to obtain an aggregation result. Then, the second device sends these aggregation results to the first device, and the first device generates an aggregation result including the first data table and the second data table for the first preset field according to the aggregation result and the grouping result. In the above manner, the data table is stored locally in the device. Based on this, the device can process the local data table according to the grouping aggregation statement, and the devices can transmit the processing results of the data table to each other, thereby realizing grouping aggregation of data. Since each device processes the local data table independently, on the one hand, the risk of data leakage is avoided from the root, and on the other hand, the whole process does not need to trigger manual review, thereby saving data maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 This is a schematic diagram of the architecture of a data aggregation system in an embodiment of the present application;
[0068] Figure 2 This is an optional structural diagram of a distributed system applied to a blockchain system in an embodiment of the present application;
[0069] Figure 3 This is an optional schematic diagram of the block structure in the embodiment of the present application;
[0070] Figure 4 A schematic diagram of a flow chart of a data aggregation method in an embodiment of the present application;
[0071] Figure 5 A schematic diagram of grouping the first data table in an embodiment of the present application;
[0072] Figure 6 A schematic diagram of grouping and aggregating the second data table in an embodiment of the present application;
[0073] Figure 7 A schematic diagram of merging the aggregation results and the grouping results in an embodiment of the present application;
[0074] Figure 8 A schematic diagram of implementing data aggregation in an embodiment of the present application;
[0075] Fig. 9 Another schematic diagram of implementing data aggregation in an embodiment of the present application;
[0076] Fig.10 A schematic diagram of a total data table obtained by combining in an embodiment of the present application;
[0077] Fig.11 A schematic diagram of information interaction between a first device and a second device in an embodiment of the present application;
[0078] Fig.12 This is another schematic diagram of information interaction between a first device and a second device in an embodiment of the present application;
[0079] Fig.13 This is another schematic diagram of information interaction between a first device and a second device in an embodiment of the present application;
[0080] Fig.14 A schematic diagram of the second device feeding back a decryption result in an embodiment of the present application;
[0081] Fig.15 A schematic diagram of implementing data sharing based on oblivious transmission in an embodiment of the present application;
[0082] Fig.16 A schematic diagram of a data aggregation device in an embodiment of the present application;
[0083] Fig.17 A schematic diagram of the structure of the server in the embodiment of the present application;
[0084] Fig.18 It is a structural diagram of a terminal in an embodiment of the present application. DETAILED DESCRIPTION
[0085] The embodiments of the present application provide a method, related apparatus, device and storage medium for data aggregation. In the present application, each device independently processes the local data table, so on the one hand, the risk of data leakage is avoided from the root, and on the other hand, the whole process does not need to trigger manual review, thereby saving data maintenance costs.
[0086] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0087] When performing data analysis, grouping and aggregation is a common scenario. The data obtained after grouping and aggregation can be used to perform corresponding processing. The following will introduce it in combination with specific scenarios.
[0088] 1. Data computing scenarios;
[0089] Different departments store their own data tables. For example, taking the game department and the advertising department as examples, it is assumed that the game department stores a game data table, which includes the game name and the game identity document (ID). The advertising department stores an advertising data table, which includes the game ID, the amount of advertising, and the date of advertising. If the game department wants to jointly calculate the total amount of advertising for each game, then use a unilateral field to group by the data column of the game name. If the game department wants to jointly calculate the total amount of advertising for each game on each date, then use a multi-party field to group by the game name and the date of advertising.
[0090] 2. Big data scenarios;
[0091] Different institutions store their own data tables. For example, taking a big data research institution and a training institution as an example, it is assumed that the big data research institution stores data table A, which includes subject names and subject IDs. The training institution stores data table B, which includes subject IDs, number of trainees, and course start dates. If the big data research institution wants to jointly calculate the total number of trainees for each subject, then use a single field to group by the data column of the subject name. If the big data research institution wants to jointly calculate the total number of trainees for each subject on each course start date, then use a multi-party field to group by subject name and course start date. As a result, the big data research institution can analyze the changes in the number of people participating in training in different subjects at different course start times, thereby guiding subsequent institutions to plan courses.
[0092] It is understandable that big data refers to a collection of data that cannot be captured, managed, and processed by conventional software tools within a certain time frame. It is a massive, high-growth, and diverse information asset that requires new processing models to have stronger decision-making power, insight discovery, and process optimization capabilities. With the advent of the cloud era, big data has also attracted more and more attention. Big data requires special technologies to effectively process large amounts of data within a tolerable time frame. Technologies suitable for big data include large-scale parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the Internet, and scalable storage systems.
[0093] 3. Machine learning scenarios;
[0094] Different companies store their own data tables. For example, taking Company A and Company B as an example, assume that Company A stores Data Table A, which includes user gender and user ID. Company B stores Data Table B, which includes user ID, consumption quantity and registration date. If Company A wants to jointly calculate the total consumption quantity of each user gender, it can use a single field to group by the data column of user gender. If Company A wants to jointly calculate the total consumption quantity of each user gender on each registration date, it can use a multi-party field to group by user gender and registration date. As a result, Company A can perform machine learning based on the information obtained and train a model for predicting consumption quantity.
[0095] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. ML is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence (AI). ML and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0096] Since different institutions or departments store data independently, in order to efficiently perform data analysis without leaking private data during joint data analysis, this application proposes a data aggregation method that is applied to Figure 1The data aggregation system shown in the figure, as shown in the figure, includes at least two devices, and the first device and the second device shown in the figure can be terminals. Exemplarily, the first device and the second device can also be servers. Exemplarily, the first device is a terminal and the second device is a server. Exemplarily, the second device is a terminal and the first device is a server. The server involved in this application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop, a PDA, a personal computer, a smart TV, a smart watch, a vehicle-mounted device, a wearable device, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application is not limited here. The number of servers and terminals is also not limited. The solution provided in this application can be completed independently by the terminal, can also be completed independently by the server, or can be completed by the terminal and the server in cooperation. This application does not make any specific limitations on this.
[0097] by Figure 1 Taking the data aggregation system shown in the figure as an example, the first device stores the first data table, and the second device stores the second data table. The first data table and the second data table both contain three columns of data, namely the value field, the group (col) field, and the identifier (id) field. Typical group aggregation statements include two situations: using a single field for group aggregation and using multiple fields for group aggregation.
[0098] For example, a grouping and aggregation statement using a single field may be:
[0099] Select sum(T1.value),sum(T2.value)from T1 join T2 on T1.id=T2.idgroup by T1.col
[0100] For example, the grouping and aggregation statement using multiple fields may be:
[0101] Select sum(T1.value),sum(T2.value)from T1 join T2 on T1.id=T2.idgroup by T1.col,T2.col
[0102] It can be seen that in the case of using unilateral fields and multi-party fields, first of all, it is necessary to perform a join operation on the data tables based on the id data columns of the two data tables. Based on this, when using unilateral fields, only the col data column of the first data table is used to group the joined tables, and in each group, the value data column of the first data table and the value data column of the second data table are aggregated. When using multi-party fields, the col data column of the first data table and the col data column of the second data table are used at the same time to group the joined tables, and then in each group, the value data column of the first data table and the value data column of the second data table are aggregated.
[0103] It should be noted that the data aggregation method provided in this application is mainly used to implement privacy computing in scenarios where grouping and aggregation are performed using multiple fields.
[0104] In order to prevent the target data table from being tampered with, after the target data table is generated, the data in the target data table can also be stored in the blockchain system. The blockchain system can be a distributed system formed by connecting a client and multiple nodes (any form of computing device connected to the network, such as a server or terminal) through network communication.
[0105] Take the distributed system as the blockchain system as an example, see Figure 2 , Figure 2 This is an optional structural diagram of the distributed system applied to the blockchain system in the embodiment of the present application. It is formed by multiple nodes (any form of computing devices in the access network, such as servers and terminals) and clients, and the nodes form a peer-to-peer (Peer To Peer, P2P) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (Transmission Control Protocol, TCP) protocol. In a distributed system, any machine such as a server or terminal can join and become a node. The node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer.
[0106] See also Figure 2 The functions of each node in the blockchain system shown include:
[0107] 1) Routing: a basic function of a node, used to support communication between nodes.
[0108] In addition to the routing function, the node can also have the following functions:
[0109] 2) Applications are deployed in the blockchain to implement specific businesses based on actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to a temporary block when they successfully verify the source and integrity of the record data.
[0110] 3) Blockchain, including a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the record data submitted by the nodes in the blockchain system.
[0111] See also Figure 3 , Figure 3 This is an optional schematic diagram of the block structure in the embodiment of the present application. Each block includes the hash value of the transaction record stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected by the hash value to form a blockchain. The block can also include information such as the timestamp when the block was generated. The blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains relevant information for verifying the validity of its information (anti-counterfeiting) and generating the next block.
[0112] Since this application involves some terms related to professional fields, they will be explained below for ease of understanding.
[0113] (1) Grouping aggregation: In a Structured Query Language (SQL) statement, a "SELECT-FROM-GROUP BY" statement is called a grouping aggregation statement.
[0114] (2) Multi-party fields: In group aggregation, fields are used to group data tables. If a field consists of multiple data columns, such group aggregation is called group aggregation using multi-party fields.
[0115] (3) User Defined Aggregate Function (UDAF): takes multiple data rows of a single data column as input and outputs an aggregate value. The aggregate functions involved in this application include but are not limited to sum, count, maximum value (max), minimum value (min) and average value (avg).
[0116] (4) Private Set Intersection (PSI): refers to the process of finding the intersection of the input sets of both parties without revealing any additional information. The additional information here refers to all information outside the intersection.
[0117] (5) Oblivious Transfer (OT): refers to a secure data transmission protocol. Participant A holds a series of messages, and participant B can select a message of his choice from them. In this process, participant A does not know which message participant B has selected, and participant B does not know the content of messages held by participant A other than the message obtained by B himself.
[0118] (6) Public key encryption algorithm: It is a cryptographic algorithm that mainly includes three components, namely, key generation algorithm (Gen), encryption algorithm (Enc), and decryption algorithm (Dec). Among them, the key generation algorithm receives a security parameter k, outputs a set of public and private key pairs (pk, sk), publishes the public key (pk), and saves the private key (sk). The encryption algorithm receives a plaintext message (m) and a public key, and outputs a ciphertext. The ciphertext will be written as [m] in the following. pk , used to specify the message and key used for encryption. The decryption algorithm receives a ciphertext message [m] pk and private key, output plain text.
[0119] (7) Joint data analysis: a method of combining data tables from multiple parties to conduct data analysis.
[0120] (8) Secure random number generator: A random number generation algorithm that can generate highly secure random numbers. This application selects a cryptographic hash function or a random number generation algorithm.
[0121] In combination with the above introduction, the data aggregation method in this application will be introduced from the perspective of the first device. The first device stores the first data table. Figure 4 , an embodiment of the data aggregation method in the embodiment of the present application includes:
[0122] 210. The first device obtains a first grouping and aggregation statement, where the first grouping and aggregation statement is used to request grouping and aggregation processing of the data table according to a first preset field;
[0123] In one or more embodiments, the first device obtains a first grouping aggregation statement, the first grouping aggregation statement includes a first preset field, and implements grouping aggregation processing on the data table based on the first preset field.
[0124] Specifically, the data columns involved in the UDAF in the first grouping aggregation statement are one-sided. Exemplarily, the first grouping aggregation statement can be:
[0125] Select sum(T2.value)from T1 join T2 on T1.id=T2.id group by T1.col,T2.col
[0126] Wherein, T1 represents the first data table, and T2 represents the second data table. sum() represents the sum function. The data column involved in the sum is "T2.value" in the second data table. T2.value represents the second value field in the second data table. T1.id represents the first identification field of the first data table. T2.id represents the second identification field of the second data table. T1.col represents the first grouping field of the first data table. T2.col represents the second grouping field of the second data table.
[0127] Take the first grouping and aggregation statement as an example, that is, the first preset field includes "T2.value", "T1.col" and "T2.col". It can be seen that it is necessary to group "T1.col" in the first data table, group "T2.col" in the second data table, and aggregate "T2.value" in the second data table.
[0128] 220. The first device performs grouping processing on the first data table according to the first grouping aggregation statement to obtain K grouping results, wherein each of the K grouping results includes identification information, and the K grouping results are used to generate T grouping results, where K is an integer greater than or equal to 1, and T is an integer greater than or equal to K;
[0129] In one or more embodiments, the first device performs grouping processing on the first data table according to the first grouping field included in the first preset field in the first grouping aggregation statement, thereby obtaining K grouping results, and each grouping result includes at least one identification information (i.e., id). The first grouping field is a grouping field in the first data table, and the first identification field is an identification field in the first data table.
[0130] Specifically, for ease of understanding, see Figure 5 , Figure 5 This is a schematic diagram of grouping the first data table in an embodiment of the present application. As shown in the figure, it is assumed that the first data table includes a first grouping field (i.e., T1.col) and a first identification field (i.e., T1.id). Based on this, T1.col in the first data table is grouped to obtain two grouping results. One grouping result includes 4 identification information of T1.col being "A" (i.e., id=1, id=3, id=4, id=6), and the other grouping result includes 3 identification information of T1.col being "B" (i.e., id=2, id=5, id=7).
[0131] The first device may generate T grouping results according to the K grouping results, where T is an integer greater than or equal to K. It is understood that, in one case, T=K, in which case, the obtained K grouping results do not need to be split. In another case, T>K, in which case, at least one of the K grouping results may be split, thereby obtaining more than K grouping results.
[0132] 230. The first device sends T grouping results to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the T grouping results to obtain T aggregation results, wherein the second data table is stored in the second device;
[0133] In one or more embodiments, the first device sends T grouping results to the second device, whereby the second device can perform grouping aggregation processing on the second data table stored locally according to the identification information included in each of the T grouping results to obtain T aggregation results.
[0134] Specifically, for ease of understanding, see Figure 6 , Figure 6 This is a schematic diagram of grouping and aggregating the second data table in an embodiment of the present application. As shown in the figure, taking a grouping result including 4 ids (i.e., id=1, id=3, id=4, id=6) whose first grouping field (i.e., T1.col) is "A" as an example, the first device sends these 4 ids to the second device, and the second device retrieves the data rows in the second data table by the id, and groups the retrieved data rows according to the second grouping field (i.e., T2.col), and obtains three grouping results. One grouping result includes 2 ids (i.e., id=3, id=4) whose second grouping field (i.e., T2.col) is "D", another grouping result includes 1 id (i.e., id=1) whose second grouping field (i.e., T2.col) is "C", and another grouping result includes 1 id (i.e., id=6) whose second grouping field (i.e., T2.col) is "E".
[0135] In each group, the second value field (i.e., T2.value) in the second data table is aggregated. The sum is used as the aggregation method, thereby obtaining an aggregation result. The aggregation result includes the aggregation field (i.e., T2.sum) and the corresponding second grouping field (i.e., T2.col). For example, T2.sum is "40", and the corresponding T2.col is "D". T2.sum is "40", and the corresponding T2.col is "C". T2.sum is "60", and the corresponding T2.col is "E".
[0136] 240. The first device receives T aggregation results sent by the second device;
[0137] In one or more embodiments, the second device performs a group aggregation operation on each of the T group results, thereby obtaining T aggregate results. The second device sends the T aggregate results to the first device.
[0138] 250. The first device generates a first target data table according to T aggregation results and T grouping results, wherein the first target data table includes grouping aggregation results for a first preset field.
[0139] In one or more embodiments, the first device merges the data according to T aggregation results and the corresponding T grouping results to generate a first target data table.
[0140] Specifically, for ease of understanding, see Figure 7 , Figure 7 This is a schematic diagram of merging the aggregation results and the grouping results in an embodiment of the present application. As shown in the figure, assuming that a grouping result of the first device includes 4 ids (i.e., id=1, id=3, id=4, id=6) whose first grouping field (i.e., T1.col) is "A", the aggregation result corresponding to the grouping result includes T2.sum is "40", the corresponding T2.col is "D", T2.sum is "40", the corresponding T2.col is "C", T2.sum is "60", and the corresponding T2.col is "E". After merging the grouping results and the corresponding aggregation results, a first target data table is generated, including the first grouping field (i.e., T1.col) in the first data table, the second grouping field (i.e., T2.col) in the second data table, and the aggregation field (i.e., T2.sum) in the second data table.
[0141] Based on this, take the first group aggregation statement as "Select sum(T2.value)from T1 join T2 onT1.id=T2.id group by T1.col,T2.col" as an example, see Figure 8 , Figure 8This is a schematic diagram of implementing data aggregation in an embodiment of the present application. As shown in the figure, the first device groups "T1.id" according to "T1.col" in the first data table, and for each group, sends the id in the group to the second device. The second device retrieves the data rows in the second data table by id, and groups the retrieved data rows according to "T2.col" in the second data table. In each group, "T2.value" in the second data table is aggregated, and the aggregation result is sent to the first device. The first device merges the grouping results and their corresponding aggregation results to obtain the first target data table.
[0142] In an embodiment of the present application, a method for data aggregation is provided. In the above manner, the data table is stored locally on the device. Based on this, the device can process the local data table according to the group aggregation statement, and the processing results of the data table can be transmitted between devices, thereby realizing group aggregation of data. Since each device processes the local data table independently, on the one hand, the risk of data leakage is avoided from the root, and on the other hand, the entire process does not need to trigger manual review, thereby saving data maintenance costs.
[0143] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the first device obtains the first group aggregation statement, which may specifically include:
[0144] The first device obtains an original group aggregation statement, wherein the original group aggregation statement includes a first value field and a second value field, the first value field belongs to the first data table, and the second value field belongs to the second data table;
[0145] The first device generates a first group aggregation statement based on the original group aggregation statement, wherein the first group aggregation statement includes a second value field, and the second value field is included in the first preset field. The original group aggregation statement is also used by the second device to generate a second group aggregation statement, and the second group aggregation statement includes a first value field, and the first value field is included in the second preset field.
[0146] In one or more embodiments, a method for dividing a multi-party data column into a single-party data column is introduced. As can be seen from the above embodiments, after obtaining the original grouping aggregation statement, the first device and the second device can respectively split it, thereby, the first device generates a first grouping aggregation statement according to the original grouping aggregation statement, and the second device generates a second grouping aggregation statement according to the original grouping aggregation statement.
[0147] Specifically, assume that the original grouping aggregation statement is:
[0148] Select sum(T1.value),sum(T2.value)from T1 join T2 on T1.id=T2.idgroup by T1.col,T2.col
[0149] Among them, T1 represents the first data table, and T2 represents the second data table. sum() represents the sum function. The data columns involved in the summation are "value" in the first data table and "value" in the second data table. T1.value represents the value field in the first data table (i.e., the first value field). T2.value represents the value field in the second data table (i.e., the second value field). T1.id represents the id field of the first data table. T2.id represents the id field of the first data table. T1.col represents the col field of the first data table. T2.col represents the col field of the second data table.
[0150] Based on this, the original group aggregation statement is divided into two groups: a first group aggregation statement and a second group aggregation statement that use multiple fields to aggregate single data columns.
[0151] The first grouping aggregation statement is:
[0152] Select sum(T2.value)from T1 join T2 on T1.id=T2.id group by T1.col,T2.col
[0153] Taking the above first grouping aggregation statement as an example, the first preset fields include "T2.value", "T1.col" and "T2.col". It can be seen that it is necessary to group "T1.col" in the first data table, group "T2.col" in the second data table, and aggregate "T2.value" in the second data table.
[0154] The second grouping aggregation statement is:
[0155] Select sum(T1.value)from T1 join T2 on T1.id=T2.id group by T1.col,T2.col
[0156] Taking the above second grouping aggregation statement as an example, the second preset fields include "T1.value", "T1.col" and "T2.col". It can be seen that it is necessary to group "col" in the second data table, group "col" in the first data table, and aggregate "value" in the first data table.
[0157] Secondly, in the embodiment of the present application, a method of dividing multiple data columns into single data columns is provided. Through the above method, considering that in the case of joint grouping, the operation of directly aggregating multiple data columns is relatively complicated, therefore, the single data columns can be split for aggregation, thereby reducing the complexity of the operation.
[0158] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, another optional embodiment provided by the embodiment of the present application may further include:
[0159] The first device receives P grouping results sent by the second device, wherein the P grouping results are obtained after the second device performs grouping processing on the second data table according to the second grouping aggregation statement, each of the P grouping results includes identification information, and P is an integer greater than or equal to 1;
[0160] The first device performs grouping aggregation processing on the first data table according to identification information included in each grouping result in the P grouping results to obtain P aggregation results;
[0161] The first device sends P aggregation results to the second device, so that the second device generates a second target data table according to the P aggregation results and the P grouping results, wherein the second target data table includes the aggregation results of the first data table and the second data table for the second preset field;
[0162] The first device receives a second target data table sent by the second device;
[0163] After the first device generates the first target data table according to the T aggregation results and the T grouping results, the method may further include:
[0164] The first device combines the first target data table and the second target data table to obtain a total data table.
[0165] In one or more embodiments, a method for data integration based on a data table fed back by a second device is introduced. As can be seen from the above embodiments, the first device generates a first grouping aggregation statement based on the original grouping aggregation statement, and the second device generates a second grouping aggregation statement based on the original grouping aggregation statement.
[0166] Specifically, assume that the original grouping aggregation statement is:
[0167] Select sum(T1.value),sum(T2.value)from T1 join T2 on T1.id=T2.idgroup by T1.col,T2.col
[0168] Exemplarily, after splitting, the first grouping aggregation statement obtained is:
[0169] Select sum(T2.value)from T1 join T2 on T1.id=T2.id group by T1.col,T2.col
[0170] For ease of understanding, please refer again to Figure 8 , the first device groups "T1.id" according to "T1.col" in the first data table, and for each group, sends the id in the group to the second device. The second device retrieves the data rows in the second data table by id, and groups the retrieved data rows according to "T2.col" in the second data table. In each group, "T2.value" in the second data table is aggregated, and the aggregated result is sent to the first device. The first device merges the grouping results and their corresponding aggregation results to obtain the first target data table.
[0171] Exemplarily, after splitting, the second grouping aggregation statement obtained is:
[0172] Select sum(T1.value)from T1 join T2 on T1.id=T2.id group by T1.col,T2.col
[0173] For easier understanding, see Fig. 9 , Fig. 9 Another schematic diagram for implementing data aggregation in an embodiment of the present application, as shown in the figure, the second device groups "T2.id" according to "T2.col" in the second data table, and for each group, sends the id in the group to the first device. The first device retrieves the data row in the first data table by id, and groups the retrieved data rows according to "T1.col" in the first data table. In each group, "T1.value" in the second data table is aggregated, and the aggregation result is sent to the second device. The second device merges the grouping results and their corresponding aggregation results to obtain the second target data table.
[0174] Based on this, for ease of understanding, please refer to Fig.10 , Fig.10 This is a schematic diagram of the total data table obtained by combining in an embodiment of the present application. As shown in the figure, the first target data table and the second target data table are combined, that is, "T1.col" and "T2.sum" in the first target data table are combined with "T2.col" and "T1.sum" in the second target data packet to obtain the total data table.
[0175] Again, in the embodiment of the present application, a method for data integration based on the data table fed back by the second device is provided. Through the above method, different participants (i.e., devices) respectively perform group aggregation operations on the data table based on the group aggregation statements obtained by splitting, and finally, the target data tables generated by each are integrated to obtain a total data table. Thus, the feasibility and operability of the solution are improved.
[0176] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, another optional embodiment provided by the embodiment of the present application may further include:
[0177] The first device obtains an intersection of identifiers between a first original data table and a second original data table, wherein the first original data table is stored in the first device and the second original data table is stored in the second device;
[0178] The first device obtains a first data table from a first original data table according to an identifier intersection, wherein a first identifier field of the first data table corresponds to the identifier intersection, and the identifier intersection is also used to obtain a second data table from a second original data table, and a second identifier field of the second data table corresponds to the identifier intersection.
[0179] In one or more embodiments, a method for implementing privacy set intersection based on PSI is introduced. From the above embodiments, it can be seen that the first device stores a first original data table, and the second device stores a second original data table, wherein the first original data table and the second original data table both include an identification field.
[0180] Specifically, for ease of understanding, please refer to Table 1, which is a schematic diagram of the first original data table.
[0181] Table 1
[0182] T1.id T1.value T1.col 1 3 A 2 4 B 3 5 C 4 6 C 5 9 D 6 8 D
[0183] Please refer to Table 2, which is a schematic diagram of the second original data table.
[0184] Table 2
[0185] T2.id T2.value T2.col 2 7 C 3 8 C 4 9 D 5 10 D 6 11 D
[0186] Based on this, the "T1.id" of the first original data table and the "T2.id" of the second original data table are used as input, and the PSI scheme is run to obtain the identifier intersection (ie, T), that is, T = T1.id ∩ T2.id. The first device filters the first original data table according to the elements of the identifier intersection, and locally filters the data rows whose id belongs to the identifier intersection, thereby forming a first data table, and the first data table can be further sorted according to T1.col. Similarly, the second device filters the second original data table according to the elements of the identifier intersection, and locally filters the data rows whose id belongs to the identifier intersection, thereby forming a second data table, and the second data table can be further sorted according to T2.col.
[0187] Please refer to Table 3, which is a schematic diagram of a first data table generated based on the first original data table shown in Table 1.
[0188] Table 3
[0189] T1.id T1.value T1.col 2 4 B 3 5 C 4 6 C 5 9 D 6 8 D
[0190] Please refer to Table 4, which is a schematic diagram of a second data table generated based on the second original data table shown in Table 2.
[0191] Table 4
[0192]
[0193]
[0194] Secondly, in the embodiment of the present application, a method for implementing the intersection of privacy sets based on PSI is provided. Through the above method, the intersection of the input sets of both parties can be obtained without leaking additional information from the devices of both parties, thereby improving the security and reliability of data interaction.
[0195] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the first device performs grouping processing on the first data table according to the first grouping aggregation statement to obtain K grouping results, which may specifically include:
[0196] The first device obtains a first grouping field from the first grouping aggregation statement, wherein the first grouping field corresponds to at least one type of group information, and the first grouping field is included in a first preset field;
[0197] The first device generates K grouping results according to at least one type of group information included in the first grouping field, wherein the same grouping result among the K grouping results has the same group information.
[0198] In one or more embodiments, a method for grouping a data table based on a grouping field is introduced. As can be seen from the above embodiments, a first device stores a first data table, and the first data table may include a first grouping field and a first identification field, wherein the first grouping field corresponds to at least one type of group information.
[0199] Specifically, for ease of understanding, please refer to Table 3 again. The first grouping field is "T1.col", and the group information associated with "T1.col" includes "B", "C", and "D". Therefore, the data rows with group information "B" are taken as a grouping result, the data rows with group information "C" are taken as a grouping result, and the data rows with group information "D" are taken as a grouping result.
[0200] Secondly, in the embodiment of the present application, a method for grouping data tables based on grouping fields is provided. Through the above method, a specific implementation method is provided for the solution implementation, thereby improving the feasibility and operability of the solution.
[0201] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiments of the present application, the first device sends T grouping results to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the T grouping results to obtain T aggregation results, which may specifically include:
[0202] The first device sends K grouping results to the second device, so that the second device performs group aggregation processing on the second data table according to identification information included in each grouping result in the K grouping results to obtain K aggregation results.
[0203] In one or more embodiments, a method of transmitting grouping results at one time is introduced. From the above embodiments, it can be seen that in one case, T=K, that is, the obtained K grouping results do not need to be split, so the first device sends K grouping results to the second device.
[0204] Specifically, exemplarily, it is assumed that the K grouping results include a first grouping result and a second grouping result. For ease of understanding, please refer to Table 5, which is a schematic diagram of the first data table.
[0205] Table 5
[0206]
[0207]
[0208] Assuming that the first grouping result includes four identification information (i.e., id) with T1.col being "A", the first grouping result sent by the first device to the second device includes id = 1, id = 3, id = 4, id = 6. Thus, the second device performs grouping aggregation processing on the second data table according to the four identification information, thereby obtaining the first aggregation result.
[0209] Assuming that the second grouping result includes three identification information of T1.col being "B", the second grouping result sent by the first device to the second device includes id = 2, id = 5, id = 7. Thus, the second device performs grouping aggregation processing on the second data table according to the three identification information, thereby obtaining a second aggregation result.
[0210] Secondly, in the embodiment of the present application, a method for transmitting grouping results at one time is provided. Through the above method, the first device can directly send K grouping results to the second device without processing the grouping results, thereby saving data processing resources and improving processing efficiency.
[0211] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the K grouping results include a first grouping result;
[0212] The first device sends T grouping results to the second device, so that the second device performs grouping aggregation processing on the second data table according to the identification information included in each grouping result in the T grouping results to obtain T aggregation results, which may specifically include:
[0213] The first device divides the first grouping result into a plurality of grouping results, wherein identification information included in each of the plurality of grouping results does not overlap;
[0214] The first device sends each grouping result to the second device, so that the second device performs grouping aggregation processing on the second data table according to the identification information included in each grouping result to obtain T aggregation results.
[0215] In one or more embodiments, a method of transmitting grouping results in multiple batches is introduced. From the above embodiments, it can be seen that in one case, T>K, that is, the obtained K grouping results need to be split, so the first device sends T grouping results to the second device.
[0216] Specifically, exemplarily, it is assumed that K grouping results include the first grouping result. For ease of understanding, please refer to Table 5 again. It is assumed that the first grouping result includes 4 identification information (i.e., id) with T1.col being "A". At this time, the first device can randomly split the first grouping result into several grouping results, and the identification information included in each grouping result does not overlap. For example, the first grouping result is split into two grouping results, wherein one grouping result includes id=1 with T1.col being "A", and the other grouping result includes id=3, id=4, and id=6 with T1.col being "A".
[0217] Secondly, in the embodiment of the present application, a method for transmitting grouping results in multiple batches is provided. Through the above method, the first device further splits the K grouping results to avoid transmitting a complete grouping result at one time, thereby preventing the leakage of identification information in the grouping results, thereby enhancing the ability of security data analysis.
[0218] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the first device receives T aggregation results sent by the second device, which may specifically include:
[0219] The first device receives a first aggregation result sent by the second device, wherein the first aggregation result includes target group information and an aggregation value, the target group information is obtained after the second device encrypts the original group information, and the target group information corresponds to the second grouping field of the second data table.
[0220] In one or more embodiments, a method for encrypting and transmitting original group information is introduced. As can be seen from the above embodiments, the first device stores a first data table, and the second device stores a second data table, wherein the second data table includes a second grouping field (i.e., "T2.col") and a second value field (i.e., "T2.value").
[0221] It is understandable that this application introduces the encryption of original group information by using a hash function as an example, but this should not be understood as a limitation of this application. Based on the hash function, it can be defined as hash(key), where key represents the key value of the element, and the value of hash(key) represents the hash value calculated by the hash function.
[0222] Specifically, taking the encryption of the original group information in the second data table as an example, for the sake of convenience, please refer to Table 4 again. Based on this, the second device can use a hash function to encrypt each original group information corresponding to the second grouping field (i.e., "T2.col"). Please refer to Table 6, which is a schematic diagram of the second data table obtained after performing hash function calculation on each original group information in Table 4.
[0223] Table 6
[0224] T2.id T2.value T2.col 2 7 hash(C) 3 8 hash(C) 4 9 hash(D) 5 10 hash(D) 6 11 hash(D)
[0225] As can be seen from Table 6, the target group information corresponding to the second grouping field (ie, "T2.col") includes hash (C) and hash (D). The original values corresponding to the second value field (ie, "T2.value") include "7", "8", "9", "10" and "11".
[0226] Secondly, in the embodiment of the present application, a method for encrypting and transmitting the original group information is provided. Through the above method, a random number can be generated for each original group information in the data table, and the random number is used to protect the original group information, thereby preventing the leakage of the original group information, thereby enhancing the ability of secure data analysis.
[0227] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the first device receives T aggregation results sent by the second device, which may specifically include:
[0228] The first device receives a first aggregation result sent by the second device, wherein the first aggregation result includes original group information and a target value, the target value is obtained by encrypting the aggregation value by the second device using a public key, and the original group information corresponds to a second grouping field of the second data table.
[0229] In one or more embodiments, a method for encrypting and transmitting the original numerical value is introduced. As can be seen from the foregoing embodiments, the second device stores a second data table, wherein the second data table includes a second grouping field (i.e., "T2.col") and a second value field (i.e., "T2.value"), and after the second device receives T grouping results sent by the first device and performs group aggregation, it can obtain an aggregation field (i.e., T2.sum).
[0230] It is understandable that the first device executes a key generation (Gen) algorithm to generate a pair of public and private keys (pk A ,sk A ), where pk A The public key generated for the first device, sk AThe private key generated by the first device, the first device publishes the public key pk A Similarly, the second device executes the Gen algorithm to generate a pair of public and private keys (pk B ,sk B ), where pk B The public key generated for the second device, sk B The private key generated for the second device, the second device publishes the public key pk B .
[0231] Specifically, taking encryption of the aggregate value as an example, for ease of explanation, please refer to Table 4 again. Based on this, the second device may use the public key pk B Each aggregate value corresponding to the aggregate field (ie, T2.sum) is encrypted. Please refer to Table 7, which is a data table obtained after grouping and aggregating each original value in the second data table shown in Table 4.
[0232] Table 7
[0233] T2.id T2.sum T2.col 2 <![CDATA[[7]pk B ]]> C 3 <![CDATA[[8]pk B ]]> C 4 <![CDATA[[9]pk B ]]> D 5 <![CDATA[
[10] pk B ]]> D 6 <![CDATA[
[11] pk B ]]> D
[0234] As can be seen from Table 7, the target values corresponding to the aggregate field (i.e., T2.sum) include [7]pk B 、[8]pk B 、[9]pk B 、
[10] pk B and
[11] pk B The original group information corresponding to the second grouping field (ie, "T2.col") includes "C" and "D".
[0235] It can be understood that the grouping result sent by the first device to the second device includes id=2 and id=3. Based on Table 4, the aggregate value is 15 (i.e., 7+8=15). Therefore, the target value corresponding to the aggregate value is
[15] pk B .
[0236] Secondly, in the embodiment of the present application, a method for encrypting and transmitting the original value is provided. Through the above method, each original value in the data table can be encrypted using a public key, thereby preventing the leakage of the original value, thereby enhancing the ability of secure data analysis.
[0237] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the first device receives T aggregation results sent by the second device, which may specifically include:
[0238] The first device receives a first aggregation result sent by the second device, wherein the first aggregation result includes target group information and a target value, the target group information is obtained by the second device encrypting the original group information, the target value is obtained by the second device encrypting the aggregate value using a public key, and the target group information corresponds to the second grouping field of the second data table.
[0239] In one or more embodiments, a method for encrypting and transmitting original group information and original values is introduced. As can be seen from the foregoing embodiments, the second device stores a second data table, wherein the second data table includes a second grouping field (i.e., "T2.col") and a second value field (i.e., "T2.value"), and after the second device receives T grouping results sent by the first device and performs group aggregation, it can obtain an aggregation field (i.e., T2.sum).
[0240] It is understandable that the present application uses the hash function to encrypt the original group information as an example, but this should not be understood as a limitation of the present application. The first device executes the Gen) algorithm to generate a pair of public and private keys (pk A ,sk A ), the second device executes the Gen algorithm to generate a pair of public and private keys (pk B ,sk B ).
[0241] Specifically, taking the encryption of the original group information and the aggregate value as an example, for the sake of convenience, please refer to Table 4 again. Based on this, the second device can use a hash function to encrypt each original group information corresponding to the second grouping field (ie, "T2.col"), and use the public key pk B Each aggregate value corresponding to the aggregate field (ie, T2.sum) is encrypted. Please refer to Table 8, which is a data table obtained by performing hash function calculation on each original group information in the second data table shown in Table 4 and grouping and aggregating each original value in the second data table.
[0242] Table 8
[0243]
[0244]
[0245] As can be seen from Table 8, the target group information corresponding to the second grouping field (ie, "T2.col") includes hash(C) and hash(D). The target value corresponding to the aggregation field (ie, T2.sum) includes [7]pk B 、[8]pk B 、[9]pk B 、
[10] pkB and
[11] pk B .
[0246] Secondly, in the embodiment of the present application, a method for encrypting and transmitting the original group information and the original value is provided. Through the above method, a random number can be generated for each original group information in the data table, and the random number can be used to protect the original group information. At the same time, a public key can be used to encrypt each original value in the data table, thereby preventing the leakage of the original group information and the original value, thereby enhancing the ability of secure data analysis.
[0247] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, another optional embodiment provided by the embodiment of the present application may further include:
[0248] If the first aggregation result and the second aggregation result include the same target group information, the first device adds the target values in the first aggregation result and the second aggregation result based on the homomorphic encryption algorithm to obtain an encrypted value.
[0249] In one or more embodiments, a method for homomorphically encrypting multiple target values is introduced. As can be seen from the foregoing embodiments, the first device groups the first data table based on the first grouping field (i.e., "T1.col") to obtain K grouping results, based on which the first device and the second device can interact according to the K grouping results.
[0250] Specifically, for ease of understanding, please refer to Table 9, which is a schematic diagram of the first data table.
[0251] Table 9
[0252] T1.id T1.value T1.col 2 4 B 3 5 C 4 6 C 5 9 D 6 8 D
[0253] The first device groups "T1.col" and obtains three grouping results, namely T1.col=B, T1.col=C and T1.col=D.
[0254] For ease of understanding, please refer to Table 10, which is a schematic diagram of the second data table.
[0255] Table 10
[0256] T2.id T2.value T2.col 2 7 C 3 8 C 4 9 D 5 10 D 6 11 D
[0257] For example, see Fig.11 , Fig.11This is a schematic diagram of information exchange between the first device and the second device in the embodiment of the present application. As shown in the figure, when T1.col = B, the first device selects T1.id = {2} and sends it to the second device. The second device indexes according to T1.id = {2} and the second data table to obtain the data row (2,7,C). Based on this, the second device can calculate [7]pk B , and then sends the aggregation result (hash(C),[7]pk B ).
[0258] For example, see Fig.12 , Fig.12 This is another schematic diagram of information exchange between the first device and the second device in the embodiment of the present application. As shown in the figure, when T1.col = C, the first device selects T1.id = {3, 4} and sends it to the second device. The second device indexes according to T1.id = {3, 4} and the second data table to obtain data rows (3, 8, C) and (4, 9, D). Based on this, the second device can calculate [8]pk B and [9]pk B , and then sends the aggregation result (hash(C),[8]pk B ) and (hash(D),[9]pk B ).
[0259] For example, see Fig.13 , Fig.13 This is another schematic diagram of information exchange between the first device and the second device in the embodiment of the present application. As shown in the figure, when T1.col = D, the first device selects T1.id = {3, 4} and sends it to the second device twice. Therefore, the second device indexes according to T1.id = {5} and the second data table to obtain the data row (5, 10, D). Based on this, the second device can calculate
[10] pk B , and then sends the first aggregation result (hash (D),
[10] pk B ). In addition, the second device indexes the second data table according to T1.id={6} to obtain the data row (6,11,D). Based on this, the second device can calculate
[11] pk B , and then sends the second aggregation result (hash (D),
[11] pk B ). It can be seen that at this time, the first aggregation result and the second aggregation result include the same target group information (ie, hash(D)), so the first device can calculate the sum of the target values using homomorphic encryption:
[0260]
[10] pk B ⊕
[11] pk B=[10+11]pk B
[0261] Here, ⊕ represents an addition operation on the ciphertext domain, for example, using the Paillier algorithm, the operation is a standard multiplication.
[0262] Based on this, the first device obtains (hash(D),
[21] pk B ).
[21] pk B Represents an encrypted value.
[0263] It is understandable that each time the first device receives an aggregation result, it needs to check whether there is the same target group information (or, original group information). If so, the sum of the target values in the aggregation result is calculated using homomorphic encryption, and the sum of the target values is updated, that is:
[0264] (L t ,Res t )←(L t ,Res t ⊕Res j );
[0265] and discard (L j ,Res j ). Among them, L t Represents the target group information (or original group information) in the first aggregation result. t Indicates the target value in the first aggregation result. L j Represents the target group information (or original group information) in the second aggregation result. j Indicates the target value in the second aggregation result.
[0266] Again, in the embodiment of the present application, a method for homomorphic encryption of multiple target values is provided. In the above manner, homomorphic encryption is used to protect the aggregation results, avoiding the risk of privacy leakage caused by others' reverse inference through the aggregation results, thereby enhancing the ability of secure data analysis.
[0267] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the first device generates a first target data table according to T aggregation results and T grouping results, which may specifically include:
[0268] The first device obtains R encrypted values according to the T aggregation results, where R is an integer greater than or equal to 1 and less than or equal to T;
[0269] The first device sends R encrypted values to the second device, so that the second device decrypts the R encrypted values using a private key to obtain R decrypted values, wherein the private key and the public key are generated by the second device;
[0270] The first device receives R decrypted values sent by the second device;
[0271] The first device generates a first target data table according to the R decrypted values and the T grouping results.
[0272] In one or more embodiments, a method for decryption based on a homomorphic encryption algorithm is introduced. It can be seen from the above embodiments that the first device receives T aggregation results sent by the second device. Taking the above embodiment as an example, the first device performs homomorphic addition on the T aggregation results with the same target group information (or, original group information), thereby obtaining R encrypted values and the target group information (or, original group information) corresponding to each encrypted value.
[0273] Specifically, suppose that the T aggregation results include (hash(C),[7]pk B ),(hash(C),[8]pk B ),(hash(D),[9]pk B ),(hash(C),
[10] pk B ) and (hash(C),
[11] pk B ), after homomorphic addition, we get (hash(C),[7]pk B ),(hash(C),[8]pk B ),(hash(D),[9]pk B ) and (hash(D),
[21] pk B ), where the R encrypted values include [7]pk B ,[8]pk B ,[9]pk B and
[21] pk B For easier understanding, please refer to Fig.14 , Fig.14 This is a schematic diagram of the second device feeding back the decryption result in an embodiment of the present application. As shown in the figure, the first device sends R encrypted values to the second device, and the second device can use the private key (ie, sk B ) decrypts the R encrypted values to obtain R decrypted values (i.e., 7, 8, 9, 21).
[0274] Based on this, the first device receives R decrypted values, and then generates a first target data table according to the R decrypted values, the target group information (or original group information) corresponding to each decrypted value, and T grouping results.
[0275] It should be noted that the second device can obtain the corresponding second target data table in a similar manner based on the second grouping aggregation statement. Thus, the first device discloses the first target data table, and the second device discloses the first target data table. Based on this, the first target data table and the second target data table are combined to obtain a total data table.
[0276] Furthermore, in an embodiment of the present application, a method for decryption based on a homomorphic encryption algorithm is provided. In the above manner, homomorphic encryption is used to protect the aggregation results, thereby avoiding the risk of privacy leakage caused by others' reverse inference through the aggregation results, thereby enhancing the ability of secure data analysis.
[0277] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the first device receives T aggregation results sent by the second device, which may specifically include:
[0278] The first device receives a first aggregation result sent by the second device, wherein the first aggregation result includes target group information and a first target value, the target group information is obtained after the second device encrypts the original group information, the first target value is the sum of the first original value and the first random value, the target group information corresponds to the second grouping field of the second data table, and the first original value corresponds to the second value field of the second data table;
[0279] The first device receives a second aggregation result sent by the second device, wherein the second aggregation result includes target group information and a second target value, the second target group information is obtained after the second device encrypts the second original group information, the second target value is the sum of the second original value and the second random value, the second target group information corresponds to the second grouping field of the second data table, and the second original value corresponds to the second value field of the second data table.
[0280] In one or more embodiments, a method for implementing data encryption based on the OT protocol is introduced. As can be seen from the above embodiments, the first device stores a first data table, and the second device stores a second data table, wherein the second data table includes a second grouping field (i.e., "T2.col") and a second value field (i.e., "T2.value"), the target group information corresponds to the second grouping field (i.e., "T2.col"), and the first original value and the second original value both correspond to the second value field (i.e., "T2.value").
[0281] Specifically, take the example of the second device sending the first aggregation result and the second aggregation result to the first device, wherein the first aggregation result includes the target group information (or, the original group information) and the first target value (ie, Res' j), the first target value (ie, Res' j ) is the first original value (ie, Res j ) and the first random value (ie, r j ), that is, Res' j =Res j +r j Similarly, the second aggregation result includes the target group information (or the original group information) and the second target value (ie, Res' i ), the second target value (ie, Res' i ) is the second original value (ie, Res i ) and the second random value (i.e., r i ), that is, Res' i =Res i +r i .
[0282] Thus, the first device can directly calculate the first target value (ie, Res' j ) and the second target value (ie, Res' i ), that is, we get Res j +Res i +r j +r i The addition here refers to addition over a finite field, which has a low computational overhead.
[0283] Secondly, in the embodiment of the present application, a method for implementing data encryption based on the OT protocol is provided. Through the above method, on the one hand, the aggregation results can be protected, avoiding the risk of privacy leakage caused by others' reverse inference through the aggregation results, thereby enhancing the ability of secure data analysis. On the other hand, the computational overhead of transmitting data based on the OT protocol is low, thereby improving the practicality of the solution.
[0284] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the first device generates a first target data table according to T aggregation results and T grouping results, which may specifically include:
[0285] The first device obtains a sum of random numbers from the second device based on the oblivious transfer protocol, wherein the sum of random numbers is a sum of random values from the 1st to the Nth random number, and N is an integer greater than 1;
[0286] The first device obtains a first target value from the first aggregation result, and obtains a second target value from the second aggregation result;
[0287] The first device determines the target original value according to the first target value, the second target value, the sum of random numbers and the total number of historical random numbers, wherein the total number of historical random numbers is the sum of the first to Mth random values, and M is an integer greater than or equal to 1 and less than N;
[0288] The first device generates a first target data table according to the target original value, the target group information and the T grouping results.
[0289] In one or more embodiments, a method for implementing data decryption based on the OT protocol is introduced. As can be seen from the above embodiments, when the first device obtains the sum of each target value corresponding to the same target group information (or, original group information), it is not necessary for the second device to decrypt. The sum of each target value obtained by the first device can be (L t ,Res t +r t ), or, (L t ,Res t +Res t+1 +…+Res t+k +r t +r t+1 +…+r t+k ). For the first device, in order to recover the result, it actually needs to know the sum of the random numbers generated by the second device, which can be achieved by using the OT-based secret sharing scheme.
[0290] Specifically, for ease of understanding, see Fig.15 , Fig.15 This is a schematic diagram of implementing data sharing based on oblivious transfer in an embodiment of the present application. As shown in the figure, it is assumed that the first device finally obtains R aggregation results, and the first device interacts with the second device T times, where R is less than or equal to T. Therefore, the second device constructs a sequence S with a length of T, S i =r 1 +r 2 +…+r i . Assume that the first device needs to know r t +r t+1 +…+r t+k , and at this time, the first device already knows the total number of historical random numbers S t-1 =r 1 +r 2 +…+r t-1 , because the historical random total will be applied to the decryption of the last aggregation result.
[0291] Based on this, the first device and the second device are based on the OT protocol, and the first device selects the t+kth value, then the first device knows the sum of random numbers S t+k , the first device calculates the sum of random numbers St+k (i.e., r t +r t+1 +…+r t+k ) and the total number of historical random t-1 (i.e., r 1 +r 2 +…+r t-1 ) to get r t +r t+1 +…+r t+k When decrypting, the sum of each target value (for example, the sum of the first target value and the second target value) is added to r t +r t+1 +…+r t+k Subtract and get the target original value Res t +Res t+1 +…+Res t+k .
[0292] It can be understood that, for ease of understanding, t+k in the above example is N, so the sum of random numbers r t +r t+1 +…+r t+k is the sum of the random values from the 1st to the Nth. In the above example, t-1 is M, so the total number of historical random numbers r 1 +r 2 +…+r t-1 is the sum of the random values from the 1st to the Mth.
[0293] It should be noted that the second device can obtain the corresponding second target data table in a similar manner based on the second grouping aggregation statement. Thus, the first device discloses the first target data table, and the second device discloses the first target data table. Based on this, the first target data table and the second target data table are combined to obtain a total data table.
[0294] Again, in the embodiment of the present application, a method for realizing data decryption based on the OT protocol is provided. Through the above method, on the one hand, the aggregation results can be protected, avoiding the risk of privacy leakage caused by others' reverse inference through the aggregation results, thereby enhancing the ability of secure data analysis. On the other hand, the computational overhead of transmitting data based on the OT protocol is low, thereby improving the practicality of the solution.
[0295] The data aggregation device in the present application is described in detail below. The data aggregation device is applied to a first device, and the first device stores a first data table. Fig.16 , Fig.16 This is a schematic diagram of an embodiment of a data aggregation device in an embodiment of the present application. The data aggregation device 30 includes:
[0296] An acquisition module 310 is used to acquire a first grouping and aggregation statement, wherein the first grouping and aggregation statement is used to request grouping and aggregation processing of the data table according to a first preset field;
[0297] A processing module 320 is used to perform grouping processing on the first data table according to the first grouping aggregation statement to obtain K grouping results, wherein each of the K grouping results includes identification information, and the K grouping results are used to generate T grouping results, where K is an integer greater than or equal to 1, and T is an integer greater than or equal to K;
[0298] The sending module 330 is used to send T grouping results to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the T grouping results to obtain T aggregation results, wherein the second data table is stored in the second device;
[0299] A receiving module 340, configured to receive T aggregation results sent by the second device;
[0300] The generating module 350 is used to generate a first target data table according to the T aggregation results and the T grouping results, wherein the first target data table includes the grouping aggregation results for the first preset field.
[0301] In an embodiment of the present application, a data aggregation device is provided. By using the above device, the data table is stored locally in the device. Based on this, the device can process the local data table according to the group aggregation statement, and the processing results of the data table can be transmitted between the devices, thereby realizing the group aggregation of data. Since each device processes the local data table independently, on the one hand, the risk of data leakage is avoided from the root, and on the other hand, the whole process does not need to trigger manual review, thereby saving data maintenance costs.
[0302] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0303] The acquisition module 310 is specifically used to acquire an original grouping aggregation statement, wherein the original grouping aggregation statement includes a first value field and a second value field, the first value field belongs to the first data table, and the second value field belongs to the second data table;
[0304] A first group aggregation statement is generated according to the original group aggregation statement, wherein the first group aggregation statement includes a second value field, and the second value field is included in the first preset field, and the original group aggregation statement is also used for the second device to generate a second group aggregation statement, and the second group aggregation statement includes a first value field, and the first value field is included in the second preset field.
[0305] In an embodiment of the present application, a data aggregation device is provided. With the above device, considering that in the case of joint grouping, the operation of directly aggregating multiple data columns is relatively complicated, the aggregation of single data columns can be split to reduce the complexity of the operation.
[0306] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0307] The receiving module 340 is further configured to receive P grouping results sent by the second device, wherein the P grouping results are obtained after the second device performs grouping processing on the second data table according to the second grouping aggregation statement, each of the P grouping results includes identification information, and P is an integer greater than or equal to 1;
[0308] The processing module 320 is further configured to perform group aggregation processing on the first data table according to the identification information included in each group result in the P group results, so as to obtain P aggregation results;
[0309] The sending module 330 is further used to send the P aggregation results to the second device, so that the second device generates a second target data table according to the P aggregation results and the P grouping results, wherein the second target data table includes the aggregation results of the first data table and the second data table for the second preset field;
[0310] The receiving module 340 is further configured to receive a second target data table sent by a second device;
[0311] The generation module 350 is further used to generate the first target data table according to the T aggregation results and the T grouping results, and then combine the first target data table and the second target data table to obtain a total data table.
[0312] In the embodiment of the present application, a data aggregation device is provided. Using the above device, different participants (i.e., devices) respectively perform group aggregation operations on data tables based on the group aggregation statements obtained by splitting, and finally, the target data tables generated by each are integrated to obtain a total data table. Thus, the feasibility and operability of the solution are improved.
[0313] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0314] The acquisition module 310 is further used to acquire the intersection of identifiers between the first original data table and the second original data table, wherein the first original data table is stored in the first device and the second original data table is stored in the second device;
[0315] The acquisition module 310 is also used to acquire the first data table from the first original data table according to the identifier intersection, wherein the first identification field of the first data table corresponds to the identifier intersection, and the identifier intersection is also used to acquire the second data table from the second original data table, and the second identification field of the second data table corresponds to the identifier intersection.
[0316] In an embodiment of the present application, a data aggregation device is provided. By adopting the above device, the intersection of the input sets of both parties can be obtained without leaking additional information from the devices of both parties, thereby improving the security and reliability of data interaction.
[0317] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0318] The processing module 320 is specifically configured to obtain a first grouping field from the first grouping aggregation statement, wherein the first grouping field corresponds to at least one type of group information, and the first grouping field is included in a first preset field;
[0319] K grouping results are generated according to at least one type of grouping information included in the first grouping field, wherein the same grouping result among the K grouping results has the same grouping information.
[0320] In the embodiment of the present application, a data aggregation device is provided. The above device provides a specific implementation method for implementing the solution, thereby improving the feasibility and operability of the solution.
[0321] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0322] The sending module 330 is specifically used to send K grouping results to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the K grouping results to obtain K aggregation results.
[0323] In an embodiment of the present application, a data aggregation device is provided. With the above device, the first device can directly send K grouping results to the second device without processing the grouping results, thereby saving data processing resources and improving processing efficiency.
[0324] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0325] The sending module 330 is specifically configured to divide the first grouping result into a plurality of grouping results, wherein identification information included in each of the plurality of grouping results does not overlap;
[0326] Each grouping result is sent to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result to obtain T aggregation results.
[0327] In an embodiment of the present application, a data aggregation device is provided. Using the above device, the first device further splits the K grouping results to avoid transmitting a complete grouping result at one time, thereby preventing the leakage of identification information in the grouping results, thereby enhancing the ability of secure data analysis.
[0328] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0329] The receiving module 340 is specifically used to receive the first aggregation result sent by the second device, wherein the first aggregation result includes target group information and an aggregation value, the target group information is obtained after the second device encrypts the original group information, and the target group information corresponds to the second grouping field of the second data table.
[0330] In an embodiment of the present application, a data aggregation device is provided. By using the above device, a random number can be generated for each original group information in the data table, and the random number is used to protect the original group information, thereby preventing the leakage of the original group information, thereby enhancing the ability of secure data analysis.
[0331] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0332] The receiving module 340 is specifically used to receive the first aggregation result sent by the second device, wherein the first aggregation result includes original group information and target value, the target value is obtained by encrypting the aggregation value by the second device using a public key, and the original group information corresponds to the second grouping field of the second data table.
[0333] In an embodiment of the present application, a data aggregation device is provided. By using the above device, each original value in the data table can be encrypted using a public key, thereby preventing the leakage of the original value, thereby enhancing the ability of secure data analysis.
[0334] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0335] The receiving module 340 is specifically used to receive the first aggregation result sent by the second device, wherein the first aggregation result includes target group information and target value, the target group information is obtained after the second device encrypts the original group information, and the target value is obtained after the second device encrypts the aggregate value using a public key, and the target group information corresponds to the second grouping field of the second data table.
[0336] In an embodiment of the present application, a data aggregation device is provided. By using the above device, a random number can be generated for each original group information in the data table, and the random number can be used to protect the original group information. At the same time, a public key can be used to encrypt each original value in the data table, thereby preventing the leakage of the original group information and the original value, thereby enhancing the ability of secure data analysis.
[0337] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0338] The processing module 320 is also used to add the target values in the first aggregation result and the second aggregation result based on the homomorphic encryption algorithm to obtain an encrypted value if the first aggregation result and the second aggregation result include the same target group information.
[0339] In an embodiment of the present application, a data aggregation device is provided. The above device is used to protect the aggregation results using homomorphic encryption, thereby avoiding the risk of privacy leakage caused by others' reverse inference through the aggregation results, thereby enhancing the ability of secure data analysis.
[0340] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0341] A generating module 350 is specifically configured to obtain R encrypted values according to T aggregation results, where R is an integer greater than or equal to 1 and less than or equal to T;
[0342] Sending the R encrypted values to the second device, so that the second device decrypts the R encrypted values using a private key to obtain R decrypted values, wherein the private key and the public key are generated by the second device;
[0343] Receiving R decrypted values sent by the second device;
[0344] A first target data table is generated according to the R decrypted values and the T grouping results.
[0345] In an embodiment of the present application, a data aggregation device is provided. The above device is used to protect the aggregation results using homomorphic encryption, thereby avoiding the risk of privacy leakage caused by others' reverse inference through the aggregation results, thereby enhancing the ability of secure data analysis.
[0346] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0347] The receiving module 340 is specifically configured to receive a first aggregation result sent by the second device, wherein the first aggregation result includes target group information and a first target value, the target group information is obtained by encrypting the original group information by the second device, the first target value is the sum of the first original value and the first random value, the target group information corresponds to the second grouping field of the second data table, and the first original value corresponds to the second value field of the second data table;
[0348] Receive a second aggregation result sent by a second device, wherein the second aggregation result includes target group information and a second target value, the second target group information is obtained after the second device encrypts the second original group information, the second target value is the sum of the second original value and the second random value, the second target group information corresponds to the second grouping field of the second data table, and the second original value corresponds to the second value field of the second data table.
[0349] In the embodiment of the present application, a data aggregation device is provided. By adopting the above device, on the one hand, the aggregation results can be protected, avoiding the risk of privacy leakage caused by others' reverse inference through the aggregation results, thereby enhancing the ability of secure data analysis. On the other hand, the computational overhead of data transmission based on the OT protocol is low, thereby improving the practicality of the solution.
[0350] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the data aggregation device 20 provided in the embodiment of the present application,
[0351] The generating module 350 is specifically configured to obtain a sum of random numbers from the second device based on the oblivious transfer protocol, wherein the sum of random numbers is a sum of random values from the 1st to the Nth random number, where N is an integer greater than 1;
[0352] Obtaining a first target value from the first aggregation result, and obtaining a second target value from the second aggregation result;
[0353] Determine the target original value according to the first target value, the second target value, the sum of random numbers and the total number of historical random numbers, wherein the total number of historical random numbers is the sum of the random values from the 1st to the Mth, and M is an integer greater than or equal to 1 and less than N;
[0354] A first target data table is generated according to the target original value, target group information and T grouping results.
[0355] In the embodiment of the present application, a data aggregation device is provided. By adopting the above device, on the one hand, the aggregation results can be protected, avoiding the risk of privacy leakage caused by others' reverse inference through the aggregation results, thereby enhancing the ability of secure data analysis. On the other hand, the computational overhead of data transmission based on the OT protocol is low, thereby improving the practicality of the solution.
[0356] This application provides a data aggregation device that can be deployed on a server. For ease of understanding, please refer to Fig.17 , Fig.17 4 is a schematic diagram of a server structure provided in an embodiment of the present application. The server 400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 422 (for example, one or more processors) and a memory 432, and one or more storage media 430 (for example, one or more mass storage devices) storing application programs 442 or data 444. Among them, the memory 432 and the storage medium 430 may be short-term storage or permanent storage. The program stored in the storage medium 430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 422 may be configured to communicate with the storage medium 430 to execute a series of instruction operations in the storage medium 430 on the server 400.
[0357] The server 400 may also include one or more power supplies 426, one or more wired or wireless network interfaces 450, one or more input and output interfaces 458, and / or one or more operating systems 441, such as Windows Server 2000. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0358] The steps performed by the server in the above embodiment can be based on the Fig.17 The server structure shown.
[0359] This application provides a data aggregation device that can be deployed on a terminal. For ease of understanding, please refer to Fig.18 ,like Fig.18For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. In the embodiments of the present application, the terminal is a smart phone as an example for explanation:
[0360] Fig.18 FIG. 1 is a block diagram showing a partial structure of a smart phone related to a terminal provided in an embodiment of the present application. Fig.18 The smart phone includes: a radio frequency (RF) circuit 510, a memory 520, an input unit 530, a display unit 540, a sensor 550, an audio circuit 560, a wireless fidelity (WiFi) module 570, a processor 580, and a power supply 590. Those skilled in the art will appreciate that Fig.18 The structure of the smartphone shown in the figure does not constitute a limitation of the smartphone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0361] Combine the following Fig.18 A detailed introduction to the various components of a smartphone:
[0362] The RF circuit 510 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 580 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 510 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 510 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.
[0363] The memory 520 can be used to store software programs and modules. The processor 580 executes various functional applications and data processing of the smartphone by running the software programs and modules stored in the memory 520. The memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the smartphone (such as audio data, a phone book, etc.), etc. In addition, the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0364] The input unit 530 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smart phone. Specifically, the input unit 530 may include a touch panel 531 and other input devices 532. The touch panel 531, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 531 or near the touch panel 531 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 531 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 580, and can receive and execute commands sent by the processor 580. In addition, the touch panel 531 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 531, the input unit 530 may further include other input devices 532. Specifically, the other input devices 532 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a mouse, a joystick, etc.
[0365] The display unit 540 can be used to display information input by the user or information provided to the user and various menus of the smartphone. The display unit 540 may include a display panel 541. Optionally, the display panel 541 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel 531 may cover the display panel 541. When the touch panel 531 detects a touch operation on or near it, it is transmitted to the processor 580 to determine the type of touch event. Subsequently, the processor 580 provides a corresponding visual output on the display panel 541 according to the type of touch event. Although in Fig.18 In the embodiment, the touch panel 531 and the display panel 541 are used as two independent components to implement the input and output functions of the smartphone, but in some embodiments, the touch panel 531 and the display panel 541 can be integrated to implement the input and output functions of the smartphone.
[0366] The smartphone may also include at least one sensor 550, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 541 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 541 and / or the backlight when the smartphone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the smartphone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in smartphones, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0367] The audio circuit 560, the speaker 561, and the microphone 562 can provide an audio interface between the user and the smartphone. The audio circuit 560 can transmit the received audio data to the speaker 561 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 560 and converted into audio data, and then the audio data is output to the processor 580 for processing, and then sent to another smartphone through the RF circuit 510, or the audio data is output to the memory 520 for further processing.
[0368] WiFi is a short-range wireless transmission technology. Smartphones can help users send and receive emails, browse web pages, and access streaming media through WiFi module 570, which provides users with wireless broadband Internet access. Fig.18 A WiFi module 570 is shown, but it is understandable that it is not an essential component of the smartphone and can be omitted as needed without changing the essence of the invention.
[0369] The processor 580 is the control center of the smartphone, which uses various interfaces and lines to connect various parts of the entire smartphone, and executes various functions of the smartphone and processes data by running or executing software programs and / or modules stored in the memory 520, and calling data stored in the memory 520. Optionally, the processor 580 may include one or more processing units; optionally, the processor 580 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 580.
[0370] The smart phone also includes a power source 590 (such as a battery) for supplying power to various components. Optionally, the power source can be logically connected to the processor 580 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption management.
[0371] Although not shown, the smartphone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0372] The steps performed by the terminal in the above embodiment can be based on the Fig.18 The terminal structure shown.
[0373] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the methods described in the aforementioned embodiments.
[0374] The present application also provides a computer program product including a program, which, when executed on a computer, enables the computer to execute the methods described in the aforementioned embodiments.
[0375] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0376] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0377] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0378] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0379] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0380] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0381] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for data aggregation, characterized in that: The method is applied to a first device, the first device stores a first data table, and the method includes: Obtaining a first grouping and aggregation statement, wherein the first grouping and aggregation statement is used to request grouping and aggregation processing of the data table according to a first preset field; According to the first grouping aggregation statement, grouping processing is performed on the first data table to obtain K grouping results, wherein each of the K grouping results includes identification information, and the K grouping results are used to generate T grouping results, where K is an integer greater than or equal to 1, and T is an integer greater than or equal to K; Sending the T grouping results to a second device, so that the second device performs group aggregation processing on the second data table according to identification information included in each of the T grouping results to obtain T aggregation results, wherein the second data table is stored in the second device; Receiving the T aggregation results sent by the second device; A first target data table is generated according to the T aggregation results and the T grouping results, wherein the first target data table includes the grouping aggregation results for the first preset field.
2. The method according to claim 1, characterized in that The obtaining of the first grouping aggregation statement includes: Obtaining an original grouping aggregation statement, wherein the original grouping aggregation statement includes a first value field and a second value field, the first value field belongs to the first data table, and the second value field belongs to the second data table; The first group aggregation statement is generated according to the original group aggregation statement, wherein the first group aggregation statement includes the second value field, and the second value field is included in the first preset field, and the original group aggregation statement is also used for the second device to generate a second group aggregation statement, the second group aggregation statement includes the first value field, and the first value field is included in the second preset field.
3. The method according to claim 2, characterized in that The method further comprises: Receiving P grouping results sent by the second device, wherein the P grouping results are obtained after the second device performs grouping processing on the second data table according to the second grouping aggregation statement, each of the P grouping results includes identification information, and P is an integer greater than or equal to 1; According to the identification information included in each grouping result in the P grouping results, the first data table is grouped and aggregated to obtain P aggregated results; Sending the P aggregation results to the second device, so that the second device generates a second target data table according to the P aggregation results and the P grouping results, wherein the second target data table includes the aggregation results of the first data table and the second data table for the second preset field; receiving the second target data table sent by the second device; After generating the first target data table according to the T aggregation results and the T grouping results, the method further includes: The first target data table and the second target data table are combined to obtain a total data table.
4. The method according to claim 1, characterized in that The method further comprises: Acquire an intersection of identifiers between a first original data table and a second original data table, wherein the first original data table is stored in the first device, and the second original data table is stored in the second device; According to the identifier intersection, the first data table is obtained from the first original data table, wherein the first identifier field of the first data table corresponds to the identifier intersection, and the identifier intersection is also used to obtain the second data table from the second original data table, and the second identifier field of the second data table corresponds to the identifier intersection.
5. The method according to claim 1, characterized in that The first data table is grouped according to the first grouping aggregation statement to obtain K grouping results, including: Acquire a first grouping field from the first grouping aggregation statement, wherein the first grouping field corresponds to at least one type of group information, and the first grouping field is included in the first preset field; The K grouping results are generated according to the at least one type of grouping information included in the first grouping field, wherein the same grouping result among the K grouping results has the same grouping information.
6. The method according to claim 1, characterized in that The sending the T grouping results to the second device so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the T grouping results to obtain T aggregation results includes: The K grouping results are sent to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the K grouping results to obtain K aggregation results.
7. The method according to claim 1, characterized in that The sending the T grouping results to the second device so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the T grouping results to obtain T aggregation results includes: Dividing the first grouping result into a plurality of grouping results, wherein identification information included in each of the plurality of grouping results does not overlap; The respective grouping results are sent to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in the respective grouping results to obtain the T aggregation results.
8. The method according to any one of claims 1 to 7, characterized in that The receiving the T aggregation results sent by the second device includes: Receive the first aggregation result sent by the second device, wherein the first aggregation result includes target group information and an aggregation value, the target group information is obtained after the second device encrypts the original group information, and the target group information corresponds to the second grouping field of the second data table.
9. The method according to claim 1, characterized in that: The receiving the T aggregation results sent by the second device includes: Receive the first aggregation result sent by the second device, wherein the first aggregation result includes original group information and a target value, the target value is obtained by encrypting the aggregation value by the second device using a public key, and the original group information corresponds to the second grouping field of the second data table.
10. The method according to claim 1, characterized in that The receiving the T aggregation results sent by the second device includes: Receive the first aggregation result sent by the second device, wherein the first aggregation result includes target group information and target value, the target group information is obtained after the second device encrypts the original group information, and the target value is obtained after the second device encrypts the aggregate value using a public key, and the target group information corresponds to the second grouping field of the second data table.
11. The method according to claim 9 or 10, characterized in that: The method further comprises: If the first aggregation result and the second aggregation result include the same target group information, based on the homomorphic encryption algorithm, the target values in the first aggregation result and the second aggregation result are added to obtain an encrypted value.
12. The method according to claim 11, characterized in that The generating a first target data table according to the T aggregation results and the T grouping results includes: According to the T aggregation results, R encrypted values are obtained, where R is an integer greater than or equal to 1 and less than or equal to T; Sending the R encrypted values to the second device, so that the second device decrypts the R encrypted values using a private key to obtain R decrypted values, wherein the private key and the public key are generated by the second device; Receiving the R decrypted values sent by the second device; The first target data table is generated according to the R decrypted values and the T grouping results.
13. The method according to any one of claims 1 to 7, characterized in that The receiving the T aggregation results sent by the second device includes: Receive a first aggregation result sent by the second device, wherein the first aggregation result includes target group information and a first target value, the target group information is obtained after the second device encrypts the original group information, the first target value is the sum of the first original value and the first random value, the target group information corresponds to the second grouping field of the second data table, and the first original value corresponds to the second value field of the second data table; Receive a second aggregation result sent by the second device, wherein the second aggregation result includes the target group information and a second target value, the target group information is obtained after the second device encrypts the original group information, the second target value is the sum of the second original value and the second random value, and the second original value corresponds to the second value field of the second data table.
14. The method according to claim 13, characterized in that The generating a first target data table according to the T aggregation results and the T grouping results includes: Based on the oblivious transfer protocol, obtaining a sum of random numbers from the second device, wherein the sum of random numbers is a sum of random values from the 1st to the Nth random number, where N is an integer greater than 1; Obtaining the first target value from the first aggregation result, and obtaining the second target value from the second aggregation result; Determine a target original value according to the first target value, the second target value, the sum of random numbers and the total number of historical random numbers, wherein the total number of historical random numbers is the sum of the first to Mth random values, and M is an integer greater than or equal to 1 and less than N; The first target data table is generated according to the target original value, the target group information and the T grouping results.
15. A data aggregation device, characterized in that: The data aggregation device is applied to a first device, the first device stores a first data table, and the data aggregation device includes: An acquisition module, used for acquiring a first grouping and aggregation statement, wherein the first grouping and aggregation statement is used for requesting to perform grouping and aggregation processing on the data table according to a first preset field; a processing module, configured to perform grouping processing on the first data table according to the first grouping aggregation statement to obtain K grouping results, wherein each of the K grouping results includes identification information, and the K grouping results are used to generate T grouping results, where K is an integer greater than or equal to 1, and T is an integer greater than or equal to K; a sending module, configured to send the T grouping results to a second device, so that the second device performs grouping aggregation processing on the second data table according to identification information included in each of the T grouping results to obtain T aggregation results, wherein the second data table is stored in the second device; A receiving module, configured to receive the T aggregation results sent by the second device; A generation module is used to generate a first target data table based on the T aggregation results and the T grouping results, wherein the first target data table includes the grouping aggregation results for the first preset field.
16. The device according to claim 15, characterized in that The acquisition module is specifically used to acquire an original grouping aggregation statement, wherein the original grouping aggregation statement includes a first value field and a second value field, the first value field belongs to the first data table, and the second value field belongs to the second data table; The first group aggregation statement is generated according to the original group aggregation statement, wherein the first group aggregation statement includes the second value field, and the second value field is included in the first preset field, and the original group aggregation statement is also used for the second device to generate a second group aggregation statement, the second group aggregation statement includes the first value field, and the first value field is included in the second preset field.
17. The device according to claim 16, characterized in that The receiving module is further configured to receive P grouping results sent by the second device, wherein the P grouping results are obtained after the second device performs grouping processing on the second data table according to the second grouping aggregation statement, each of the P grouping results includes identification information, and P is an integer greater than or equal to 1; The processing module is further configured to perform grouping and aggregation processing on the first data table according to identification information included in each grouping result in the P grouping results to obtain P aggregation results; The sending module is further used to send the P aggregation results to the second device, so that the second device generates a second target data table according to the P aggregation results and the P grouping results, wherein the second target data table includes the aggregation results of the first data table and the second data table for the second preset field; The receiving module is further used to receive the second target data table sent by the second device; The generating module is further configured to generate a first target data table according to the T aggregation results and the T grouping results, and then combine the first target data table with the second target data table to obtain a total data table.
18. The device according to claim 15, characterized in that The acquisition module is further used to acquire an intersection of identifiers between a first original data table and a second original data table, wherein the first original data table is stored in the first device, and the second original data table is stored in the second device; The acquisition module is further used to acquire the first data table from the first original data table according to the identification intersection, wherein the first identification field of the first data table corresponds to the identification intersection, and the identification intersection is further used to acquire the second data table from the second original data table, and the second identification field of the second data table corresponds to the identification intersection.
19. The device according to claim 15, characterized in that The processing module is specifically configured to obtain a first grouping field from the first grouping aggregation statement, wherein the first grouping field corresponds to at least one type of group information, and the first grouping field is included in the first preset field; The K grouping results are generated according to the at least one type of grouping information included in the first grouping field, wherein the same grouping result among the K grouping results has the same grouping information.
20. The device according to claim 15, characterized in that The sending module is specifically used to send the K grouping results to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in each grouping result in the K grouping results to obtain K aggregation results.
21. The device according to claim 15, characterized in that The sending module is specifically configured to divide the first grouping result into a plurality of grouping results, wherein identification information included in each of the plurality of grouping results does not overlap; The respective grouping results are sent to the second device, so that the second device performs group aggregation processing on the second data table according to the identification information included in the respective grouping results to obtain the T aggregation results.
22. The device according to any one of claims 15 to 21, characterized in that The receiving module specifically receives the first aggregation result sent by the second device, wherein the first aggregation result includes target group information and an aggregation value, the target group information is obtained after the second device encrypts the original group information, and the target group information corresponds to the second grouping field of the second data table.
23. The device according to claim 15, characterized in that The receiving module is specifically used to receive the first aggregation result sent by the second device, wherein the first aggregation result includes original group information and a target value, the target value is obtained after the second device encrypts the aggregation value using a public key, and the original group information corresponds to the second grouping field of the second data table.
24. The device according to claim 15, characterized in that The receiving module is specifically used to receive a first aggregation result sent by the second device, wherein the first aggregation result includes target group information and a target value, the target group information is obtained after the second device encrypts the original group information, and the target value is obtained after the second device encrypts the aggregate value using a public key, and the target group information corresponds to the second grouping field of the second data table.
25. The device according to any one of claims 23-24, characterized in that The processing module is also used to add the target values in the first aggregation result and the second aggregation result based on the homomorphic encryption algorithm to obtain an encrypted value if the first aggregation result and the second aggregation result include the same target group information.
26. The device according to claim 25, characterized in that The generating module is specifically configured to obtain R encrypted values according to the T aggregation results, wherein R is an integer greater than or equal to 1 and less than or equal to T; Sending the R encrypted values to the second device, so that the second device decrypts the R encrypted values using a private key to obtain R decrypted values, wherein the private key and the public key are generated by the second device; Receiving the R decrypted values sent by the second device; The first target data table is generated according to the R decrypted values and the T grouping results.
27. The device according to any one of claims 15 to 21, characterized in that The receiving module is specifically used to receive a first aggregation result sent by the second device, wherein the first aggregation result includes target group information and a first target value, the target group information is obtained after the second device encrypts the original group information, the first target value is the sum of the first original value and the first random value, the target group information corresponds to the second grouping field of the second data table, and the first original value corresponds to the second value field of the second data table; Receive a second aggregation result sent by the second device, wherein the second aggregation result includes the target group information and a second target value, the target group information is obtained after the second device encrypts the original group information, the second target value is the sum of the second original value and the second random value, and the second original value corresponds to the second value field of the second data table.
28. The device according to claim 27, characterized in that The generating module is specifically configured to obtain a sum of random numbers from the second device based on an oblivious transfer protocol, wherein the sum of random numbers is a sum of random values from the 1st to the Nth random number, and N is an integer greater than 1; Obtaining the first target value from the first aggregation result, and obtaining the second target value from the second aggregation result; Determine a target original value according to the first target value, the second target value, the sum of random numbers and the total number of historical random numbers, wherein the total number of historical random numbers is the sum of the first to Mth random values, and M is an integer greater than or equal to 1 and less than N; The first target data table is generated according to the target original value, the target group information and the T grouping results.
29. A computer device, characterized in that: include: Memory, processor, and bus system; Wherein, the memory is used to store programs; The processor is used to execute the program in the memory, and the processor is used to perform the method according to any one of claims 1 to 14 according to the instructions in the program code; The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
30. A computer-readable storage medium comprising instructions, which, when executed on a computer, causes the computer to perform the method according to any one of claims 1 to 14.
31. A computer program product comprising a computer program and instructions, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 14 is implemented.
