Sharing database connections using ordered secrets
By appending identifiers to matching columns in database tables to generate modified values and using bit vectors and tree structures, the limitations of one-to-many database connections in existing technologies are overcome, enabling secure database connections between different computers and improving computational efficiency and data security.
Patent Information
- Application Number
- CN202380034491.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-04-25
- Filing Date
- 2023-03-17
- Publication Date
- 2024-11-29
AI Technical Summary
In existing technologies, database connections can only be made between database tables that have unique matching columns, making it impossible to achieve one-to-many secret shared database connections. This limits the types of database table connections and makes it impossible to perform connection operations without exposing data when different computers have database tables.
By generating modified values by appending identifiers to the matching columns of the database table, creating and sorting an unsorted list, using bit vectors to determine the matching values, and finally using a tree structure to improve computational efficiency, a one-to-many secret shared database connection is achieved.
It enables one-to-many database connections between different computers without exposing database table data, improving computing efficiency and enhancing data security, and expanding the application scope of database connections.
Smart Images

Figure CN119053967A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to and is a PCT application of U.S. Provisional Application No. 63 / 334,531, filed on April 25, 2022, entitled “SECRET-SHARED DATABASE JOINS USING SORTING,” the entire contents of which are incorporated herein by reference for all purposes. Background Art
[0003] Secret sharing techniques allow different parties to see the results of a join in their respective database tables without compromising the security of each party's respective database tables. For example, consider a situation where both Party A and Party B have user data. Each party typically does not want to share its user data with the other party, but may want to perform queries (e.g., joins) on each other's data. By using a secret shared database join, Party A or Party B will be able to access the joined database table without revealing their own private database tables to each other. Therefore, it is desirable to provide techniques for performing secret shared database joins in a variety of situations. Summary of the invention
[0004] One embodiment of the present disclosure includes a method for performing a secret sharing connection of a first database table and a second database table stored on a first computer and a second computer, respectively. The method includes: performing multi-party computation by the first computer in conjunction with the second computer: storing the first database table having a first column and a second column, the first column being used to connect the first database table and the second database table, wherein the second database table includes the first column and a third column, wherein the first column is a matching column between the first database table and the second database table; distributing a share of the first database table to the second computer, wherein the second computer distributes a share of the second database table to the first computer; modifying the first value by appending a first identifier indicating that the first value of the matching column of the first database table corresponds to the first identifier of the first database table, thereby generating a first modified value; modifying a second value of a match column of a table corresponding to a second identifier of the second database table to generate a second modified value, wherein the modified value includes (1) the first value or the second value and (2) either the first identifier or the second identifier; generating an unsorted list including the first modified value and the second modified value; sorting the first modified value and the second modified value of the unsorted list to create a sorted list; determining a bit vector by comparing a current modified value of the sorted list with a previous modified value to determine whether the current modified value is a match value, wherein bit values in the bit vector specify whether a row having a match value of the first database table and a row having a match value of the second database table are to be combined in a combined row of the combined database table; and
[0005] The combined database table is generated using the bit vector, the value of the second column of the first database table, and the value of the third column of the second database table.
[0006] These and other embodiments of the present disclosure are described in detail below.For example, other embodiments relate to systems, devices, and computer-readable media associated with the methods described herein.
[0007] A better understanding of the nature and advantages of embodiments of the present invention may be obtained by reference to the following detailed description and accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 An exemplary one-to-one database connection between two database tables is shown.
[0009] Figure 2 An exemplary one-to-many database connection between two database tables is shown.
[0010] Figure 3A flow chart corresponding to a secret sharing database connection method according to some embodiments is shown.
[0011] Figure 4 An exemplary table of sorted and unsorted values of matching columns from a first database table and a second database table is shown.
[0012] Figure 5A Exemplary tables and bit vectors according to some embodiments are shown.
[0013] Figure 5B An exemplary table with row notation is shown.
[0014] Figure 6 An upstream replication method using a tree is shown.
[0015] Figure 7 A downstream replication method using a tree is shown.
[0016] Figure 8 An exemplary server performing secure multi-party computation on a database table is shown.
[0017] Fig. 9 A flow chart corresponding to performing a secret shared database join on a shared database is shown.
[0018] Fig.10 A block diagram of an example computer system that may be used with systems and methods according to embodiments of the present disclosure is shown.
[0019] the term
[0020] Before discussing the embodiments of the present disclosure, some terms may be described in further detail.
[0021] A "database connection" may refer to two or more database tables being connected on "matching values" of a "matching column". A "primary key" or "matching column" may refer to a database field (column) from each database that is used to connect between two databases. For example, a first database may be connected to a second database using a common field (i.e., a field that exists in both databases), and more specifically, using a value common to both databases in the common field (matching column). The value in the matching column of the first database table may be different from the value in the matching column of the second database table. The values that match in the matching columns of the two databases may be referred to as "matching values" or "primary values". A "Private Set Intersection" (PSI) may refer to a database connection performed between two or more computers (each storing a corresponding database table) without exposing their raw data to other computers.
[0022] A "server computer" may include a powerful computer or cluster of computers. For example, a server computer may include a large mainframe, a cluster of small computers, or a group of servers operating as a unit. In one example, a server computer may include a database server coupled to a network server. A server computer may include one or more computing devices and may use any of a variety of computing structures, arrangements, and compilations to service requests from one or more client computers.
[0023] "Multi-party computation" (MPC) may refer to a computation performed by multiple parties. Each party, such as a computer, server, or cryptographic device, may have some computation inputs. Each party may use the inputs to jointly compute the output of the computation.
[0024] The term "secure multi-party computation (secure MPC)" may refer to secure multi-party computation. In some cases, "secure multi-party computation" refers to multi-party computation in which the parties do not share information or other inputs with each other. Determining PSI may be implemented using secure MPC. The input from each computer in MPC may be a secret share of a value known to one computer. For example, a first computer may divide a database value into multiple secret shares and distribute the shares among the computers. Only the first computer may know how to assemble the shares to reconstruct the database value. One way to generate the shares is by selecting a random number and then XORing the random number with the value of a single database table, which may be done independently for each value in the database.
[0025] The term "secret sharing" may refer to any of a variety of techniques that may be used to store a data item on a group of computers such that each computer cannot determine the value of the data item on its own. As an example, secret sharing may involve splitting a data item into shares that require a sufficient number (e.g., all) of the computers to reconstruct and / or an encryption mechanism where decryption requires collusion among the computers.
[0026] A "client computer" may refer to a computer that uses the services of other computers or devices, such as a server computer. Client computers may connect to these other computers or devices through a network, such as the Internet. As an example, a client computer may include a laptop computer that connects to an image hosting server in order to view images stored on the image hosting server. DETAILED DESCRIPTION
[0027] Secret sharing technology can allow different computers to see the results of connections in their corresponding database tables without compromising the security of each computer's respective database table. Before the connection, the values of the respective database tables used for the connection are secrets shared between the different computers, where the shares (also called secret shares) from the different computers are used to obtain the values of the respective database tables. The computers can also perform a secret sharing database connection using the shares of the respective database tables. After the secret sharing database connection, each computer can obtain a share of the values of the connected database table.
[0028] Certain techniques for performing secret sharing database joins are limited. Only database tables with unique matching columns are capable of performing secret sharing database joins. This severely limits the types of database tables that can be joined using secret sharing, since only database tables with one or more unique matching columns can be joined. To address this issue, embodiments may perform a database join that allows secret sharing database joins between database tables with unique matching columns and database tables with non-unique matching columns (i.e., database tables that contain infinite repetitions of values).
[0029] An embodiment may perform a secret sharing database join by first obtaining some or all values of matching columns of two database tables, where the matching columns of the first database table are unique and the matching columns of the second database table may be infinite. The values of the first database table and the second database table may be modified by appending a first identifier and a second identifier to create a modified value, where 0 represents the first identifier and 1 represents the second identifier. Each identifier indicates which database table the value comes from. The modified values may be stored in an unsorted combination table (also called an unsorted combination list). For example, if the matching columns {a, b, c, e} of the first database table have unique values and the matching columns {b, b, c, d, e} of the second database table have infinite values, an embodiment may modify and combine these values to create a modified value {a, b, c, e} in an unsorted combination (join) table. 0 ,b 0 ,c 0 ,e 0 ,b 1 ,b 1 ,c 1 ,d 1 ,e 1}.
[0030] The computer may sort the unsorted combination table, wherein the modified values from the first database table appear first, and the modified values from the second database table that match the modified values of the first database table appear next. 0 ,b 0 ,c 0 ,e0 ,b 1 ,b 1 ,c 1 ,d 1 ,e 1}, the sorting combination table can be {a 0 ,b 0 ,b 1 ,b 1 ,c 0 ,c 1 ,e 0 ,e 1 ,d 1}, where b 1 In b 0 After but in c 0 Appeared before, because b 1 With b 0 This sorting also applies to the modified value c from the second database table. 1 and e 1 .
[0031] The computer may compare the modified values in the sorted combination table to generate a bit vector, wherein a value of 0 indicates that there is no matching value from the second database table to the first database table, and a value of 1 indicates that there is a matching value from the second database table to the first database table. The bit vector is determined by comparing the modified values of adjacent rows in the sorted combination table. For example, when b 1 With b 0 Match, c 1 With c 0 Match and e 1 With e 0 When matching, the implementation can output a sorted combination table {a 0 ,b 0 ,b 1 ,b 1 ,c 0 ,c 1 ,e 0 ,e 1 ,d 1}The bit vector {0,0,1,1,0,1,0,1,0}.
[0032] The computer can combine one or more values of one or more other columns of the rows with matching values from the first database table with one or more values of one or more other columns of the rows with matching values in the second database table according to the bit vector {0,0,1,1,0,1,0,1,0}. In effect, the matching values in the rows of the first database table are combined with the matching values in the rows of the second database table. Having a value of 1 in the bit vector indicates that there is a match between the current value in the first database table and the second database table. Therefore, whenever the bit vector has a value of 1, the rows of the first database table can be combined with the rows of the second database table on the matching value. For example, for the sorted combination table {a 0 ,b 0 ,b 1 ,b 1 ,c 0 ,c 1 ,e 0 ,e 1 ,d 1} and the bit vector {0,0,1,1,0,1,0,1,0}, the first database table has a matching value b 0 The rows of the second database table will have matching values for b 1 The row combination of these b 1 The bit vector of values has a value of 1. Once at least some of the rows from the first database table that have matching values are combined with the second database table, the combined rows may then be copied to the combined database table.
[0033] In some embodiments, the computer can use a tree to combine the rows of matching values from the first database table with the second database table. In this tree, each leaf node indicates the value of the sorted combination table. Using a first set of functions, the node values in the tree can then be updated from the leaf nodes of the tree to the root node during the so-called upstream processing stage. After updating the root node, using a second set of functions, the tree can then be updated from the root node to the leaf nodes during the so-called downstream processing stage. During this downstream processing stage, the rows of matching values of the first database table can be combined with the rows of the second database table with matching values to the first database table. The combined row can then be copied to the combined database table.
[0034] I. Database connection
[0035] A database join or inner join may involve two database tables being joined on matching columns between the two database tables. There are many other operations that can be used to find a relationship between two database tables, such as union, intersection, outer join, etc. Among the operations used to find a relationship between two database tables, one of the most commonly used operations is the inner join. An inner join first determines the matching rows from the two database tables by determining the matching values between the columns of the two database tables (called matching columns). These matching rows of the two database tables are then joined based on the matching columns to create rows of the combined database table.
[0036] A. One-to-one database connection
[0037] A database join can be a one-to-one join, where the matching columns of the two database tables are unique. A unique matching column is a column that has no duplicate values in that column. Therefore, when a join is performed between two database tables with unique matching columns, the matching rows of one database table are related to exactly one row of the other database table.
[0038] Figure 1 An exemplary one-to-one database connection is shown, where the first database table 102 and the second database table 104 are connected in matching columns (in Figure 1 The matching values of the first database table 102 and the second database table 104 are combined to produce the combined database table 106. The primary key columns of the first database table 102 and the second database table 104 are the only matching columns. The matching rows of the two database tables are combined into the rows of the combined database table 106.
[0039] A database table may be composed of a series of columns. For example, a first database table 102 is composed of a value 1 column, a value 2 column, and a "primary key" column. A second database table 104 is composed of a "primary key" column and a value 3 column. The first database table is joined with the second database table along the matching column "primary key" to generate a combined database table 106.
[0040] The combined database table 106 does not include rows where the "primary key" values do not match between the first database table 102 and the second database table 104. Figure 1 In the example of FIG. 1 , only matching rows (e.g., rows with values "a" and "g" in combined database table 106) for which the "primary key" values of first database table 102 and second database table 104 match are in combined database table 106. These rows are determined by combining the matching rows of first database table 102 with the matching rows of second database table 104 on matching "primary key" values. Since the names (primary keys) of the matching columns of the first and second database tables are the same, they are combined into one column in combined database table 106.
[0041] exist Figure 1In the example shown, the value "a0" from the value 1 column of the first database table 102 and the value "a1" from the value 2 column are from the same row as the value "a" from the "primary key" column. In the second database table 104, the value "a3" from the value 3 column is in the same row as "a" from the "primary key" column. Since the first database table 102 and the second database table 104 are joined on the "primary key" column, the combined database table 106 will combine the matching rows of the first database table 102 with the matching rows of the second database table 104 where the "primary key" values match. For example, since the "primary key" value "a" matches for both the first database table 102 and the second database table 104, the value "a0" from the value 1 column, the value "a1" from the value 2 column, the value "a" from the "primary key" column, and the value "a3" from the value 3 column will be combined into one row. The combination of matching rows from the first database table 102 and the second database table 104 also applies to matching "primary key" values "g".
[0042] Each matching row of the first database table 102 is associated with exactly one matching row of the second database table 103. For example, the first database table 102 and the second database table 104 both have exactly one row with a matching "primary key" value "a". Also, the first database table 102 and the second database table 104 both have exactly one row with a matching value "g".
[0043] B. One-to-many database connection
[0044] A database connection can be a one-to-many connection, where the matching columns of one database table are unique and the matching columns of the other database table are infinite (i.e., can repeat). Thus, when a join is performed between a first database table having a unique matching column and a second database table having an infinite matching column, each matching row of the first database table is related to one or more rows of the second database table.
[0045] Figure 2 is an example of a one-to-many database connection. Figure 2 A database connection between two database tables is shown, where the "primary key" columns of both tables are used as matching columns to connect a first database table 202 and a second database table 204. The first database table 202 has a unique "primary key" column. The second database table 204 has an unlimited "primary key" column.
[0046] In the combined database table 206, rows whose "primary key" values do not match between the first database table 202 and the second database table 204 are not included in the combined database table 206. Only matching rows (e.g., rows with values "a" and "g" in the combined database table 206) whose "primary key" values of the first database table 202 and the second database table 204 match are in the combined database table 206. These rows are determined by combining matching rows of the first database table 202 with matching rows of the second database table 204 on matching "primary key" values. The second database table 204 may include rows with repeated matching "primary key" values, such as rows with value "a". In this case, the rows of the first database table 202 with matching primary key values may be used multiple times to be combined with the rows of the second database table 204 with repeated matching "primary key" values. Since the names (primary keys) of the matching columns of the first database table and the second database table are the same, they are combined into one column in the combined database table 206.
[0047] For example, in Figure 2 , the rows of the first database table 202 and the second database table 204 with the primary key values "a" and "g" match. In the first database table 202, the value "a0" from the value 1 column and the value "a1" from the value 2 column are from the same row as the value "a" from the primary key column. In the second database table 204, the primary key column has three rows with the value "a", which have the values "a3*", "a3", and "a3!" respectively. Since the first database table 202 and the second database table 204 are connected by the primary key column, the combined database table 206 will combine the matching rows of the first database table where the primary key values match with the matching rows of the second database table. The second database table 204 has several rows with repeated matching primary key values "a". Therefore, the rows of the first database table 202 with matching primary key values "a" are used multiple times to combine with the rows of the second database table 204 with repeated matching "primary key" values "a". For example, a matching row of the first database table 202 having a value "a0" from the value 1 column, a value "a1" from the value 2 column, a value "a" from the primary key column is used three times to combine with a matching row of the second database table 204 having a value "a" from the primary key column and values "a3*", "a3", and "a3!" from the value 3 column. The combination of matching rows from the first database table 202 and the second database table 204 is also applied to match the "primary key" value "g", but in this case, there is only one row in the second database table 204 that has a value for the primary key "g".
[0048] As can be seen, each matching row of the first database table 202 is associated with one or more matching rows of the second database table 204. For example, the first database table 202 has only one row, but the second database table 204 has three rows with matching "primary key" value "a". The first database table 202 has exactly one row and the second database table 204 also has exactly one row with matching value "g". One-to-many database connections allow for great flexibility compared to one-to-one connections. For example, in the case of database tables storing information related to user activities (e.g., access to various network services), the database connection between the encrypted user table (unique user information) and the encrypted action table (multiple actions per user) would most likely require a one-to-many database connection because, for this example, it can be expected that any given user accesses more than one network service, and therefore performs more than one action, or even performs the same action multiple times for the same network service.
[0049] II. Performing Secret Sharing Database Connection
[0050] like Figure 1 and Figure 2 As seen in , performing a join between two database tables typically accesses all elements in both database tables. This may not be a problem if the data sets are owned or controlled by a single computer. However, if the database tables are owned or held by different computers, both computers need to reveal their private database tables to each other to perform the join operation. Exposing private database tables is undesirable. To address this issue, a secret-sharing database connection using secure multi-party computation can be used to connect private database tables.
[0051] In general, secret shared database connections are useful when there is data in a private database table on one computer and data in a private database table on another computer, and neither computer wants to grant the other computer access to their own private database table. For example, consider the case where computer A and computer B both have user data. They do not want to share their user data with each other, but may want to perform queries (e.g., joins) on each other's data. By using a secret shared database connection, either computer A or computer B is able to access the connected database table without revealing their own private database table to each other.
[0052] Figure 3A flow chart corresponding to a secret sharing database connection method according to some embodiments is shown. Step 305 combines the values from the matching columns to generate an unsorted combination table. Step 310 sorts the values in the unsorted combination table to create a sorted combination table. Step 320 compares the values in the sorted combination table to generate a bit vector. Step 330 combines the matching rows of the first database table 202 with the matching rows of the second database table 204 with the matching values using the bit vector, and copies the combined rows to the combined database table 206. Step 340, once the combined database table 206 is calculated, the secret share of the combined database table 206 can be provided to each server.
[0053] In step 305, the values of the matching columns of the two database tables are combined to create an unordered combined list (also referred to as a table). Figure 2 , the values "a", "b", and "g" of the matching column of the first database table 202 are combined with the values "a", "a", "i", "g", "a" of the matching column of the second database table 204. All values of the matching column of the first database table 202 may be stored first, and then all values of the matching column of the second database table 204 may be stored.
[0054] Before storing the values in the unsorted combined table, the values of the matching columns of the first database table and the second database table may be modified by appending a first identifier and a second identifier to create a modified value of the matching column, where 0 represents the first identifier and 1 represents the second identifier. Each identifier indicates which database table the modified value comes from. After modifying and combining the values, the unsorted combined table will include {a 0 ,b 0 ,g 0 ,a 1 ,a 1 ,i 1 ,g 1 ,a 1}. Details of such modifications are provided in later sections.
[0055] In step 310, once the values of the matching columns of the two database tables are combined to create an unsorted combined table, the modified values within the unsorted combined table are sorted to create an ordered combined table. The modified values within the unsorted combined table are sorted in such a way that the modified values from the first database table appear first, and the modified values from the second database table that are equal to the modified values of the first database table appear next. For example, since the “a” of the first database table 202 0 " and three "a" in the second database table 204 1 " matches, so "a" from the first database table 202 0 " will appear first, and the three "a 1" will appear next. See below for Figure 4 Generating a sorted combination table from the unsorted combination table is further described. Because both database tables are shared secrets, the sorted combination table will also be a secret shared between the parties, and the sorting will also be performed securely (e.g., by the techniques described in Koji Chida, Koki Hamada, Dai Ikarashi, Ryo Kikuchi, Naoto Kiribuchi, and Benny Pinkas, "Efficient Secure Three-party Sorting Protocol with an Honest Majority," Cryptographic Electronic Print Archive, Report 2019 / 695, June 12, 2019).
[0056] In step 320, each value in the combined table is compared to its previous adjacent value (e.g., the left adjacent value when the first database table has a unique value in the match column and the first database table has a smaller computer identifier than the second database table). The result of the comparison is recorded in a bit vector. The bit vector indicates whether the current value from the second database table has a matching value in the first database table. The length of the bit vector can be equal to the sum of the number of rows in the first database table and the number of rows in the second database table. A bit value of 0 indicates that there is no match and a bit value of 1 indicates that there is a match. Because the first value of the combined table will not have a value to be compared, the first value of the bit vector will always be assigned 0 to start. This will be referenced below. Figure 5A-5B Additional details regarding generating the bit vector are described.
[0057] In step 330, once the bit vector is formed, the rows of matching values of the first database table are combined with the rows of matching values of the second database table. For example, the bit vector can be used to identify when the rows of matching values of the first database table are combined with the rows of matching values of the second database table. Figure 5A-5B Describes the use of bit vectors to determine which rows to combine.Once matching rows of a first database table have been combined with matching rows in a second database table, the combined rows can be copied to the combined database table.
[0058] Once the combined row has been copied into the combined database table, the secret shares for the combined database table can be distributed in a variety of ways in step 340. For example, the shares can be used as a single database table in conjunction with another secret share, or they can be combined by the server to access the value of the combined database table.
[0059] III. Secret Sharing Database Connection
[0060] A secret sharing database connection is a multi-party computation in which all parties or servers perform each step in the secret sharing database connection. Prior to performing the secret sharing database connection, the individual database tables used to connect and output the combined database table are secretly shared. Shares of the individual database tables are provided to each computer performing the secret sharing database connection.
[0061] Shares for a single database can be generated in a variety of ways. One way to generate shares is by selecting a random number and then XORing the random number with the value of a single database table, which can be done independently for each value in the database. The random number or the XOR difference can be sent to another computer. When there are more than two computers, multiple random numbers can be used. Another way to generate shares is by generating random values in a way that the addition or multiplication of random values can produce the value of a single database table. For example, if three secret shares need to be generated for three computers, two shares can be randomly generated and the values of these two shares can be subtracted or divided by the value of a single database table. This can be done independently for each value in the database. Both methods listed may require that the number of shares required to reconstruct the secret or value of the database is equal to the number of shares divided into.
[0062] The shares of a single database can be generated in various ways without the restriction that the number of shares required to reconstruct the secret is equal to the number of shares into which it is divided. One method is by using the additive-shamir technique. Additive-shamir can generate a random polynomial function (p(x) = a 0 +a 1 *x+…a k-1 *x k-1 ), where the highest order is the minimum number of shares to reconstruct the secret (k) minus one. For i=1,…,n, each share can have a value x i = p(i), where n is the total number of shares into which it is divided. The secret or value of a single table can be the result of a function whose input is 0, such that p(0) = secret. Using polynomial interpolation, the polynomial function can be reconstructed using any number of shares greater than or equal to k to find the value or secret of p(0). Another way is by using replicated secret sharing or additive replication techniques. For some random value d, the total number of shares n, and the minimum number of shares to reconstruct the secret k, a random value x can be randomly generated. 1 ,…,x d-1 , so that x d =xx 1 -…-x d-1 , where x is a secret value. Each party or computer may have x 1 ,…,x dsome unique subset of x such that for all subsets of size k, these k subsets will have all values x that can be used to reconstruct the secret 1 ,…,x d .
[0063] The individual database tables used by different parties can be shared in secret in a variety of ways. One way is to use the output database table of a secret sharing connection in one instance as the input database table of a secret sharing connection in another instance. Another way is for the computer holding the complete single database table to distribute shares of the single database table directly to other parties. Figure 8 Details regarding secret sharing of individual database tables and output database tables are further described.
[0064] A secret sharing database join may consist of three steps: sorting, comparing, and copying. Since the individual database tables are secret shared between the servers, a join between two individual database tables requires identifying which values from the second database table match the first database table on a matching column. To determine which values match, the values of the matching columns of the two database tables may be sorted and compared to determine a bit vector. Once the bit vector is determined, the server may use the bit vector to determine the matching values and combine the rows of matching values from the first database table into the second database table. The combined rows may then be copied into the combined database table.
[0065] A. Sorting
[0066] Figure 4 An exemplary table showing an unsorted combination table 406 and a sorted combination table 408 of matching columns from a first database table 402 and a second database table 404. Figure 2 The first database table 202 in matches, and the second database table 404 matches Figure 2 The values of the matching columns (“primary keys”) of the first database table 402 and the second database table 404 are combined into an unsorted combination table 406 , which is sorted to generate a sorted combination table 408 .
[0067] In the first database table 402, the values under the primary key column are "a", "b", and "g". In the second database table 404, the values under the primary key column are "a", "a", "i", "g", and "a". Since the primary key column is a matching column, the primary key values of the two database tables are first combined to generate the unordered combination table 406. All values of the matching column of the first database table 402 appear first, and all values of the matching column of the second database table 404 appear after.
[0068] Before combining the values to generate the unordered combination table 406, the values of the matching columns of the first database table and the second database table or the primary key values of the first database table and the second database table are modified by appending the first identifier and the second identifier to create the modified value, where 0 represents the first identifier and 1 represents the second identifier. The subscripts in the unordered combination table 406 represent the identifier indicating which database table it comes from. For example, "a 0 " will be the matching value "a" from the first database table.
[0069] Then, the unsorted combination table 406 is subjected to a sorting operation, wherein the modified values of the first database table appear first, and the modified values of the second database table that match the modified values of the first database table appear next. For example, since the first modified value of the first database table is "a 0 ", so the first modified value is appended first, and the next modified value appended will be the value of the second database table that matches "a". Therefore, in the sorted combination table 408, this is represented as {a 0 ,a 1 ,a 1 ,a 1 ,…}, because there are three "a 1 If there is no match, the current modification value of the first database table 402 is appended, and the next modification value of the first database table 402 is used to check whether there is a match in the modification value of the second database table 404. For example, since there is no modification value "b" in the second database table 404 1 ", so the additional modification value "b 0 ", and checks the next modified value "g" of the first database table 402 0 ” to see if there is a matching modified value in the second database table 404. The sort is applied to all modified values in the unsorted combination table 406 to generate the sorted combination table 408.
[0070] Because both the first database table 402 and the second database table 404 are shared in secret, the modified values of the unsorted combination table 406 will also be shared in secret, and the sorting must be performed in a secure setting. The secure sorting protocol can be accomplished using the techniques described in Koji Chida, Koki Hamada, Dai Ikarashi, Ryo Kikuchi, Naoto Kiribuchi, and Benny Pinkas, "An Efficient Secure Three-party Sorting Protocol with an Honest Majorit," Cryptographic Electronic Print Archive, Report 2019 / 695, June 12, 2019.
[0071] B. Comparison
[0072] Figure 5A Exemplary combination tables for generating a bit vector are shown. The values within the first sorted combination table 502A are compared to generate a first bit vector 502B. The values within the second sorted combination table 504A are compared to generate a second bit vector 504B.
[0073] Compare the values within the sorted combination table to generate a bit vector. Comparing the values of the bit vector always involves looking at the adjacent (previous) elements of the sorted combination table. A bit value of 1 indicates that the current value between the first database table and the second database table matches. A bit value of 0 indicates that the current value between the first database table and the second database table does not match. In the following examples, for ease of illustration, the previous element is considered to be on the left. The length of the bit vector can be equal to the sum of the number of rows in the first database table and the number of rows in the second database table.
[0074] If the left adjacent value is from the first database table and the current value is from the second database table, and these values match, the current bit will have a value of 1. If both the left adjacent value and the current value are from the second database table, and these values match, the left adjacent bit is copied to the current bit. This is because if the left adjacent bit is 1, it means that the left adjacent value matches the value from the first database table. Since the left adjacent value is the same as the current value, this means that the current value matches the value from the first database table. However, if the left adjacent bit is 0, it means that the left adjacent value cannot be matched with the first database table, and since the current value has the same value as the left adjacent value, it does not match the first database table. In all other cases where these values do not match, the current bit will have a value of 0. In addition, by default, any bit vector will have a default value of 0 as its first element because there is no value on the left side for the first combined table value to be compared.
[0075] For example, in the first sorting combination table 502A, the first value is "a 0Since the first value "a 0 ” has no value on the left side to compare it to, so the first bit vector 502B will have its first element equal to 0. The second value of the first sorted combination table 502A has the value “a 1 Since the first value of the first sorted key-value pair 502A has a value of "a 0 ”, so the first value and the second value match. When these two values match and come from different database tables, this will make the second value of the first bit vector have a value of 1. A row with a matching value in the first database table can match multiple rows with matching values in the second database table. Since the second value and the third value of the first sorted combination table 502A are both from the second database table, and these values (a 1 ), so the second value of the first bit vector 502B is copied to the third value of the first bit vector 502B, which is 1. The fourth value of the first bit vector 502B will also have a value of 1 because the third and fourth values of the first sorted combination table 502A are from the second database table and match. However, the fourth and fifth values are different because the fourth value has a value of "a 1 ", while the fifth value has the value "b 0 ”. Therefore, the fifth value of the first bit vector 502B will have the value 0. These comparisons between these values will continue until all values within the first sorted combination table 502A are compared.
[0076] C. Copy
[0077] Figure 5B An exemplary table with row notation is shown. The first database table 506 is Figure 2 The first database table 202 matches, and the second database table 508 matches Figure 2 The second database table 204 in the table matches, and the combined database table 510 matches Figure 2 The combination in the database table 206 matches. Each row in the database table is represented by a row symbol to indicate the row of primary key values.
[0078] Once the values within the bit vector are determined, the rows of the first database table with matching values are combined with the rows of the second database table with matching values. The rows with matching values in the first database table may match multiple rows with matching values in the second database table. For example, row v_a of the first database table 506 with matching primary key value "a" 0 will be combined on matching primary key value "a" to row v_a of the second database table 508 having matching primary key value "a" 1 In the first database table v_a 0 The row v_a of the second database table 404 1After the combination, the combined row (v_a') is copied to the combined database table 510. Since there are three v_a's in the second database table 508 1 row, so the row (v_a 0 ) Combine the three times into the three v_a of the second database table 508 1 The combined database table 510 will include three combined rows (v_a') with matching primary key values "a".
[0079] Since the values in the sorted combination table are shared in secret, the bit vector is used to determine which values need to be copied. A bit value of 0 in the bit vector indicates that there is no matching value for the current value in the first database table. Since the current value has no match, the implementation moves to the next bit until a bit value of 1 appears.
[0080] A bit value of 1 in the bit vector indicates that there is a match for the current value in the first database table. If the left adjacent bit value is 0 and the current bit value is 1, the row of the left adjacent value is copied to the row of the current value. For example, in the first bit vector 502B, the first value is 0 and the second value is 1. The row (v_a) of the matching value (first value) 0 ) and the rows with matching value (second value) (v_a 1 ) combination. In another example, in the first bit vector 502B, the second value is 1 and the third value is 1. The row (v_a) of the matching value (second value) previously obtained from the first value 0 ) is combined with the row of the second database table having a matching value (third value). The rows of matching values are combined to create a combined row. The combined row is then copied to the combined database table 206.
[0081] The first database table 506 and the second database table 508 may be joined in various ways to generate a combined database table (e.g., combined database table 510). One method of performing the join is to copy all rows of the second database table 508 to the combined database table 510, and to copy and combine rows of matching values of the first database table to the combined database table 510. Rows that do not have matching values may be deleted from the combined database table 510. Another method of performing the join is to combine rows of matching values of the first database table 506 and rows of matching values of the second database table 508, and to copy the combined rows to the combined database table 510.
[0082] When the rows are combined for inclusion in the combined database table 510, the combined row will have the values {v_a', v_a', v_a', v_g'}, where v_a' and v_g' indicate the combined rows of the first and second database tables having matching values "a" and "g".
[0083] However, in some cases, rows with matching values from the first database table are combined multiple times with rows with matching values from the second database table. For example, for the second sorted combination table 504A, there is a matching value "a 0 ”, which has a matching value (v_a 0 ) and the matching value (a 1 ). This is also indicated in the second bit vector 504B, where only the first value is 0 and the rest of the bit vector values have the value 1. 0 ) will result in a linear number of steps (n) and linear running time (O(n)). This is computationally inefficient. To address this, a tree can be used to combine rows with matching values from the first database table into the second database table.
[0084] IV. Using tree replication
[0085] A tree can be used to complete the combination of matching rows from the first database table to the second database table to improve computational efficiency. The tree can be a binary tree where a node has at most two child nodes, which are referred to as left child nodes and right child nodes. A node without any child nodes is referred to as a leaf node, and a node without any parent node is referred to as a root node. The algorithm for combining matching values of the first database table with the second database table using a tree is divided into two stages: an upstream stage and a downstream stage.
[0086] The upstream phase includes updating the parent nodes starting from the leaf nodes all the way to the root node. For example, the leaf nodes (602A-602H) will have an initial value that will be used to update the parent value (e.g., nodes 603A-603D), and the updates will continue until all the way to the root node (605A). The reference Figure 6 The first set of functions described in detail updates each node in the tree with an array of three values. Updating a node in the tree has log 2 (n) steps and logarithmic running time O(log 2 (n)).
[0087] A. Upstream stage
[0088] Figure 6 An exemplary tree 600 for performing an upstream replication method is shown. The leaf nodes (602A-602H) of the tree 600 consist of values within a sorted combination table 606A. Each node in the tree has an array of three values: the current item (v) of the node, the product bit (p) of the node, and the leftmost bit (l) of the node. For ease of illustration, this example is directed to the leftmost bit, although the order can be swapped and the rightmost bit can be used. The array for each node is determined according to a first set of functions.
[0089] Sorting combination table 606A and Figure 5A The first sorted combination table 502A in matches, and the bit vector 606B matches to Figure 5A The sorted combination table 606A consists of the values x 1 ,…,x n , where each subscript number represents an index into the table, and x represents the element at that index. For example, x in sorted combination table 606A 1 Indicates the first value a 0 , x 3 Indicates the third value a 1 Etc. Similar to sorted combination table 606A, bit vector 606B consists of value y 1 ,…,y n Composition, where y 1 Indicates the first value 0, y 3 Indicates 1st level.
[0090] Each tree node is associated with an array of three values (v, p, l), the three values being the term value (v), the product bit (p), and the leftmost bit (l). Leaf node i is given the initial term value x of sorted combination table 606A. i , the product bit (p)y of bit vector 606B i and the leftmost bit (l)y of bit vector 606B i .
[0091] As an illustrative example, the first leaf node 602A has an x corresponding to the sorted combination table 606A. 1 The value of the term (v)a 0 The first leaf node 602A will have a y corresponding to the bit vector 606B 1 The product of (p)0 and corresponding to y 1 The leftmost bit (1) of the second leaf node 602B is 0. The second leaf node 602B has an x corresponding to the sorted combination table 606A. 2 The value of a 1 The second leaf node will have a y corresponding to bit vector 606B 2 The product of (p) 1 and the corresponding y 2 The leftmost bit (l) is 1.
[0092] The third leaf node 602C has an array (a 1 ,1,1), the fourth leaf node 602D has an array (a 1 ,1,1), the fifth leaf node 602E has an array (b 0 ,0,0), the sixth leaf node 602F has an array (g 0 ,0,0), the seventh leaf node 602G has an array (g 1 ,1,1), and the eighth leaf node 602H has an array (i 1,0,0), where each entry value (v) in the leaf node corresponds to the i-th element in the sorted combination table 606A, and each product bit (p) and leftmost bit (l) corresponds to the i-th element in the bit vector 606B.
[0093] After the leaf nodes are updated, the array of nodes (v, p, l) in the upper level of the tree can be determined. In particular, the left child has the array (v 0 ,p 0 ,l 0 ) and the right child has the array (v 1 ,p 1 ,l 1 ), the parent node has an array (v',p',l') according to the first set of functions, where
[0094]
[0095] p′=p 1 *p 0
[0096] l′=l 0
[0097] As an illustrative example, consider a node 603A having two child nodes 602A and 602B. From the previous example, the left child node 602A has a term value (v 0 ) 0 , product position (p 0 )0 and the leftmost bit (l 0 )0. The right child node 602B has an item value (v 1 ) 1 , product position (p 1 )1 and the leftmost bit (l 1 )1. An array of three values can be obtained by applying the following function:
[0098]
[0099] p′=p 1 *p 0 =1*0=0
[0100] l′=l 0 =0
[0101] Therefore, node 603A has an entry value (v')a 0 , the product bit (p') is 0 and the leftmost bit has the value 0.
[0102] By using the first set of functions, node 603B has an array (a 1 ,1,1), whose left child node 602C has an array (a 1,1,1), the right child node 602D has an array (a 1 ,1,1), node 603C has array (g 0 ,0,0), whose left child node 602E has an array (b 0 ,0,0), the right child node 602F has an array (g 0 ,0,0), and node 603D has an array (i 1 ,0,1), whose left child node 602G has an array (g 1 ,1,1), the right child node 602H has an array (i 1 ,0,0).
[0103] By using the first set of functions, node 604A has an array (a 0 ,0,0), whose left child node 603A has an array (a 0 ,0,0), the right child node 603B has an array (a 1 ,1,1), and node 604B has an array (i 1 ,0,0), whose left child node 603C has an array (g 0 ,0,0), the right child node 603D has an array (i 1 ,0,1). By using the first set of functions, node 605A has an array (i 1 ,0,0), whose left child node 604A has an array (a 0 ,0,0), the right child node 604B has an array (i 1 ,0,0).
[0104] The upstream calculation is performed for each level of the tree, thereby determining the array (v, p, l) for each node in the tree until the root node. Figure 6 The following computations of the node can be processed in parallel, which yields a running time of O(log 2 (n)). Once all nodes of the tree have been updated by the upstream stage, the downstream stage will push the values back along the tree starting from the root to the leaves.
[0105] B. Downstream stage
[0106] The downstream stage involves updating the child nodes starting from the root node and working down to the leaf nodes. The nodes in the tree have been updated with an array of three values from the upstream stage, and the downstream stage updates the item values of the nodes using the array from the upstream stage. For example, the root node (705A) and its child nodes (704A and 704B) will have an initial array of three values (v, p, l) that will be used to update the values of the child nodes (704A and 704B). Figure 7The second set of functions described in detail in the previous section updates the value of an item (v) at each node in the tree. The nodes in the tree updated for the downstream stage have log 2 (n) steps and logarithmic running time O(log 2 (n)).
[0107] Figure 7 An exemplary tree with node item values after executing the downstream copy method is shown. As the downstream stage starts from the root node to the leaf node, the tree node is updated according to the operation of determining the node's item value (v), product bit (p), and leftmost bit (l).
[0108] Starting from the root node and working down to the leaf nodes, the nodes are updated according to the following rules: given an internal parent node with array (v', p', l'), a parent node with array (v 0 ,p 0 ,l 0 )'s parent node and the left child node with array (v 1 ,p 1 ,l 1 )'s parent node's right child node, the item value of the left child node (v 0 ') and the item value of the right child node (v 1 ') will be updated according to the second set of functions
[0109] v 0 ′=if(l 0 =1) then v′, else v 0
[0110] v 1 ′=if(p 0 =1) then v′, else v 0
[0111] That is, if the left child node (v 0 ')'s leftmost bit (l 0 ) is 1, the updated item value of the left child will have the item value of the parent (v'). Otherwise, it keeps its original item value (v 0 ). If the product of the left child node is (p 0 ) is 1, then the update item value (v 1 ') will have the parent's item value. Otherwise, it will have the original item value of the left child (v 0 ). Once the value of a child node's item is updated, other values of the child node, such as the product bit (p) and the leftmost bit (l), are no longer used.
[0112] As an illustrative example, node 705A has an entry value (v')i 1 The left child node 704A has the item value (v 0) 0 , product position (p 0 )0 and the leftmost bit (l 0 )0. The right child node 704B has the item value (v 1 )i 1 , product position (p 1 )0 and the leftmost bit (l 1 )0. These values are determined by the upward phase, which uses Figure 6 The second set of functions for obtaining the update item value of the left child node 704A is applied, because l 0 is not equal to 1, so the left child node (v' 0 ) will have its original value v 0 (a 0 ). For the updated item value of the right child node 704B, since p 0 is not equal to 1, so the right child node (v' 1 ) will have the original item value v of the left child 0 (a 0 ).
[0113] With updated item value a 0 The node 704A has a left child node 703A and a right child node 703B, and the left child node has an array (a 0 ,0,0), the right child node has an array (a 1 ,1,1). By using the second set of functions, the left child node 703A will have an updated term value a 0 , and the right child node 703B will have the updated item value a 0 . With updated item value a 0 The node 704B has a left child node 703C and a right child node 703D, and the left child node has an array (g 0 ,0,0), the right child node has the array (i 1 ,0,1). By using the second set of functions, the left child node 703C will have an updated term value g 0 , and the right child node 703D will have the updated item value g 0 .
[0114] When pushing a value into a leaf node, add extra logic to the right child node (v 1 ;),in
[0115] v′ 1 =if(l 1 =1)then(if(p 0 =1) then v′, else v 0 ),else(v 1 )
[0116] That is, if the right child node (l 1 ) is 1, then if the product bit (p 0 ) is also 1, and the updated value of the right child node (v 1 ') will have the parent's item value (v'). Otherwise, it will have the left child's original item value (v 0 ). However, if the leftmost bit of the right child node (l 1 ) is 0, then the update item value (v 1 ') will keep the original right child node value (v 1 ).exist Figure 7 You can see the item values of the nodes after the downstream calculation.
[0117] As an illustrative example, node 703A has an update term value (v')a 0 The left child node 702A has the item value (v 0 ) 0 , product position (p 0 )0 and the leftmost bit (l 0 )0. The right child node 702B has the item value (v 1 ) 1 , product position (p 1 )1 and the leftmost bit (l 1 )1. The array of child nodes starts from Figure 6 Used to determine the left child node (v' 0 ) remain the same. 0 is not equal to 1, so the updated item value (v' 0 ) will have its original item value v 0 (a 0 ). Apply the update item value (v') for obtaining the right child node 702B. 1 )'s update logic, the update item value of the right child node (v' 1 ) because its leftmost bit (l 1 ) is 1 and p 0 If it is 0, it will have the value v of the left child node. 0 (a 0 ).
[0118] With updated item value a 0 The node 703B has a left child node 702C and a right child node 702D, and the left child node has an array (a 1 ,1,1), the right child node has an array (a 1 ,1,1). By using the second set of functions, the left child node 702C will have an updated term value a 0, and the right child node 702D will have the updated item value a 0 . With updated term value g 0 The node 703C has a left child node 702E and a right child node 702F, and the left child node has an array (b 0 ,0,0), the right child node has the array (g 0 ,0,0). By using the second set of functions, the left child node 702E will have the updated term value b 0 , and the right child node 702F will have the updated term value g 0 . With updated term value g 0 The node 703D has a left child node 702G and a right child node 702H. The left child node has an array (g 1 ,1,1), the right child node has the array (i 1 ,0,0). By using the second set of functions, the left child node 702G will have an updated term value g 0 , and the right child node 702H will have the updated item value i 1 .
[0119] When a leaf node is updated during the downward phase, the row with the updated item value is combined with the row with the original item value to create a combined row. Figure 7 In the example, nodes 702B, 702C, and 702D use item value a. 0 Update, and node 702G uses item value g 0 Update. Combine the rows of the updated item value and the original item value to create a combined row. For example, the original item value of node 702B is a 1 , and the updated value of node 702B is a 0 .because Figure 7 Each of these item values in is based on matching columns of the first database table 402 and the second database table 404, so the first database table 402 has matching column values a 0 The rows of the second database table 404 will have matching column values a 1 The rows of are combined to create combined rows (v_a'). These combined rows will be replicated to create the combined database table 206. Since all combined rows are secretly shared, the combined database table 306 will also be secretly shared.
[0120] V. Secret Share Distribution
[0121] The shares of a combined database table (e.g., combined database table 206) may be distributed among the servers. These shares may be distributed so that a single share does not allow a server to identify the values of the combined database table. If a server wants to access the values of the combined database table, the server needs to communicate with other servers to obtain all the shares of the combined database table.
[0122] The various database tables used by different parties as input to a secret-sharing database connection are all secret-shared before the connection. The various database tables can be secret-shared between servers in various ways. One way is to use the output database table of a secret-sharing connection in one instance as the input database table of a secret-sharing connection in another instance. In such scenarios, each computer may also hold a secret share of the input database table. Another way is for each party with complete database tables to distribute shares of a single database table directly to other parties. Yet another way may be that some external party has distributed secret shares of the various database tables to the server before the connection.
[0123] Figure 8 It shows that each holds a first database table R (R 1 ,R 2 ,R 3 ), the second database table Q(Q 1 ,Q 2 ,Q 3 ) and the combined database table T(T 1 ,T 2 ,T 3 ) of three servers (first server 802, second server 804, and third server 806). These servers can communicate with each other by sending their secret shares to each other to perform operations such as connecting.
[0124] Since the first database table R and the second database table Q are secret-shared, a secret-shared database table join can be used to join the two database tables to output a combined database table T. Since the first database table R and the second database table Q are secret-shared, a secret database join between the two database tables is performed using multi-party computation involving all three servers. Therefore, each step involving the secret-shared database join, such as sorting, comparing, and copying, can be performed between the three servers.
[0125] The output of the secret sharing database table connection, that is, the combined database table T, can also be secret shared, and the shares of the combined database table T can be automatically distributed among the three servers as a result of the connection. If necessary, the three servers can communicate with each other to exchange the shares of the combined database table T.
[0126] The shares of the combined database table T distributed among the servers can be used in various ways. One way is to use the shares of the combined database table T as an input database table for another secret sharing database connection. Another way is to access the values in the combined database table T. When a server obtains all the shares of the combined database table T, the server can access the values in the combined database table T. The shares of the combined database table T can be obtained by the server communicating with other servers to receive the shares of the combined database table. However, other servers can refuse the request to give shares to the server and prevent the server from accessing the values of the combined database table T.
[0127] Embodiments of the present disclosure have several advantages. Using embodiments of the present disclosure, one-to-many secret sharing database connections are possible. Prior to the present invention, only one-to-one secret sharing database connections were possible, which severely limited the types of database tables that could be connected together. Distributing shares of the combined output also provides more capabilities to each server. By having a share of the combined output, each server has the ability to provide access to the combined output to other servers. Therefore, in the case where the combined output may expose important information of the server, the server may choose not to exchange shares to other servers and prevent other servers from accessing the combined database table.
[0128] Additionally, the implementation is fully composable, meaning that the output database table of a secret sharing join in one instance can be used as the input database table of a secret sharing join in another instance. This allows computers to repeatedly perform operations (e.g., joins, intersections, etc.) while keeping the underlying data secret. Because one-to-many relationships are allowed, specialized set union operations can also be performed as a set of SQL join operations.
[0129] VI. Example Method for Secret Sharing Database Connection
[0130] Fig. 9 A flow chart corresponding to performing a secret shared database connection on a shared database is shown. The secret shared database connection of a first database table and a second database table is stored on a first computer and a second computer, respectively. The secret shared database connection is a multi-party computing method involving the first computer and the second computer. The method includes steps 910 to 970.
[0131] As described above, the database table is secretly shared between two computers and possibly additional computers. For example, the values in the first database table can be split into multiple shares, and each share can be distributed to a different computer. The first computer can generate the shares for the first database table, and the second computer can generate the shares for the second database table. The shares for the database table are generated so that a single share does not allow the computer to identify the value of the database table, but can reconstruct the value when a sufficient number of shares are combined.
[0132] Step 910 includes storing, by a first computer, a first database table having a first column and a second column, and storing, by a second computer, a second database table having a first column and a third column. In some embodiments, the first database table and the second database table may have more than two columns. For example, Figure 2 The first database table 202 in has three columns. The columns in the first database table and the second database are database fields with specific properties. For example, the first column may be the database field "user ID", and the second column may be the database field "user name". The first database table and the second database table each have a first column, and the first column may be used to connect the first database table and the second database table. The value in the first column of the first database table may be different from the value in the first column of the second database table. The column used to connect between the two databases is called a "matching column" or a "master key", and the value in the matching column that is the same between the two databases is called a "matching value" or a "master value".
[0133] Step 920 includes the first computer distributing the shares of the first database table to the second computer. The second computer also distributes the shares of the second database table to the first computer. In some embodiments, the shares of the first database table and the second database table are distributed before being stored in step 910. The shares of the database table are distributed so that a single share does not allow the computer to identify the value of the database table. If the computer wants to access the value of the database table, the computer needs to obtain all the shares of the database table.
[0134] Step 930 includes modifying the values of the matching columns of the first database table and the second database table. The first value or the value of the matching column of the first database table is appended with a first identifier indicating that the first value corresponds to the first database table. In some embodiments, the first identifier is indicated by the number 0. The first value and the first identifier are combined to generate a first modified value. The second value or the value of the matching column of the second database table is appended with a second identifier indicating that the second value corresponds to the second database table. In some embodiments, the second identifier is indicated by the number 1. The second value and the second identifier are combined to generate a second modified value. The modified value includes (1) the first value or the second value and (2) any one of the first identifier or the second identifier.
[0135] Step 940 includes generating an unordered list including the first modified value and the second modified value. The first modified value and the second modified value can be combined so that all first modified values of the first database table appear first and all second modified values of the second database table appear later. The unordered list is also called an unordered combination table.
[0136] Step 950 includes sorting the first modified values and the second modified values of the unsorted list to create a sorted list. The values of the unsorted list are sorted, wherein the first modified value appears first and the second modified value that matches the corresponding first modified value appears next. For example, Figure 4 The unsorted combination table 406 in the example has a first modified value "a 0 This is appended first, and the next value to be appended is the value that matches "a 0 "The second modified value matched"a 1 Therefore, in the sorting combination table 408, this is represented as {a 0 ,a 1 ,a 1 ,a 1 ,…}. If there is no match, the first modified value that does not have a match is appended, and the next first modified value is used to check if there is a match with the value in the second modified value. A sorted list is also called a sorted combination table.
[0137] Step 960 includes determining a bit vector by comparing the current modified value of the sorted list with the previous modified value to determine whether a match exists. A bit value of 0 may indicate that there is no match between the current modified value and the previous modified value, and a bit value of 1 may indicate that there is a match. If there is a match, this indicates that the current modified value is a matching value in the matching columns of the first database and the second database. The bit values in the bit vector specify whether the rows of the first database table with matching values (where the row includes the values of the first column and the second column) and the rows of the second database table with matching values (where the row includes the values of the first column and the third column) are to be combined on the matching values and copied to the rows of the combined database table. The length of the bit vector may be equal to the sum of the number of rows in the first database table and the number of rows in the second database table. In some embodiments, a tree may be used to combine and copy to the combined database table.
[0138] Step 970 includes generating a combined database table using the bit vector, the value of the second column of the first database table, and the value of the third column of the second database table. A match value between the first database table and the second database table is determined by using the bit vector, wherein the bit indicates whether a match exists. The combined database table consists of rows that combine matching rows or matching values of the first database table and the second database table combined on matching values. The combined matching rows consist of values from columns of the first database table and the second database table (e.g., values from the first column of the first database table and the third column of the second database table).
[0139] VII. Computer System
[0140] Any computer system described herein may utilize any suitable number of subsystems. Fig.10An example of such a subsystem in computer system 10 is shown in FIG. In some embodiments, the computer system includes a single computer device, wherein the subsystem may be a component of the computer device. In other embodiments, the computer system may include multiple computer devices with internal components, each of which is a subsystem. The computer system may include desktop and laptop computers, tablet computers, mobile phones, and other mobile devices.
[0141] Fig.10 The subsystems shown in FIG. 7 are interconnected via a system bus 75. Additional subsystems are shown, such as a printer 74, a keyboard 78, a storage device 79, a monitor 76 coupled to a display adapter 82 (e.g., a display screen such as an LED), etc. Peripheral devices and I / O devices coupled to an input / output (I / O) controller 71 may be connected to the computer system by any number of means known in the art, such as input / output (I / O) ports 77 (e.g., USB, ). For example, I / O port 77 or external interface 81 (e.g., Ethernet, Wi-Fi, or other network interface) can be used to connect computer system 10 to a wide area network (e.g., the Internet), a mouse input device, or a scanner. Interconnection via system bus 75 allows central processor 73 to communicate with each subsystem and control the execution of multiple instructions from system memory 72 or (one or more) storage devices 79 (e.g., fixed disks, such as hard drives or optical disks), as well as the exchange of information between subsystems. System memory 72 and / or (one or more) storage devices 79 may contain computer readable media. Another subsystem is a data collection device 85, such as a camera, microphone, accelerometer, etc. Any data mentioned in this article can be output from one component to another and can be output to a user.
[0142] The computer system may include multiple identical components or subsystems, which are connected together, for example, through an external interface 81, through an internal interface or via a removable storage device, which can be connected and removed from one component to another component. In some embodiments, the computer system, subsystem or device can communicate through a network. In such cases, one computer can be considered as a client and another computer can be considered as a server, wherein each computer can be part of the same computer system. The client and the server can each include multiple systems, subsystems or components.
[0143] Aspects of the embodiments may be implemented using hardware circuitry (e.g., an application specific integrated circuit or a field programmable gate array) and / or in a modular or integrated manner using computer software in the form of control logic with the aid of a substantially programmable processor. As used herein, a processor may include a single-core processor, a multi-core processor on the same integrated chip, or multiple processing units on a single circuit board or networked and dedicated hardware. Based on the disclosure and teachings provided herein, one of ordinary skill in the art will know and understand other ways and / or methods of implementing the embodiments of the present disclosure using hardware and combinations of hardware and software.
[0144] Any software component or function described in this application can be implemented as a software code executed by a processor using any suitable computer language such as Java, C, C++, C#, Objective-C, Swift or a scripting language such as Perl or Python using, for example, conventional or object-oriented techniques. The software code can be stored on a computer-readable medium as a series of instructions or commands for storage and / or transmission. Suitable non-transitory computer-readable media may include random access memory (RAM), read-only memory (ROM), magnetic media such as a hard drive or a floppy disk, or optical media such as a compact disk (CD) or DVD (digital versatile disc) or a blue-ray disc, flash memory, etc. The computer-readable medium may be any combination of such devices. In addition, the order of operations may be rearranged. The process terminates when its operation is completed, but may have other steps not included in the accompanying drawings. The process may correspond to a method, function, program, subroutine, subprogram, etc. When the process corresponds to a function, its termination may correspond to the function returning to the calling function or main function.
[0145] Such programs can also be encoded and transmitted using carrier signals suitable for transmission via wired networks, optical networks and / or wireless networks that meet multiple protocols, including the Internet. Therefore, a data signal encoded with such programs can be used to create a computer-readable medium. The computer-readable medium encoded with program code can be packaged with compatible devices or (for example, downloaded via the Internet) provided separately from other devices. Any such computer-readable medium can reside on or within a single computer product (for example, a hard drive, a CD or an entire computer system), and can be present on or within different computer products in a system or network. The computer system may include a monitor, a printer, or other suitable displays for providing any result mentioned herein to the user.
[0146] Any method described herein may be performed completely or in part with a computer system comprising one or more processors that may be configured to perform these steps. Therefore, embodiments may relate to a computer system configured to perform the steps of any method described herein, possibly with different components that perform corresponding steps or corresponding step groups. Although presented as numbered steps, the steps of the method herein may be performed simultaneously or at different times or in different orders. In addition, the parts of these steps may be used together with the parts of other steps of other methods. In addition, all or part of the steps may be optional. In addition, any step of any method may be performed using other devices of the modules, units, circuits or systems for performing these steps.
[0147] The specific details of a particular embodiment may be combined in any suitable manner without departing from the spirit and scope of the embodiments of the present disclosure. However, other embodiments of the present disclosure may be directed to specific embodiments related to each individual aspect, or specific combinations of these individual aspects.
[0148] The above description of example embodiments of the present disclosure has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the disclosure to the precise form described, and many modifications and variations are possible in light of the above teachings.
[0149] Unless expressly indicated to the contrary, the recitation of "a, an," or "the" is intended to mean "one or more." Unless expressly indicated to the contrary, the use of "or" is intended to mean an "inclusive or," not an "exclusive or." Reference to a "first" component does not necessarily require the provision of a second component. Furthermore, reference to a "first" or "second" component does not limit the referenced components to a particular location unless expressly stated. The term "based on" is intended to mean "based at least in part on." When a Markush group or other grouping is used herein, all individual members of the group and all possible combinations and subcombinations of the group are intended to be individually included in the present disclosure.
[0150] All patents, patent applications, disclosures and descriptions mentioned herein are incorporated herein by reference in their entirety for all purposes. It is not admitted that they are prior art. In the event of a conflict between the present application and the references provided herein, the present application shall prevail.
Claims
1. A method for performing a secret sharing connection of a first database table and a second database table stored on a first computer and a second computer, the method comprising performing a multi-party computation by the first computer in conjunction with the second computer: storing the first database table having a first column and a second column, wherein the first column is used to connect the first database table and the second database table, wherein the second database table includes the first column and a third column, wherein the first column is a matching column between the first database table and the second database table; distributing the shares of the first database table to the second computer, wherein the second computer distributes the shares of the second database table to the first computer; modifying the first value by appending a first identifier indicating that the first value of the matching column of the first database table corresponds to the first database table, thereby generating a first modified value, wherein the first modified value includes the first value and the first identifier; modifying the second value by appending a second identifier indicating that the second value of the matching column of the second database table corresponds to the second database table, thereby generating a second modified value, wherein the second modified value includes the second value and the second identifier; generating an unordered list including the first modified value and the second modified value; sorting the first modified value and the second modified value of the unsorted list to create a sorted list; determining a bit vector by comparing a current modified value of the sorted list with a previous modified value to determine whether the current modified value is a matching value, wherein bit values in the bit vector specify whether a row of the first database table having the matching value and a row of the second database table having the matching value are to be combined in a combined row of a combined database table; as well as The combined database table is generated using the bit vector, the value of the second column of the first database table, and the value of the third column of the second database table. 2 . The method of claim 1 , wherein the row in the first database table having the matching value matches a plurality of rows in the second database table having the matching value. 3 . The method of claim 1 , wherein the ordered list includes a first one of the first modification values followed by one or more second modification values that match the first one of the first modification values. The method according to claim 1 , wherein the values of the matching columns of the first database table are unique to each other.
5. The method of claim 4, wherein the secret sharing connection is a one-to-many database connection, wherein the matching columns of the second database table are infinite. The method of claim 1 , wherein the length of the bit vector is equal to the sum of the number of rows in the first database table and the number of rows in the second database table.
7. The method of claim 1, wherein the nodes of the tree are used to combine the rows of the first database table having the matching values with one or more rows of the second database table having matching values.
8. The method according to claim 7, wherein the tree has an upstream stage and a downstream stage, the upstream stage is used to update the parent node starting from the leaf node to the root node using a first set of functions, and the downstream stage is used to update the item value (v) of the child node starting from the root node to the leaf node using a second set of functions after the upstream stage.
9. A method according to claim 8, wherein the first set of functions is used to update each node of the tree with an array having three values in the upstream stage, wherein the three values are: the current item of the node (v), the product bit of the node (p) and the leftmost bit of the node (l), and wherein the array having three values is used to update child nodes during the downstream stage.
10. The method of claim 8, wherein the second set of functions specifies whether rows of updated term values for leaf nodes are to be combined with rows of original term values before updating the leaf nodes.
11. The method of claim 1, wherein the shares of the first database table are generated by selecting a random number and then XORing the random number with a value of the first database table.
12. A first computer, comprising: processor; Network interface; as well as A non-transitory computer-readable medium comprising code for instructing the processor to implement a method for performing a secret sharing connection of a first database table and a second database table respectively stored on the first computer and the second computer, the method comprising performing a multi-party computation by the first computer in conjunction with the second computer, the method comprising: storing the first database table having a first column and a second column, wherein the first column is used to connect the first database table and the second database table, wherein the second database table includes the first column and a third column, wherein the first column is a matching column between the first database table and the second database table; distributing the shares of the first database table to the second computer, wherein the second computer distributes the shares of the second database table to the first computer; modifying the first value by appending a first identifier indicating that the first value of the matching column of the first database table corresponds to the first database table, thereby generating a first modified value, wherein the first modified value includes the first value and the first identifier; modifying the second value by appending a second identifier indicating that the second value of the matching column of the second database table corresponds to the second database table, thereby generating a second modified value, wherein the second modified value includes the second value and the second identifier; generating an unordered list including the first modified value and the second modified value; sorting the first modified value and the second modified value of the unsorted list to create a sorted list; determining a bit vector by comparing a current modified value of the sorted list with a previous modified value to determine whether the current modified value is a matching value, wherein bit values in the bit vector specify whether a row of the first database table having the matching value and a row of the second database table having the matching value are to be combined in a combined row of a combined database table; and The combined database table is generated using the bit vector, the value of the second column of the first database table, and the value of the third column of the second database table.
13. The first computer of claim 12, wherein the row in the first database table having the matching value matches a plurality of rows in the second database table having the matching value.
14. The first computer of claim 12, wherein the ordered list includes one of the first modified values followed by one or more second modified values that match the one of the first modified values.
15. The first computer of claim 12, wherein values of the matching columns of the first database table are unique to each other.
16. The first computer of claim 15, wherein the secret sharing connection is a one-to-many database connection, wherein the matching columns of the second database table are infinite.
17. The first computer of claim 12, wherein a length of the bit vector is equal to a sum of a number of rows in the first database table and a number of rows in the second database table.
18. The first computer of claim 12, wherein nodes of the tree are used to combine rows of the first database table having the matching values with one or more rows of matching values of the second database table.
19. The first computer of claim 18, wherein the tree has an upstream stage and a downstream stage, the upstream stage being used to update a parent node starting from a leaf node to a root node using a first set of functions, and the downstream stage being used to update an item value (v) of a child node starting from the root node to the leaf node using a second set of functions after the upstream stage.
20. A first computer according to claim 19, wherein the first set of functions is used to update each node of the tree with an array having three values in the upstream stage, wherein the three values are: the current item of the node (v), the product bit of the node (p), and the leftmost bit of the node (l), and wherein the array having three values is used to update child nodes during the downstream stage.
