Vector point multiplication calculation method, device and equipment for cloud computing, readable storage medium and program product

Through the vector point multiplication calculation method for cloud computing, the vector is converted into ciphertext or share vectors using public key encryption system and subtraction cryptographic sharing technology, which solves the problem of insufficient security of the vector point multiplication protocol in the prior art, and achieves higher security and richer application scenarios.

CN120104939APending Publication Date: 2025-06-06ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510321577.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing vector point multiplication protocol based on Paillier partial homomorphic encryption algorithm has insufficient security, which is specifically manifested as the need to input plaintext vectors, which poses a greater security risk.

Method used

A vector point multiplication calculation method for cloud computing is designed. By obtaining the first vector and the second vector to be processed, packaging them into ciphertext or splitting them into component vectors through subtraction password sharing, and sending them to servers that are not in common for calculation, finally obtaining the point multiplication result of the vector.

Benefits of technology

By converting the input vector into ciphertext or share vectors, the input of plaintext vectors is avoided, security is improved, and the applicable scenarios of the protocol are expanded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104939A_ABST
    Figure CN120104939A_ABST
Patent Text Reader

Abstract

The invention relates to a cloud computing-oriented vector point multiplication calculation method and device, equipment, a storage medium and a program product, and relates to the technical field of information security. By adopting the method, the security of vector dot product calculation can be improved. The method comprises the following steps: packaging a first vector to obtain a corresponding plaintext, encrypting the plaintext through an encryption algorithm to obtain a ciphertext, and splitting a second vector into a first share vector and a second share vector by using subtraction password sharing; sending the ciphertext and the first share vector to a first server, calculating by the first server according to the ciphertext and the first share vector to obtain a first share, sending the ciphertext and the second share vector to a second server, and calculating by the second server according to the ciphertext and the second share vector to obtain a second share; and receiving a first share returned by the first server and a second share returned by the second server, and obtaining a point product result of the first vector and the second vector according to the first share and the second share.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a vector dot multiplication calculation method, apparatus, computer equipment, computer-readable storage medium, and computer program product for cloud computing. Background Art

[0002] With the development of cloud computing technology, users can store data on cloud servers and perform machine learning training and reasoning. In order to protect data privacy, users generally encrypt data using homomorphic encryption before storing it on cloud servers. Homomorphic encryption supports meaningful operations on encrypted data, which can protect user data privacy and ensure the availability of user data. Homomorphic encryption is divided into two types: fully homomorphic encryption and partially homomorphic encryption. Since fully homomorphic encryption often requires large computing and storage costs, the industry often uses partially homomorphic encryption, especially the Paillier partially homomorphic encryption algorithm.

[0003] Paillier partially homomorphic encryption currently only supports addition and scalar multiplication operations on encrypted data. Through additional technical means, Paillier partially homomorphic encryption can support more types of operations, such as vector point multiplication. However, the existing vector point multiplication protocol based on the Paillier partially homomorphic encryption algorithm has the problem of insufficient security. Specifically, the existing vector point multiplication protocol based on the Paillier partially homomorphic encryption algorithm requires the input of a plaintext vector, and there is a great security risk in inputting a plaintext vector in a secure computing protocol. Summary of the invention

[0004] Based on this, it is necessary to provide a vector dot multiplication calculation method, device, computer equipment, computer-readable storage medium and computer program product for cloud computing to address the above technical problems.

[0005] In a first aspect, the present application provides a vector dot multiplication calculation method for cloud computing, including:

[0006] Obtaining a first vector and a second vector to be processed, and recruiting a first server and a second server that do not collude with each other;

[0007] Packing the first vector to obtain corresponding plaintext, encrypting the plaintext by using an encryption algorithm of a public key encryption system to obtain ciphertext, and splitting the second vector into a first share vector and a second share vector by using subtraction cryptographic sharing;

[0008] Sending the ciphertext and the first share vector to the first server, where the first server calculates a first share according to the ciphertext and the first share vector, and sending the ciphertext and the second share vector to the second server, where the second server calculates a second share according to the ciphertext and the second share vector;

[0009] The first share returned by the first server and the second share returned by the second server are received, and a dot product result of the first vector and the second vector is obtained according to the first share and the second share.

[0010] In one embodiment, after recruiting the first server and the second server which do not collude with each other, the method further includes:

[0011] Generate relevant parameters of the public key encryption system, execute a key generation algorithm according to the relevant parameters, and obtain a public-private key pair of the public key encryption system; initialize the public-private key pair, send the public key in the public-private key pair to the first server and the second server respectively, and retain the private key in the public-private key pair.

[0012] In one embodiment, before packing the first vector to obtain the corresponding plaintext, the method further includes:

[0013] Obtaining a first bit length of the modulus of the public key encryption system and a second bit length of twice the private key of the public key encryption system, and determining a size value of a slot; calculating a usage number of the slot according to the size value, the first bit length, and the second bit length, and calculating an upper limit on the number of message packages in a single plaintext according to the usage number;

[0014] The step of packing the first vector to obtain corresponding plaintext includes:

[0015] Based on the usage quantity and the upper limit of the message packaging quantity, the first vector is packaged to obtain the plaintext.

[0016] In one embodiment, the splitting the second vector into a first share vector and a second share vector using subtraction cryptographic sharing comprises:

[0017] The second vector is represented as a second sub-vector of a target number, and a random number of the target number is selected from a preset interval as a second share sub-vector; a first share sub-vector is determined according to the second share sub-vector, the private key in the public-private key pair, and the second sub-vector; and the first share vector and the second share vector are obtained according to the first share sub-vector and the second share sub-vector, respectively.

[0018] In one embodiment, the first server calculating the first share according to the ciphertext and the first share vector includes:

[0019] The first server determines a first target coefficient according to the first share vector and the number of used slots, inputs the ciphertext and the first target coefficient into a preset share calculation model, and obtains the first share output by the share calculation model;

[0020] The calculating, by the second server according to the ciphertext and the second share vector, of the second share includes:

[0021] The second server determines a second target coefficient according to the second share vector and the number of used slots, inputs the ciphertext and the second target coefficient into the share calculation model, and obtains the second share output by the share calculation model.

[0022] In one embodiment, obtaining a dot product result of the first vector and the second vector according to the first share and the second share includes:

[0023] Determine a target share based on the first share and the second share, and update the target share based on the private key in the public-private key pair to obtain a current share; determine the dot product result based on the current share and the size value of the slot.

[0024] In a second aspect, the present application also provides a vector dot product computing device for cloud computing, comprising:

[0025] A vector acquisition module, used for acquiring a first vector and a second vector to be processed, and recruiting a first server and a second server that do not collude with each other;

[0026] a plaintext encryption module, configured to package the first vector to obtain corresponding plaintext, encrypt the plaintext by using an encryption algorithm of a public key encryption system to obtain ciphertext, and split the second vector into a first share vector and a second share vector by using subtraction cryptographic sharing;

[0027] a share calculation module, configured to send the ciphertext and the first share vector to the first server, and the first server calculates a first share according to the ciphertext and the first share vector, and send the ciphertext and the second share vector to the second server, and the second server calculates a second share according to the ciphertext and the second share vector;

[0028] The result generating module is configured to receive the first share returned by the first server and the second share returned by the second server, and obtain a dot product result of the first vector and the second vector according to the first share and the second share.

[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0030] Obtain a first vector and a second vector to be processed, and recruit a first server and a second server that do not collude with each other; pack the first vector to obtain corresponding plaintext, encrypt the plaintext by using an encryption algorithm of a public key encryption system to obtain a ciphertext, and use subtraction cipher sharing to split the second vector into a first share vector and a second share vector; send the ciphertext and the first share vector to the first server, and the first server calculates a first share based on the ciphertext and the first share vector, and send the ciphertext and the second share vector to the second server, and the second server calculates a second share based on the ciphertext and the second share vector; receive the first share returned by the first server and the second share returned by the second server, and obtain a dot product result of the first vector and the second vector based on the first share and the second share.

[0031] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0032] Obtain a first vector and a second vector to be processed, and recruit a first server and a second server that do not collude with each other; pack the first vector to obtain corresponding plaintext, encrypt the plaintext by using an encryption algorithm of a public key encryption system to obtain a ciphertext, and use subtraction cipher sharing to split the second vector into a first share vector and a second share vector; send the ciphertext and the first share vector to the first server, and the first server calculates a first share based on the ciphertext and the first share vector, and send the ciphertext and the second share vector to the second server, and the second server calculates a second share based on the ciphertext and the second share vector; receive the first share returned by the first server and the second share returned by the second server, and obtain a dot product result of the first vector and the second vector based on the first share and the second share.

[0033] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0034] Obtain a first vector and a second vector to be processed, and recruit a first server and a second server that do not collude with each other; pack the first vector to obtain corresponding plaintext, encrypt the plaintext by using an encryption algorithm of a public key encryption system to obtain a ciphertext, and use subtraction cipher sharing to split the second vector into a first share vector and a second share vector; send the ciphertext and the first share vector to the first server, and the first server calculates a first share based on the ciphertext and the first share vector, and send the ciphertext and the second share vector to the second server, and the second server calculates a second share based on the ciphertext and the second share vector; receive the first share returned by the first server and the second share returned by the second server, and obtain a dot product result of the first vector and the second vector based on the first share and the second share.

[0035] The above-mentioned vector point multiplication calculation method, device, computer equipment, computer-readable storage medium and computer program product for cloud computing are based on a public key encryption system with fast encryption and decryption capabilities, subtractive secret sharing and a dual-server architecture, and a secure vector point multiplication calculation protocol is designed; the secure vector point multiplication calculation protocol is input by the first server and the second server that do not collude with each other at the same time, and the same ciphertext obtained by packing and encrypting the first vector is obtained. Then the first server and the second server respectively input the first share vector and the second share vector obtained by splitting the second vector by subtractive secret sharing. Finally, the two servers output the first share and the second share respectively, and the data owner can obtain the point multiplication result of the first vector and the second vector from the first share and the second share. In this application, the vectors input to the secure vector point multiplication protocol are either in ciphertext form or processed by subtractive secret sharing. There is no plaintext vector, which effectively avoids high-risk operations such as inputting plaintext vectors in the secure calculation protocol, thereby improving security; in addition, due to the updated security of the secure vector point multiplication calculation protocol proposed in this application, its applicable application scenarios are also richer. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 A diagram of an application environment of a vector dot product calculation method for cloud computing in one embodiment;

[0038] Figure 2A schematic diagram of a process flow of a vector dot multiplication calculation method for cloud computing in one embodiment;

[0039] Figure 3 is a schematic flow chart of a vector splitting step in one embodiment;

[0040] Figure 4 It is a flowchart of a vector dot multiplication calculation method for cloud computing in a specific embodiment;

[0041] Figure 5 is a structural block diagram of a vector dot product calculation device for cloud computing in one embodiment;

[0042] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] The vector dot multiplication calculation method for cloud computing provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the data owner communicates with the first server and the second server respectively through the network.

[0045] Specifically, the vector dot multiplication calculation method for cloud computing provided in the embodiments of the present application can be executed by the data owner.

[0046] Exemplarily, the data owner obtains the first vector and the second vector to be processed, and recruits the first server and the second server that do not collude with each other; packages the first vector to obtain the corresponding plaintext, encrypts the plaintext through the encryption algorithm of the public key encryption system to obtain the ciphertext, and uses subtraction cipher sharing to split the second vector into the first share vector and the second share vector; sends the ciphertext and the first share vector to the first server, and the first server calculates the first share based on the ciphertext and the first share vector, and sends the ciphertext and the second share vector to the second server, and the second server calculates the second share based on the ciphertext and the second share vector; receives the first share returned by the first server and the second share returned by the second server, and obtains the dot product result of the first vector and the second vector based on the first share and the second share.

[0047] In such Figure 1 In the application environment shown, the data owner may be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The first server and the second server may be implemented as independent servers or a server cluster consisting of multiple servers.

[0048] In one embodiment, Figure 2 As shown in the figure, a vector dot multiplication calculation method for cloud computing is provided. Figure 1 The data owner in is taken as an example to illustrate, including the following steps:

[0049] Step S201, obtaining a first vector and a second vector to be processed, and recruiting a first server and a second server that do not collude with each other.

[0050] For example, this embodiment can be applied to scenarios such as machine learning training and reasoning on a cloud server. In the above scenarios, the first vector and the second vector can represent model parameters of the machine learning model, and can also represent data provided by the user. The types of data include but are not limited to text data, image data, and audio data. These data and model parameters need to be converted into vector form for calculation in the machine learning training and reasoning scenarios. Similarly, the application scenarios in other embodiments of this application are the same as those in this embodiment, so they will not be repeated.

[0051] Among them, non-collusive servers refer to the situation in which multiple servers or nodes in a distributed system or network are independent of each other and do not cooperate or share information with each other. This means that each server or node remains independent in its own operations and does not exchange sensitive information about specific operations with other nodes.

[0052] Specifically, the data owner responds to the vector dot product calculation instruction, obtains the first vector and the second vector to be processed, and recruits the first server that does not collude with each other and the second server ;Then, the data owner initializes the public key encryption system.

[0053] Step S202: Pack the first vector to obtain corresponding plaintext, encrypt the plaintext by using an encryption algorithm of a public key encryption system to obtain ciphertext, and use subtraction cryptographic sharing to split the second vector into a first share vector and a second share vector.

[0054] Among them, the public key encryption system can be an encryption system built based on the Paillier Partial Homomorphic Encryption algorithm, and the encryption algorithm can be an improved Paillier Partial Homomorphic Encryption algorithm.

[0055] Among them, subtractive cryptographic sharing is an encryption scheme based on the principle of secret sharing, which allows multiple participants to share a secret and perform subtraction operations on the secret value.

[0056] Specifically, the data owner converts the first vector Pack a plaintext , then use the Paillier partially homomorphic encryption algorithm to encrypt the plaintext Encrypted to get ciphertext ; The data owner then uses subtraction secret sharing to identify the second vector Split into two share vectors and ; In addition, the data owner will package the time slot The data owner uses a variant of the Paillier partially homomorphic encryption algorithm to encrypt the plaintext Encrypted to get ciphertext , the above encryption algorithm is formally expressed as: ,in, is a bit length less than or equal to the private key The length of the random number in bits.

[0057] Step S203: Send the ciphertext and the first share vector to the first server, and the first server calculates the first share based on the ciphertext and the first share vector; and send the ciphertext and the second share vector to the second server, and the second server calculates the second share based on the ciphertext and the second share vector.

[0058] Specifically, the data owner will ciphertext and the first share vector Send to the first server , the ciphertext and the second share vector Send to the second server ; First server Exploiting Ciphertext and the first share vector Calculate locally and get the first share , and the first share Send back to data owner; second server Exploiting Ciphertext and the second share vector Calculate locally and get the second share and the second share Sent back to the data owner.

[0059] Step S204: receiving the first share returned by the first server and the second share returned by the second server, and obtaining a dot product result of the first vector and the second vector according to the first share and the second share.

[0060] Specifically, the data owner receives the first server The first share returned And the second server The second share returned , and according to the first share and the second share , recover the first vector and the second vector The dot product result of .

[0061] In the above-mentioned vector point multiplication calculation method for cloud computing, a secure vector point multiplication calculation protocol is designed based on a public key encryption system with fast encryption and decryption capabilities, subtractive secret sharing, and a dual-server architecture; the secure vector point multiplication calculation protocol is input by a first server and a second server that do not collude with each other at the same time, which are the same ciphertext obtained by packing and then encrypting the first vector, and then the first server and the second server respectively input the first share vector and the second share vector obtained by splitting the second vector by subtractive secret sharing, and finally the two servers output the first share and the second share respectively, and the data owner can obtain the point multiplication result of the first vector and the second vector from the first share and the second share. In this application, the vectors input to the secure vector point multiplication protocol are either in ciphertext form or processed by subtractive secret sharing, and there are no plaintext vectors, which effectively avoids high-risk operations such as inputting plaintext vectors in the secure calculation protocol, thereby improving security; in addition, due to the updated security of the secure vector point multiplication calculation protocol proposed in this application, its applicable application scenarios are also richer.

[0062] In one embodiment, after recruiting the first server and the second server that do not collude with each other, the method of the present application further includes the following steps:

[0063] Generate relevant parameters of the public key encryption system, execute the key generation algorithm according to the relevant parameters, and obtain the public-private key pair of the public key encryption system; initialize the public-private key pair, send the public key in the public-private key pair to the first server and the second server respectively, and retain the private key in the public-private key pair.

[0064] Specifically, the data owner can generate the relevant parameters of the public key encryption system through the following process: :

[0065] a.Select Odd prime number of bits and ,choose Odd number of bits and ;

[0066] b. Order ;

[0067] c. Order ;

[0068] d. Testing Are they mutually prime? If not, return to step a;

[0069] e. Discuss each case individually; if is not a prime number, is a prime number, then regenerate , until is a prime number and Mutually prime; if is a prime number, If it is not a prime number, regenerate , until is a prime number and Mutually prime; if and None of them are prime numbers, return to step a;

[0070] f. Output ;

[0071] in, is a safety parameter, and Is with safety parameters Related functions; Subsequently, the data owner initializes the public-private key pair of the Paillier partially homomorphic encryption algorithm variant , and publish the public key , keep the private key ; The above public key ,in , and is a large prime number, , is in the integer group A random number in , and is and Small odd prime number; the above private key ,in .

[0072] In one embodiment, before packing the first vector to obtain the corresponding plaintext, the method of the present application further includes the following steps:

[0073] Obtaining a first bit length of the modulus of a public key encryption system and a second bit length of twice the private key of the public key encryption system, and determining a size value of the slot; calculating the number of slots used according to the size value, the first bit length, and the second bit length, and calculating an upper limit on the number of message packages in a single plaintext according to the number of used slots;

[0074] In the above step S202, the first vector is packaged to obtain the corresponding plaintext, which specifically includes the following steps:

[0075] Based on the usage quantity and the upper limit of the message packaging quantity, the first vector is packaged to obtain a plaintext.

[0076] Specifically, before packaging, the data owner first defines the slot The size value is used to calculate the number of slots used , and then calculate the upper limit of the number of messages that can be packaged in a plaintext ,in Modulus representing a variant of the Paillier partially homomorphic encryption algorithm The bit length of Double private key representing a variant of the Paillier partially homomorphic encryption algorithm When packing, it is necessary to ensure that the first vector and the second vector The same length as the first vector The length is ,Require ; Record the first vector The maximum bit length of the elements inside is , the second vector The maximum bit length of the elements inside is , then it is necessary to satisfy , and ,in is a security parameter. The specific packaging process is as follows: With form , data owner Initialize packaging results ; Order counter , data owner Perform related operations Second-rate: ; ; . Subsequently, the data owner Packing time slots The number of uses is public.

[0077] In one embodiment, if Figure 3 As shown, in the above step S202, the second vector is split into a first share vector and a second share vector using subtraction password sharing, which specifically includes the following steps:

[0078] The second vector is represented as a second sub-vector of a target number, and a target number of random numbers are selected from a preset interval as a second share sub-vector; the first share sub-vector is determined according to the second share sub-vector, the private key in the public-private key pair, and the second sub-vector; and the first share vector and the second share vector are obtained according to the first share sub-vector and the second share sub-vector, respectively.

[0079] Specifically, let the second vector With form , data owner Initialize two share vectors and ; Order counter , data owner Perform related operations Times: From interval Pick a random number as , then order ,Will Put the first share vector ,Will Put the second share vector ,in is the private key of the Paillier partially homomorphic encryption algorithm variant; calculation ; Finally, the first share vector and the second share vector Respectively have the form and .

[0080] In one embodiment, in the above step S203, the first server calculates the first share according to the ciphertext and the first share vector, which specifically includes the following steps:

[0081] The first server determines a first target coefficient according to the first share vector and the number of used slots, inputs the ciphertext and the first target coefficient into a preset share calculation model, and obtains a first share output by the share calculation model;

[0082] In the above step S203, the second server calculates the second share according to the ciphertext and the second share vector, which specifically includes the following steps:

[0083] The first server determines the second target coefficient according to the second share vector and the number of slots used, inputs the ciphertext and the second target coefficient into the share calculation model, and obtains the second share output by the share calculation model.

[0084] Specifically, the first server Exploiting Ciphertext and the first share vector Calculate locally and get the first share , and the first share Send back to data owner ; Second server Exploiting Ciphertext and the second share vector Calculate locally and get the second share and the second share Send back to data owner Among them, the specific calculation process of the secure vector dot multiplication calculation protocol includes the following steps:

[0085] (1) Command counter , the first server Initialization results ,use The ciphertext and the first share vector , do the following Times: Calculation ; Calculate ciphertext ; Calculate share ;calculate ;calculate ;

[0086] (2) Command counter , the second server Initialization results ,use The ciphertext and the second share vector , do the following Times: Calculation ; Calculate ciphertext ; Calculate share ;calculate ;calculate ;

[0087] After completing the above calculations, the first server and the second server The first share and the second share Sent to data owner ; The above share calculation model can be , the calculation process includes: , , and They are the intermediate results required for calculation; output share .

[0088] In one embodiment, in the above step S204, obtaining the dot product result of the first vector and the second vector according to the first share and the second share specifically includes the following steps:

[0089] According to the first share and the second share, the target share is determined, and the target share is updated according to the private key in the public-private key pair to obtain the current share; based on the current share and the size value of the slot, the point product result is determined.

[0090] Specifically, the data owner Utilize the first share and the second share Recover the first vector and the second vector The point product result of , the specific operations include:

[0091] (1) Calculation ;calculate ;

[0092] (2) Calculation ;

[0093] Above The first vector and the second vector The dot product result of .

[0094] In actual deployment, security parameters And related functions have the following values; when Sometimes, there are and ;when Sometimes, there are and ;when Sometimes, there are and .

[0095] In one embodiment, Figure 4 As shown, a vector dot product calculation method for cloud computing in a specific embodiment is provided, which specifically includes the following steps:

[0096] Step S401, obtaining a first vector and a second vector to be processed, and recruiting a first server and a second server that do not collude with each other.

[0097] Step S402, generate relevant parameters of the public key encryption system, execute the key generation algorithm according to the relevant parameters, and obtain the public-private key pair of the public key encryption system; initialize the public-private key pair, send the public key in the public-private key pair to the first server and the second server respectively, and retain the private key in the public-private key pair.

[0098] Step S403, obtain the first bit length of the modulus of the public key encryption system and the second bit length of twice the private key of the public key encryption system, and determine the size value of the slot; calculate the number of slots used according to the size value, the first bit length and the second bit length, and calculate the upper limit of the number of message packages in a single plaintext according to the number of uses.

[0099] Step S404: based on the usage quantity and the upper limit of the message packaging quantity, the first vector is packaged to obtain plaintext, and the plaintext is encrypted by an encryption algorithm of a public key encryption system to obtain ciphertext.

[0100] Step S405, representing the second vector as a second sub-vector of the target number, selecting a target number of random numbers from a preset interval as a second share sub-vector; determining the first share sub-vector according to the second share sub-vector, the private key in the public-private key pair, and the second sub-vector; and obtaining the first share vector and the second share vector respectively according to the first share sub-vector and the second share sub-vector.

[0101] Step S406, sending the ciphertext and the first share vector to the first server, the first server determines the first target coefficient according to the first share vector and the number of slots used, inputs the ciphertext and the first target coefficient into a preset share calculation model, and obtains the first share output by the share calculation model.

[0102] Step S407, sending the ciphertext and the second share vector to the second server, which determines the second target coefficient based on the second share vector and the number of slots used, inputs the ciphertext and the second target coefficient into the share calculation model, and obtains the second share output by the share calculation model.

[0103] Step S408, determine the target share according to the first share and the second share, and update the target share according to the private key in the public-private key pair to obtain the current share; determine the dot product result based on the current share and the size value of the slot.

[0104] The beneficial effects brought by the above embodiments are as follows:

[0105] 1. Higher security. The existing vector dot multiplication protocol based on the Paillier partially homomorphic encryption algorithm requires the input of a plaintext vector. However, inputting a plaintext vector in a secure computing protocol is a security risk. The vector input of the secure vector dot multiplication protocol proposed in this application is either in ciphertext form or processed by subtractive secret sharing, and there is no plaintext vector. Therefore, the secure vector dot multiplication protocol designed in this application is more secure.

[0106] 2. Richer application scenarios. The existing secure vector point multiplication protocol based on the Paillier partially homomorphic encryption algorithm has limited application scenarios due to its insufficient security. The secure vector point multiplication protocol designed in this application has higher security and is applicable to richer application scenarios.

[0107] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0108] Based on the same inventive concept, the embodiment of the present application also provides a cloud computing-oriented vector dot product calculation device for implementing the cloud computing-oriented vector dot product calculation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more cloud computing-oriented vector dot product calculation device embodiments provided below can refer to the limitations of the cloud computing-oriented vector dot product calculation method above, and will not be repeated here.

[0109] In an exemplary embodiment, Figure 5 As shown, a vector dot multiplication computing device for cloud computing is provided, comprising:

[0110] A vector acquisition module 501 is used to acquire a first vector and a second vector to be processed, and recruit a first server and a second server that do not collude with each other;

[0111] A plaintext encryption module 502, configured to package the first vector to obtain corresponding plaintext, encrypt the plaintext by using an encryption algorithm of a public key encryption system to obtain ciphertext, and split the second vector into a first share vector and a second share vector by using subtraction cryptographic sharing;

[0112] a share calculation module 503, configured to send the ciphertext and the first share vector to the first server, and the first server calculates a first share according to the ciphertext and the first share vector, and send the ciphertext and the second share vector to the second server, and the second server calculates a second share according to the ciphertext and the second share vector;

[0113] The result generating module 504 is configured to receive the first share returned by the first server and the second share returned by the second server, and obtain a dot product result of the first vector and the second vector according to the first share and the second share.

[0114] In one embodiment, the vector dot multiplication calculation device for cloud computing also includes a parameter generation module, which is used to generate relevant parameters of the public key encryption system, execute a key generation algorithm according to the relevant parameters, and obtain a public-private key pair of the public key encryption system; initialize the public-private key pair, send the public key in the public-private key pair to the first server and the second server respectively, and retain the private key in the public-private key pair.

[0115] In one embodiment, the vector dot multiplication calculation device for cloud computing also includes a quantity determination module, which is used to obtain a first bit length of the modulus of the public key encryption system and a second bit length of twice the private key of the public key encryption system, and determine the size value of the slot; calculate the number of uses of the slot according to the size value, the first bit length and the second bit length, and calculate the upper limit of the number of message packings in a single plaintext according to the number of uses; the plaintext encryption module 502 is also used to pack the first vector based on the number of uses and the upper limit of the number of message packings to obtain the plaintext.

[0116] In one embodiment, the plaintext encryption module 502 is further used to represent the second vector as a second sub-vector of a target number, select the target number of random numbers from a preset interval as a second share sub-vector; determine the first share sub-vector according to the second share sub-vector, the private key in the public-private key pair, and the second sub-vector; and obtain the first share vector and the second share vector respectively according to the first share sub-vector and the second share sub-vector.

[0117] In one embodiment, the share calculation module 503 is also used for the first server to determine the first target coefficient based on the first share vector and the number of used slots, input the ciphertext and the first target coefficient into a preset share calculation model, and obtain the first share output by the share calculation model; the share calculation module 503 is also used for the first server to determine the second target coefficient based on the second share vector and the number of used slots, input the ciphertext and the second target coefficient into the share calculation model, and obtain the second share output by the share calculation model.

[0118] In one embodiment, the result generation module 504 is also used to determine the target share based on the first share and the second share, and update the target share based on the private key in the public-private key pair to obtain the current share; based on the current share and the size value of the slot, determine the dot product result.

[0119] Each module in the above-mentioned vector dot product calculation device for cloud computing can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0120] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a vector point multiplication calculation method for cloud computing is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0121] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0122] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0123] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0124] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0125] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0126] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0127] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0128] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A vector dot multiplication calculation method for cloud computing, characterized in that: Applied to the data owner, the method comprises: Obtaining a first vector and a second vector to be processed, and recruiting a first server and a second server that do not collude with each other; Packing the first vector to obtain corresponding plaintext, encrypting the plaintext by using an encryption algorithm of a public key encryption system to obtain ciphertext, and splitting the second vector into a first share vector and a second share vector by using subtraction cryptographic sharing; Sending the ciphertext and the first share vector to the first server, where the first server calculates a first share according to the ciphertext and the first share vector, and sending the ciphertext and the second share vector to the second server, where the second server calculates a second share according to the ciphertext and the second share vector; The first share returned by the first server and the second share returned by the second server are received, and a dot product result of the first vector and the second vector is obtained according to the first share and the second share.

2. The method according to claim 1, characterized in that After recruiting the first server and the second server which are not colluding with each other, the method further includes: Generate relevant parameters of the public key encryption system, execute a key generation algorithm according to the relevant parameters, and obtain a public-private key pair of the public key encryption system; Initialize the public-private key pair, send the public key in the public-private key pair to the first server and the second server respectively, and retain the private key in the public-private key pair.

3. The method according to claim 2, characterized in that Before packaging the first vector to obtain the corresponding plaintext, the method further includes: Obtaining a first bit length of a modulus of the public key encryption system and a second bit length of twice a private key of the public key encryption system, and determining a slot size value; Calculate the number of used slots according to the size value, the first bit length, and the second bit length, and calculate the upper limit of the number of message packages in a single plaintext according to the number of used slots; The step of packing the first vector to obtain corresponding plaintext includes: The first vector is packaged based on the usage quantity and the upper limit of the message packaging quantity to obtain the plaintext.

4. The method according to claim 3, characterized in that The step of using subtraction cryptographic sharing to split the second vector into a first share vector and a second share vector comprises: Representing the second vector as a second sub-vector of a target number, and selecting a random number of the target number from a preset interval as a second share sub-vector; Determine a first share sub-vector according to the second share sub-vector, the private key in the public-private key pair, and the second sub-vector; The first share vector and the second share vector are obtained according to the first share sub-vector and the second share sub-vector, respectively.

5. The method according to claim 3, characterized in that: The calculating, by the first server according to the ciphertext and the first share vector, of the first share includes: The first server determines a first target coefficient according to the first share vector and the number of used slots, inputs the ciphertext and the first target coefficient into a preset share calculation model, and obtains the first share output by the share calculation model; The calculating, by the second server according to the ciphertext and the second share vector, of the second share includes: The first server determines a second target coefficient according to the second share vector and the number of used slots, inputs the ciphertext and the second target coefficient into the share calculation model, and obtains the second share output by the share calculation model.

6. The method according to any one of claims 3 to 5, characterized in that: The obtaining, according to the first share and the second share, a dot product result of the first vector and the second vector includes: Determine a target share according to the first share and the second share, and update the target share according to the private key in the public-private key pair to obtain a current share; The dot product result is determined based on the current share and the size value of the slot.

7. A vector dot multiplication computing device for cloud computing, characterized in that: The device comprises: A vector acquisition module, used for acquiring a first vector and a second vector to be processed, and recruiting a first server and a second server that do not collude with each other; a plaintext encryption module, configured to package the first vector to obtain corresponding plaintext, encrypt the plaintext by using an encryption algorithm of a public key encryption system to obtain ciphertext, and split the second vector into a first share vector and a second share vector by using subtraction cryptographic sharing; a share calculation module, configured to send the ciphertext and the first share vector to the first server, and the first server calculates a first share according to the ciphertext and the first share vector, and send the ciphertext and the second share vector to the second server, and the second server calculates a second share according to the ciphertext and the second share vector; The result generating module is configured to receive the first share returned by the first server and the second share returned by the second server, and obtain a dot product result of the first vector and the second vector according to the first share and the second share.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.