Approximate join aggregation query method and device based on secure multi-party computation and collaborative query system

By performing iterative approximate queries and secure join aggregation on multiple data relationship tables, the problem of existing systems being unable to handle multi-table join aggregation is solved, achieving efficient and secure multi-party computation queries, and improving query efficiency and result reliability.

CN119884143BActive Publication Date: 2026-05-15BEIJING UNIV OF POSTS & TELECOMM
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING UNIV OF POSTS & TELECOMM
Filing Date
2024-12-06
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing collaborative query systems based on secure multi-party computation only support approximate queries on a single data table and cannot effectively handle join and aggregation operations on multiple data tables, resulting in limited query efficiency.

Method used

By receiving approximate and join aggregation query requests, multiple iterations are performed on the data relationship tables of each participant. Sample blocks are generated using offline secure sampling for approximate query and join aggregation processing. The iteration process is optimized by combining cross product method and secure join algorithm, and the estimated value of query result and half confidence interval length are output.

Benefits of technology

It significantly improves the query efficiency and reliability of multiple data relationship tables while protecting individual privacy, sacrificing a small amount of precision to enhance query efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884143B_ABST
    Figure CN119884143B_ABST
Patent Text Reader

Abstract

The application provides an approximate join aggregation query method and device based on secure multi-party computation and a collaborative query system. The method comprises: performing multiple iterations on each data relationship table corresponding to each participant of an approximate and join aggregation query request, selecting one from each sample block of each data relationship table as a target sample block of each data relationship table in each iteration round; performing approximate query and join aggregation processing on each target sample block to obtain a query result estimate value and a semi-confidence interval length; and outputting the query result estimate value obtained in the last iteration round after the iteration stops. The application can realize approximate query and join aggregation query based on secure multi-party computation for multiple data relationship tables, and can protect individual privacy during the query process while significantly improving query efficiency through a small amount of precision loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data collaborative query technology based on secure multi-party computation, and in particular to an approximate join aggregation query method, apparatus and collaborative query system based on secure multi-party computation. Background Technology

[0002] With the rapid development of the internet, the volume of data is growing exponentially. Organizations want to perform joint queries on data to extract value. One important task is to perform join and aggregation queries. For example, to calculate the insurance reimbursement amount for patients with a certain disease in a hospital, it is necessary to join the patient table with the insurance company table and then calculate the corresponding aggregation function SUM. However, a large amount of privacy is contained in the data. Directly querying in plaintext poses a serious privacy leakage problem. For example, in the above case, the insurance company may know the patient's detailed medical condition, which is something the data owner does not want. To protect data privacy, in terms of technology, the emergence of secure multi-party computation (MPC) solves the problem of leakage of raw data and intermediate computation results. MPC stipulates that multiple participants can jointly perform agreed-upon computation tasks without exposing their own raw data and intermediate results. MPC-based collaborative query systems are used to solve the privacy leakage problem in the process of multiple participants collaboratively querying private data. Each participant can only obtain the final computation result and does not obtain the private data of other participants.

[0003] Existing MPC-based collaborative query systems use complete data and produce perfectly accurate results, but incur significant time overhead, especially for queries involving join operations. Approximate query processing offers a solution to improve query efficiency. The field of approximate query processing encompasses various techniques, with sampling techniques being the most widely used. This technique utilizes sample blocks to perform query operations, sacrificing some accuracy for increased efficiency. Approximate queries are primarily used in scenarios requiring rapid response and allowing for some margin of error. For example, in the financial sector, some financial institutions need to monitor and analyze customer credit scores, transaction behavior, and market risks in real time. Without compromising user privacy, approximate queries can be used to quickly calculate risk indicators and market trends to adjust portfolios and risk management strategies promptly. Therefore, combining approximate queries with MPC-based collaborative queries can improve query efficiency while ensuring data security. Existing MPC-based collaborative approximate query systems address the security and efficiency issues arising from sampling individual data tables. Join operations, however, are crucial but also the most expensive operations. However, existing MPC-based collaborative approximate query systems only support queries on a single data table and do not support join and aggregation operations on multiple data tables, thus limiting the efficiency of join and aggregation queries on multiple data tables. Summary of the Invention

[0004] In view of this, embodiments of this application provide an approximate join aggregation query method, apparatus and collaborative query system based on secure multi-party computation, so as to eliminate or improve one or more defects existing in the prior art.

[0005] One aspect of this application provides an approximate join aggregation query method based on secure multi-party computation, comprising:

[0006] Receive approximation and join aggregation query requests for multiple parties involved in secure multi-party computation;

[0007] For each of the participating parties specified in the approximation and join aggregation query request, multiple iterations are performed on their respective data relationship tables used for joining. In each iteration round, a preset join aggregation step based on approximation query is executed. The join aggregation step based on approximation query includes: selecting one sample block from each of the data relationship tables corresponding to each of the participating parties, which are generated through offline secure sampling, as the current target sample block for each data relationship table; performing approximation query and join aggregation processing on each of the current target sample blocks to obtain the corresponding query result estimate and half-confidence interval length.

[0008] After the iteration stops, output the estimated value of the query result obtained in the last iteration.

[0009] In some embodiments of this application, each of the participating parties performs a preset offline security sampling step locally for each of their respective data relationship tables to obtain each of the sample blocks corresponding to each of the participating parties' respective data relationship tables;

[0010] Correspondingly, selecting one sample block from each of the data relationship tables generated offline through security sampling for each of the participating parties as the current target sample block for each data relationship table includes:

[0011] The target sample block request is sent to each of the participants specified in the approximation and connection aggregation query request, so that each participant selects one of the sample blocks corresponding to each of the data relationship tables generated by offline security sampling as the current target sample block and returns the target sample block according to the received target sample request.

[0012] Receive the target sample blocks sent by each of the participating parties.

[0013] In some embodiments of this application, the offline security sampling step includes:

[0014] The data relationship table is divided into blocks to obtain the block relationship tables corresponding to the data relationship table. The block relationship tables are used to store the correspondence between a preset number of tuples in the data relationship table and the sample number corresponding to the sample block.

[0015] Each of the sample blocks is added to the block relationship table so that the block relationship table is used to store the correspondence between the preset number of tuples in the data relationship table, the block number and the sample number;

[0016] From the data relationship table, each block number and the sample number corresponding to each randomly selected block number are randomly extracted from each block relationship table to form a sampling auxiliary table for storing the correspondence between the randomly selected block numbers and the sample numbers.

[0017] The sampling auxiliary table is safely sorted based on the block number in ascending order;

[0018] Based on the block number, the block relationship table and the sampling auxiliary table after the secure sorting are connected using a preset secure connection algorithm to obtain the corresponding connection result data;

[0019] The connection result data is sorted based on the sampling number in ascending order, and the corresponding sorted result data is used as a sample block.

[0020] In some embodiments of this application, the step of performing approximate query and join aggregation processing on each of the current target sample blocks to obtain the corresponding query result estimate and half-confidence interval length includes:

[0021] Approximate query and join aggregation processing is performed on each of the current target sample blocks using a cross product method to obtain the corresponding query result estimate and half-confidence interval length. When it is determined during the execution of the approximate query and join aggregation query that the number of corresponding query results is less than a preset number threshold, a preset secure join algorithm is used to accelerate the approximate query and join aggregation query process.

[0022] In some embodiments of this application, the join aggregation step based on approximate queries further includes:

[0023] Before performing approximate query and join aggregation processing on each of the current target sample blocks, each target sample block is sorted according to the association attributes between them.

[0024] In some embodiments of this application, before outputting the corresponding estimated query result after the iteration stops, the method further includes:

[0025] After executing the join aggregation step based on approximate query in each iteration round to obtain the corresponding query result estimate and half-confidence interval length, it is determined whether the ratio of the half-confidence interval length to the query result estimate is less than the preset expected error; if yes, the iteration stops; if no, the next iteration round is executed.

[0026] Another aspect of this application provides an approximate join aggregation query apparatus based on secure multi-party computation, comprising:

[0027] The request receiving module is used to receive approximate and join aggregation query requests for multiple parties participating in secure multi-party computation.

[0028] The iterative query module is used to perform multiple iterations on the data relationship tables corresponding to each of the participating parties specified in the approximate and join aggregation query request, so as to perform a preset join aggregation step based on approximate query in each iteration round; wherein, the join aggregation step based on approximate query includes: selecting one sample block from each of the data relationship tables corresponding to each of the participating parties, which are generated by offline secure sampling, as the current target sample block of each data relationship table; performing approximate query and join aggregation processing on each of the current target sample blocks to obtain the corresponding query result estimate and half-confidence interval length;

[0029] The result output module is used to output the estimated value of the query result obtained in the last iteration after the iteration stops.

[0030] The third aspect of this application provides a collaborative query system based on secure multi-party computation, comprising: an approximate connection aggregation query device based on secure multi-party computation, and offline secure sampling devices corresponding to each participating party that are communicatively connected to the approximate connection aggregation query device based on secure multi-party computation.

[0031] The approximate join aggregation query device based on secure multi-party computation is used to execute the approximate join aggregation query method based on secure multi-party computation.

[0032] The offline security sampling device is used to generate, offline, uniquely corresponding sample blocks for each of the data relationship tables of the participating parties.

[0033] A fourth aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the approximate join aggregation query method based on secure multi-party computation.

[0034] A fifth aspect of this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the approximate join aggregation query method based on secure multi-party computation.

[0035] The sixth aspect of this application provides a computer program product including a computer program that, when executed by a processor, implements the approximate join aggregation query method based on secure multi-party computation.

[0036] The approximate join aggregation query method based on secure multi-party computation provided in this application receives approximate and join aggregation query requests for multiple participants in secure multi-party computation; performs multiple iterations on the data relation tables corresponding to each participant specified in the approximate and join aggregation query requests, and executes a preset join aggregation step based on approximate query in each iteration round; wherein the join aggregation step based on approximate query includes: selecting one sample block from each sample block corresponding to each data relation table generated offline securely by each participant as the current target sample block for each data relation table; performing approximate query and join aggregation processing on each current target sample block to obtain the corresponding query result estimate and half-confidence interval length; and outputting the query result estimate obtained in the last iteration round after the iteration stops. This method can realize approximate query and join aggregation query based on secure multi-party computation for multiple data relation tables, and can protect individual privacy during the query process while trading a small amount of precision loss for a significant improvement in query efficiency, that is, it can effectively improve the efficiency and reliability of join queries based on secure multi-party computation for multiple data relation tables.

[0037] Additional advantages, objectives, and features of this application will be set forth in part in the description which follows, and will in part become apparent to those skilled in the art upon review of the following description, or may be learned by practice of the application. The objectives and other advantages of this application can be realized and obtained by means of the structures specifically pointed out in the specification and drawings.

[0038] Those skilled in the art will understand that the purposes and advantages that can be achieved with this application are not limited to those specifically described above, and that the above and other purposes that this application can achieve will be more clearly understood from the following detailed description. Attached Figure Description

[0039] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, do not constitute a limitation thereof. The components in the drawings are not drawn to scale but are merely for illustrating the principles of this application. For ease of illustration and description of certain parts of this application, corresponding portions in the drawings may be enlarged, i.e., may appear larger relative to other components in an exemplary device actually manufactured according to this application. In the drawings:

[0040] Figure 1 This is a schematic diagram of the first process of an approximate join aggregation query method based on secure multi-party computation in one embodiment of this application.

[0041] Figure 2This is a flowchart illustrating the approximate query-based join aggregation step in the approximate join aggregation query method based on secure multi-party computation according to an embodiment of this application.

[0042] Figure 3 This is a flowchart illustrating the offline secure sampling step in the approximate join aggregation query method based on secure multi-party computation in one embodiment of this application.

[0043] Figure 4 This is a schematic diagram of the second process of the approximate join aggregation query method based on secure multi-party computation in one embodiment of this application.

[0044] Figure 5 This is a schematic diagram of the execution architecture of the approximate join aggregation query method based on secure multi-party computation, provided as an application example of this application.

[0045] Figure 6 This is a schematic diagram illustrating an example of the execution of the secure block batch sampling algorithm provided in this application.

[0046] Figure 7 This is a schematic diagram illustrating an example of the execution of a cross-product process provided as an application example of this application.

[0047] Figure 8 This is a schematic diagram illustrating the execution of an independent process, provided as an application example of this application.

[0048] Figure 9 This is a schematic diagram illustrating an example of the execution of the Scape secure join algorithm for ordered samples, provided as an application example of this application.

[0049] Figure 10 The graph shows the error of different sampling size estimates over time, provided as an application example of this application.

[0050] Figure 11 This diagram illustrates the query efficiency for a 400MB dataset under the INDEP and cross-product (CP) procedures provided as an application example of this application.

[0051] Figure 12 This diagram illustrates the time required for Q3 to reach 1% error on TPC-H datasets of different sizes, as an application example of this application.

[0052] Figure 13 This is a schematic diagram of the structure of an approximate join aggregation query device based on secure multi-party computation in one embodiment of this application.

[0053] Figure 14 This is a schematic diagram of the structure of a collaborative query system based on secure multi-party computation in one embodiment of this application. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and their descriptions are used to explain this application, but are not intended to limit it.

[0055] It should also be noted that, in order to avoid obscuring this application with unnecessary details, only the structures and / or processing steps closely related to the solution according to this application are shown in the accompanying drawings, while other details that are not closely related to this application are omitted.

[0056] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.

[0057] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.

[0058] In the following description, embodiments of the present application will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.

[0059] To address the limitation that existing MPC-based collaborative approximate query methods only support queries on a single data relation table, embodiments of this application provide an approximate join aggregation query method based on secure multi-party computation, an approximate join aggregation query device based on secure multi-party computation for executing the method, a collaborative query system based on secure multi-party computation, a physical device, a computer-readable storage medium, and a computer program product, capable of performing approximate queries and join aggregation queries based on secure multi-party computation for multiple data relation tables.

[0060] The following examples will provide a detailed description.

[0061] Based on this, embodiments of this application provide an approximate join aggregation query method based on secure multi-party computation, which can be implemented by an approximate join aggregation query device based on secure multi-party computation. See [link to relevant documentation]. Figure 1 The approximate join aggregation query method based on secure multi-party computation specifically includes the following:

[0062] Step 100: Receive approximation and join aggregation query requests for multiple parties involved in secure multi-party computation.

[0063] In one or more embodiments of this application, a join aggregation query refers to a query process that involves joining data from multiple tables via a join operation (JOIN), and then performing aggregation operations (such as summation, counting, averaging, etc.) on the join result set. For example, "select sum(B.age) from A, B where A.id = B.id", where from A, B is the join, and sum(B.age) is the aggregation operation. An approximate join aggregation query involves multiple iterations. In each iteration, a sample is collected from the tables involved in the query and stored in memory. This sample is then joined with existing samples using a cross product to obtain multiple sample values. The summation and averaging of these multiple sample values ​​yields an estimated result, which is the estimated result of the exact join aggregation query. (Note: The sample values ​​need to be amplified. For example, the process of obtaining sample values ​​through a join aggregation query on a sample table is as follows: Data of size r and s are collected from tables R and S. A join query Q(r, s) is executed to obtain result v. Here, v needs to be amplified by a certain ratio.) This can be represented by a single sample value; the estimated value can be obtained by summing and averaging multiple sample values, and complex confidence intervals can be calculated using sample values. The approximate join aggregation query based on secure multi-party computation (MPC) refers to a join aggregation method based on secure multi-party computation for multiple data relation tables, building upon existing approximate query methods for single data relation tables. The approximate join aggregation query request refers to a join aggregation request based on approximate queries for at least one data relation table corresponding to each of the multiple parameter parties, and the requested content is the estimated value of the query result. It can be understood that the estimated value of the query result refers to the estimated result of performing an exact join aggregation query.

[0064] Step 200: Perform multiple iterations on the data relation tables corresponding to each of the participating parties specified in the approximation and join aggregation query request, so as to perform a preset join aggregation step based on approximation query in each iteration round; wherein, the join aggregation step based on approximation query includes: selecting one sample block from each of the data relation tables corresponding to each of the participating parties generated by offline secure sampling as the current target sample block of each data relation table; performing approximation query and join aggregation processing on each of the current target sample blocks to obtain the corresponding query result estimate and half-confidence interval length.

[0065] In one or more embodiments of this application, the half-confidence interval length refers to half the length of a preset confidence interval.

[0066] In step 200, the data relationship table can also be simply referred to as a relationship table. This data relationship table is used to store each attribute and the data corresponding to each attribute. Each row in the data relationship table (i.e., each record in the database) is a tuple, and each column is an attribute.

[0067] Step 300: After the iteration stops, output the estimated value of the query result obtained in the last iteration.

[0068] As can be seen from the above description, the approximate join aggregation query method based on secure multi-party computation provided in this application embodiment can realize approximate queries and join aggregation queries based on secure multi-party computation for multiple data relationship tables. It can protect individual privacy during the query process while trading a small amount of precision loss for a significant improvement in query efficiency. That is, it can effectively improve the efficiency of join queries based on secure multi-party computation for multiple data relationship tables and the reliability of query results.

[0069] To further improve the effectiveness and applicability of approximate join aggregation queries based on secure multi-party computation, in an embodiment of this application, each participating party pre-executes a preset offline secure sampling step locally for its respective data relationship table to obtain the sample blocks corresponding to each participating party's data relationship table; see also Figure 2 The approximate join aggregation query step in the approximate join aggregation query method based on secure multi-party computation specifically includes the following:

[0070] Step 210: Send a target sample block request to each of the participants specified in the approximation and connection aggregation query request, so that each participant selects one of the sample blocks corresponding to each of the data relationship tables generated by offline security sampling as the current target sample block and returns the target sample block according to the received target sample request.

[0071] Step 220: Receive the target sample block sent by each of the participating parties.

[0072] In one or more embodiments of this application, the participating party may also be a data provider, specifically a computer device such as a server or client device.

[0073] To further improve the effectiveness and efficiency of offline security sampling, an approximate join aggregation query method based on secure multi-party computation is provided in this application embodiment, see [link to relevant documentation]. Figure 3 The offline secure sampling step in the approximate join aggregation query method based on secure multi-party computation specifically includes the following:

[0074] Step 01: Divide the data relationship table into blocks to obtain the corresponding block relationship tables. The block relationship tables are used to store the correspondence between a preset number of tuples in the data relationship table and the sample number corresponding to the sample block.

[0075] Step 02: Add block numbers corresponding to each sample block to each of the block relationship tables, so that the block relationship tables are used to store the correspondence between the preset number of tuples in the data relationship table, the block numbers and the sample numbers.

[0076] Step 03: Randomly extract each block number and the corresponding sample number from each of the block relationship tables corresponding to the data relationship table to form a sampling auxiliary table for storing the correspondence between the randomly extracted block numbers and the sample numbers.

[0077] Step 04: Sort the sampling auxiliary table securely based on the block number in ascending order.

[0078] Step 05: Based on the block number, connect the block relationship table and the sampling auxiliary table after the secure sorting using a preset secure connection algorithm to obtain the corresponding connection result data.

[0079] Step 06: Sort the connection result data according to the sampling number in ascending order, and use the corresponding sorted result data as a sample block.

[0080] To further improve the efficiency of the join aggregation step based on approximate queries, an approximate join aggregation query method based on secure multi-party computation is provided in this application embodiment, see [link to relevant documentation]. Figure 2 The approximate join aggregation query method based on secure multi-party computation, after step 220 in the join aggregation step based on approximate query, specifically includes the following:

[0081] Step 230: Perform approximate query and join aggregation processing on each of the current target sample blocks using the cross product method to obtain the corresponding query result estimate and half-confidence interval length. When it is determined during the execution of the approximate query and join aggregation query that the number of corresponding query results is less than a preset number threshold, a preset secure join algorithm is used to accelerate the approximate query and join aggregation query process.

[0082] In one or more embodiments of this application, the preset quantity threshold can be set according to actual application requirements.

[0083] To further improve the efficiency of the join aggregation step based on approximate queries, an approximate join aggregation query method based on secure multi-party computation is provided in this application embodiment, see [link to relevant documentation]. Figure 2 The approximate join aggregation query method based on secure multi-party computation, before step 210 of the join aggregation step based on approximate query, specifically includes the following:

[0084] Step 201: Before performing approximate query and join aggregation processing on each of the current target sample blocks, sort each of the target sample blocks according to the association attributes between them.

[0085] It is understood that a related attribute refers to an attribute that is present in at least two of the target sample blocks.

[0086] To further improve the efficiency of the join aggregation step based on approximate queries, an approximate join aggregation query method based on secure multi-party computation is provided in this application embodiment, see [link to relevant documentation]. Figure 4 The approximate join aggregation query method based on secure multi-party computation further includes the following content between steps 200 and 300 of the join aggregation step based on approximate query:

[0087] Step 010: After executing the join aggregation step based on approximate query in each iteration round to obtain the corresponding query result estimate and half-confidence interval length, determine whether the ratio of the half-confidence interval length to the query result estimate is less than the preset expected error; if yes, stop the iteration; if no, execute the next iteration round.

[0088] To further illustrate the above technical solutions, this application also provides a specific application example of an approximate join aggregation query method based on secure multi-party computation. With the rapid development of the internet and the dramatic increase in data volume, institutions hope to mine data value through joint queries. However, plaintext queries pose a privacy risk; for example, an insurance company might know a patient's medical condition. Secure multi-party computation (MPC) allows multiple participants to jointly compute without exposing their individual data, effectively solving the privacy leakage problem. MPC-based collaborative query systems can protect the private data of each participant, returning only the final computation result. Although existing MPC-based collaborative query systems incur significant overhead when processing complete data, especially in join operations, approximate queries (such as sampling techniques) offer a solution to improve efficiency. This technique is suitable for scenarios requiring rapid response and allowing for some error in results, such as real-time monitoring of customer credit scores and market risks by financial institutions. Combining approximate queries and MPC-based collaborative queries can improve query efficiency while ensuring data security. Current solutions address the security and efficiency issues caused by sampling, but only support aggregation queries on a single table, limiting query operations.

[0089] This application example designs an approximate join aggregation query method based on secure multi-party computation, efficiently completing secure join aggregation queries through iterative estimation. The method comprises two stages: an offline stage uses a secure block-based batch sampling algorithm to acquire a batch of sample blocks, while the online stage performs multiple iterations and continuously updates the estimate of the query results. The specific process of each iteration in the online stage is as follows: First, each relation table selects a sample block from the pre-collected sample blocks in the offline stage; second, a join aggregation query is performed on the selected sample block to obtain the query result; then, the query result obtained in this iteration is used together with the query results obtained in previous iterations to calculate the estimated value and confidence interval of the true query result; finally, to ensure data privacy, users need to pre-set the expected error, and the iteration terminates when the error reaches the expected error, returning the final query result. This application example can significantly improve query efficiency by sacrificing a small amount of accuracy while protecting individual privacy.

[0090] See Figure 5 The approximation and join aggregation query request can be simply referred to as query Q. When issuing query Q, the user can also send the confidence level 'a' and the expected error 'E' used to calculate the half-confidence interval length. Figure 5 In this context, Tupleblock1 to Tupleblock5 represent the tuple blocks obtained after the original relation table has been processed into blocks; Sample1 to Sample5 represent different sample blocks; and sendTn means sending the estimated value of the error that meets the user's expectations to the user.

[0091] Based on this, the approximate join aggregation query method based on secure multi-party computation specifically includes the following:

[0092] S1: In the offline phase, a large number of sample blocks are obtained using the secure block batch sampling algorithm proposed in this application example. Specifically:

[0093] Perform secure block batch sampling on a relation table R of size n, with a block size of s. The first step is initialization, initializing [R1(i)]←([x i ],[i / s]), where x i Let be the i-th tuple, and i / s be the block number. This step is actually to generate two tables R1(x, eid) and R2(eid, sid), where eid in R1 is the tuple x. i The corresponding block number, while eid in R2 represents a randomly generated block number. Note that all attributes are stored in a secret shared form among the three participants. Initialize [R2(j)]←([eid], [sid]), where eid in R2 is the randomly generated block number and sid is the sample number. If you want to collect n / s sample blocks, then the size of R2 is n / s. The second step is connection. By performing a secure join operation on the attribute eid between R1 and R2, the sampling table T (i.e., the aforementioned join result data) is obtained. The join here uses Scape, and the required complexity is O(n^2). The third step is sorting. Finally, the sid is sorted to obtain a batch of sample blocks. When using sampling-based approximate queries, it is necessary to ensure that the data is stored randomly, so the data needs to be randomly arranged. In plaintext scenarios, the overhead of random arrangement is huge, while in MPC scenarios, the complexity required for random arrangement is O(n), which is much lower than the overhead required for connections during sampling.

[0094] It should be noted that "unified [x]" represents secret sharing. In a three-party secret sharing scenario, data x is divided into three parts: x1 + x2 + x3 = x. Here, x1 and x2 are sent to the first participant, x2 and x3 to the second participant, and x3 and x1 to the third participant. No single participant can know the true data x. Similarly, the data owner's relation table can be sent to the three computation parties in this form. Secure multi-party computation (MPC) utilizes basic arithmetic operations such as addition, subtraction, multiplication, division, Boolean operations, and XOR. Examples include ([x] + [y], [x] · [y]). Combining these basic operations, algorithms for secure comparison, secure sorting, and secure permutation (in MPC, "secure" can be replaced with "unintentional") can be derived. To satisfy innocence, in other words, when a computer executes an innocuous algorithm, the operations performed on any input must be identical, meaning no intermediate results can be leaked. For example, in plaintext (non-MPC scenario) cases, a sample of size s can be collected by directly selecting from the first s positions. However, to satisfy the unintentionality requirement, directly selecting the first 's' tuples would reveal the sample's origin to the participants. Unless rigorously proven, no one would know whether this information could be used to deduce information from the original table based on the query results. To maintain unintentionality, the simplest sampling method is to perform a random shuffle on the original table and then select samples from the first 's' positions. This way, the computer wouldn't know where the sample was selected from. Therefore, most algorithms designed to satisfy unintentionality require a traversal of the original table to obtain the result.

[0095] Consider optimization, such as Figure 6 As shown, eid is ordered in R1, while eid is unordered in R2. (1) First sort R2, the required cost is (2) Then perform a join on R1 and R2. Since eid is ordered, the required complexity is O(n). (3) Finally, sort the sid. We can utilize the Scape join property. After the join operation, the result table will be arranged in the ordered order of eid. At this time, the sid attribute will be similar to (0, 0, 0, 3, 3, 3, 2, 2, 2, 1, 1, 1), meaning that identical sids will be adjacent, and the total number is s. We only need to calculate [sid()] = ([sid()] - [1)] * [s] + ([i%s]), and we can use this property to calculate the sorted permutation π = (0, 1, 2, 9, 10, 11, 6, 7, 8, 3, 4, 5). Finally, the result obtained through Oblivious permutation is the result of sorting the sid. The required complexity is O(n), which is much lower than the time cost of directly sorting the sid (O(nlog n)). 2In general, when dealing with large-scale data, the size of s can reach 1000 or even more. Therefore, the optimization scheme will bring a performance improvement of logn, reducing the amortized complexity of each sample block to O(slogn). This significantly reduces the sampling time in the near-plaintext case and greatly reduces the overhead of the offline stage.

[0096] It should be noted that unintentional sorting, unintentional joins (Scape), and unintentional permutations are well-established algorithms in MPC-based collaborative queries. Unintentional sorting, using bitonic sort, requires O(n log n) time for an unordered list. 2 The time cost is O(n log n) for two sorted lists, while for two sorted lists it requires O(n log n). The Scape join operation is currently the most efficient algorithm known in existing work. Its main idea is sort-merge-join. The sorting step uses a bitonic sort on the two lists to make them sorted. The merge operation merges the two sorted lists into one sorted list, aiming to make identical elements adjacent, so that the frequency of each tuple can be safely calculated by traversing the list. Finally, the join operation uses a safe augmentation operation on both relation tables (a safe augmentation operation: for example, for X = (x1, x2, x3, x4), the number of augmentations D = (1, 2, 0, 2), the augmentation size is 6, and after the augmentation operation, we get (x1, x2, x2, x4, x4, ⊥), where ⊥ is redundant (since the sum of the elements in D is unknown, the augmentation size is manually set, generally set to the sum of the sizes of the two tables being joined; if the size of the join result exceeds the manually set augmentation size, the algorithm terminates, and the user resets the augmentation size). Tuples with a count of 0 are directly removed; this complexity is linear). After merging, we get the final join result. An oblivious permutation, for permuting π, makes x permuted according to π, with a linear complexity of O(n). The object data of the above operations are stored in a secret shared format across three computational parties.

[0097] In other words, S1 partitions the original relation table R into blocks and adds an attribute `eid` to indicate the block number to which the current tuple belongs, resulting in the processed partitioned relation table R1(x, eid). A sampling auxiliary table R2(eid, sid) is constructed, where `eid` is a randomly generated block number and `sid` is the sample block number (i.e., the sample number). The sampling auxiliary table R2(eid, sid) is safely sorted according to `eid`, ensuring that both R1 and R2 are ordered in terms of the `eid` attribute. R1(x, eid) and R2(eid, sid) are joined using Scape based on `eid`, achieving a time complexity of O(nlogn) since `eid` is ordered. Finally, the blocks are sorted according to `sid` to obtain the final batch of sample blocks.

[0098] S2: In the online phase, the estimator is updated through multiple iterations. Specifically, a cross-product process is used to reuse sample blocks, reducing the impact of sampling on iteration efficiency. During the join process, the Scape safe join algorithm is used for queries with a small number of valid query results. Specifically:

[0099] Figure 7 The cross-product process is given. In each iteration, each relation table involved in the join selects a sample block B from the batch sample blocks obtained in the offline stage. i,k , representing the sample block selected by the i-th relation table in the k-th iteration. In one or more embodiments of this application, Tuple represents a tuple followed by a number to distinguish different tuples; Block represents a block followed by a number to distinguish different blocks.

[0100] Using the cross-product approach, considering two relation tables R1 and R2, sample block B is selected in the i-th iteration. 1,i With B 2,i Execute Q({B) for query Q. 1,i B 2,j}), Q({B 1,j B 2,i})(In other words, Q({B 1,p B 2,q}), that is, for B 1,p B 2,q Execute a join aggregation query where at least one of p∈(1,i) and q∈(1,i) equals i. Where j∈(1,i). After i iterations, i can be obtained. 2 Sample values, and such Figure 8The independent process shown (in each iteration, each relation table selects a sample block and performs a join-aggregate query on the sample block to obtain sample values. The difference between the independent process and the cross-product approach is that the sample is discarded after use. The purpose of using the independent process for comparison is to highlight the efficiency improvement brought by the efficiency of sample block usage (cp reuses and indexes discard directly) to the approximate join-aggregate query). After i iterations, only i sample values ​​can be obtained. Therefore, it is evident that the cross-product approach can save more time overhead from sampling.

[0101] When executing Q({B) for query Q 1,i B 2,j}), Q({B 1,j B 2,i When j∈(1,i), the Scape algorithm is used to accelerate queries with few valid query results. When the number of valid query results is large, the error convergence speed is faster, so its efficiency is not considered.

[0102] In other words, during each iteration, each relation table participating in the join selects a sample block B from the batch sample blocks obtained in the offline phase. i,k Let B represent the sample block selected by relation i in the k-th iteration. Using the cross-product process, considering two relation tables R1 and R2, sample block B is selected in the i-th iteration. 1,i With B 2,i Execute Q({B) for query Q. 1,i B 2,j}), Q({B 1,j B 2,i}) where j∈(1, i). After i iterations, we can obtain i. 2 Sample values. When executing Q({B) for query Q. 1,i B 2,j}), Q({B 1,j B 2,i When j∈(1,i), the Scape algorithm is used to accelerate the case where there are few valid query results. When the number of valid query results is large, the error convergence speed is faster, so its efficiency is not considered.

[0103] S3: Observing the characteristic of repeated use of sample blocks, and the correlation between the efficiency of the Scape secure connection algorithm and the order of the input table, operations such as sorting the selected sample blocks each time are performed to further improve the efficiency of the algorithm. Specifically:

[0104] In each iteration, the selected sample blocks are first sorted according to their join attributes. For example, in the case of joining two tables... Simply sort the sample blocks collected by R1 and R2 according to attribute B. This applies to multi-table joins, for example... For R1 and R3, only attributes K1 and K2 need to be sorted separately, while table R2 cannot guarantee that attributes K1 and K2 are ordered at the same time.

[0105] Solution: such as Figure 9 As shown, first sort attribute K2, and then add attribute S in parallel. c ={0, 1, 2, 3, 4}, then sort attribute K1. R1 and R2 are joined using Scape. After the merge operation, the relationship between R2 and attribute a is calculated. l , indicating how many tuples in R1 have the same attribute K1 as the current tuple, we can get R2 and attribute aL, indicating how many tuples in R1 have the same attribute K1 as the current tuple. (1) First, arrange R2 according to attribute P. (2) Add attribute g, attribute g indicates how many tuples will be before the current tuple after the expansion operation, calculate [g(i)]=[g(i-1)]+([a l [i-1]= ? [0])+[a l (i-1)].

[0106] (3) Reverse the arrangement according to attribute P to return to the initial state, and perform the expansion operation according to aL.

[0107] (4) Finally, this application example can calculate the expanded attribute g′ and the final attribute G. A temporary variable [c] is needed here. The calculation is as follows:

[0108] a)[g′(i)]=([g′(i)]+1)′([g(i)]= ? [g(i+1)])

[0109] b)[c(i)]=([R(i)]= ? [⊥])

[0110] c)[G(i)]=(1-[c(i)])·([g(i)]+[g′(i)])+[c(i)]·[i]

[0111] Where, [A] = ? [B] indicates a safe comparison operation, while [A] and [B] respectively represent the parameter expressions of the equality scale; it will return [0] or [1] to indicate whether they are equal.

[0112] Following the above process, this application example can sort the tables using [g] to achieve K2 sorting. For k tables, after n iterations with a sample block size of m each time, the time complexity before optimization is O(n^2). Kmlog 2 The optimized time complexity is O(knmlog m), while the optimized time complexity is O(knmlog m). 2 m+n K This optimization achieves log (mlogm) compared to the original method. m This results in a 10x speedup if the sample block size is 1000, which is something that independent processes do not offer.

[0113] This application example also shows that efficiency is positively correlated with the size of the sample blocks. Assuming that concatenating two sample blocks of size s1 and s2 requires a total of O((s1+s2)log) 2 Given the overhead of (s1+s2), let's assume it yields t valid results. When the sample block size increases by a factor of a, the total overhead becomes O(a(s1+s2)log). 2 The cost of (a(s1+s2)) is the same, but the result is a. 2 t valid results, using only a times more time but yielding a 2 A multiple of effective results. For example... Figure 10 As shown in the efficiency plots for sample blocks of 1% and 2%, it can be observed that the larger the sample size, the higher the efficiency. Here, sampling rate represents the sampling rate, CI represents the confidence level, and estimate represents the estimated value. Figure 10 Efficiency plots for the two processes are shown (excluding the amortized sampling time), where estimate error represents 1 - estimated value / true result; error (%) represents the ratio.

[0114] S4: The user sets the expected error E. If the error calculated after the current iteration is lower than the user's expected error, the iteration ends and the estimated value is returned. Specifically:

[0115] In the independent scheme, each sample value is independent, so calculating the sample variance is very straightforward. However, in the cross-product scheme, the samples are not independent. For the summation and count aggregation operations, after n iterations, let M... k , n Indicates from relation R k The selected set of sample blocks. Definition: μ v,k,i =v(M 1,n M k-1,n B k,i M k+1,n M K,n ), representing the result of joining the i-th tuple block of relation table k with all selected sample blocks from other relation tables for aggregation operation v. The sample mean is defined as follows:

[0116]

[0117] Definition of sample variance:

[0118]

[0119] Variance σ 2 The estimate can be expressed as:

[0120] For average aggregation operations,

[0121] Definition of sample mean:

[0122]

[0123] Definition of sample variance:

[0124]

[0125] The final variance estimate is:

[0126] Based on the above formula, after n iterations, the estimate T of the final result corresponding to different aggregation operations can be obtained. n (v) and the estimator of variance The half-width of the confidence interval is calculated (with respect to the confidence level threshold α): The user provides the expected error E, and at the end of each iteration, the calculation is performed. The iteration terminates when the expected error E is reached, and returns an estimate of the final result T. The value of is checked against the expected error E. n According to Figure 10 and Figure 11 The ratio of the true value to the estimate is |true value - estimate| / |true value|, which represents the estimate error. The CI error is within the acceptable range, demonstrating the feasibility of the solution. It preserves data privacy and enhances the usability of this application example.

[0127] exist Figure 11In this context, CI error represents the ratio of the half-confidence interval length to the estimated value, INDEP estimate represents the estimate error using the independent process, cross-product estimate represents the estimate error using the cross-product process, INDEP CI represents the CI error using the independent process, CP CI represents the CI error using the cross-product process, and CP estimate represents the estimate error using the cross-product process. As can be seen, the Cross-product scheme, after optimization, is still more efficient than the independent scheme even without considering sampling time.

[0128] In other words, to protect data privacy, the estimated value is not returned after each iteration. Users pre-set the expected error E = |actual result - estimated value| / |actual result|, and each iteration updates two variables [∈ n ] and [T n ], representing the half-confidence interval length and the estimated value, respectively, to determine... If true, the iteration terminates and returns the estimated value T. n .

[0129] at last Figure 12 This demonstrates that the time overhead of the independent process becomes significantly larger when amortized sampling times (INDEP_S and CP_S) are taken into account. Furthermore, a comparison of the time overhead of the scape join algorithm for querying the entire relation is shown. It can be seen that in query Q3 with a data size of 400MB, the cross-product process is almost 3 times faster than scape at achieving a 1% error. Moreover, it can be observed that as the data size increases, the time complexity of the scape algorithm increases by O(n log n). 2 As n) increases, the time required for approximate query schemes shows a slightly less linear increase.

[0130] Consider a chained join among k relations, where each relation contains N tuples. Assume that for each relation R... i i = 1, ..., k-1, each tuple t ∈ R i Can be used with R i+1 Let there be *a* tuples joined together. Then, the probability of randomly selecting one tuple from each of the *k* relations for a join is... If n tuples are selected from each relation, the expected number of valid join results is: For most queries in the TPC-H benchmark, the join is a primary key-foreign key join, meaning a = 1. To obtain s valid join results, the number of tuples required per relation is... If the data size increases from N to P*N, while still obtaining s valid join results, the number of tuples required for each relation will become […]. This explains why approximate query schemes show slightly less linear growth. Therefore, the performance improvement becomes more significant as the data size increases.

[0131] As can be seen from the above tests, the approximate join aggregation query method based on secure multi-party computation in this application example can ensure the safety of any intermediate data except the final result, while sacrificing a small amount of precision in exchange for a significant improvement in efficiency.

[0132] From a software perspective, this application also provides an apparatus for executing all or part of the approximate join aggregation query based on secure multi-party computation in the aforementioned approximate join aggregation query method based on secure multi-party computation. See [link to relevant documentation]. Figure 13 The approximate join aggregation query device based on secure multi-party computation specifically includes the following:

[0133] The request receiving module 10 is used to receive approximate and join aggregation query requests for multiple parties participating in secure multi-party computation.

[0134] The iterative query module 20 is used to perform multiple iterations on the data relationship tables corresponding to each of the participating parties specified in the approximation and join aggregation query request, so as to perform a preset join aggregation step based on approximation query in each iteration round; wherein, the join aggregation step based on approximation query includes: selecting one sample block from each of the data relationship tables corresponding to each of the participating parties generated by offline secure sampling as the current target sample block of each data relationship table; performing approximation query and join aggregation processing on each of the current target sample blocks to obtain the corresponding query result estimate and half-confidence interval length;

[0135] The result output module 30 is used to output the estimated value of the query result obtained in the last iteration after the iteration stops.

[0136] The embodiments of the approximate join aggregation query device based on secure multi-party computation provided in this application can be used to execute the processing flow of the embodiments of the approximate join aggregation query method based on secure multi-party computation in the above embodiments. Its functions will not be repeated here, but can be referred to the detailed description of the embodiments of the approximate join aggregation query method based on secure multi-party computation.

[0137] The approximate join aggregation query based on secure multi-party computation (MPC) can perform the MPC-based query on either a server or a client device. The choice can be made based on the processing power of the client device and limitations imposed by the user's usage scenario. This application does not impose any limitations in this regard. If all operations are performed on the client device, the client device may further include a processor for the specific processing of the MPC-based approximate join aggregation query.

[0138] The aforementioned client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission. The server may include a server on the task scheduling center side; in other implementation scenarios, it may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, a server cluster consisting of multiple servers, or a distributed server structure.

[0139] The server and the client device can communicate using any suitable network protocol, including those not yet developed as of the date of this application. Such network protocols may include, for example, TCP / IP, UDP / IP, HTTP, HTTPS, etc. Furthermore, such network protocols may also include RPC (Remote Procedure Call Protocol) and REST (Representational State Transfer Protocol) protocols used on top of the aforementioned protocols.

[0140] As can be seen from the above description, the approximate join aggregation query device based on secure multi-party computation provided in this application embodiment can realize approximate query and join aggregation query based on secure multi-party computation for multiple data relationship tables. It can protect individual privacy during the query process while trading a small amount of precision loss for a significant improvement in query efficiency. That is, it can effectively improve the efficiency of join query based on secure multi-party computation for multiple data relationship tables and the reliability of query results.

[0141] Based on the aforementioned embodiments of the approximate join aggregation query method and / or approximate join aggregation query device based on secure multi-party computation, this application also provides a collaborative query system based on secure multi-party computation, see [link to relevant documentation]. Figure 14 The collaborative query system based on secure multi-party computation specifically includes the following:

[0142] The approximate connection aggregation query device based on secure multi-party computation, and the offline secure sampling devices corresponding to each participating party that are connected to the approximate connection aggregation query device based on secure multi-party computation.

[0143] The approximate join aggregation query device based on secure multi-party computation is used to execute the approximate join aggregation query method based on secure multi-party computation provided in the foregoing embodiments;

[0144] The offline security sampling device is used to generate, offline, each sample block corresponding to each of the data relationship tables of the parameter square that is uniquely matched.

[0145] This application also provides an electronic device, which may include a processor, a memory, a receiver, and a transmitter. The processor is used to execute the approximate join aggregation query method based on secure multi-party computation mentioned in the above embodiments. The processor and the memory can be connected via a bus or other means, taking a bus connection as an example. The receiver can be connected to the processor and the memory via wired or wireless means.

[0146] The processor can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.

[0147] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the approximate join aggregation query method based on secure multi-party computation in the embodiments of this application. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the approximate join aggregation query method based on secure multi-party computation in the above method embodiments.

[0148] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0149] The one or more modules are stored in the memory, and when executed by the processor, the approximate join aggregation query method based on secure multi-party computation in the embodiment is executed.

[0150] In some embodiments of this application, the user equipment may include a processor, a memory, and a transceiver unit. The transceiver unit may include a receiver and a transmitter. The processor, memory, receiver, and transmitter may be connected via a bus system. The memory is used to store computer instructions, and the processor is used to execute the computer instructions stored in the memory to control the transceiver unit to send and receive signals.

[0151] As one implementation method, the functions of the receiver and transmitter in this application can be implemented by transceiver circuits or dedicated transceiver chips, and the processor can be implemented by dedicated processing chips, processing circuits or general-purpose chips.

[0152] As another implementation approach, the server provided in this application embodiment can be implemented using a general-purpose computer. That is, the program code implementing the processor, receiver, and transmitter functions is stored in memory, and the general-purpose processor implements the processor, receiver, and transmitter functions by executing the code in memory.

[0153] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned approximate join aggregation query method based on secure multi-party computation. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.

[0154] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the aforementioned approximate join aggregation query method based on secure multi-party computation.

[0155] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave.

[0156] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0157] In this application, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.

[0158] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to the embodiments of this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for approximate join aggregation query based on secure multi-party computation, characterized in that, include: Receive approximation and join aggregation query requests for multiple parties involved in secure multi-party computation; Each of the aforementioned participants pre-executes a preset offline security sampling step locally for its respective data relationship table to obtain each sample block corresponding to its respective data relationship table; For each participant specified in the approximation and join aggregation query request, multiple iterations are performed on their respective data relation tables used for joining. In each iteration round, a preset join aggregation step based on approximation query is executed. This join aggregation step includes: sending target sample block requests to each participant specified in the approximation and join aggregation query request, so that each participant selects one of the sample blocks corresponding to its respective data relation tables (generated through offline secure sampling) as the current target sample block and returns the target sample block; receiving the target sample blocks sent by each participant; and performing approximation query and join aggregation processing on the current target sample blocks to obtain the corresponding query result estimate and half-confidence interval length. After the iteration stops, output the estimated value of the query result obtained in the last iteration round; The offline security sampling step includes: The data relationship table is divided into blocks to obtain the block relationship tables corresponding to the data relationship table. The block relationship tables are used to store the correspondence between a preset number of tuples in the data relationship table and the sample number corresponding to the sample block. Each of the sample blocks is added to the block relationship table so that the block relationship table is used to store the correspondence between the preset number of tuples in the data relationship table, the block number and the sample number; From the data relationship table, each block number and the sample number corresponding to each randomly selected block number are randomly extracted from each block relationship table to form a sampling auxiliary table for storing the correspondence between the randomly selected block numbers and the sample numbers. The sampling auxiliary table is safely sorted based on the block number in ascending order; Based on the block number, the block relationship table and the sampling auxiliary table after the secure sorting are connected using a preset secure connection algorithm to obtain the corresponding connection result data; The connection result data is sorted based on the sample number in ascending order, and the corresponding sorted result data is used as a sample block.

2. The approximate join aggregation query method based on secure multi-party computation according to claim 1, characterized in that, The step of performing approximate query and join aggregation processing on each of the current target sample blocks to obtain the corresponding query result estimate and half-confidence interval length includes: Approximate query and join aggregation processing is performed on each of the current target sample blocks using a cross product method to obtain the corresponding query result estimate and half-confidence interval length. When it is determined during the execution of the approximate query and join aggregation query that the number of corresponding query results is less than a preset number threshold, a preset secure join algorithm is used to accelerate the approximate query and join aggregation query process.

3. The approximate join aggregation query method based on secure multi-party computation according to claim 1, characterized in that, The join aggregation step based on approximate queries further includes: Before performing approximate query and join aggregation processing on each of the current target sample blocks, each target sample block is sorted according to the association attributes between them.

4. The approximate join aggregation query method based on secure multi-party computation according to claim 1, characterized in that, Before outputting the corresponding estimated query result after the iteration stops, the process also includes: After executing the join aggregation step based on approximate query in each iteration round to obtain the corresponding query result estimate and half-confidence interval length, it is determined whether the ratio of the half-confidence interval length to the query result estimate is less than the preset expected error; if yes, the iteration stops; if no, the next iteration round is executed.

5. An approximate join aggregation query device based on secure multi-party computation, characterized in that, include: The request receiving module is used to receive approximate and join aggregation query requests for multiple parties participating in secure multi-party computation. Each of the aforementioned participants pre-executes a preset offline security sampling step locally for its respective data relationship table to obtain each sample block corresponding to its respective data relationship table; An iterative query module is used to perform multiple iterations on the data relation tables corresponding to each participant specified in the approximation and join aggregation query request, so as to perform a preset join aggregation step based on approximation query in each iteration round; wherein, the join aggregation step based on approximation query includes: sending a target sample block request to each participant specified in the approximation and join aggregation query request, so that each participant selects one of the sample blocks corresponding to each of the data relation tables generated by offline security sampling as the current target sample block and returns the target sample block; receiving the target sample blocks sent by each participant; and performing approximation query and join aggregation processing on each of the current target sample blocks to obtain the corresponding query result estimate and half-confidence interval length; The result output module is used to output the estimated value of the query result obtained in the last iteration after the iteration stops; The offline security sampling step includes: The data relationship table is divided into blocks to obtain the block relationship tables corresponding to the data relationship table. The block relationship tables are used to store the correspondence between a preset number of tuples in the data relationship table and the sample number corresponding to the sample block. Each of the sample blocks is added to the block relationship table so that the block relationship table is used to store the correspondence between the preset number of tuples in the data relationship table, the block number and the sample number; From the data relationship table, each block number and the sample number corresponding to each randomly selected block number are randomly extracted from each block relationship table to form a sampling auxiliary table for storing the correspondence between the randomly selected block numbers and the sample numbers. The sampling auxiliary table is safely sorted based on the block number in ascending order; Based on the block number, the block relationship table and the sampling auxiliary table after the secure sorting are connected using a preset secure connection algorithm to obtain the corresponding connection result data; The connection result data is sorted based on the sample number in ascending order, and the corresponding sorted result data is used as a sample block.

6. A collaborative query system based on secure multi-party computation, characterized in that, include: The approximate connection aggregation query device based on secure multi-party computation, and the offline secure sampling devices corresponding to each participating party that are connected to the approximate connection aggregation query device based on secure multi-party computation. The approximate join aggregation query device based on secure multi-party computation is used to execute the approximate join aggregation query method based on secure multi-party computation as described in any one of claims 1 to 4; The offline security sampling device is used to generate, offline, uniquely corresponding sample blocks for each of the data relationship tables of the participating parties.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the approximate join aggregation query method based on secure multi-party computation as described in any one of claims 1 to 4.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the approximate join aggregation query method based on secure multi-party computation as described in any one of claims 1 to 4.