Multi-party collaborative vector inner product calculation method, device, medium and system

By decomposing the original vector into multiple pieces and adding verification information, and utilizing collaborative computation by multiple computing devices, the problems of large computational load and data privacy and security risks in existing technologies are solved, and fast and accurate vector inner product calculation is achieved.

CN116647395BActive Publication Date: 2025-12-09CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310664295.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-06
Publication Date
2025-12-09
Estimated Expiration
2043-06-06

AI Technical Summary

Technical Problem

Existing multi-party collaborative vector inner product calculation schemes involve large computational loads, require semi-trusted third-party nodes, and pose data privacy and security risks.

Method used

By decomposing the original vector into multiple pieces and incorporating verification information during the computation process, and by utilizing multiple computing devices to perform collaborative computation, data privacy and security are ensured, and the accuracy of the computation results is ensured through a verification mechanism.

Benefits of technology

It achieves vector inner product calculation with low computational cost, fast operation, and easy verification, ensuring data privacy and security, avoiding deception by a single computing party, and improving computation and communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116647395B_ABST
    Figure CN116647395B_ABST
Patent Text Reader

Abstract

The application provides a multi-party collaborative vector inner product calculation method, device, medium and system, relates to the technical field of data processing, and is used for solving the problem that the existing vector inner product calculation scheme is greatly restricted. The method comprises the following steps: data provider device A / B negotiates with B / A to process x / y, which is to be calculated by the original vector y / x of B / A, into p first vector fragments X i / Y i and second vector fragments X′ i / Y′ i , X i / Y i and X′ i / Y′ i carry verification information; p X i / Y i and X′ i / Y′ i are respectively sent to p calculation device C i , so that: p C i respectively receive X i and Y i , X′ i and Y′ i , and perform collaborative calculation according to X i and Y i , X′ i and Y′ i , so as to obtain a first vector inner product O and a second vector inner product O′, and a certain C i sends O and O′ to A and B; O and O′ are received, and the inner product of x and y is obtained and verified according to O and O′. The application has small calculation amount, high operation speed, and the calculation result is easy to verify.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a multi-party collaborative vector inner product calculation method, a data provider device, a calculation device, a computer readable storage medium and a multi-party collaborative vector inner product calculation system. BACKGROUND

[0002] With the development of the data industry, many businesses need to use the data of multiple parties to better develop, such as multi-party collaborative AI modeling, joint data analysis and mining, etc. However, due to privacy protection and data security considerations or restrictions on data sharing by laws and regulations, enterprises cannot directly share data. In this context, technical means are needed to support privacy-protected data collaboration. Vector inner product calculation is a basic operation in the fields of AI model training, data mining and data analysis.

[0003] Most of the current schemes for implementing multi-party collaborative vector inner product calculation are based on general privacy calculation technology, for example, based on a traditional additive secret sharing mechanism. The additive secret sharing technology involves the generation and distribution of beaver triplets, which requires a large amount of calculation, or needs to rely on semi-trusted third-party nodes, which faces great constraints in actual scenarios. SUMMARY

[0004] The technical problem to be solved by the present application is to solve the above-mentioned deficiencies of the prior art, and to provide a multi-party collaborative vector inner product calculation method, a data provider device, a calculation device, a computer readable storage medium and a multi-party collaborative vector inner product calculation system, to solve the problem of great constraints faced by the prior art multi-party collaborative vector inner product calculation scheme.

[0005] In a first aspect, the present application provides a multi-party collaborative vector inner product calculation method applied to a data provider device A / B, the method comprising:

[0006] negotiating with B / A to process x / y, which is to be calculated with the original vector y / x of B / A, into p first vector slices X i / Y i and second vector slices X i ′ / Y i ′, X i / Y i and X i ′ / Y i ′ at least one of which carries verification information, i∈[1...p];

[0007] sending p X i / Y i and X i ′ / Y i ′ to p calculation devices Ci , such that:

[0008] p C i each receives X i and Y i from A and B, and cooperatively computes a first vector inner product O and a second vector inner product O' from X i and Y i , and sends O and O' to A and B via some C i . i i i . i

[0009] receives O and O' from some C i , and obtains and verifies the inner product of x and y from O and O'.

[0010] Optionally, in the method:

[0011] x = (x1...x n ) / y = (y1...y n ), the inner product of x and y is obtained and verified from O and O' by:

[0012] X i / Y i is an extended vector shard obtained by decomposing X / Y into p shards according to a multiplication secret sharing pattern after B / A negotiate, insert random verification numbers into x / y at the same random positions, and obtain an extended vector X / Y;

[0013] X i ′ / Y i ′ is an extended coefficient vector shard obtained by decomposing X′ / Y′ into p shards according to a multiplication secret sharing pattern after B / A negotiate, insert random verification numbers into x / y at the same random positions, and multiply each element x j / y j except the random verification numbers by a random coefficient to obtain an extended coefficient vector X′ / Y′;

[0014] O is an extended vector inner product obtained by p C i cooperatively computing from X i and Y i , and O' is an extended coefficient vector inner product obtained by p C i cooperatively computing from X i ′ and Y i ′.

[0015] Optionally, the inner product of x and y is obtained and verified from O and O' by: ​​​

[0016] Z is calculated based on O and the random validation number, and the inner product validation parameter Z′ of x and y is calculated based on O′ and the random validation number. Z is then validated based on Z′ and the random coefficients, where O and O′ are determined by p C. i To obtain it, follow these steps:

[0017] p C i Each according to the X it receives i and Y i Calculate the integral slice S of the extended vector elements i And based on the X it receives i ′ and Y i Calculate the integral slice S of the extended coefficient vector elements. i ′,

[0018] Make a certain C i Get from p C i S i and S i ′, and according to p S i Calculate O, and based on p S i Calculate O'.

[0019] Optionally, the x / y that is to be calculated as the inner product of itself with the original vector y / x of B / A is negotiated with B / A to be processed into p first vector slices X. i / Y i and the second vector slice X i ′ / Y i Specifically, it includes:

[0020] Obtain the same random verification number r, random position number k, and random coefficient α as B / A;

[0021] Insert r into x / y according to k to obtain X = (x1...x k-1 ...r...x k+1 ...x n ) / Y=(y1...y k- 1...r...y k+1 ...y n );

[0022] x j / y j Multiply by α to obtain X′=(αx1...αxk) -1 ...r...αx k+1 ...αx n ) / Y′=(αy1...αy k- 1...r...αy k+1 ...αy n );

[0023] According to Or,

[0024] X / Y is decomposed into X i =(x 1i ...r ix ...x ni ) / Y i =(y 1i ...r iy ...y ni ), and X' / Y' is decomposed into X i '= (αx 1i ...r' ix ...ax ni ) / Y i '= (αy 1i ...r' iy ...αy ni ).

[0025] Optionally, the same random verification number r, random position number k, and random coefficient α as B / A are obtained, and the method specifically comprises the following steps:

[0026] Generating the random verification number r, random position number k, and random coefficient α, and sending the r, k, and α to B / A; or receiving the random verification number r, random position number k, and random coefficient α from B / A.

[0027] Optionally, the inner product verification parameter Z' of x and y is calculated according to O' and the random verification number, and Z is verified according to Z' and the random coefficient, and the method specifically comprises the following steps:

[0028] Z=O-rr is calculated according to O and r, wherein O is obtained from a certain C i According to the following formula:

[0029] Where S i is obtained from p C i Each according to the following formula:

[0030] S i =(x 1i y 1i ,..., r ix r iy ,..., x ni y ni );

[0031] Z'=O'-rr is calculated according to O' and r, wherein O' is obtained from a certain C i According to the following formula:

[0032] where S i ′ is obtained by p C i Each is obtained according to the following formula:

[0033] S i ′ = (αx 1i αy 1i ,..., r′ ix r′ iy ,..., αx ni αy ni );

[0034] Verify whether Z' is equal to α 2p Z, if equal, then Z is verified.

[0035] In a second aspect, the present application provides a multi-party collaborative vector inner product calculation method, applied to a calculation party device C i , i∈[1...p], the method comprising:

[0036] Receiving first vector fragments X i and Y i and second vector fragments X i ' and Y i ' from data provider devices A and B, wherein:

[0037] A / B respectively negotiate with B / A to process x / y, which is to be calculated by A / B with the original vector y / x of B / A, into p X i / Y i and X i ' / Y i ', and send at least one of X i , X i / Y i and X i ' / Y i ' to p C i , i∈[1...p];

[0038] According to X i and Y i and X i ' and Y i ', collaborative calculation is performed with the remaining (p-1) C i to obtain the first vector inner product O and the second vector inner product O', and O and O' are sent by a certain C i to A and B, so that:

[0039] A and B receive O and O' from a certain C i , and obtain and verify the inner product of x and y according to O and O'.

[0040] Optionally, in the method:

[0041] x=(x1...x n ) / y=(y1...y n The inner product of x and y

[0042] X i / Y i The expanded vector fragments are obtained by A / B and B / A negotiating and inserting random verification numbers at the same random positions for x / y to obtain the expanded vector X / Y. Then, according to the multiplication secret sharing mode, X / Y is decomposed into p fragments.

[0043] X i ′ / Y i ′ is determined by A / B and B / A, where a random verification number is inserted at the same random position for x / y, and each element x other than the random verification number is set to 0. j / y j After multiplying by random coefficients to obtain the expanded coefficient vector X′ / Y′, the expanded coefficient vector fragments are obtained by decomposing X′ / Y′ into p fragments according to the multiplication secret sharing mode;

[0044] O is composed of p Cs i According to X i and Y i The extended vector inner product obtained through collaborative computation, O′, is composed of p C... i According to X i ′ and Y i The inner product of the extended coefficient vector obtained through collaborative computation.

[0045] Optionally, according to X i and Y i and X i ′ and Y i ′ and the remaining (p-1) C i Perform collaborative computation to obtain the first vector inner product O and the second vector inner product O′, and determine the result from a certain C. i Sending O and O' to A and B, specifically including:

[0046] Based on the X it receives i and Y i Calculate the integral slice S of the extended vector elements i And based on the X it receives i ′ and Y i Calculate the integral slice S of the extended coefficient vector elements. i ′;

[0047] Make a certain C i Get from p C i S i and S i ′, and according to p Si Calculate O, and based on p S i Calculate O', and send O and O' to A and B so that:

[0048] A and B calculate Z based on O and the random verification number, and calculate the inner product verification parameter Z′ of x and y based on O′ and the random verification number, and verify Z based on Z′ and the random coefficient.

[0049] Optionally, make a certain C i Get from p C i S i and S i Specifically, it includes:

[0050] Get the S calculated by itself i and S i ′, and receive from the remaining (p-1) C i S i and S i ′, so that it can obtain from p C i S i and S i ′; or, to the remaining (p-1) C i A certain C in i Send S i and S i ′, so that the remaining (p-1) C i A certain C in i Get from p C i S i and S i ′.

[0051] Optionally, based on the X received by itself i and Y i Calculate the integral slice S of the extended vector elements i And based on the X it receives i ′ and Y i Calculate the integral slice S of the extended coefficient vector elements. i Specifically, it includes:

[0052] Based on the X it receives i and Y i Calculate S i =(x 1i y 1i ,...,r ix r iy , ..., x ni y ni ), and based on the X it receives i ′ and Y i 'Calculate S'i = (αx 1i ...r 1i ...x ix ) / Y = (y1...y iy ...r ni ...y ni ) where X i / Y i and X i ′ / Y i ′ are obtained from A / B according to the following steps:

[0053] Obtain the same random verification number r, random position number k, random coefficient α as B / A;

[0054] Insert r into x / y according to k to obtain X = (x1...x k-1 ...r...x k+1 ...x n ) / Y = (y1...y k- 1...r...y k+1 ...y n );

[0055] Multiply x j / y j by α to obtain X' = (αx1...αx k-1 ...r...αx k+1 ...αx n ) / Y' = (αy1...αy k- 1...r...αy k+1 ...αy n );

[0056] According to or,

[0057] Decompose X / Y into X i = (x 1i ...r ix ...x ni ) / Y i = (y1i...r iy ...y ni ), and X' / Y' into X i ′= (αx 1i ...r′ ix ...αx ni ) / Y i ′= (αy 1i ...r′ iy ...αy ni ).

[0058] Optionally, according to p S i Calculate O, and according to p S i Calculate O', and send O and O' to A and B, specifically including:

[0059] According to p S i Calculate And according to p S i Calculate

[0060] Send O and O' to A and B, so that A and B calculate Z = O-rr according to O and r, and calculate Z' = O'-rr according to O' and r, and verify whether Z' is equal to Z, if equal, Z is verified. 2p

[0061] In a third aspect, the present application provides a data provider device A / B, the device comprising:

[0062] A fragment processing module for processing x / y, which is to be calculated by the device itself and the original vector y / x of B / A, into p first vector fragments X i / Y i And second vector fragments X i / Y i ′, X i / Y i And X i / Y i ′ at least one of which carries verification information, i ∈ [1...p];

[0063] A first calculation starting module connected with the fragment processing module, for sending p X i / Y i And X i / Y i ′ to p calculation device C i respectively, so that:

[0064] P C i Each receives X i and Y i and X i ' and Y i ' from A and B, and cooperatively calculates according to X i and Y i and X i ' and Y i ' to obtain first vector inner product O and second vector inner product O', and some C i Send O and O' to A and B;

[0065] ​The inner product verification module is connected with the first calculation starting module, and is configured to receive O and O' from a certain C i , and obtain and verify the inner product of x and y according to O and O'.

[0066] In a fourth aspect, the present application provides a computing device C i , i∈[1...p], which comprises:

[0067] The second calculation starting module is configured to receive first vector fragments X i and Y i and second vector fragments X i ' and Y i ' from data provider devices A and B, wherein:

[0068] A / B respectively negotiate with B / A to process x / y, which is to be calculated by A / B respectively with the original vector y / x of B / A, into p X i / Y i and X i ' / Y i ', and send them to p C i , wherein at least one of X i / Y i and X i ' / Y i ' carries verification information, i∈[1...p];

[0069] The collaborative calculation module is connected with the second calculation starting module, and is configured to perform collaborative calculation with the remaining (p-1) C i according to X i and Y i and X i ' and Y i ', so as to obtain first vector inner product O and second vector inner product O', and send O and O' to A and B by a certain C i , so that:

[0070] A and B receive O and O' from a certain C i , and obtain and verify the inner product of x and y according to O and O'.

[0071] In a fifth aspect, the present application provides a computer readable storage medium, which stores a computer program, and when the computer program is run by a processor, the multi-party collaborative vector inner product calculation method as described above is realized.

[0072] In a sixth aspect, the present application provides a multi-party collaborative vector inner product calculation system, which comprises:

[0073] Data provider devices A and B are configured to respectively perform the multi-party collaborative vector inner product calculation method as described in the first aspect.

[0074] p computing devices C i , i∈[1...p], connected with the data provider devices A and B, used for cooperatively performing the multi-party cooperative vector inner product calculation method as described in the second aspect above.

[0075] The present application provides a multi-party cooperative vector inner product calculation method, a data provider device, a computing device, a computer readable storage medium and a multi-party cooperative vector inner product calculation system, which calculates the inner product of two vectors provided by two data provider devices through multiple computing devices. In order to ensure data privacy and security, the data provider device adds verification information to its own original vector and processes it into fragments, and then sends it to multiple computing devices. Any computing device cannot obtain the complete vector, and multiple computing devices cooperatively complete the calculation of the vector fragments. According to the vector fragment cooperative calculation result, the original vector inner product calculation result is restored based on the verification information added to the original vector, and the original vector inner product calculation result is verified to avoid the cheating behavior of a certain computing device and ensure the accuracy of the calculation result. It has the advantages of small calculation amount, fast operation speed, easy verification of calculation result, high calculation and communication efficiency, and wide application prospect. BRIEF DESCRIPTION OF DRAWINGS

[0076] Figure 1 is a flow chart of a multi-party cooperative vector inner product calculation method according to an embodiment of the present application;

[0077] Figure 2 is a structural schematic diagram of a multi-party cooperative vector inner product calculation system according to an embodiment of the present application;

[0078] Figure 3 is a flow chart of another multi-party cooperative vector inner product calculation method according to an embodiment of the present application;

[0079] Figure 4 is a flow chart of another multi-party cooperative vector inner product calculation method according to an embodiment of the present application;

[0080] Figure 5 is a structural schematic diagram of a data provider device according to an embodiment of the present application;

[0081] Figure 6 is a structural schematic diagram of a computing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0082] In order for those skilled in the art to better understand the technical solutions of the present application, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0083] It can be understood that the specific embodiments and drawings described herein are only used to explain the present application, and are not a limitation on the present application.

[0084] It can be understood that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0085] It can be understood that, for the convenience of description, only parts related to the present application are shown in the drawings of the present application, and parts unrelated to the present application are not shown in the drawings.

[0086] It can be understood that each unit and module involved in the embodiments of the present application can only correspond to one entity structure, or can be composed of multiple entity structures, or multiple units and modules can be integrated into one entity structure.

[0087] It can be understood that the functions and steps marked in the flowcharts and block diagrams of the present application can occur in an order different from that marked in the drawings without conflict.

[0088] It can be understood that in the flowcharts and block diagrams of the present application, the architecture, functions and operations of possible implementations of the systems, devices, apparatuses and methods according to the embodiments of the present application are shown. Each block in the flowchart or block diagram can represent a unit, module, program segment, code, which contains executable instructions for implementing the specified functions. Moreover, each block or combination of blocks in the block diagram and flowchart can be implemented by a hardware-based system for implementing the specified functions, or by a combination of hardware and computer instructions.

[0089] It can be understood that the units and modules involved in the embodiments of the present application can be implemented in software or hardware, for example, the units and modules can be located in a processor.

[0090] Embodiment 1

[0091] As shown in Figure 1 , the embodiment 1 of the present application provides a multi-party collaborative vector inner product calculation method, which can be applied to a data provider device A / B as shown in Figure 2 , and the method at least includes the steps as shown in Figure 1 :

[0092] S11, negotiating with B / A to process x / y, which is to be calculated with the original vector y / x of B / A, into p first vector slices X i / Y i and second vector slices X i ′ / Y i ′, X i / Y i and X i ′ / Yi at least one carries verification information, i ∈ [1...p];

[0093] S12, p X i / Y i and X i ′ / Y i ′ are sent to p computing device C i , so that:

[0094] p C i each receives X i and Y i and X i ′ and Y i ′ from A and B, and performs collaborative calculation according to X i and Y i and X i ′ and Y i ′, obtains first vector inner product O and second vector inner product O′, and sends O and O′ to A and B by some C i .

[0095] S13, receiving O and O′ from some C i , and obtaining and verifying the inner product of x and y according to O and O′.

[0096] Specifically, in this embodiment, first, a multi-party collaborative vector inner product calculation system as shown in Figure 2 is constructed, which includes data provider devices A and B, and p computing devices C i (C1...C p ), A and B hold original vectors x and y respectively, and both parties want to obtain the inner product of the two vectors by calculation, in order to prevent a single computing party from obtaining the data provider's privacy, p computing devices C i (i = 1, 2,... p) jointly calculate to obtain the vector inner product. In order to realize the collaborative calculation of p C i on the vector inner product of x and y and protect privacy, it is necessary to decompose x and y into p pieces respectively, each C i receives one piece, and any C i cannot obtain the complete vector, in order to avoid cheating behavior of C i , a set of verification mechanism is also designed, A and B add verification information to their original vectors, and are respectively decomposed into two different pieces X i / Y i and Xi′ / Y i ′, so that p C i based on two different vector pieces X i and Yi and X i ′ and Y i A and B perform collaborative calculations, and then, based on the results of the collaborative calculations and the verification mechanism, they reconstruct the vector inner product of x and y and verify the vector inner product. The method in this embodiment can ensure data privacy and security, while ensuring the accuracy of the calculation results. It has the advantages of small computational load, fast operation speed, easy verification of calculation results, and high computation and communication efficiency, and has broad application prospects.

[0097] Optionally, in the method:

[0098] x=(x1...x n ) / y=(y1...y n The inner product of x and y

[0099] X i / Y i It is an expanded vector fragment obtained by negotiating with B / A, inserting random verification numbers at the same random positions for x / y to obtain the expanded vector X / Y, and then decomposing X / Y into p fragments according to the multiplication secret sharing mode;

[0100] X i ′ / Y i ' is a negotiation with B / A to insert a random verification number at the same random position for x / y, and to set each element x other than the random verification number as a separate variable. j / y j After multiplying by random coefficients to obtain the expanded coefficient vector X′ / Y′, the expanded coefficient vector fragments are obtained by decomposing X′ / Y′ into p fragments according to the multiplication secret sharing mode;

[0101] O is composed of p Cs i According to X i and Y i The extended vector inner product obtained through collaborative computation, O′, is composed of p C... i According to X i ′ and Y i The inner product of the extended coefficient vector obtained through collaborative computation.

[0102] Specifically, in this embodiment, an example of implementing vector inner product calculation through interaction between the data provider and the computer is as follows: Figure 3 As shown, the steps performed on A and B first include: S001, the data provider adds a verification bit to the vector according to a random number; S002, the data provider decomposes the vector into slices according to the multiplication pattern. Based on the multiplication secret sharing scheme, the speed of the two-directional vector inner product operation can be improved; more specifically, A and B respectively hold the vector x = (x1...x2) to be calculated. n ) and y = (y1...yn ), the vector inner product to be calculated x j and y j are elements in x and y respectively, j e [1...n], the designed verification mechanism is that A and B perform two processing means of expansion and expansion after multiplication of coefficients on the original vectors of themselves, and then decompose the expanded and expanded after multiplication of coefficients vectors into slices respectively, so that p C i Based on the expansion and expansion after multiplication of coefficients vector slices, A and B restore the vector inner product of x and y according to the results of collaborative calculation and the rules of expansion and expansion after multiplication of coefficients, and realize the verification of the vector inner product. The way A and B expand the original vector is realized by inserting random numbers at random positions of the vector, and the way of expanding the original vector and adding coefficients is realized by multiplying the elements of the original vector by the coefficients after inserting random numbers at random positions, but the inserted random numbers are not multiplied by the coefficients. In this way, the random numbers can be used to verify the correctness of the inner product result when the original vector inner product is obtained in the subsequent restoration. The way of decomposing the vector into slices is based on the multiplication secret sharing mode. In the subsequent calculation of the inner product, it is also calculated by multiplication, so that the original vector inner product can be obtained without the participation of a third party, further improving the calculation efficiency. It should be noted that the random position, random verification number and random coefficient are determined by A and B negotiation. The position of the random verification number inserted into X and Y is required to be the same. The random verification number at this position will obtain the product result in the subsequent restoration. When Z is obtained, the product result is subtracted. It can be seen that the two random verification numbers only need to be known by A and B, and do not require to be the same. The same is true for X i ′ and Y i ′, and X / Y and X i ′ / Y i ′ do not perform operations, so the random positions of the two can also be different.

[0103] Optionally, the inner product of x and y is obtained and verified according to O and O', specifically including:

[0104] According to O and the random verification number, Z is calculated, and according to O' and the random verification number, the inner product verification parameter Z' of x and y is calculated, and Z is verified according to Z' and the random coefficient, wherein O and O' are obtained by p C i According to the following steps:

[0105] p C i According to X i and Y i received by itself, respectively, calculate the expanded vector element integral slice S i , and calculate the expanded coefficient vector element integral slice S i ′ according to X i ′ and Y i ′ received by itself,

[0106] Make a certain C i Get from p C i S i and S i ′, and according to p S i Calculate O, and based on p S i Calculate O'.

[0107] Specifically, in this embodiment, in such Figure 3 In the example shown, in p C i The steps executed above include: S003, the computer computes intermediate results locally based on vector partitioning; S004, the computer aggregates the intermediate results to one of the compute nodes; S005, one of the compute nodes computes the aggregated result based on the intermediate results; more specifically, p C i The method for collaborative computation based on the received vector fragments is to first perform computation on the received vector fragment X on each of the three entities. i and Y i and X i ′ and Y i Each element in the vector ' is multiplied element by element, and the result of each element-wise multiplication is retained in its corresponding position to form a new vector segment S. i and S i Then, it divides its own new vector into S segments. i and S i Send to a pre-agreed C i , by this C i For the received p S i and S i The calculation yields the dot product O of the extended vectors and the dot product O' of the extended coefficient vectors. In the case of... Figure 3 In the example shown, p C i After obtaining O and O′ and sending them to A and B, A and B ultimately execute step S006, whereby the data provider verifies the correctness of the convergence result. If the verification passes, A and B execute step S007 to obtain the vector inner product calculation result; otherwise, step S008 determines that the calculator did not perform the calculation honestly. More specifically, O obtained based on the above operations contains the inner product of x and y and the product of random verification numbers, and O′ contains the inner product of x and y, the product of random verification numbers, and the product of random coefficients. Therefore, after receiving O and O′, A and B can reconstruct the inner product of x and y and verify the correctness of the inner product result. Through algorithm design, the verification of the correctness of the calculation result is realized, further improving the efficiency of calculation and communication.

[0108] Optionally, the x / y that is to be calculated as the inner product of itself with the original vector y / x of B / A is negotiated with B / A to be processed into p first vector slices X.i / Y i and the second vector slice X i ′ / Y i ′, specifically including:

[0109] Obtain the same random verification number r, random position number k, random coefficient a as B / A;

[0110] Insert r according to k into x / y to obtain X=(x1...x k-1 ...r...x k+1 ...x n ) / Y=(y1...y k- 1...r...y k+1 ...y n );

[0111] Multiply xj / yj by a to obtain X′=(ax1...ax k-1 ...r...ax k+1 ...ax n ) / Y′=(ay1...ay k- 1...r...ay k+1 ...ay n );

[0112] According to or,

[0113] Decompose X / Y into X i =(x 1i ...r ix ...x ni ) / Y i =(y 1i ...r iy ...y ni ), and decompose X′ / Y′ into X i ′=(ax 1i ...r′ ix ...ax ni ) / Y i ′=(ay 1i ...r′ iy ...ay ni ).

[0114] Specifically, in the embodiment, a specific way of expanding, multiplying coefficients and slicing the original vector is to select random number r, k, a from A, insert random number r into the k position of the vector x, expand the n-dimensional vector x into n+1 dimension, obtain X=(x1...x k-1 ...r...x k+1 ...xn ), r can be specifically in x k Before or after, but requiring the same insertion method as B, for each element x in X except r. j Multiply by α to obtain X′=(αx1...αx) k-1 ...r...αx k+1 ...αx n Meanwhile, A informs B of r, k, and α, and B expands the vector Y = (y1...y2) using the same process. k-1 ...r...y k+1 ...y n ), and calculate Y′=(αy1...αy k-1 ...r...αy k+1 ...αy n A divides vectors X and X′ into p parts according to the multiplication pattern: (x 11 ...r 1x ...x n1 ), (x 12 ...r 2x ...x n2 ), ..., (x 1p ...r px ...x np ) and (αx 11 ...r′ 1x ...αx n1 ), (αx 12 ...r′ 2x ...αx n2 ), ..., (αx 1p ...r′ px ...αx np ),in Divide the vector X i =(x 1i ...r ix ...x ni ) and X′ i =(αx 1i ...r′ ix ...αx ni )Send to the corresponding C i B also decomposes vectors Y and Y′ in a similar way and sends the corresponding fragments to C. i .

[0115] Optionally, obtain the same random verification number r, random position number k, and random coefficient α as B / A, specifically including:

[0116] generating a random verification number r, a random position number k, and a random coefficient a, and sending the r, k, and a to B / A; or receiving the random verification number r, the random position number k, and the random coefficient a from B / A.

[0117] Specifically, in this embodiment, the r, k, and a can be generated by either A / B and then sent to the other party.

[0118] Optionally, a Z is calculated according to the O and the random verification number, and an inner product verification parameter Z' of x and y is calculated according to the O' and the random verification number, and the Z is verified according to the Z' and the random coefficient, specifically including:

[0119] calculating Z = O - rr according to the O and the r, wherein the O is from a certain C i is obtained according to the following formula:

[0120] wherein S i is from p C i is obtained according to the following formula respectively:

[0121] S i = (x 1i y 1i ,..., r ix r iy ,..., x ni y ni );

[0122] calculating Z' = O' - rr according to the O' and the r, wherein the O' is from a certain C i is obtained according to the following formula:

[0123] wherein S i ' is from p C i is obtained according to the following formula respectively:

[0124] S i ' = (a x 1i a y 1i ,..., r' ix r' iy ,..., a x ni a y ni );

[0125] verifying whether the Z' is equal to the a 2p Z, if equal, the Z is verified.

[0126] Specifically, in this embodiment, each C i calculates locally:

[0127] S i = (x 1i y 1i , x2i y 2i ,...,r ix r iy , ..., x ni y ni );

[0128] S i ′=(αx 1i αy 1i , αx 2i αy 2i ,...,r′ ix r′ iy , ..., αx ni αy ni );

[0129] Each C i They all calculated their S i S′i is sent to the first computer C1, and C1 computes:

[0130]

[0131]

[0132] Then send O and O′ to A and B.

[0133] A and B calculate Z = O - rr and Z′ = O′ - rr, and verify the relationship between Z′ and α. 2p If Z is equal to Z, the verification passes; otherwise, it can be determined that the calculator has engaged in deception, and the verification fails. The principle of the verification is as follows: assuming a certain calculator C... i To deceive A and B, falsify the local calculation result S i and S i ′, obviously, if S is randomly forged i and S i The result cannot be verified. There is only one way to forge the result and pass verification: scale the elements of the vector proportionally while keeping the element at position k unchanged. However, since position k is kept secret and only A and B know it, the calculator cannot forge the result and pass verification.

[0134] Example 2:

[0135] like Figure 4 As shown, Embodiment 2 of the present invention provides a method for calculating the inner product of multi-party cooperative vectors, which can be applied to, for example... Figure 2 Any of the computing devices C shown i , i∈[1...p], the method includes at least the following: Figure 4 The steps shown are as follows:

[0136] S21. Receive the first vector fragment X from data provider devices A and B. i and Y i and the second vector slice X i ′ and Y i ',in:

[0137] The x / y values ​​obtained by A / B performing an inner product calculation with the original vector y / x of B / A are then negotiated and processed into p X values ​​with B / A. i / Y i and X i ′ / Y i ′, and send them to p C respectively. i X i / Y i and X i ′ / Y i At least one of them carries verification information, i∈[1...p];

[0138] S22, According to X i and Y i and X i ′ and Y i ′ and the remaining (p-1) C i Perform collaborative computation to obtain the first vector inner product O and the second vector inner product O′, and determine the result from a certain C. i Send O and O′ to A and B so that:

[0139] A and B receive data from a certain C. i Given O and O′, obtain and verify the inner product of x and y based on O and O′.

[0140] Optionally, in the method:

[0141] x=(x1...x n ) / y=(y1...y n The inner product of x and y

[0142] X i / Y i The expanded vector fragments are obtained by A / B and B / A negotiating and inserting random verification numbers at the same random positions for x / y to obtain the expanded vector X / Y. Then, according to the multiplication secret sharing mode, X / Y is decomposed into p fragments.

[0143] X i ′ / Y i ′ is determined by A / B and B / A, where a random verification number is inserted at the same random position for x / y, and each element x other than the random verification number is set to 0. j / y jAfter multiplying by random coefficients to obtain the expanded coefficient vector X′ / Y′, the expanded coefficient vector fragments are obtained by decomposing X′ / Y′ into p fragments according to the multiplication secret sharing mode;

[0144] O is composed of p Cs i According to X i and Y i The extended vector inner product obtained through collaborative computation, O′, is composed of p C... i According to X i ′ and Y i The inner product of the extended coefficient vector obtained through collaborative computation.

[0145] Optionally, according to X i and Y i and X i ′ and Y i ′ and the remaining (p-1) C i Perform collaborative computation to obtain the first vector inner product O and the second vector inner product O′, and determine the result from a certain C. i Sending O and O' to A and B, specifically including:

[0146] Based on the X it receives i and Y i Calculate the integral slice S of the extended vector elements i And based on the X it receives i ′ and Y i Calculate the integral slice S of the extended coefficient vector elements. i ′;

[0147] Make a certain C i Get from p C i S i and S i ′, and according to p S i Calculate O, and based on p S i Calculate O', and send O and O' to A and B so that:

[0148] A and B calculate Z based on O and the random verification number, and calculate the inner product verification parameter Z′ of x and y based on O′ and the random verification number, and verify Z based on Z′ and the random coefficient.

[0149] Optionally, make a certain C i Get from p C i S i and S i Specifically, it includes:

[0150] Get the S calculated by itself i and S i ′, and receive from the remaining (p-1) C iS i and S i ′, so that it can obtain from p C i S i and S i ′; or, to the remaining (p-1) C i A certain C in i Send S i and S i ′, so that the remaining (p-1) C i A certain C in i Get from p C i S i and S i ′.

[0151] Optionally, based on the X received by itself i and Y i Calculate the integral slice S of the extended vector elements i And based on the X it receives i ′ and Y i Calculate the integral slice S of the extended coefficient vector elements. i Specifically, it includes:

[0152] Based on the X it receives i ′ and Y i Calculate S i =(x 1i y 1i ,...,r ix r iy , ..., x ni y ni ), and based on the X it receives i ′ and Y i 'Calculate S' i ′=(αx 1i αy 1i ,...,r′ ix r′ iy , ..., αx ni αy ni ), where X i / Y i and X i ′ / Y i A and B were obtained respectively through the following steps:

[0153] Obtain the same random verification number r, random position number k, and random coefficient as B / A. α ;

[0154] Insert r into x / y according to k to obtain X = (x1...x k-1 ...r...x k+1...x n ) / Y = (y1...yr k- 1...r...yr k+1 ...yr n );

[0155] x j / y j is multiplied by α to obtain X' = (αx1...αx k-1 ...r...αx k+1 ...αx n ) / Y' = (αy1...αy k- 1...r...αy k+1 ...αy n );

[0156] According to or,

[0157] X / Y is decomposed into X i = (x 1i ...r ix ...x ni ) / Y i = (y 1i ...r iy ...y ni ), and X' / Y' is decomposed into X i ' = (αx 1i ...r' ix ...αx ni ) / Y i ' = (αy 1i ...r' iy ...αy ni ).

[0158] Optionally, O is calculated according to p S i , and O' is calculated according to p S i ', and O and O' are sent to A and B, specifically including:

[0159] is calculated according to p S i , and is calculated according to p S i '.

[0160] O and O' are sent to A and B, so that A and B calculate Z = O-rr according to O and r, and calculate Z' = O'-rr according to O' and r, and verify whether Z' is equal to α 2p Z, if equal, the verification of Z is passed.

[0161] Specifically, in this embodiment, any computing device C i After obtaining intermediate results by calculating based on the vector fragments received, or by receiving the remaining (p-1) C... i The intermediate result sent is itself acting as a C. i Complete the aggregation calculation of intermediate results, or direct the results to the remaining (p-1) Cs. i A certain C in i Send its own intermediate results, by this C i Complete the aggregation calculation of intermediate results; C i The interaction between A and B has been described in detail in Example 1 and will not be repeated here. This example uses p computing devices to collaboratively calculate the inner product of two vectors provided by two data provider devices, which ensures data privacy and security while ensuring the accuracy of the calculation results. It has the advantages of low computational load, fast operation speed, easy verification of calculation results, and high computation and communication efficiency, and has broad application prospects.

[0162] Example 3:

[0163] like Figure 2 and 5 As shown, Embodiment 3 of the present invention provides a data provider device A / B, wherein device A / B includes:

[0164] The slice processing module 11 is used to process the x / y, which is to be calculated as the inner product of itself with the original vector y / x of B / A, into p first vector slices X through negotiation with B / A. i / Y i and the second vector slice X i ′ / Y i ′, X i / Y i and X i ′ / Y i At least one of them carries verification information, i∈[1...p];

[0165] The first calculation activation module 12, connected to the segmentation processing module 11, is used to process p X segments. i / Y i and X i ′ / Y i Send them to p computing devices C respectively. i So that:

[0166] p C i Each receives X from A and B. i and Y i and X i ′ and Y i ′, and according to X i and Y iand X i and Y i perform a cooperative calculation to obtain a first vector inner product O and a second vector inner product O', and from some C i O and O' are sent to A and B;

[0167] The inner product verification module 13 is connected with the first calculation starting module 12, and is configured to receive O and O' from some C i and obtain and verify the inner product of x and y according to O and O'.

[0168] Optionally, in the device A / B:

[0169] x = (x1...x n ) / y = (y1...y n ), the inner product of x and y

[0170] X i / Y i is an extended vector piece obtained by decomposing the extended vector X / Y into p pieces according to a multiplication secret sharing mode after the extended vector X / Y is obtained by inserting a random verification number into x / y at the same random position and negotiating with B / A;

[0171] X i ′ / Y i ′ is an extended coefficient vector piece obtained by decomposing the extended coefficient vector X' / Y' into p pieces according to a multiplication secret sharing mode after the extended coefficient vector X' / Y' is obtained by multiplying each element x j / y j by a random coefficient except the random verification number, and negotiating with B / A;

[0172] O is an extended vector inner product obtained by cooperative calculation of p Cs i according to X i and Y i , and O' is an extended coefficient vector inner product obtained by cooperative calculation of p Cs i according to X i ′ and Y i ′.

[0173] Optionally, the inner product verification module 13 is specifically configured to:

[0174] calculate Z according to O and the random verification number, calculate an inner product verification parameter Z' of x and y according to O' and the random verification number, and verify Z according to Z' and the random coefficient, wherein O and O' are obtained by p Cs i according to the following steps:

[0175] p Cs i each according to the Xi and Y i Calculate the integral slice S of the extended vector elements i And based on the X it receives i ′ and Y i Calculate the integral slice S of the extended coefficient vector elements. i ′,

[0176] Make a certain C i Get from p C i S i and S i ′, and according to p S i Calculate O, and based on p S i 'Calculate O'.

[0177] Optionally, the sharding processing module 11 specifically includes:

[0178] The negotiation unit is used to obtain the same random verification number r, random position number k, and random coefficient α as B / A.

[0179] The expansion unit, connected to the negotiation unit, is used to insert r into x / y according to k to obtain X = (x1...x k- 1...r...x k+1 ...x n ) / Y=(y1...y k-1 ...r...y k+1 ...y n );

[0180] The coefficient unit, connected to the expansion unit, is used to convert x j / y j Multiply by α to obtain X′=(αx1...αx) k-1 ...r...αx k+1 ...αx n ) / Y′=(αy1...αy k-1 ...r...αy k+1 ...αy n );

[0181] Decomposition units, connected to coefficient units, are used to decompose according to...

[0182] Decompose X / Y into X i =(x 1i ...r ix ...x ni ) / Y i =(y 1i ...r iy ...y ni), and decomposing X / Y into X i ' = (αx 1i ... r' ix ... αx ni ) / Y i ' = (αy 1i ... y ... αy ni ).

[0183] Optionally, the negotiation unit specifically comprises:

[0184] a first sending unit, configured to generate a random verification number r, a random position number k, and a random coefficient α, and send the r, k, and α to the B / A; or a first receiving unit, configured to receive the random verification number r, the random position number k, and the random coefficient α from the B / A.

[0185] Optionally, the inner product verification module 13 specifically comprises:

[0186] an original inner product calculation unit, configured to calculate Z = O-rr according to the O and the r, wherein the O is calculated by a certain C i According to the following formula:

[0187] wherein S i is calculated by p C i Each is calculated according to the following formula:

[0188] S i = (x 1i y 1i ,..., r ix r iy ,..., x ni y ni );

[0189] a verification parameter calculation unit, configured to calculate Z' = O'-rr according to the O' and the r, wherein the O' is calculated by a certain C i According to the following formula:

[0190] wherein S i ' is calculated by p C i Each is calculated according to the following formula:

[0191] S i ' = (αx 1i αy 1i ,..., r' ix r' iy ,..., αx ni αy ni );

[0192] The verification and judgment unit, connected to the original inner product calculation unit and the verification parameter calculation unit, is used to verify the relationship between Z′ and α. 2p If Z is equal to Z, then the verification of Z is successful.

[0193] Example 4:

[0194] like Figure 2 and 6 As shown, Embodiment 4 of the present invention provides a computing device C. i , i∈[1...p], the device C i include:

[0195] The second computation activation module 21 is used to receive the first vector fragment X from data provider devices A and B. i and Y i and the second vector slice X i ′ and Y i ',in:

[0196] The x / y values ​​obtained by A / B performing an inner product calculation with the original vector y / x of B / A are then negotiated and processed into p X values ​​with B / A. i / Y i and X i ′ / Y i ′, and send them to p C respectively. i X i / Y i and X i ′ / Y i At least one of them carries verification information, i∈[1...p];

[0197] The collaborative computing module 22, connected to the second computing activation module 21, is used to calculate based on X. i and Y i and X i ′ and Y i ′ and the remaining (p-1) C i Perform collaborative computation to obtain the first vector inner product O and the second vector inner product O′, and determine the result from a certain C. i Send O and O′ to A and B so that:

[0198] A and B receive data from a certain C. i Given O and O′, obtain and verify the inner product of x and y based on O and O′.

[0199] Optionally, the device C i middle:

[0200] x=(x1...x n ) / y=(y1...y n The inner product of x and y

[0201] X i / Y i is an extended vector slice obtained by A / B and B / A negotiating, inserting a random verification number to x / y at the same random position, obtaining an extended vector X / Y, and decomposing X / Y into p slices according to a multiplication secret sharing mode;

[0202] X i ′ / Y i ′ is an extended coefficient vector slice obtained by A / B and B / A negotiating, inserting a random verification number to x / y at the same random position, multiplying each element x j / y j except the random verification number by a random coefficient to obtain an extended coefficient vector X′ / Y′, and decomposing X′ / Y′ into p slices according to a multiplication secret sharing mode;

[0203] O is an extended vector inner product obtained by p C i synchronously calculating X i and Y i , and O′ is an extended coefficient vector inner product obtained by p C i synchronously calculating X i ′ and Y i ′.

[0204] Optionally, the synchronously calculating module 22 specifically comprises:

[0205] an element product calculating unit, configured to calculate an extended vector element product slice S i according to X i and Y i received by itself, and calculate an extended coefficient vector element product slice S i ′ according to X i ′ and Y i ′ received by itself.

[0206] a vector product calculating unit, connected with the element product calculating unit, configured to make a certain C i obtain S i and S i ′ from p C i , calculate O according to p S i , calculate O′ according to p S i ′, and send O and O′ to A and B, so that:

[0207] A and B calculate Z according to O and the random verification number, calculate an inner product verification parameter Z′ of x and y according to O′ and the random verification number, and verify Z according to Z′ and the random coefficient.

[0208] Optionally, the vector product calculation unit comprises a cooperation unit, in particular comprising:

[0209] a second receiving unit configured to acquire S i and S i ′ obtained by itself, and receive S i and S i ′ from the remaining (p-1) C i s, so that the S i and S i ′ from the p C i s are acquired by itself; or a second sending unit configured to send S i and S i ′ to a certain C i from the remaining (p-1) C i s, so that the S i and S i ′ from the p C i s are acquired by a certain C i from the remaining (p-1) C i s.

[0210] Optionally, the element product calculation unit is specifically configured to:

[0211] calculate Si=(x i y i ,...,r 1i r 1i ,...,x ix y iy ) according to the X ni and Y ni received by itself, and calculate S i ′=(αx i αy i ,...,r′ 1i r′ 1i ,...,αx ix αy iy ) according to the X ni ′ and Y ni ′ received by itself, wherein X i / Y i and X i ′ / Y i ′ are obtained by A / B according to the following steps:

[0212] acquire the random verification number r, the random position number k, and the random coefficient α which are the same as B / A;

[0213] insert r into x / y according to k to obtain X=(x1...x k-1 ...r...x k+1 ...x n) / Y = (y1...yr...y k- 1...r...y k+1 ...y n );

[0214] X / Y = (x1...xr...x j / y j ) and X' / Y' = (αx1...αxr...αx k-1 ...r...αx k+1 ...αx n ) / Y' = (αy1...αyr...αy k- 1...r...αy k+1 ...αy n );

[0215] According to the above equation, O and O' can be calculated as follows: or,

[0216] X / Y = (x1...xr...x i ) / Y = (y1...yr...y 1i ...r ix ...x ni ) / Y i =(y 1i ...r iy ...y ni ) and X' / Y' = (αx1...αxr...αx i ) / Y' = (αy1...αyr...αy 1i ...r′ ix ...αx ni ) / Y i =(αy 1i ...r′ iy ...αy ni )。

[0217] Optionally, the vector product calculation unit is specifically configured to:

[0218] According to p S i , calculate and according to p S i ', calculate

[0219] Send O and O' to A and B, so that A and B calculate Z = O-rr according to O and r, and calculate Z' = O'-rr according to O' and r, and verify whether Z' is equal to α 2p Z, if equal, the verification of Z is passed.

[0220] Embodiment 5:

[0221] Embodiment 5 of the present application provides a computer readable storage medium, which stores a computer program, and when the computer program is run by a processor, the method for calculating the inner product of vectors in multi-party cooperation as described in Embodiment 1 or Embodiment 2 is realized.

[0222] Specifically, in the present embodiment, the computer program can be run in an electronic device, which can be a data provider device A or B, or any computing device C i , i∈[1...p], the inner product of two vectors provided by two data provider devices is calculated by p computing device in cooperation, which can ensure the data privacy security and the accuracy of the calculation result, has the advantages of small calculation amount, fast operation speed, easy verification of calculation result, high calculation and communication efficiency, and wide application prospect. The computer readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer readable instructions, data structures, computer program modules or other data). Computer readable storage medium includes but is not limited to RAM (Random Access Memory, Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory, Electrically Erasable Programmable Read-Only Memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory, Compact Disc Read-Only Memory), digital versatile disc (DVD) or other optical disc storage, magnetic box, magnetic tape, magnetic disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer.

[0223] In addition, the present application can also provide an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the method for calculating the inner product of vectors in multi-party cooperation as described in Embodiment 1 or Embodiment 2.

[0224] Wherein the memory is connected with the processor, and the memory can adopt flash memory or read-only memory or other storage, and the processor can adopt central processing unit or single-chip microcomputer.

[0225] Embodiment 6:

[0226] As shown in Figure 2 Embodiment 6 of the present application provides a multi-party cooperative vector inner product calculation system, which comprises:

[0227] Data provider devices A and B are used for performing the multi-party collaborative vector inner product calculation method as described in Embodiment 1 respectively.

[0228] p computing devices C i , i is in [1...p], which are connected with the data provider devices A and B, and are used for collaboratively performing the multi-party collaborative vector inner product calculation method as described in Embodiment 2.

[0229] Specifically, in the embodiment, the data provider devices A and B are connected with each other, and the negotiation of the processing rules of the original vectors is realized, for example, the random verification number r, the random position number k and the random coefficient a are agreed, and the A and B are connected with p computing devices C i (C1, C2...C p ) respectively, and are used for sending the corresponding vector fragments after processing to each C i respectively, and the p C i are connected with each other, so as to realize the collaborative calculation of the vector fragments, and the final result containing the original vector inner product information and the verification information is obtained after the collaborative calculation is completed, and the final result is sent to the A and B by a certain C i , and the original vector inner product is restored and verified by the A and B, and the detailed implementation process is described in Embodiment 1; through the collaborative calculation of the p computing devices, the inner product of the two vectors provided by the two data provider devices can be ensured to be safe in data privacy, and the accuracy of the calculation result is ensured, and the calculation amount is small, the operation speed is fast, the calculation result is easy to verify, the calculation and communication efficiency is high, and the application prospect is wide.

[0230] Embodiments 1-6 of the application provide a multi-party collaborative vector inner product calculation method, a data provider device, a computing device, a computer readable storage medium and a multi-party collaborative vector inner product calculation system, through the collaborative calculation of the p computing devices, the inner product of the two vectors provided by the two data provider devices can be ensured to be safe in data privacy, and the accuracy of the calculation result is ensured, and the calculation amount is small, the operation speed is fast, the calculation result is easy to verify, the calculation and communication efficiency is high, and the application prospect is wide.

[0231] It is understood that the above embodiments are only exemplary for illustrating the principles of the present application, and the present application is not limited thereto. Various modifications and improvements can be made by those skilled in the art without departing from the spirit and scope of the present application, and these modifications and improvements are also considered as the protection scope of the present application.

Claims

1. A method for multi-party collaborative vector inner product computation, the method comprising: The method is applied to data provider devices A / B, and the method comprises: x / y, which is to be internally multiplied with the original vector y / x of B / A, is split into p first vector pieces X i / y i and second vector pieces X' i / y' i , X i / y i and X' i / y' i at least one of which carries authentication information, i∈[1...p], wherein: x = (x1...x n ) / y = (y1...y n ), inner product of x and y X i / Y i are the extended vector shards obtained by decomposing the extended vector X / Y into p shards according to the multiplication secret sharing mode after inserting a random verification number at the same random position as B / A negotiates, X′ i Y′ i is negotiated with B / A, a random verification number is inserted at the same random position as x / y, and each element x j / y j After multiplying the random coefficient to obtain the extended coefficient vector X′ / Y′, the extended coefficient vector fragments obtained by decomposing X′ / Y′ into p fragments according to the multiplication secret sharing mode; p X i / Y i and X' i / Y' i to p computing devices C i such that: p C i each receiving X from A and B i and Y i and X' i and Y' i and Y i and Y i and X' i and Y' i and Y i and Y i and Y i and Y i and Y i and Y i and Y i and Y i by the following steps: p C i each according to the X i and Y i computes the augmented vector element integral piece S i , and according to the X′ i and Y′ i computes the augmented coefficient vector element integral piece S′ i , C i acquire p S i from p C i and S' i , and compute O from p S i and O' from p S' i ​ Receiving from some C i O and O', and obtaining and verifying the inner product of x and y from O and O', in particular comprising: According to O and the random verification number, Z is calculated, and according to O' and the random verification number, the inner product verification parameter Z' of x and y is calculated, and Z is verified according to Z' and the random coefficient.

2. The method of claim 1, wherein, X / Y, which is to be calculated with the original vector y / x of B / A, is processed into p first vector slices X with B / A i / Y i and second vector slices X' i / Y' i , specifically comprising: Obtain the same random verification number r, random position number k and random coefficient a as B / A. insert r according to k into x / y to get X=(x1...x k-1 ... r... x k+1 ... x n ) / Y=(y1...y k-1 ... r... y k+1 ... y n ); x j y j x k-1 y k+1 x n y k-1 y k+1 y n ) According to or, X / Y is decomposed into X i = (x 1i …r ix …x ni ) / Y i = (y 1i …r iy …y ni ), and X' / Y' is decomposed into X' i = (αx 1i …r' ix …αx ni ) / Y' i = (αy 1i …r' iy …αy ni ).

3. The method of claim 2, wherein, Obtain the same random verification number r, random position number k and random coefficient a as B / A, specifically comprising: Generate the random verification number r, the random position number k and the random coefficient a, and send r, k and a to B / A; or receive the random verification number r, the random position number k and the random coefficient a from B / A.

4. The method according to claim 2 or 3, characterized in that, According to O and the random verification number, Z is calculated, and according to O' and the random verification number, the inner product verification parameter Z' of x and y is calculated, and Z is verified according to Z' and the random coefficient, specifically comprising: According to O and r, calculate Z = O - rr, where O is from some C i According to the following formula: wherein S i from p C i each according to the following formula: S i = (x 1i y 1i ,…,r ix r iy ,…,x ni y ni ); According to O' and r, calculate Z' = O' - rr, where O' is derived from some C i According to the following formula: where S' i from p C i each according to the following formula: S' i = (αx 1i αy 1i ,…,r′ ix r′ iy ,…,αx ni αy ni ); Verify Z' with a 2p Z is equal, if equal, then Z is verified.

5. A method for multi-party coordinated vector inner product computation, the method comprising: Applying to computing device C i i∈[1…p], the method comprising: Receiving a first vector slice X from data provider devices A and B i and Y i and a second vector slice X' i and Y' i wherein: x / y, which are calculated by A / B respectively with the original vector y / x to be processed with B / A, negotiate with B / A to be processed into p X i / Y i and X' i / Y' i and send to p C i , X i / Y i and X' i / Y' i at least one of which carries authentication information, i∈[1…p], wherein: x = (x1...x n ) / y = (y1...y n ), inner product of x and y X i / Y i is an extended vector slice obtained by decomposing the extended vector X / Y into p slices according to the multiplication secret sharing mode after the extended vector X / Y is obtained by inserting a random verification number at the same random position of x / y, which is negotiated by A / B and B / A, X′ i / Y i ′ is obtained by A / B and B / A negotiating, inserting a random verification number at the same random position of x / y, and multiplying each element x j / y j After obtaining the extended coefficient vector X′ / Y′ by multiplying the random coefficient, the extended coefficient vector pieces are obtained by decomposing X′ / Y′ into p pieces according to the multiplication secret sharing mode. According to X i and Y i and X' i and Y' i and the remaining (p-1) C i , a first vector inner product O and a second vector inner product O' are obtained, O is obtained by p C i According to X i and Y i , an extended vector inner product is obtained by cooperative calculation, O' is obtained by p C i According to X' i and Y' i , an extended coefficient vector inner product is obtained by cooperative calculation, and from a certain C i O and O' are sent to A and B, specifically including: According to the X i and Y i received by itself, the extended vector element integral piece S i is calculated, and according to the X′ i and Y′ i received by itself, the extended coefficient vector element integral piece S′ i is calculated, C i p C i S i and S' i and p S i O and p S' i O' are computed and sent to A and B, So that: A and B receive data from a certain C. i Given O and O′, and based on O and O′, obtain and verify the inner product of x and y, specifically including: A and B according to O and the random verification number, Z is calculated, and according to O' and the random verification number, the inner product verification parameter Z' of x and y is calculated, and Z is verified according to Z' and the random coefficient.

6. The method of claim 5, wherein, C i acquire S i from p C i and S' i , specifically comprising: Get the S calculated by itself i and S′ i and receive from the remaining (p-1) C i S i and S′ i In order to obtain from p C i S i and S′ i Alternatively, to the remaining (p-1) C i A certain C in i Send S i and S′ i So that the remaining (p-1) C i A certain C in i Get from p C i S i and S′ i .

7. The method according to claim 5 or 6, characterized in that, According to the X i and Y i , calculate the extended vector element integral piece S i , and according to the X' i and Y' i , calculate the extended coefficient vector element integral piece S' i , specifically comprising: According to the X i and Y i itself received, calculate S i = (x 1i y 1i ,..., r ix r iy ,..., x ni y ni ), and according to the X' i and Y' i itself received, calculate S' i = (αx 1i αy 1i ,..., r' ix r' iy ,..., αx ni αy ni ), wherein X i / Y i and X' i / Y' i are obtained by A / B according to the following steps: Obtain the same random verification number r, random position number k and random coefficient a as B / A. insert r into x / y according to k to get X=(x1...x k-1 ...r...x k+1 ...x n ) / Y=(y1...y k-1 ...r...y k+1 ...y n ); x j y j x k-1 x k+1 x n y k-1 y k+1 y n ) According to or, X / Y is decomposed into X i = (x 1i …r ix …x ni ) / Y i = (y 1i …r iy …y ni ), and X' / Y' is decomposed into X' i = (αx 1i …r' ix …αx ni ) / Y' i = (αy 1i …r' iy …αy ni ).

8. The method of claim 7, wherein, According to p S i O is calculated, and according to p S' i O' is calculated, and O and O' are sent to A and B, specifically including: According to p S i Computing and according to p S' i Computing Send O and O′ to A and B so that: A and B calculate Z = O - rr based on O and r, and calculate Z′ = O′ - rr based on O′ and r, and verify that Z′ is consistent with α. 2p If Z is equal to Z, then the verification of Z is successful.

9. A data provider device A / B, characterized by The device comprises: a fragment processing module, configured to negotiate with B / A to process x / y, which is to be calculated with B / A by inner product, into p first vector fragments X i / Y i and second vector fragments X' i / Y' i , X i / Y i and X' i / Y' i at least one of which carries verification information, i∈[1…p], wherein: x = (x1...x n ) / y = (y1...y n ), inner product of x and y X i / Y i are the extended vector shards obtained by decomposing the extended vector X / Y into p shards according to the multiplication secret sharing mode after inserting a random verification number at the same random position as B / A negotiates, X′ i / Y i ′ is negotiated with B / A, a random verification number is inserted at the same random position as x / y, and each element x j / y j After multiplying the random coefficient to obtain the extended coefficient vector X′ / Y′, the extended coefficient vector fragments obtained by decomposing X′ / Y′ into p fragments according to the multiplication secret sharing mode; The first calculation opening module is connected with the fragmentation processing module, and is used for sending p X i / Y i and X' i / Y' i to p calculation device C i respectively, so that p C i Each receives X from A and B. i and Y i and X′ i and Y i ′, and according to X i and Y i and X′ i and Y i Perform collaborative computation to obtain the first vector inner product O and the second vector inner product O′, and determine the result from a certain C. i Send O and O′ to A and B, where O is composed of p C's. i According to X i and Y i The extended vector inner product obtained through collaborative computation, O′, is composed of p C... i According to X′ i and Y i The extended coefficient vector inner product obtained through collaborative computation, O, and O′ are composed of p C's. i To obtain it, follow these steps: p C i each according to its own received X i and Y i computes the augmented vector element integral piece S i , and according to its own received X' i and Y i ' computes the augmented coefficient vector element integral piece S' i , Make a certain C i Get from p C i S i and S′ i And based on p S i Calculate O, and based on p S's i Calculate O′; The inner product verification module is connected with the first calculation starting module, and is used for receiving O and O' from a certain C, and obtaining and verifying the inner product of x and y according to O and O', specifically comprising: According to O and the random verification number, Z is calculated, and according to O' and the random verification number, the inner product verification parameter Z' of x and y is calculated, and Z is verified according to Z' and the random coefficient.

10. A computing device C i , i e [1...p], characterized in that The device comprises: a second computation opening module, configured to receive the first vector slice X from the data provider device A and B i and Y i and the second vector slice X' i and Y' i wherein: x / y, which are respectively the inner product of x / y with the original vector y / x of A / B, are negotiated with B / A into p X i / Y i and X' i / Y' i and sent to p C i , X i / Y i and X' i / Y' i at least one of which carries authentication information, i∈[1...p], wherein: x = (x1...x n ) / y = (y1...y n ), inner product of x and y X i / Y i is an extended vector slice obtained by decomposing the extended vector X / Y into p slices according to the multiplication secret sharing mode after the extended vector X / Y is obtained by inserting a random verification number at the same random position of x / y, which is negotiated by A / B and B / A, X′ i / Y i ′ is obtained by A / B and B / A negotiating, inserting a random verification number at the same random position of x / y, and multiplying each element x j / y j After obtaining the extended coefficient vector X′ / Y′ by multiplying the random coefficient, the extended coefficient vector pieces are obtained by decomposing X′ / Y′ into p pieces according to the multiplication secret sharing mode. The collaborative computing module, connected to the second computing activation module, is used to perform calculations based on X. i and Y i and X′ i and Y i ′ and the remaining (p-1) C i Perform collaborative computation to obtain the first vector inner product O and the second vector inner product O′, where O is composed of p C... i According to X i and Y i The extended vector inner product obtained through collaborative computation, O′, is composed of p C... i According to X′ i and Y i The inner product of the extended coefficient vectors obtained through collaborative computation, and determined by a certain C i Sending O and O' to A and B, specifically including: an element product calculation unit for calculating an element product slice S of the extended coefficient vector from the X i and Y i received by itself i , and an element product calculation unit for calculating an element product slice S' of the extended coefficient vector from the X' i and Y i received by itself i , Vector product calculation unit, connected to the element product calculation unit, for calculating a certain C i S i and S' i from p C i S i and S' i and sending O and O' to A and B, So that: A and B receive data from a certain C. i Given O and O′, and based on O and O′, obtain and verify the inner product of x and y, specifically including: A and B according to O and the random verification number, Z is calculated, and according to O' and the random verification number, the inner product verification parameter Z' of x and y is calculated, and Z is verified according to Z' and the random coefficient.

11. A computer readable storage medium, characterized in that, The computer program is stored on the computer, and when the computer program is run by the processor, the multi-party collaborative vector inner product calculation method of any one of claims 1-4 or 5-8 is realized.

12. A multi-party coordinated vector inner product computation system, comprising: The system comprises: Data provider devices A and B are used for respectively executing the multi-party collaborative vector inner product calculation method of any one of claims 1-4; p computing devices C i , i ∈ [1...p], are connected with the data provider devices A and B for jointly performing the multi-party coordinated vector inner product computation method as claimed in any one of claims 5-8.

Citation Information

Patent Citations

  • Data processing method, multi-party safety computing system and electronic equipment

    CN112464155A

  • Method and device for jointly generating data tuples for secure computing

    CN113434886A