Data processing method and device for two-party joint
By moving the matrix-vector multiplication operation of homomorphic encryption to the offline stage, the problems of large online computation and communication volume are solved, achieving efficient data processing and ensuring data privacy and security.
Patent Information
- Application Number
- CN202310240217.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-13
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-03-13
AI Technical Summary
Existing matrix-vector multiplication methods based on homomorphic encryption have limited performance in online computation, with high computational and communication costs, making them difficult to meet the needs of practical applications.
The matrix-vector multiplication operation based on homomorphic encryption is moved to the offline stage. Secure matrix multiplication and truncation are performed in the offline stage to generate offline results, and simple calculations are performed in the online stage to obtain the final result.
This significantly reduces the computational and communication load during the online phase, while ensuring the data privacy and security of all parties.
Smart Images

Figure CN116318613B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of data security processing technology, and in particular, to a two-party joint data processing method and device. Background Art
[0002] Secure Multi-Party Computation (MPC), also known as multi-party secure computation, involves multiple parties working together to compute the result of a function without disclosing the input data of each party. The result is publicly available to one or more of the parties involved. The underlying technologies behind MPC include homomorphic encryption (HE) and secret sharing (SS).
[0003] Matrix-vector multiplication is a common computation, such as logistic regression modeling and inference in machine learning. HE-based matrix-vector multiplication can protect the privacy information of each participant.
[0004] However, the current HE-based matrix-vector multiplication method has limited performance, so a solution is needed that can better meet practical application requirements, such as reducing online computing and communication volume. Summary of the Invention
[0005] The embodiments of this specification describe a two-party joint data processing method and device, which can effectively reduce the amount of online computing and communication.
[0006] According to a first aspect, a two-party joint data processing method is provided, which is executed by the second party, including: obtaining a second vector slice of a target vector involved in an online business under secret sharing, and the corresponding first vector slice is held by the first party; reading a second multiplied slice determined in an offline stage as the second target slice of this operation; the second multiplied slice is a slice of the local party of a secure matrix multiplication operation of a random vector generated by the local party and a target matrix held by the first party, and the corresponding first multiplied slice is held by the first party; based on the second vector slice and the random vector, a third vector slice is determined; and the third vector slice is sent to the first party, so that the first party determines the first target slice of the product result of the target vector and the target matrix based on the first vector slice, the third vector slice, the target matrix and the first multiplied slice.
[0007] In one embodiment, determining the first vector slice and the second vector slice of the target vector under secret sharing includes: determining a zero vector as the first vector slice; and determining the target vector as the second vector slice.
[0008] In one embodiment, the determining of the second product share comprises: performing the secure matrix multiplication operation with the first party to obtain a second product share; performing a secure truncation protocol with the first party based on the second product share to obtain an updated second product share.
[0009] According to a second aspect, there is provided a two-party joint data processing method, performed by a first party, comprising: obtaining a first vector share of a target vector involved in an online service under a secret sharing, a corresponding second vector share being held by a second party; receiving a third vector share from the second party, the third vector share being determined based on the second vector share and a random vector generated by the second party; reading a first product share determined in an offline stage, the first product share being a first-party share of a secure matrix multiplication operation of a target matrix held by the first party and the random vector, a corresponding second product share being held by the second party, the second product share being read by the second party as a second target share for the current operation; and determining a first target share of a product result of the target vector and the target matrix based on the first vector share, the third vector share, the target matrix, and the first product share.
[0010] In one embodiment, the determining of the first product share comprises: performing the secure matrix multiplication operation with the second party to obtain a first product share; and performing a secure truncation protocol with the second party to obtain an updated first product share, the secure truncation protocol having as inputs the two product shares generated by the secure matrix multiplication operation.
[0011] In one embodiment, the determining of the first target share of the product result of the target vector and the target matrix comprises: obtaining a first calculation result based on the first vector share, the third vector share, and the target matrix; performing a truncation operation on the first calculation result to obtain a first truncated result; and determining the first target share based on the first truncated result and the first product share.
[0012] According to a third aspect, there is provided a two-party joint data processing method, performed by a second party, comprising: obtaining a target vector involved in an online service; reading a second product share determined in an offline stage as a second target share for the current operation, the second product share being a first-party share of a secure matrix multiplication operation of a random vector generated by the first party and a target matrix held by a first party, a corresponding first product share being held by the first party; determining an intermediate vector based on the target vector and the random vector; and sending the intermediate vector to the first party to enable the first party to determine a first target share of a product result of the target vector and the target matrix based on the intermediate vector, the target matrix, and the first product share.
[0013] According to a fourth aspect, there is provided a two-party joint data processing method, executed by a first party, comprising: receiving an intermediate vector from a second party; the intermediate vector being determined based on a target vector acquired by the second party online and a random vector generated by the second party; reading a first product share determined in an offline phase, which is a first-party share of a secure matrix multiplication operation of a target matrix held by the first party and a random vector generated by the second party, a corresponding second product share being held by the second party; the second product share being read by the second party as a second target share for the current operation; determining a first target share of a product result of the target vector and the target matrix based on the first intermediate vector, the target matrix and the first product share.
[0014] According to a fifth aspect, there is provided a two-party joint data processing apparatus, integrated in a second party, comprising: a share obtaining module configured to obtain a second vector share of a target vector involved in an online service under secret sharing, a corresponding first vector share being held by a first party; a share reading module configured to read a second product share determined in an offline phase as a second target share for the current operation; the second product share being a first-party share of a secure matrix multiplication operation of a random vector generated by the first party and a target matrix held by the first party, a corresponding first product share being held by the first party; a share determining module configured to determine a third vector share based on the second vector share and the random vector; and a share sending module configured to send the third vector share to the first party, so that the first party determines a first target share of a product result of the target vector and the target matrix based on the first vector share, the third vector share, the target matrix and the first product share.
[0015] According to a sixth aspect, there is provided a two-party joint data processing apparatus, integrated in a first party, comprising: a share obtaining module configured to obtain a first vector share of a target vector involved in an online service under secret sharing, a corresponding second vector share being held by a second party; a share receiving module configured to receive a third vector share from the second party, the third vector share being determined based on the second vector share and a random vector generated by the second party; a share reading module configured to read a first product share determined in an offline phase, which is a first-party share of a secure matrix multiplication operation of a target matrix held by the first party and the random vector, a corresponding second product share being held by the second party; the second product share being read by the second party as a second target share for the current operation; and a share determining module configured to determine a first target share of a product result of the target vector and the target matrix based on the first vector share, the third vector share, the target matrix and the first product share.
[0016] According to a seventh aspect, there is provided a two-party joint data processing apparatus integrated in a second party, comprising: a vector obtaining module configured to obtain a target vector involved in an online service; a shard reading module configured to read a second product shard determined in an offline stage as a second target shard of this operation; the second product shard is a second-party shard of a secure matrix multiplication operation of a random vector generated by the second party and a target matrix held by a first party, and a corresponding first product shard is held by the first party; a vector determining module configured to determine an intermediate vector based on the target vector and the random vector; and a vector sending module configured to send the intermediate vector to the first party, so that the first party determines a first target shard of a product result of the target vector and the target matrix based on the intermediate vector, the target matrix and the first product shard.
[0017] According to an eighth aspect, there is provided a two-party joint data processing apparatus integrated in a first party, comprising: a vector receiving module configured to receive an intermediate vector from a second party; the intermediate vector is determined based on a target vector obtained online by the second party and a random vector generated by the second party; a shard reading module configured to read a first product shard determined in an offline stage, which is a first-party shard of a secure matrix multiplication operation of a target matrix held by the first party and a random vector generated by the second party, and a corresponding second product shard is held by the second party; the second product shard is read by the second party as a second target shard of this operation; and a shard determining module configured to determine a first target shard of a product result of the target vector and the target matrix based on the intermediate vector, the target matrix and the first product shard.
[0018] According to a ninth aspect, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method provided in the first aspect or the second aspect or the third aspect or the fourth aspect.
[0019] According to a tenth aspect, there is provided a computing device comprising a memory and a processor, the memory having stored therein executable code which, when executed by the processor, implements the method provided in the first aspect or the second aspect or the third aspect or the fourth aspect.
[0020] The two-party joint data processing method and apparatus disclosed in the embodiments of the present specification transfer the matrix-vector multiplication and truncation operations based on homomorphic encryption to the offline stage while ensuring the privacy and security of the data of each party, thereby greatly reducing the online computation and communication amount. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings needed in the embodiment description. Obviously, the drawings in the following description only show some embodiments of the present application, and for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 Fig. 1 shows a schematic diagram of communication interaction between two parties for data processing according to an embodiment of the present application;
[0023] Figure 2 Fig. 2 shows another schematic diagram of communication interaction between two parties for data processing according to an embodiment of the present application;
[0024] Figure 3 Fig. 3 shows a schematic diagram of a data processing device structure integrated in a second party according to an embodiment of the present application; Figure 1
[0025] Figure 4 Fig. 4 shows a schematic diagram of a data processing device structure integrated in a first party according to an embodiment of the present application; Figure 1
[0026] Figure 5 Fig. 5 shows a schematic diagram of a data processing device structure integrated in a second party according to an embodiment of the present application; Figure 2
[0027] Figure 6 Fig. 6 shows a schematic diagram of a data processing device structure integrated in a first party according to an embodiment of the present application. Figure 2 DETAILED DESCRIPTION
[0028] The solutions provided by the present application are described below with reference to the drawings.
[0029] As described above, homomorphic encryption algorithm is a kind of encryption algorithm commonly used in secure multi-party computation. Compared with ordinary encryption, homomorphic encryption has the property of homomorphism, that is, the data in the encrypted state can be calculated. For example, the operation of homomorphic encryption ciphertext E(a) of a and homomorphic encryption ciphertext E(b) of b can obtain the ciphertext E(a+b) of a+b, and the operation process does not leak a, b or a+b, nor does it need to use the decryption key.
[0030] The homomorphic encryption-based matrix-vector multiplication can protect privacy information. In this scenario, the party A holds a vector v, and the party B holds a matrix M. After secure calculation by using the homomorphic encryption, the party A obtains the result c=Mv of the matrix-vector multiplication, or each party obtains a fragment of the result c (the party A obtains c1, and the party B obtains c2, and c1+c2=c).
[0031] Based on the above observation and analysis, the embodiments of the present specification propose an offline matrix-vector multiplication based on homomorphic encryption. By transferring the low-performance and high-computational-consumption operations such as the homomorphic encryption-based matrix multiplication to the offline stage, the offline result is calculated with the vector in the online stage to obtain the final result, thereby greatly reducing the computational load and communication load in the online stage.
[0032] Figure 1 One of the communication interaction diagrams for the two-party joint calculation of the matrix-vector product disclosed by the embodiments of the present specification is shown. It should be understood that both of the two parties can be implemented as any device, server, platform, or device cluster with computing and processing capabilities, such as a secure computing node.
[0033] As shown in Figure 1 , the first party (P1 party) and the second party (P2 party) need to perform matrix-vector multiplication. Hereinafter, the target matrix of the P1 party is denoted as A, and the target vector maintained by the P1 party and the P2 party is denoted as b. Generally, the matrix A is determined in the offline stage (or the pre-computation stage), and then the P1 party and the P2 party securely calculate the vector fragments of the target vector b in the online stage. In some business scenarios, the matrix A is a sample feature matrix, and the vector b is a model parameter vector that is continuously updated in the online training stage. The sample label vector y corresponding to the sample feature matrix A is held by the P2 party. It should be understood that in these business scenarios, the two fragments b1 and b2 of the parameter vector b are actually updated.
[0034] The offline stage and the online stage involved in the above communication interaction are introduced in turn as follows. Figure 1 As shown in the offline stage, at least steps S110 and S120 are included.
[0035] In step S110, the P2 party generates a random vector r.
[0036] Exemplarily, the number of bits (bit) in the plaintext space is denoted as p, for example, p=24, so that a p-bit vector r can be randomly generated. Exemplarily, the number of random vectors r can be one or more.
[0037] In step S120, the P1 party performs a secure matrix-vector multiplication operation based on the target matrix A and the random vector r of the P2 party. Thus, the P1 party obtains a first product fragment s1, and the P2 party obtains a first product fragment s2.
[0038] The above-mentioned secure matrix-vector multiplication operation can be implemented in a conventional manner, which takes a matrix and a vector as input and outputs two product shares of the product of the matrix and the vector under a secret sharing. The secret sharing, also known as secret split or secret sharing, is a cryptographic technique originally used for the management of secret information. Its basic principle is to split a secret (such as a key) into multiple shares, which are given to different people for safekeeping. Only more than a threshold number of people can combine their shares (or shards) to recover the secret; less than the threshold number of shards cannot recover any information about the secret. In multi-party secure computation, the threshold number is usually the same as the number of participants.
[0039] It can be seen that the product s of the target matrix A and the random vector r can be reconstructed from the first product share s1 and the second product share s2, that is, s = Ar. 1+ s2 = s = Ar, but this reconstruction process does not occur.
[0040] On the other hand, in some embodiments, when multiple random vectors r are generated, the P1 party can perform secure matrix-vector multiplication operations with multiple random vectors of the P2 party based on the target matrix A, respectively. Thus, the two parties can each obtain the product share corresponding to any t-th random vector r (t) of the P2 party.
[0041] It should be understood that the shard space in the embodiments of the present specification is preferably 2 p , but it can also not be a power of 2. In addition, for the modulo 2 p operation after a single operation, the description of the embodiments of the present specification is omitted.
[0042] In some embodiments, after step S120 is performed, a secure truncation operation can be performed on the first product share s1 and the second product share s2 to reduce the number of bits of the operation result and prevent overflow in subsequent operations.
[0043] Specifically, the offline phase can further include step S125, in which the P1 party performs a secure truncation protocol with the second product share s2 of the P2 party based on the first product share s1. Thus, the P1 party obtains a first truncated share to update the first product share s1, and the P2 party obtains a second truncated share to update the second product share s2.
[0044] In this step, an existing secure truncation protocol can be executed, such as the truncation protocol in the papers of secureml, aby3, etc. By executing the secure truncation protocol, the lowest k (which can be manually set) bits of the product result s can be discarded, thereby generating two truncated shards of the product under secret sharing after truncation, and corresponding outputs to the P1 party and the P2 party, so that the P1 party and the P2 party can each update the product shard they hold to the truncated shard.
[0045] After the above offline phase, the P1 party holds the target matrix A and the first product shard s1, and the P2 party holds the random vector r and the second product shard s2. Next, the communication interaction process of the online phase is introduced, including Figure 1 Steps S130 to S170 shown in FIG. 13.
[0046] In step S130, the P1 party and the P2 party securely compute the shards of the target vector b involved in the online business. Thus, the P1 party holds the first vector shard b1, and the P2 party holds the second vector shard b2.
[0047] In some embodiments, the above online business is a training task, which involves multiple rounds of iterative training and repeated execution of steps S130 to S170; thus, the target vector b in this step can be the model parameter vector b (t) .
[0048] Further, in the case of t = 0, the P1 party can locally randomly initialize the first parameter shard The P2 party can locally randomly initialize the second parameter shard
[0049] In the case of t > 0, the P1 party determines the first prediction result shard based on the sample feature matrix A, the first parameter shard updated after the t-1th iteration, and the second parameter shard updated after the t-1th iteration in the P2 party. based on the two parameter shards updated after the t-1th iteration, and the sample label vector y in the P2 party, the second parameter shard updated after the t-1th iteration. (t-1) , jointly execute the secure computation of the model parameter update function, so that the P1 party obtains the first parameter shard updated after the tth iteration.
[0050] In some embodiments, the P1 party and the P2 party each obtain corresponding service data according to an online service request, and then perform secure computation on a corresponding fragment of the target vector b based on the service data. In general, this can be represented as:
[0051] f(d1, d2) = b = b1 + b2 (1)
[0052] In formula (1), d1 represents the first service data obtained by the P1 party, d2 represents the second service data obtained by the P2 party, and f() represents a function of secure computation. It can be understood that d1, d2, f(), and b depend on the specific online service scenario.
[0053] In step S140, the P2 party reads the second product fragment s2 as the second target fragment c2 of this operation. That is, the P2 party sets c2 = s2.
[0054] Exemplarily, in the model training scenario, the P2 party determines a plurality of second product fragments corresponding to a plurality of rounds in the offline stage. Accordingly, in this step, the P2 party can read the tthsecond product fragment corresponding to the tthround of iterative update as the second target fragment of this operation That is, the P2 party sets
[0055] It should be noted that this step can be triggered to be executed in response to step S130.
[0056] In step S150, the P2 party determines a third vector fragment u based on the second vector fragment b2 and the random vector r. In one example, the fragment u can be calculated using the following formula:
[0057] u = b2 - r (2)
[0058] It should be understood that other calculation formulas can also be used, such as u = b2 + r, u = r - b2, etc.
[0059] In step S160, the P2 party sends the third vector fragment u to the P1 party.
[0060] In step S170, the P1 party determines the first target fragment c1 of the product result of the target vector b and the target matrix A based on the first vector fragment b1, the third vector fragment u, the target matrix A, and the first product fragment s1.
[0061] It should be understood that the calculation formula of the first target fragment c1 used in this step is adapted to the calculation formula of the third vector fragment u, etc. In one example, assuming that the third vector fragment u is calculated using the above formula (2), the first target fragment c1 can be calculated using the following formula (3) in this step:
[0062] c1=s0+A(b0+u) (3)
[0063] On the other hand, in order to prevent overflow after the product operation, the product result can also be truncated. For example, the truncation operation of A(b0+u) can be introduced on the basis of formula (3), thereby obtaining formula (4):
[0064] c1=s0+trunc(A(b0+u)) (4)
[0065] In this way, party P1 can obtain the first target fragment c1 through a small amount of online calculation.
[0066] In summary, the two-party joint data processing method disclosed in the embodiments of this specification ensures the data privacy and security of all parties while transferring operations such as matrix-vector multiplication and truncation based on homomorphic encryption to the offline stage, greatly reducing the online computing and communication volume.
[0067] Figure 2 The second schematic diagram of a communication interaction for two parties to jointly process data disclosed in an embodiment of this specification is shown. It should be understood that both parties can be implemented as any device, server, platform, or device cluster with computing and processing capabilities, such as a secure computing node.
[0068] like Figure 1 As shown, the first party (P1) and the second party (P2) need to perform a matrix-vector multiplication. Below, the target matrix of party P1 is denoted as A, and the target vector of party P2 is denoted as b. Generally, matrix A is determined in the offline phase (or pre-calculation phase), while vector b can only be determined in the online phase. In some business scenarios, matrix A is a pre-trained parameter matrix, and vector b is a sample feature vector determined in real time during online business. For example, vector b is the feature vector of the user corresponding to the online business request, which includes the user's static attribute characteristics and network behavior characteristics.
[0069] The following are introduced in order Figure 2 The offline phase and online phase involved in the communication interaction are shown in FIG. Figure 2 As shown, the offline stage at least includes steps S210 and S220.
[0070] In step S210, party P2 generates a random vector r. In step S220, party P1 performs a secure matrix-vector multiplication operation on party P2's random vector r based on the target matrix A. Thus, party P1 obtains a first multiplied integral slice s1, and party P2 obtains a first multiplied integral slice s2. In some embodiments, the offline phase may further include step S225, performing a secure truncation operation on the first multiplied integral slice s1 and the first multiplied integral slice s2 to reduce the number of bits in the result and prevent overflow in subsequent operations.
[0071] It should be noted that the description of steps S210, S220 and S225 can refer to the foregoing description of steps S110, S120 and S125, and will not be repeated here.
[0072] After the above offline phase, the P1 party holds the target matrix A and the first product slice s1, and the P2 party holds the random vector r and the second product slice s2. Next, the communication interaction process of the online phase is introduced, including Figure 2 steps S230 to S270 shown in FIG. 2B.
[0073] In step S230, the P2 party obtains the target vector b involved in the online service.
[0074] In some embodiments, the online service can include online payment service, online ordering service, online customer service, etc. In some embodiments, the target vector can be determined based on service request data or service processing logic of the online service, etc. In one example, the P2 party determines the user feature vector corresponding to the user identifier in the payment request in response to the payment request. In another example, the P2 party obtains the multi-turn dialogue data in the online customer service and processes the multi-turn dialogue data into the corresponding text vector.
[0075] In step S240, the P2 party reads the second product slice s2 as the second target slice c2 of this operation. It can be understood that no matter what kind of target vector is obtained, the P2 party can assign the second target slice c2 using the second product slice s2.
[0076] In step S250, the P2 party determines the intermediate vector v based on the target vector b and the random vector r. In one example, the intermediate vector v can be calculated using the following formula:
[0077] v = b - r (5)
[0078] It should be understood that other calculation formulas can also be used, such as v = b + r, v = r - b, etc.
[0079] In step S260, the P2 party sends the intermediate vector v to the P1 party.
[0080] In step S270, the P2 party determines the first target slice c1 of the product result of the target vector b and the target matrix A based on the intermediate vector v, the target matrix A and the first product slice s1.
[0081] It should be understood that the calculation formula of the first target slice c1 used in this step is adapted to the formula for calculating the intermediate vector v, etc. In one example, assuming that the intermediate vector v is calculated using the above formula (5), accordingly, the first target slice c1 can be calculated using the following formula (6) in this step:
[0082] c1 = s0 + Av (6)
[0083] On the other hand, in order to prevent overflow after the product operation, the product result can also be subjected to a truncation operation. Exemplarily, a truncation operation on Av can be introduced on the basis of formula (6), and thus formula (7) can be obtained:
[0084] c1 = s0 + trunc(Av) (7)
[0085] In this way, the P1 party can obtain the first target shard c1 through a small amount of calculation online.
[0086] In summary, the two-party joint data processing method disclosed in the embodiments of the present specification transfers the matrix-vector multiplication and truncation operations based on homomorphic encryption to the offline stage while ensuring the privacy and security of the data of each party, thereby greatly reducing the online calculation amount and communication amount.
[0087] Corresponding to the above processing method, the embodiments of the present specification also disclose a processing apparatus. Figure 3 The embodiments of the present specification are based on Figure 1 The disclosed data processing apparatus structure integrated in the second party is shown in FIG. 3. The apparatus is integrated in the second party. As shown in FIG. 3, the apparatus 300 comprises: Figure 3
[0088] The shard obtaining module 310 is configured to obtain a second vector shard of a target vector involved in an online service under secret sharing, and a corresponding first vector shard is held by the first party. The shard reading module 320 is configured to read a second product shard determined in the offline stage as a second target shard for this operation; the second product shard is a self shard of a secure matrix multiplication operation of a random vector generated by the second party and a target matrix held by the first party, and a corresponding first product shard is held by the first party. The shard determining module 330 is configured to determine a third vector shard based on the second vector shard and the random vector. The shard sending module 340 is configured to send the third vector shard to the first party, so that the first party determines a first target shard of a product result of the target vector and the target matrix based on the first vector shard, the third vector shard, the target matrix, and the first product shard.
[0089] In one embodiment, the determination of the second product shard comprises: the second party and the first party jointly performing the secure matrix multiplication operation to obtain the second product shard; and the second party and the first party jointly performing a secure truncation protocol based on the second product shard and the first product shard held by the first party to obtain an updated second product shard.
[0090] Figure 4 The embodiments of the present specification are based onFigure 1 The disclosed integrated data processing device structure in the first party is shown in Fig. 4. The device 400 is integrated in the first party. As shown, the device 400 includes: Figure 4
[0091] A shard obtaining module 410 is configured to obtain a first vector shard of a target vector involved in an online service under a secret sharing, and a corresponding second vector shard is held by a second party. A shard receiving module 420 is configured to receive a third vector shard from the second party, which is determined based on the second vector shard and a random vector generated by the second party. A shard reading module 430 is configured to read a first product shard determined in an offline stage, which is a first-party shard of a secure matrix multiplication operation of a target matrix and a random vector held by the first party, and a corresponding second product shard is held by the second party; the second product shard is read by the second party as a second target shard of the current operation. A shard determining module 440 is configured to determine a first target shard of a product result of the target vector and the target matrix based on the first vector shard, the third vector shard, the target matrix, and the first product shard.
[0092] In one embodiment, the determination of the first product shard includes: the first party and the second party jointly perform the secure matrix multiplication operation to obtain the first product shard; the first party and the second party jointly perform a secure truncation protocol to obtain a first truncated shard to update the first product shard; the input of the secure truncation protocol includes two product shards generated by the secure matrix multiplication operation.
[0093] In one embodiment, the shard determining module 440 is specifically configured to: obtain a first calculation result based on the first vector shard, the third vector shard, and the target matrix; perform a truncation operation on the first calculation result to obtain a first truncated result; and determine the first target shard based on the first truncated result and the first product shard.
[0094] Figure 5 The embodiment of the present specification is based on Figure 2 The disclosed integrated data processing device structure in the second party is shown in Fig. 5. The device is integrated in the second party. As shown, the device 500 includes: Figure 5
[0095] The vector acquisition module 510 is configured to obtain the target vector involved in the online business. The shard reading module 520 reads the second multiplied shard determined in the offline stage as the second target shard of this operation; the second multiplied shard is the shard of the local party for the secure matrix multiplication operation of the random vector generated by the local party and the target matrix held by the first party, and the corresponding first multiplied shard is held by the first party. The vector determination module 530 determines the intermediate vector based on the target vector and the random vector. The vector sending module 540 sends the intermediate vector to the first party, so that the first party determines the first target shard of the product result of the target vector and the target matrix based on the intermediate vector, the target matrix and the first multiplied shard.
[0096] In one embodiment, determining the second multiplied integral slice includes: jointly performing the security matrix multiplication operation by the present party and the first party to obtain the second multiplied integral slice; and jointly executing the security truncation protocol by the present party and the first multiplied integral slice held by the first party based on the second multiplied integral slice to obtain an updated second multiplied integral slice.
[0097] Figure 6 This specification embodiment is based on Figure 2 The disclosed data processing device integrated into the first party is a schematic diagram, wherein the device 600 is integrated into the first party. Figure 6 As shown, the apparatus 600 includes:
[0098] The vector receiving module 610 is configured to receive an intermediate vector from the second party; the intermediate vector is determined based on the target vector obtained online by the second party and the generated random vector. The shard reading module 620 reads the first multiplied shard determined in the offline stage, which is the shard of the local party for the secure matrix multiplication operation of the target matrix held by the local party and the random vector generated by the second party, and the corresponding second multiplied shard is held by the second party; the second multiplied shard is read by the second party as the second target shard of this operation. The shard determination module 630 determines the first target shard of the product result of the target vector and the target matrix based on the first intermediate vector, the target matrix and the first multiplied shard.
[0099] In one embodiment, determining the first multiplied slice includes: the present party and the second party jointly performing the secure matrix multiplication operation to obtain the first multiplied slice; the present party and the second party jointly performing a secure truncation protocol to obtain a first truncated slice to update the first multiplied slice; the input of the secure truncation protocol includes two multiplied slices generated by the secure matrix multiplication operation.
[0100] In one embodiment, the slice determining module 630 is specifically configured to: obtain a first calculation result based on the intermediate vector and the target matrix; perform a truncation operation on the first calculation result to obtain a first truncated result; and determine the first target slice based on the first truncated result and the first product slice.
[0101] According to another aspect, an embodiment also provides a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method described above. Figure 1 or Figure 2 described above.
[0102] According to yet another aspect, an embodiment also provides a computing device comprising a memory and a processor, the memory having stored therein executable code which, when executed by the processor, implements the method described above. Those skilled in the art should appreciate that the functions described above in one or more examples can be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions can be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Figure 1 or Figure 2 described above. It should be understood that all modifications, equivalent replacements, improvements, and the like made on the basis of the technical solutions of the present application are included in the scope of the protection of the present application.
[0103] The above detailed description further explains the purpose, technical solutions, and advantages of the present application. It should be understood that the above detailed description is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, and the like made on the basis of the technical solutions of the present application are included in the protection scope of the present application.
Claims
1. A two-party joint data processing method, performed by a second party, comprising: Obtaining a second vector shard of a target vector involved in the online service under secret sharing, where the corresponding first vector shard is held by the first party; The second multiplication slice determined during the offline phase is read as the second target slice of this operation. The second multiplication slice is the slice of the local party for the secure matrix multiplication of the random vector generated by the local party and the target matrix held by the first party. The corresponding first multiplication slice is held by the first party. determining a third vector slice based on the second vector slice and the random vector; The third vector slice is sent to the first party, so that the first party determines a first target slice of a product result of the target vector and the target matrix based on the first vector slice, the third vector slice, the target matrix, and the first product slice.
2. The method according to claim 1, wherein Determining the second multiplied slice includes: The party and the first party jointly perform the security matrix multiplication operation to obtain a second product slice; Based on the second multiplied integral slice, the party executes the secure truncation protocol together with the first multiplied integral slice held by the first party to obtain an updated second multiplied integral slice.
3. A two-party joint data processing method, performed by a first party, comprising: Obtaining a first vector shard of the target vector involved in the online service under secret sharing, with the corresponding second vector shard held by the second party; receiving, from a second party, a third vector slice determined based on the second vector slice and a random vector generated by the second party; Reading the first multiplication slice determined in the offline phase, which is the slice of the local party for the secure matrix multiplication operation of the target matrix held by the local party and the random vector, and the corresponding second multiplication slice held by the second party; The second product slice is read by the second party as the second target slice of this operation; A first target slice of a product result of the target vector and the target matrix is determined based on the first vector slice, the third vector slice, the target matrix, and the first product slice.
4. The method according to claim 3, wherein: Determining the first multiplied slice includes: The party and the second party jointly perform the security matrix multiplication operation to obtain a first product slice; The present party and the second party jointly execute a secure truncation protocol to obtain a first truncated fragment to update the first multiplied fragment; the input of the secure truncation protocol includes two multiplied fragments generated by the secure matrix multiplication operation.
5. The method according to claim 3, wherein Determining a first target slice of a product result of the target vector and the target matrix includes: Obtain a first calculation result based on the first vector slice, the third vector slice, and the target matrix; performing a truncation operation on the first calculation result to obtain a first truncation result; The first target fragment is determined based on the first truncation result and the first product fragment.
6. A two-party joint data processing method, performed by a second party, comprising: Obtain target vectors involved in online business; Read the second product shard determined in the offline phase as the second target shard of this operation; The second multiplication slice is the slice of the party for the secure matrix multiplication of the random vector generated by the party and the target matrix held by the first party, and the corresponding first multiplication slice is held by the first party; determining an intermediate vector based on the target vector and the random vector; The intermediate vector is sent to the first party, so that the first party determines a first target slice of a product result of the target vector and the target matrix based on the intermediate vector, the target matrix, and the first product slice.
7. A two-party joint data processing method, performed by a first party, comprising: receiving an intermediate vector from a second party; The intermediate vector is determined based on the target vector obtained online by the second party and the generated random vector; The first multiplication slice determined during the offline phase is read. This slice is the slice of the secure matrix multiplication operation between the target matrix held by the local party and the random vector generated by the second party. The corresponding second multiplication slice is held by the second party. The second party reads the second multiplication slice as the second target slice of this operation. A first target slice of a product result of the target vector and the target matrix is determined based on the intermediate vector, the target matrix and the first product slice.
8. A data processing device for a two-party joint, integrated in a second party, comprising: A shard acquisition module configured to acquire a second vector shard of a target vector involved in an online service under secret sharing, wherein the corresponding first vector shard is held by the first party; The shard reading module is configured to read a second multiplication shard determined during the offline phase as a second target shard for the current operation; the second multiplication shard is the shard of the local party for the secure matrix multiplication operation of the random vector generated by the local party and the target matrix held by the first party, and the corresponding first multiplication shard is held by the first party; a shard determination module configured to determine a third vector shard based on the second vector shard and the random vector; The slice sending module is configured to send the third vector slice to the first party, so that the first party determines a first target slice of the product result of the target vector and the target matrix based on the first vector slice, the third vector slice, the target matrix and the first product slice.
9. A two-party joint data processing device, integrated into a first party, comprising: A shard acquisition module configured to acquire a first vector shard of a target vector involved in an online service under secret sharing, wherein the corresponding second vector shard is held by the second party; a slice receiving module configured to receive a third vector slice from a second party, the third vector slice being determined based on the second vector slice and a random vector generated by the second party; A shard reading module is configured to read a first multiplication shard determined in an offline phase, which is the shard of the party for the secure matrix multiplication operation of the target matrix held by the party and the random vector, and a corresponding second multiplication shard held by the second party; The second product slice is read by the second party as the second target slice of this operation; The slice determination module is configured to determine a first target slice of the product result of the target vector and the target matrix based on the first vector slice, the third vector slice, the target matrix and the first product slice.
10. A data processing device for a joint operation of two parties, integrated in a second party, comprising: A vector acquisition module configured to acquire target vectors involved in online business; The shard reading module reads the second multiplication shard determined during the offline phase as the second target shard of the current operation; the second multiplication shard is the shard of the local party for the secure matrix multiplication operation of the random vector generated by the local party and the target matrix held by the first party, and the corresponding first multiplication shard is held by the first party; a vector determination module, which determines an intermediate vector based on the target vector and the random vector; A vector sending module sends the intermediate vector to the first party, so that the first party determines a first target slice of a product result of the target vector and the target matrix based on the intermediate vector, the target matrix, and the first product slice.
11. A two-party joint data processing device, integrated in a first party, comprising: a vector receiving module configured to receive an intermediate vector from a second party; The intermediate vector is determined based on the target vector obtained online by the second party and the generated random vector; The shard reading module reads the first multiplication slice determined during the offline phase. The first multiplication slice is the shard of the local party for the secure matrix multiplication operation of the target matrix held by the local party and the random vector generated by the second party. The corresponding second multiplication slice is held by the second party. The second party reads the second multiplication slice as the second target slice of this operation. The slice determination module determines a first target slice of a product result of the target vector and the target matrix based on the intermediate vector, the target matrix and the first product slice.
12. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 7.
13. A computing device comprising a memory and a processor, wherein: The memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for jointly training service prediction model by two parties for protecting data privacy
CN111160573A
Multi-party security computing method and system and device for multi-party security computing
CN114448630A