Security indexing method and device for database
Through three-party copy secret sharing and secure multi-party computing, and using single-hot vectors to query database indexes, the problem of low database security index efficiency in the existing technology is solved, and efficient privacy protection and computing performance is achieved.
Patent Information
- Application Number
- CN202411073652.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-06
AI Technical Summary
The prior art is less efficient when implementing secure indexing of databases, making it difficult to simultaneously protect private data and ensure high efficiency.
Using the three-party copy secret sharing method, each party holds multiple secret shards, through secure multi-party calculations and secret sharing, use single-hot vectors to perform dot product or matrix multiplication, to obtain element shards at the target index position, and ensure that privacy data is not leaked And improve computing efficiency.
It realizes that while protecting private data, it improves the efficiency of database query and communication bandwidth performance, and meets the needs of efficient computing and privacy protection.
Smart Images

Figure CN118607005B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the computer field, and in particular, to a security indexing method and device for a database. Background Art
[0002] Currently, data held by different data holders may contain user privacy information, and data sharing between data holders may infringe on user privacy. In order to facilitate data flow between multiple parties, secure multi-party computing is used to support joint computing between multiple parties, tap the value of data, and ensure that the plaintext information of each party's private data will not be leaked during multi-party interaction.
[0003] Secure multi-party computation enables multiple non-trusting parties to securely compute a given function without leaking inputs or intermediate computation results other than the result. Secret sharing is a method of distributing a secret to different parties, with each party receiving a portion of the secret, called a shard. The secret can only be restored when enough shards are held; a single shard cannot restore the secret.
[0004] Secret sharing is widely used in security computing in various scenarios due to its high efficiency in arithmetic calculations and linear algebra operations. Calculations based on secret sharing often involve security indexes for databases. Assuming there is a database D, the goal of the security index is to obtain the secret sharing of the element D[x] at position x, where each element in D and x are in a secret sharing state, and x can be called the target index. In the prior art, when implementing a security index, in order to protect private data, the efficiency is low. Therefore, it is necessary to provide a security index for the database that can protect private data while being highly efficient. Summary of the invention
[0005] One or more embodiments of the present specification describe a method and device for secure indexing of a database, which can protect privacy data while being highly efficient.
[0006] In a first aspect, a secure indexing method for a database is provided, wherein each element in the database has a corresponding index, and each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, and the method is performed by the first party, including:
[0007] Get the target index of the element to be queried in the index Boolean fragment of this side;
[0008] Through a first secure multi-party computation, a first secret sharing is performed with the second party for the target point function, and a first result slice under the first secret sharing of a one-hot vector representing an output result of the target point function is obtained by using the index Boolean slice and the function slice under the first secret sharing; the one-hot vector has a value of 1 only at the target index position, and all other positions are 0;
[0009] Performing a second secret sharing with the third party for the target point function through a second secure multi-party computation, and obtaining a second result sharding of the one-hot vector under the second secret sharing by using the index Boolean sharding and the function sharding under the second secret sharing;
[0010] The first result slice and the second result slice of the one-hot vector are used to perform dot products with vectors consisting of two slices of each element of the database held by the party, and a slice of the element at the target index position in the database is obtained according to the dot product result.
[0011] In a possible implementation, the method further includes:
[0012] receiving another shard of the element at the target index position from the second party, so that the party holds two shards of the three-party secret sharing of the element;
[0013] A fragment of the element at the target index position is sent to the third party, so that the third party holds two fragments of the three-party secret sharing of the element.
[0014] In a possible implementation manner, obtaining the target index of the element to be queried in the local index Boolean fragmentation includes:
[0015] Obtain the index arithmetic shard of the target index in the local side;
[0016] Based on the index arithmetic sharding of the target index, a third secure multi-party computation is performed in conjunction with the second party and the third party to obtain the index Boolean sharding of the target index on the local party.
[0017] In a possible implementation, the first secure multi-party computation includes:
[0018] Obtaining a first party key jointly generated with the second party as a function shard;
[0019] For the first own key and the Boolean shard in the index Boolean shard that the own party holds but the second party does not hold, local calculation is performed to obtain the first result shard; or, for the first own key and the two Boolean shards included in the index Boolean shard, local calculation is performed to obtain the first result shard.
[0020] In a possible implementation manner, the second secure multi-party computation includes:
[0021] Obtaining a second local key jointly generated with the third party as a function shard;
[0022] For the second own key and the Boolean shard in the index Boolean shard that the own party holds but the third party does not hold, local calculation is performed to obtain the second result shard; or, for the second own key and the two Boolean shards contained in the index Boolean shard, local calculation is performed to obtain the second result shard.
[0023] In one possible implementation, the first result shard is an arithmetic shard, and the first secure multi-party computation includes a Boolean to arithmetic conversion operation; the second result shard is an arithmetic shard, and the second secure multi-party computation includes a Boolean to arithmetic conversion operation.
[0024] In a possible implementation, the method further includes:
[0025] When it is necessary to obtain a target number of consecutive elements in the database with the target index as the starting index, based on the first result slice, a circular shift operation is performed to shift by 1 to the target number, so as to obtain a first shifted slice after the one-hot vector is shifted;
[0026] Based on the second result slices, a circular shift operation is performed to shift the slices by 1 to the target number, so as to obtain second shifted slices after the one-hot vector is shifted;
[0027] The first shifted slice and the second shifted slice after the one-hot vector is shifted are used to perform dot products with vectors consisting of two slices of each element of the database held by the party, and a slice of the element at the shift position after the target index position in the database is obtained according to the dot product result.
[0028] In a second aspect, a security indexing method for a database is provided, wherein each element in the database forms a matrix, and each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, and the method is performed by the first party, and includes:
[0029] Get the target row index of the element to be queried in the index Boolean fragment of this side;
[0030] Through a first secure multi-party computation, a first secret sharing is performed with the second party for the target point function, and a first result slice under the first secret sharing of a one-hot vector representing the output result of the target point function is obtained by using the index Boolean slice and the function slice under the first secret sharing; the one-hot vector has a value of 1 only at the target row index position, and all other positions are 0;
[0031] Performing a second secret sharing with the third party for the target point function through a second secure multi-party computation, and obtaining a second result sharding of the one-hot vector under the second secret sharing by using the index Boolean sharding and the function sharding under the second secret sharing;
[0032] Utilize the first result slice and the second result slice of the one-hot vector to perform matrix multiplication with matrices consisting of two slices of each element of the database held by the party, and obtain a slice corresponding to each row of elements at the target row index position in the database according to the multiplication result.
[0033] In a third aspect, a secure indexing method for a database is provided, wherein each element in the database has a sub-index of each dimension in n dimensions, and each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, and the method is performed by the first party, including:
[0034] For the current dimension among the n dimensions, if the number of unqueried dimensions in the current query result obtained in the previous dimension is greater than or equal to 2, the elements of each unqueried dimension are flattened, the current query result is converted into a matrix, and the target sub-index of the current dimension in the target index to be queried is used as the target row index;
[0035] Execute the method of the second aspect to obtain a shard corresponding to each row element at the target row index position as an update query result;
[0036] The shape of the updated query result is changed to the size of each dimension, and the updated query result is continued to be used as the current query result to query several elements of the target sub-index of the current dimension included in the target index until the result obtained is one element.
[0037] In a fourth aspect, a security indexing device for a database is provided, wherein each element in the database has a corresponding index, and each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, and the device is disposed on the first party, comprising:
[0038] An acquisition unit, used for acquiring the target index of the element to be queried in the index Boolean fragment of the local side;
[0039] A first secure computing unit is configured to perform a first secret sharing with the second party for a target point function through a first secure multi-party computing, and obtain a first result slice of a one-hot vector representing an output result of the target point function under the first secret sharing by using the index Boolean slice obtained by the obtaining unit and the function slice under the first secret sharing; the one-hot vector has a value of 1 only at a target index position, and all other positions are 0;
[0040] A second secure computing unit is configured to perform a second secret sharing with the third party for the target point function through a second secure multi-party computing, and obtain a second result slice of the one-hot vector under the second secret sharing by using the index Boolean slice obtained by the obtaining unit and the function slice under the second secret sharing;
[0041] The local dot product unit is used to use the first result slice of the one-hot vector obtained by the first security calculation unit and the second result slice obtained by the second security calculation unit to perform dot products with vectors consisting of two slices of each element of the database held by the local party, and obtain a slice of the element at the target index position in the database according to the dot product result.
[0042] In a fifth aspect, a security indexing device for a database is provided, wherein each element in the database forms a matrix, and each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, and the device is disposed on the first party, and includes:
[0043] An acquisition unit, used to acquire the target row index of the element to be queried in the index Boolean fragment of the local side;
[0044] A first secure computing unit is configured to perform a first secret sharing with the second party for a target point function through a first secure multi-party computing, and obtain a first result slice of a one-hot vector representing an output result of the target point function under the first secret sharing by using the index Boolean slice obtained by the obtaining unit and the function slice under the first secret sharing; the one-hot vector has a value of 1 only at the target row index position, and all other positions are 0;
[0045] A second secure computing unit is configured to perform a second secret sharing with the third party for the target point function through a second secure multi-party computing, and obtain a second result slice of the one-hot vector under the second secret sharing by using the index Boolean slice obtained by the obtaining unit and the function slice under the second secret sharing;
[0046] A local multiplication unit is used to use the first result slice of the one-hot vector obtained by the first security calculation unit and the second result slice obtained by the second security calculation unit to perform matrix multiplication with matrices consisting of two slices of each element of the database held by the local party, and obtain a slice corresponding to each row of elements at the target row index position in the database according to the multiplication result.
[0047] In a sixth aspect, a security indexing device for a database is provided, wherein each element in the database has a sub-index of each dimension in n dimensions, each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, and the device is disposed on the first party, including:
[0048] A tiling processing unit is used to perform tiling processing on the elements of each unqueried dimension in turn for the current dimension among the n dimensions, if the number of unqueried dimensions in the current query result obtained by the previous dimension is greater than or equal to 2, convert the current query result into a matrix, and use the target sub-index of the current dimension in the target index to be queried as the target row index;
[0049] A calling unit, used to call the apparatus of the fifth aspect to obtain a shard corresponding to each row element at the target row index position as an update query result;
[0050] A shape changing unit is used to change the shape of the updated query result obtained by the calling unit to the size of each dimension, continue to use the updated query result as the current query result, and query several elements of the target sub-index of the current dimension included in the target index until the result obtained is one element.
[0051] In a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of any one of the first to third aspects.
[0052] In an eighth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of any one of the first to third aspects is implemented.
[0053] A method and apparatus provided by an embodiment of the present specification utilize a three-party replication secret sharing method in which each party holds more than one secret shard of private data, and any two parties have all shards of the private data, so that secret sharing can be performed between the two parties for a target point function, and the target point function outputs 1 only when the input is a target index. With the help of the target point function shared by the two parties, a one-hot vector representing the output result of the target point function can be obtained. The result shard of the two-party secret sharing can then be used to perform a local dot product operation to obtain a shard of the element at the target index position. This secure indexing method can meet the requirements of high efficiency in local computing, communication rounds, and bandwidth, so that it can protect private data while being highly efficient.
[0054] Another method and device provided by the embodiments of this specification, for a specific scenario, each element in the database forms a matrix, and it is necessary to obtain a slice corresponding to each row of elements at the target row index position in the database. In this scenario, a three-party replication secret sharing method is used, in which each party holds more than one secret slice of private data, and any two parties have all slices of private data, so that secret sharing can be performed between the two parties for the target point function, and the target point function outputs 1 only when the input is the target row index. With the help of the target point function shared by the two parties, the result slice of the one-hot vector under the two-party secret sharing that represents the output result of the target point function can be obtained, and then the result slice of the one-hot vector is used to perform local vector and matrix multiplication operations to obtain a slice corresponding to each row of elements at the target row index position in the database. This secure indexing method can meet the requirements of high efficiency in local computing, communication rounds and bandwidth, so that it can protect private data and have high efficiency.
[0055] Another method and device provided by the embodiments of this specification, for a specific scenario, each element in the database has a sub-index of each dimension in n dimensions, and a slice of the element at the target index position in the database needs to be obtained. In this scenario, index queries are performed on the current dimension in n dimensions in turn, and by flattening the elements of each unqueried dimension, a slice corresponding to a row of elements at the target row index position can be obtained using the method of the second aspect as an update query result, and then by changing the shape of the update query result to the size of each dimension, the update query result is continued as the current query result, and the index query of the next dimension can be continued, thereby gradually narrowing the query range. In the method of the second aspect, a three-party replicated secret sharing method is utilized, in which each party holds more than one secret shard of the private data, and any two parties have all the shards of the private data, so that secret sharing can be performed between the two parties for the target point function. The target point function outputs 1 only when the input is the target row index. With the help of the target point function secretly shared by the two parties, a one-hot vector representing the output result of the target point function can be obtained. The result shard under the two-party secret sharing can then be obtained. The result shard of the one-hot vector is then used to perform local vector and matrix multiplication operations to obtain a shard corresponding to each row of elements at the target row index position in the database. This secure indexing method can meet the requirements of high efficiency in local computing, communication rounds, and bandwidth, thereby being able to protect private data while being highly efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0057] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;
[0058] Figure 2 A flow chart of a secure indexing method for a database according to one embodiment is shown;
[0059] Figure 3 A flow chart of a security indexing method for a database according to another embodiment is shown;
[0060] Figure 4 A flow chart of a security indexing method for a database according to another embodiment is shown;
[0061] Figure 5 A schematic block diagram of a security indexing device for a database according to an embodiment is shown;
[0062] Figure 6 A schematic block diagram showing a security indexing device for a database according to another embodiment;
[0063] Figure 7 A schematic block diagram of a security indexing device for a database according to another embodiment is shown. DETAILED DESCRIPTION
[0064] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0065] Figure 1 The present invention is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification. The implementation scenario involves a security index for a database. The security index needs to protect private data from being leaked, and the private data includes each element in the database and the target index of the element to be queried. For example, there is a database D, and the goal of the security index is to obtain the secret sharing of the element D[x] at position x therein, wherein each element in D and x are in a secret sharing state, and x can be called the target index. In the embodiment of this specification, when there are three parties involved and the database and the target index are both replicated secret sharing (RSS), a security index for a database is efficiently implemented. Replicated secret sharing is a secret sharing method in which each participant holds more than one secret shard. As Figure 1As shown, the scenario of secure indexing of a database involves participants A, B, and C, or the first party, the second party, and the third party, or Party A, Party B, and Party C, or P0, P1, and P2. Each participant can be implemented as any device, platform, server, or device cluster with computing and processing capabilities. All parties should jointly obtain the elements to be queried corresponding to the target index while protecting data privacy.
[0066] In the embodiment of this specification, three computing parties P0, P1, and P2 are involved, the database D is split into three shards (D0, D1, and D2), and the target index x is also split into three shards (x0, x1, and x2). The database is split into three shards, that is, each element in the database is split into three shards. The database can be regarded as a vector composed of each element arranged in the order of the index, and the shards of the database can be regarded as a vector composed of each element shard arranged in the order of the index, satisfying P i Hold(D i ,D i+1 ) and (x i ,x i+1 ),as well as , .
[0067] In the embodiment of this specification, secure indexing for a database is implemented through secure multi-party computing. This solution is used for three parties, each of which has a P i Both have two shards of database D and two shards of target index x as input, represented as (D i ,D i+1 ) and (x i ,x i+1 ), the three parties want to calculate the query element corresponding to the target index together, and each party obtains two fragments of the query element, expressed as (D[x] i ,D[x] i+1 ) without leaking private data.
[0068] The embodiments of this specification propose corresponding solutions to improve the efficiency in security indexing of databases.
[0069] The embodiments of this specification can be used for security computing in various scenarios, such as security training and security prediction of machine learning models.
[0070] In another implementation scenario of the embodiment disclosed in this specification, the database has only one dimension, which has an index. The element to be queried corresponding to the target index can be queried through the security index without leaking private data. For example, the database D is (D[1], D[2], ..., D[n]) and the index x is (1, 2, ..., n). The database can be regarded as a vector composed of elements arranged in index order. For example, the index of element D[1] is 1, the index of element D[2] is 2, ..., the index of element D[n] is n, and there are n elements in the database, so the n elements constitute a vector with one row and n columns. If the target index x is 1, the queried element is D[1], and if the target index x is 2, the queried element is D[2].
[0071] Figure 2 A flowchart of a secure indexing method for a database according to an embodiment is shown. The method can be based on Figure 1 In the implementation scenario shown, each element in the database has a corresponding index, each element is distributed to the first party, the second party and the third party in a manner of replicating secret sharing, and the method is executed by the first party. Figure 2 As shown, the secure indexing method for the database in this embodiment includes the following steps: Step 21, obtaining the target index of the element to be queried in the index Boolean slice of the party; Step 22, through the first secure multi-party computation, the first secret sharing is performed with the second party for the target point function, and the index Boolean slice and the function slice under the first secret sharing are used to obtain the first result slice of the one-hot vector representing the output result of the target point function under the first secret sharing; the one-hot vector has a value of 1 only at the target index position, and all other positions are 0; Step 23, through the second secure multi-party computation, the second secret sharing is performed with the third party for the target point function, and the index Boolean slice and the function slice under the second secret sharing are used to obtain the second result slice of the one-hot vector under the second secret sharing; Step 24, the first result slice and the second result slice of the one-hot vector are used to perform dot products with the vectors composed of two slices of each element of the database held by the party, and a slice of the element at the target index position in the database is obtained according to the dot product result. The specific execution method of each of the above steps is described below.
[0072] First, in step 21, the target index of the element to be queried is obtained in the index Boolean slice of the local side. It can be understood that the index Boolean slice is a slice under the Boolean share of the target index.
[0073] In one example, obtaining the target index of the element to be queried in the local index Boolean fragmentation includes:
[0074] Obtain the index arithmetic shard of the target index in the local side;
[0075] Based on the index arithmetic sharding of the target index, a third secure multi-party computation is performed in conjunction with the second party and the third party to obtain the index Boolean sharding of the target index on the local party.
[0076] In this example, the index arithmetic shard is the shard under the arithmetic share of the target index. The third secure multi-party computation is a shard conversion operation, which converts the shard under the arithmetic share into the shard under the Boolean share.
[0077] For example, x A Represents the index arithmetic sharding. After the sharding conversion operation, we get x B , x B Represents a boolean shard of an index.
[0078] Then, in step 22, the first secret sharing is performed with the second party for the target point function through the first secure multi-party computation, and the first result slice under the first secret sharing of the one-hot vector representing the output result of the target point function is obtained by using the index Boolean slice and the function slice under the first secret sharing; the one-hot vector has a value of 1 only at the target index position, and all other positions are 0. It can be understood that the target point function is shared between the first party and the second party, and the one-hot vector is also shared between the first party and the second party.
[0079] The embodiment of this specification utilizes the function secret sharing (FSS) technology to share the function f, so that multiple participants can calculate the secret sharing of f(x) without knowing the information of f. The target point function performs the first secret sharing, which belongs to the distributed point function (DPF), which is a special form of FSS, specifically referring to the case where the secret sharing function is a point function, that is, f(x) is 1 only when the input is the target index, and the results are 0 for other inputs.
[0080] In one example, the first secure multi-party computation includes:
[0081] Obtaining a first party key jointly generated with the second party as a function shard;
[0082] For the first own key and the Boolean shard in the index Boolean shard that the own party holds but the second party does not hold, local calculation is performed to obtain the first result shard; or, for the first own key and the two Boolean shards included in the index Boolean shard, local calculation is performed to obtain the first result shard.
[0083] In this example, based on the function shard held by the party, a shard of the one-hot vector can be obtained through local calculation, and the second party can obtain another shard of the one-hot vector in a similar manner. The one-hot vector is shared secretly between the first party and the second party.
[0084] For example, suppose p i-1 and p i The target point function between is dpf i , then p i-1 enter , p i enter , or, p i-1 enter , p i enter , the two slices of the generated one-hot vector are p i-1 hold , p i hold Among them, the superscript B represents Boolean sharding, and the superscript A represents arithmetic sharding.
[0085] Then, in step 23, a second secret sharing is performed with the third party for the target point function through a second secure multi-party computation, and the index Boolean sharding and the function sharding under the second secret sharing are used to obtain a second result sharding of the one-hot vector under the second secret sharing. It can be understood that the target point function is shared between the first party and the third party through two-party secret sharing, and the one-hot vector is also shared between the first party and the third party through two-party secret sharing.
[0086] In the embodiment of this specification, the target point function needs to perform three sets of two-party secret sharing, namely, between the first party and the second party, between the first party and the third party, and between the second party and the third party. Correspondingly, the one-hot vector also needs to perform three sets of two-party secret sharing.
[0087] In one example, the second secure multi-party computation includes:
[0088] Obtaining a second local key jointly generated with the third party as a function shard;
[0089] For the second own key and the Boolean shard in the index Boolean shard that the own party holds but the third party does not hold, local calculation is performed to obtain the second result shard; or, for the second own key and the two Boolean shards contained in the index Boolean shard, local calculation is performed to obtain the second result shard.
[0090] In this example, based on the function shard held by the first party, a shard of the one-hot vector can be obtained through local calculation. The third party can obtain another shard of the one-hot vector in a similar manner. The one-hot vector is shared secretly between the first party and the third party.
[0091] In one example, the first result shard is an arithmetic shard, and the first secure multi-party computation includes a Boolean to arithmetic conversion operation; the second result shard is an arithmetic shard, and the second secure multi-party computation includes a Boolean to arithmetic conversion operation.
[0092] Finally, in step 24, the first result slice and the second result slice of the one-hot vector are used to perform dot products with the vectors composed of two slices of each element of the database held by the party, and a slice of the element at the target index position in the database is obtained according to the dot product result. It can be understood that the slice is a slice of the three-party secret sharing of the element, and each party has one slice of the three slices. If it is desired to be converted into a form of replicated secret sharing, that is, each party has two slices of the three slices, then the slices need to be exchanged between the parties.
[0093] In the present embodiment of the specification, the above dot product process is a local calculation. For example, p i Local Computing , thus obtaining a slice of the element at the target index position. and are two slices of the one-hot vector, and are two shards of the database. It is understandable that the one-hot vector is a secret shared by two parties, but and It is not a set of shards. The two cannot recover the one-hot vector. The database is a three-party secret sharing. and It is also impossible to recover individual elements of the database.
[0094] In one example, the method further includes:
[0095] receiving another shard of the element at the target index position from the second party, so that the party holds two shards of the three-party secret sharing of the element;
[0096] A fragment of the element at the target index position is sent to the third party, so that the third party holds two fragments of the three-party secret sharing of the element.
[0097] In this example, by exchanging shards between the parties, each party can have two of the three shards, for example, p i Get two slices of the element at the target index position .
[0098] The embodiments of this specification may provide a corresponding simplified processing method when acquiring multiple elements with consecutive indexes in a database, thereby further improving efficiency.
[0099] In one example, the method further includes:
[0100] When it is necessary to obtain a target number of consecutive elements in the database with the target index as the starting index, based on the first result slice, a circular shift operation is performed to shift by 1 to the target number, so as to obtain a first shifted slice after the one-hot vector is shifted;
[0101] Based on the second result slices, a circular shift operation is performed to shift the slices by 1 to the target number, so as to obtain second shifted slices after the one-hot vector is shifted;
[0102] The first shifted slice and the second shifted slice after the one-hot vector is shifted are used to perform dot products with vectors consisting of two slices of each element of the database held by the party, and a slice of the element at the shift position after the target index position in the database is obtained according to the dot product result.
[0103] In this example, the shift process can simplify the processing of each element after the target index. For example, the target index is x, the target data is s, and the result is a vector with the element at the target index position as the starting point and a length of s, that is, When querying the elements When The one-hot vector in the process is circularly shifted right by jx positions and used as the one-hot vector when querying the element for subsequent calculations.
[0104] The embodiments of this specification only use the first party as an example to introduce the processing of the security index. In fact, the status of each party in the security index process is equal, and the processing of the second and third parties is similar to that of the first party. In order to have a comprehensive understanding of the entire processing process, the following examples are given to illustrate.
[0105] For example, the three shards of database D are (D0, D1, D2), and the one-hot vectors are shared by three groups of two-party secrets. The one-hot vectors of each group of secret sharing are recorded as e0, e1, and e2, respectively, e0=e1=e2; party p0 owns the shard (D0, D1) of the database, party p1 owns the shard (D1, D2) of the database, and party p2 owns the shard (D2, D0) of the database; party p0 owns the shard (e 01 ,e 10 ), p1 has a slice with one-hot vectors (e11 ,e 20 ), p2 has a slice with one-hot vectors (e 21 ,e 00 ); The local dot product operation on the p0 square obtains a slice of the element (D0e 01 + D1e 10 ), the local dot product operation of square p1 obtains a slice of the element (D1e 11 +D2e 20 ), the p2 square local dot product operation obtains a slice of the element (D2e 21 + D0e 00 ), it can be verified that (D0e 01 +D1e 10 )+(D1e 11 +D2e 20 )+(D2e 21 + D0e 00 )=De=D[x].
[0106] Through the method provided in the embodiments of this specification, a three-party replication secret sharing method is utilized, in which each party holds more than one secret shard of the private data, and any two parties have all the shards of the private data, so that secret sharing can be performed between the two parties for the target point function. The target point function outputs 1 only when the input is the target index. With the help of the target point function secretly shared by the two parties, a one-hot vector representing the output result of the target point function can be obtained. The result shard of the two-party secret sharing can then be used to perform a local dot product operation to obtain a shard of the element at the target index position. This secure indexing method can meet the high efficiency requirements in terms of local computing, number of communication rounds and bandwidth, so that it can protect private data while being highly efficient.
[0107] In another implementation scenario of the embodiment disclosed in this specification, the database has two dimensions, and the two dimensions correspond to the rows and columns of the matrix respectively, so that each element in the database can be formed into a matrix, each element has a corresponding row index and column index, and a row of elements corresponding to the target row index can be queried through the security index without leaking private data. For example, the database D is , the row index x is , the database can be regarded as a matrix composed of elements arranged in the order of row index and column index. For example, the row index of element D[1,1] is 1 and the column index is 1, the row index of element D[2,1] is 2 and the column index is 1, ..., the row index of element D[n,1] is n and the column index is 1. There are n rows and m columns of elements in the database, so n×m elements constitute a matrix. If the target row index x is 1, the queried element is a row of elements from D[1,1] to D[1,m]. If the target row index x is 2, the queried element is a row of elements from D[2,1] to D[2,m].
[0108] Figure 3 A flowchart of a security indexing method for a database according to another embodiment is shown. The method can be based on Figure 1 In the implementation scenario shown, each element in the database forms a matrix, each element is distributed to the first party, the second party and the third party in a manner of replicating secret sharing, and the method is executed by the first party. Figure 3 As shown, the security index method for a database in this embodiment includes the following steps:
[0109] First, in step 31, the target row index of the element to be queried is obtained in the index Boolean fragment of the local side. It can be understood that in this scenario, a row of elements needs to be obtained, so there is no restriction on the column index of the element to be queried.
[0110] Then in step 32, through the first secure multi-party computation, the first secret sharing is performed with the second party for the target point function, and the first result slice under the first secret sharing of the one-hot vector representing the output result of the target point function is obtained by using the index Boolean slice and the function slice under the first secret sharing; the one-hot vector has a value of 1 only at the target row index position, and all other positions are 0. It can be understood that the dimension of the one-hot vector is 1×n, that is, the number of its elements is equal to the number of rows of the aforementioned matrix.
[0111] Then, in step 33, a second secret sharing is performed with the third party for the target point function through a second secure multi-party computation, and the index Boolean sharding and the function sharding under the second secret sharing are used to obtain the second result sharding of the one-hot vector under the second secret sharing. It can be understood that although the first result sharding and the second result sharding are both shardings of the one-hot vector, they belong to different secret sharings, so the one-hot vector cannot be restored by the two.
[0112] Finally, in step 34, the first result slice and the second result slice of the one-hot vector are used to perform matrix multiplication with the matrices formed by the two slices of each element of the database held by the party, and a slice corresponding to each row of elements at the target row index position in the database is obtained according to the multiplication result. It can be understood that the above matrix multiplication is a local operation.
[0113] Among them, the above embodiments and Figure 2 The illustrated embodiment is based on the same inventive concept and can be used in natural language processing tasks to perform an embedding operation of taking a vector of size (1, m) from the position of the row index x of a matrix of size (n, m), that is, obtaining a row of elements of the matrix and performing an index query on each column of the matrix.
[0114] Through the method provided in the embodiment of this specification, for a specific scenario, each element in the database forms a matrix, and it is necessary to obtain a slice corresponding to each row of elements at the target row index position in the database. In this scenario, a three-party replication secret sharing method is used, in which each party holds more than one secret slice of private data, and any two parties have all slices of private data, so that secret sharing can be performed between the two parties for the target point function. The target point function outputs 1 only when the input is the target row index. With the help of the target point function shared by the two parties, the result slice of the one-hot vector under the two-party secret sharing that represents the output result of the target point function can be obtained, and then the result slice of the one-hot vector is used to perform local vector and matrix multiplication operations to obtain a slice corresponding to each row of elements at the target row index position in the database. This secure indexing method can meet the requirements of high efficiency in local computing, communication rounds and bandwidth, so that it can protect private data and have high efficiency.
[0115] In another implementation scenario of the embodiment disclosed in this specification, the database has n dimensions, and each element in the database has a sub-index of each dimension in the n dimensions. Through the security index, an element that satisfies the sub-index of each dimension included in the target index can be queried without leaking private data. For example, database D is , index x is , the sub-indexes of each dimension are recorded as x0,...,x n , the sizes of each dimension are recorded as d0,...,d n It can be understood that the dimension size corresponds to the range of the sub-index of the dimension, for example, the range of x0 is 1 to d0, ..., x n The range is 1 to d n, to find elements that satisfy the target index, is to find elements that satisfy the sub-indexes of each dimension included in the target index. For example, the value of n is 5, the range of x0 is 1 to 10, the range of x1 is 1 to 5, the range of x2 is 1 to 5, the range of x3 is 1 to 6, and the range of x4 is 1 to 8. The sub-indexes of each dimension included in the target index are x0=3, x1=2, x2=4, x3=1, and x4=5. The queried elements need to match the sub-indexes of each dimension included in the target index. The query processing can be performed on the current dimension of the n dimensions in turn, and the query range can be gradually narrowed until the query result is an element. First, query the database for each element that satisfies x0=3 to obtain the current query result, and then query each element that satisfies x1=2 from the current query result to obtain the update query result, and then query each element that satisfies x2=4 from the update query result, and so on.
[0116] Figure 4 A flowchart of a security indexing method for a database according to another embodiment is shown. The method can be based on Figure 1 In the implementation scenario shown, each element in the database has a sub-index of each dimension in n dimensions, each element is distributed to the first party, the second party and the third party in a manner of replicating secret sharing, and the method is executed by the first party. Figure 4 As shown, the security index method for a database in this embodiment includes the following steps:
[0117] First, in step 41, for the current dimension among the n dimensions, if the number of unqueried dimensions in the current query result obtained in the previous dimension is greater than or equal to 2, the elements of each unqueried dimension are tiled, the current query result is converted into a matrix, and the target sub-index of the current dimension in the target index to be queried is used as the target row index. It can be understood that the above tiling process can be regarded as merging each unqueried dimension into a merged dimension, the current dimension corresponds to the row of the matrix, and the merged dimension corresponds to the column of the matrix.
[0118] Then in step 42, execute Figure 3 The method is used to obtain a slice corresponding to each row element of the target row index position as the update query result. It can be understood that after the current query result is converted into a matrix, it can be used Figure 3 The query is performed using the method of , and the updated query result narrows the range of elements included compared to the current query result obtained in the previous dimension.
[0119] Finally, in step 43, the shape of the update query result is changed to the size of each dimension, and the update query result is continued to be used as the current query result to query several elements of the target sub-index of the current dimension included in the target index until the result obtained is an element. It can be understood that the specific form of the update query result is a row of elements, and the shape of the update query result is changed to the size of each dimension, so as to facilitate subsequent queries for each dimension.
[0120] Through the method provided in the embodiment of this specification, for a specific scenario, each element in the database has a sub-index of each dimension in n dimensions, and a slice of the element at the target index position in the database needs to be obtained. In this scenario, index queries are performed on the current dimension in n dimensions in turn, and by flattening the elements of each unqueried dimension, a slice corresponding to a row of elements at the target row index position can be obtained using the method of the second aspect as an update query result, and then by changing the shape of the update query result to the size of each dimension, the update query result is continued as the current query result, and the index query of the next dimension can be continued, thereby gradually narrowing the query range. In the method of the second aspect, a three-party replicated secret sharing method is utilized, in which each party holds more than one secret shard of the private data, and any two parties have all the shards of the private data, so that secret sharing can be performed between the two parties for the target point function. The target point function outputs 1 only when the input is the target row index. With the help of the target point function secretly shared by the two parties, a one-hot vector representing the output result of the target point function can be obtained. The result shard under the two-party secret sharing can then be obtained. The result shard of the one-hot vector is then used to perform local vector and matrix multiplication operations to obtain a shard corresponding to each row of elements at the target row index position in the database. This secure indexing method can meet the requirements of high efficiency in local computing, communication rounds, and bandwidth, thereby being able to protect private data while being highly efficient.
[0121] The embodiments of this specification take three-party secret sharing as an example for explanation. In fact, it can be extended to a wider range of scenarios. Assume that the number of participants is p, and p>2, and the i-th party p i Holds two shards of database D (D i ,D i+1 ) and two shards of the target index x (x i ,x i+1), if the slices held by the two adjacent parties cannot construct x, they only need to exchange slices between the parties so that the slices held by the two adjacent parties can construct x, and the solution provided by the embodiments of this specification can be reused. The target point function is secretly shared between the two parties, and the target point function outputs 1 only when the input is the target index. With the help of the target point function secretly shared by the two parties, the result slice of the one-hot vector under the secret sharing of the two parties that represents the output result of the target point function can be obtained, and then the result slice of the one-hot vector is used to perform a local dot product operation to obtain a slice of the element at the target index position. This secure indexing method can meet the requirements of high efficiency in local computing, communication rounds and bandwidth, so that it can protect privacy data and have high efficiency.
[0122] According to another embodiment, a security index device for a database is also provided, the device is used to execute the Figure 2 In the method provided by the illustrated embodiment, each element in the database has a corresponding index, each element is distributed to the first party, the second party and the third party in a manner of replicating secret sharing, and the device is arranged on the first party. Figure 5 FIG. 1 is a schematic block diagram of a security indexing device for a database according to an embodiment. Figure 5 As shown, the device 500 includes:
[0123] An acquisition unit 51 is used to acquire the index Boolean fragment of the target index of the element to be queried in the local side;
[0124] A first secure computing unit 52 is configured to perform a first secret sharing with the second party for the target point function through a first secure multi-party computing, and obtain a first result slice of a one-hot vector representing an output result of the target point function under the first secret sharing by using the index Boolean slice obtained by the obtaining unit 51 and the function slice under the first secret sharing; the one-hot vector has a value of 1 only at the target index position, and all other positions are 0;
[0125] A second secure computing unit 53 is configured to perform a second secret sharing with the third party for the target point function through a second secure multi-party computing, and obtain a second result slice of the one-hot vector under the second secret sharing by using the index Boolean slice obtained by the obtaining unit 51 and the function slice under the second secret sharing;
[0126] The local dot product unit 54 is used to use the first result slice of the one-hot vector obtained by the first security calculation unit 52 and the second result slice obtained by the second security calculation unit 53 to perform dot products with vectors consisting of two slices of each element of the database held by the local party, and obtain a slice of the element at the target index position in the database according to the dot product result.
[0127] Optionally, as an embodiment, the device further includes:
[0128] a receiving unit, configured to receive another fragment of the element at the target index position from the second party, so that the party holds two fragments of the three-party secret sharing of the element;
[0129] The sending unit is used to send a fragment of the element at the target index position to the third party, so that the third party holds two fragments of the three-party secret sharing of the element.
[0130] Optionally, as an embodiment, the acquiring unit 51 includes:
[0131] A first acquisition subunit is used to acquire the index arithmetic fragmentation of the target index in the local side;
[0132] The conversion subunit is used to perform a third secure multi-party computation jointly with the second party and the third party based on the index arithmetic sharding of the target index obtained by the first obtaining subunit, so as to obtain the index Boolean sharding of the target index on the local side.
[0133] Optionally, as an embodiment, the first security computing unit 52 includes:
[0134] A second acquisition subunit, used for acquiring a first local key jointly generated with the second party as a function shard;
[0135] The first calculation subunit is used to perform local calculation on the first own key obtained by the second acquisition subunit and the Boolean shard in the index Boolean shard that is held by the own party but not by the second party, to obtain the first result shard; or, to perform local calculation on the first own key and the two Boolean shards contained in the index Boolean shard to obtain the first result shard.
[0136] Optionally, as an embodiment, the second security computing unit 53 includes:
[0137] A third acquisition subunit is used to obtain a second local key jointly generated with the third party as a function shard;
[0138] The second calculation subunit is used to perform local calculation on the second own key obtained by the third acquisition subunit and the Boolean shard in the index Boolean shard that is held by the own party but not held by the third party, to obtain the second result shard; or, to perform local calculation on the second own key and the two Boolean shards contained in the index Boolean shard to obtain the second result shard.
[0139] Optionally, as an embodiment, the first result shard is an arithmetic shard, and the first secure multi-party computation includes a Boolean to arithmetic conversion operation; the second result shard is an arithmetic shard, and the second secure multi-party computation includes a Boolean to arithmetic conversion operation.
[0140] Optionally, as an embodiment, the device further includes:
[0141] A first shift unit is used for, when it is necessary to obtain a continuous target number of elements in the database with the target index as the starting index, performing a circular shift operation of shifting by 1 to the target number based on the first result slice, to obtain a first shifted slice after the one-hot vector is shifted;
[0142] A second shift unit is used to perform a circular shift operation of shifting by 1 to the target number based on the second result slices, so as to obtain second shifted slices after the one-hot vector is shifted;
[0143] The local dot product unit 54 is also used to use the first shifted slice after the one-hot vector shift obtained by the first shift unit and the second shifted slice obtained by the second shift unit to perform dot products with vectors composed of two slices of each element of the database held by the local party, and obtain a slice of the element at the shift position after the target index position in the database according to the dot product result.
[0144] According to another embodiment, a security index device for a database is also provided, the device is used to execute the Figure 3 In the method provided by the illustrated embodiment, each element in the database forms a matrix, each element is distributed to the first party, the second party and the third party in a manner of replicating secret sharing, and the device is arranged on the first party. Figure 6 FIG. 2 is a schematic block diagram of a security indexing device for a database according to another embodiment. Figure 6 As shown, the device 600 includes:
[0145] An acquisition unit 61 is used to acquire the index Boolean fragment of the target row index of the element to be queried on the local side;
[0146] A first secure computing unit 62 is configured to perform a first secret sharing with the second party for the target point function through a first secure multi-party computing, and obtain a first result slice of a one-hot vector representing an output result of the target point function under the first secret sharing by using the index Boolean slice obtained by the obtaining unit 61 and the function slice under the first secret sharing; the one-hot vector has a value of 1 only at the target row index position, and all other positions are 0;
[0147] A second secure computing unit 63 is configured to perform a second secret sharing with the third party for the target point function through a second secure multi-party computing, and obtain a second result slice of the one-hot vector under the second secret sharing by using the index Boolean slice obtained by the obtaining unit 61 and the function slice under the second secret sharing;
[0148] The local multiplication unit 64 is used to use the first result slice of the one-hot vector obtained by the first security calculation unit 62 and the second result slice obtained by the second security calculation unit 63 to perform matrix multiplication with the matrix consisting of two slices of each element of the database held by the local party, and obtain a slice corresponding to each row of elements at the target row index position in the database according to the multiplication result.
[0149] According to another embodiment, a security index device for a database is also provided, the device is used to execute the Figure 4 In the method provided by the illustrated embodiment, each element in the database has a sub-index of each dimension in n dimensions, each element is distributed to the first party, the second party and the third party in a manner of replicated secret sharing, and the device is arranged on the first party. Figure 7 FIG. 2 is a schematic block diagram of a security indexing device for a database according to another embodiment. Figure 7 As shown, the device 700 includes:
[0150] A tiling processing unit 71 is used to perform tiling processing on the elements of each unqueried dimension in turn for the current dimension among the n dimensions, if the number of unqueried dimensions in the current query result obtained in the previous dimension is greater than or equal to 2, convert the current query result into a matrix, and use the target sub-index of the current dimension in the target index to be queried as the target row index;
[0151] The calling unit 72 is used to call Figure 6 The device obtains a shard corresponding to each row element at the target row index position as an update query result;
[0152] The shape changing unit 73 is used to change the shape of the updated query result obtained by the calling unit 72 to the size of each dimension, continue to use the updated query result as the current query result, and query several elements of the target sub-index of the current dimension included in the target index until the result obtained is one element.
[0153] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 , Figure 3 , Figure 4 Any of the methods described.
[0154] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 , Figure 3 , Figure 4 Any of the methods described.
[0155] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0156] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A secure indexing method for a database, wherein each element in the database has a corresponding index, and each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, and the method is performed by the first party, comprising: Get the target index of the element to be queried in the index Boolean slice of this side; Through a first secure multi-party computation, a first secret sharing is performed with the second party for the target point function, and a first result shard of a unique hot vector representing an output result of the target point function under the first secret sharing is obtained by using the index Boolean sharding and the function sharding under the first secret sharing; The one-hot vector has a value of 1 only at the target index position and 0 at other positions; Performing a second secret sharing with the third party for the target point function through a second secure multi-party computation, and obtaining a second result sharding of the one-hot vector under the second secret sharing by using the index Boolean sharding and the function sharding under the second secret sharing; Using the first result slice and the second result slice of the one-hot vector, dot products are performed with the vectors consisting of two slices of each element of the database held by the party, and a slice of the element at the target index position in the database is obtained according to the dot product result; Wherein, the first secure multi-party computation includes: Obtaining a first party key jointly generated with the second party as a function shard; For the first own key and the Boolean shard held by the own party but not held by the second party in the index Boolean shard, local calculation is performed to obtain the first result shard; or, for the first own key and the two Boolean shards included in the index Boolean shard, local calculation is performed to obtain the first result shard; Wherein, the second secure multi-party computation includes: Obtaining a second local key jointly generated with the third party as a function shard; For the second own key and the Boolean shard in the index Boolean shard that the own party holds but the third party does not hold, local calculation is performed to obtain the second result shard; or, for the second own key and the two Boolean shards contained in the index Boolean shard, local calculation is performed to obtain the second result shard.
2. The method of claim 1, wherein: The method further comprises: receiving another shard of the element at the target index position from the second party, so that the party holds two shards of the three-party secret sharing of the element; A fragment of the element at the target index position is sent to the third party, so that the third party holds two fragments of the three-party secret sharing of the element.
3. The method of claim 1, wherein: The step of obtaining the target index of the element to be queried in the index Boolean fragment of the local party includes: Obtain the index arithmetic shard of the target index in the local side; Based on the index arithmetic sharding of the target index, a third secure multi-party computation is performed in conjunction with the second party and the third party to obtain the index Boolean sharding of the target index on the local party.
4. The method of claim 1, wherein: The first result shard is an arithmetic shard, and the first secure multi-party computation includes a Boolean to arithmetic conversion operation; the second result shard is an arithmetic shard, and the second secure multi-party computation includes a Boolean to arithmetic conversion operation.
5. The method of claim 1, wherein: The method further comprises: When it is necessary to obtain a target number of consecutive elements in the database with the target index as the starting index, based on the first result slice, a circular shift operation is performed to shift by 1 to the target number, so as to obtain a first shifted slice after the one-hot vector is shifted; Based on the second result slices, a circular shift operation is performed to shift the slices by 1 to the target number, so as to obtain second shifted slices after the one-hot vector is shifted; The first shifted slice and the second shifted slice after the one-hot vector is shifted are used to perform dot products with vectors consisting of two slices of each element of the database held by the party, and a slice of the element at the shifted position after the target index position in the database is obtained according to the dot product result.
6. A security indexing method for a database, wherein each element in the database forms a matrix, each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, the method being performed by the first party, comprising: Get the target row index of the element to be queried in the index Boolean fragment of this side; Through a first secure multi-party computation, a first secret sharing is performed with the second party for the target point function, and a first result shard of a unique hot vector representing an output result of the target point function under the first secret sharing is obtained by using the index Boolean sharding and the function sharding under the first secret sharing; The one-hot vector has a value of 1 only at the target row index position and 0 at other positions; Performing a second secret sharing with the third party for the target point function through a second secure multi-party computation, and obtaining a second result sharding of the one-hot vector under the second secret sharing by using the index Boolean sharding and the function sharding under the second secret sharing; Using the first result slice and the second result slice of the one-hot vector, perform matrix multiplication with matrices formed by two slices of each element of the database held by the party, and obtain a slice corresponding to each row of elements at the target row index position in the database according to the multiplication result; Wherein, the first secure multi-party computation includes: Obtaining a first party key jointly generated with the second party as a function shard; For the first own key and the Boolean shard held by the own party but not held by the second party in the index Boolean shard, local calculation is performed to obtain the first result shard; or, for the first own key and the two Boolean shards included in the index Boolean shard, local calculation is performed to obtain the first result shard; Wherein, the second secure multi-party computation includes: Obtaining a second local key jointly generated with the third party as a function shard; For the second own key and the Boolean shard in the index Boolean shard that the own party holds but the third party does not hold, local calculation is performed to obtain the second result shard; or, for the second own key and the two Boolean shards contained in the index Boolean shard, local calculation is performed to obtain the second result shard.
7. A secure indexing method for a database, wherein each element in the database has a sub-index of each dimension in n dimensions, each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, the method being performed by the first party, comprising: For the current dimension among the n dimensions, if the number of unqueried dimensions in the current query result obtained in the previous dimension is greater than or equal to 2, the elements of each unqueried dimension are flattened, the current query result is converted into a matrix, and the target sub-index of the current dimension in the target index to be queried is used as the target row index; Execute the method of claim 6 to obtain a shard corresponding to each row element at the target row index position as an update query result; The shape of the updated query result is changed to the size of each dimension, and the updated query result is continued to be used as the current query result to query several elements of the target sub-index of the current dimension included in the target index until the result obtained is one element.
8. A secure indexing device for a database, wherein each element in the database has a corresponding index, and each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, wherein the device is disposed on the first party, and comprises: An acquisition unit, used for acquiring the target index of the element to be queried in the index Boolean fragment of the local side; A first secure computing unit, configured to perform a first secret sharing with the second party on a target point function through a first secure multi-party computing, and obtain a first result slice of a unique hot vector representing an output result of the target point function under the first secret sharing by using the index Boolean slice obtained by the obtaining unit and the function slice under the first secret sharing; The one-hot vector has a value of 1 only at the target index position and 0 at other positions; A second secure computing unit is configured to perform a second secret sharing with the third party for the target point function through a second secure multi-party computing, and obtain a second result slice of the one-hot vector under the second secret sharing by using the index Boolean slice obtained by the obtaining unit and the function slice under the second secret sharing; A local dot product unit is used to perform dot products with the first result slice of the one-hot vector obtained by the first security calculation unit and the second result slice obtained by the second security calculation unit, respectively, and the vectors consisting of two slices of each element of the database held by the local party, and obtain a slice of the element at the target index position in the database according to the dot product result; Wherein, the first secure multi-party computation includes: Obtaining a first party key jointly generated with the second party as a function shard; For the first own key and the Boolean shard held by the own party but not held by the second party in the index Boolean shard, local calculation is performed to obtain the first result shard; or, for the first own key and the two Boolean shards included in the index Boolean shard, local calculation is performed to obtain the first result shard; Wherein, the second secure multi-party computation includes: Obtaining a second local key jointly generated with the third party as a function shard; For the second own key and the Boolean shard in the index Boolean shard that the own party holds but the third party does not hold, local calculation is performed to obtain the second result shard; or, for the second own key and the two Boolean shards contained in the index Boolean shard, local calculation is performed to obtain the second result shard.
9. A security indexing device for a database, wherein each element in the database forms a matrix, each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, the device being disposed on the first party, comprising: An acquisition unit, used to acquire the target row index of the element to be queried in the index Boolean fragment of the local side; A first secure computing unit, configured to perform a first secret sharing with the second party on a target point function through a first secure multi-party computing, and obtain a first result slice of a unique hot vector representing an output result of the target point function under the first secret sharing by using the index Boolean slice obtained by the obtaining unit and the function slice under the first secret sharing; The one-hot vector has a value of 1 only at the target row index position and 0 at other positions; A second secure computing unit is configured to perform a second secret sharing with the third party for the target point function through a second secure multi-party computing, and obtain a second result slice of the one-hot vector under the second secret sharing by using the index Boolean slice obtained by the obtaining unit and the function slice under the second secret sharing; A local multiplication unit, configured to perform matrix multiplications respectively on matrices consisting of two slices of each element of the database held by the local party using the first result slice of the one-hot vector obtained by the first security calculation unit and the second result slice obtained by the second security calculation unit, and obtain a slice corresponding to each row of elements at the target row index position in the database according to the multiplication result; Wherein, the first secure multi-party computation includes: Obtaining a first party key jointly generated with the second party as a function shard; For the first own key and the Boolean shard held by the own party but not held by the second party in the index Boolean shard, local calculation is performed to obtain the first result shard; or, for the first own key and the two Boolean shards included in the index Boolean shard, local calculation is performed to obtain the first result shard; Wherein, the second secure multi-party computation includes: Obtaining a second local key jointly generated with the third party as a function shard; For the second own key and the Boolean shard in the index Boolean shard that the own party holds but the third party does not hold, local calculation is performed to obtain the second result shard; or, for the second own key and the two Boolean shards contained in the index Boolean shard, local calculation is performed to obtain the second result shard.
10. A security indexing device for a database, wherein each element in the database has a sub-index of each dimension in n dimensions, each element is distributed to a first party, a second party, and a third party in a manner of replicating secret sharing, the device being disposed on the first party, comprising: A tiling processing unit is used to perform tiling processing on the elements of each unqueried dimension in turn for the current dimension among the n dimensions, if the number of unqueried dimensions in the current query result obtained by the previous dimension is greater than or equal to 2, convert the current query result into a matrix, and use the target sub-index of the current dimension in the target index to be queried as the target row index; A calling unit, used to call the apparatus of claim 9 to obtain a shard corresponding to each row element at the target row index position as an update query result; A shape changing unit is used to change the shape of the updated query result obtained by the calling unit to the size of each dimension, continue to use the updated query result as the current query result, and query several elements of the target sub-index of the current dimension included in the target index until the result obtained is one element.
11. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 7.
12. A computing device comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 7 is implemented.
