CN112615852A - Data processing method, related device and computer program product - Google Patents

Data processing method, related device and computer program product Download PDF

Info

Publication number
CN112615852A
CN112615852A CN202011484630.2A CN202011484630A CN112615852A CN 112615852 A CN112615852 A CN 112615852A CN 202011484630 A CN202011484630 A CN 202011484630A CN 112615852 A CN112615852 A CN 112615852A
Authority
CN
China
Prior art keywords
protocol
party secure
calculation
party
new
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011484630.2A
Other languages
Chinese (zh)
Inventor
杨青友
洪爵
蒋精华
何恺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu Online Network Technology Beijing Co Ltd
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011484630.2A priority Critical patent/CN112615852A/en
Publication of CN112615852A publication Critical patent/CN112615852A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/50Adding; Subtracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/52Multiplying; Dividing
    • G06F7/523Multiplying only
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Optimization (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the application discloses a data processing method and device, electronic equipment, a computer readable storage medium and a computer program product, and relates to the technical field of artificial intelligence, in particular to the technical fields of deep learning, data processing and multi-party computing. One embodiment of the method comprises: after ciphertext data obtained based on an encryption algorithm corresponding to the multi-party secure computation protocol is obtained, an old operation mode which takes division operation as a core and is contained in the multi-party secure computation protocol is updated to a new operation mode which is formed by at least one of addition, subtraction and multiplication, a new multi-party secure computation protocol is obtained, then the ciphertext data is processed according to the new multi-party secure computation protocol, and a processing result is returned. The data processing method provided by the embodiment updates the complex operation which is contained in the original multi-party secure computing protocol and takes division operation as a core into a new operation mode which is formed based on other operations, so as to achieve the effects of simplifying operation and improving data processing capability.

Description

Data processing method, related device and computer program product
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to the field of deep learning, data processing, and multi-party computing technologies, and in particular, to a method and an apparatus for processing data, an electronic device, a computer-readable storage medium, and a computer program product.
Background
In the multi-party machine learning, a plurality of participants jointly perform machine learning training by using respective data and resources to obtain a shared model. Compared with the method that each party only uses own data for training, the multi-party machine learning often can obtain a more accurate model due to the fact that the training data is larger in scale. And the safe multi-party machine learning concerns the data privacy safety of each participant, and requires that the data privacy of each participant is not disclosed to other entities in the learning process. Secure Multi-Party Computing (MPC) technology is often used in Secure Multi-Party Computing and learning to protect data privacy of each participant in Secure learning.
The safe multi-party computing protocol is participated by two parties or multiple parties together, and the computation of corresponding functions is completed on the premise of not revealing the data privacy of the participating parties. At present, the secure multiparty computing protocol can basically realize basic operations such as addition, subtraction, multiplication and division.
Disclosure of Invention
The embodiment of the application provides a data processing method and device, electronic equipment and a computer readable storage medium.
In a first aspect, an embodiment of the present application provides a data processing method, including: acquiring ciphertext data transmitted based on a multi-party secure computing protocol; wherein, the ciphertext data is obtained by encrypting through an encryption algorithm corresponding to a multi-party security protocol; updating an old operation mode which takes division operation as a core and is contained in the multi-party secure computation protocol into a new operation mode which is formed by at least one of addition, subtraction and multiplication to obtain a new multi-party secure computation protocol; and processing the ciphertext data according to the new multi-party secure computing protocol, and returning a processing result.
In a second aspect, an embodiment of the present application provides an apparatus for processing data, including: a ciphertext data acquisition unit configured to acquire ciphertext data incoming based on a multi-party secure computing protocol; wherein, the ciphertext data is obtained by encrypting through an encryption algorithm corresponding to a multi-party secure computing protocol; the calculation protocol updating unit is configured to update an old operation mode which takes division operation as a core and is contained in the multi-party security calculation protocol to a new operation mode which is formed by at least one of addition, subtraction and multiplication to obtain a new multi-party security calculation protocol; and the data processing unit is configured to process the ciphertext data according to the new multi-party secure computing protocol and return a processing result.
In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor, when executing, to implement a method of processing data as described in any implementation manner of the first aspect.
In a fourth aspect, the present application provides a non-transitory computer-readable storage medium storing computer instructions for enabling a computer to implement a data processing method as described in any implementation manner of the first aspect when executed.
In a fifth aspect, the present application provides a computer program product including a computer program, where the computer program is capable of implementing the data processing method described in any implementation manner of the first aspect when executed by a processor.
After ciphertext data obtained by an encryption algorithm corresponding to a secure multi-party computing protocol and transmitted based on the multi-party secure computing protocol is obtained, an old operation mode with division operation as a core included in the multi-party secure computing protocol is updated to a new operation mode formed by at least one of addition, subtraction and multiplication, so that a new multi-party secure computing protocol is obtained, and then the ciphertext data is processed according to the new multi-party secure computing protocol and a processing result is returned.
The method updates the complex operation which takes division operation as a core and needs more computing resources compared with addition, subtraction and multiplication and is contained in the original multi-party safe computing protocol into a new operation mode formed based on other operations, and then processes the ciphertext data through the new operation mode, so as to achieve the effects of simplifying operation and improving data processing capacity.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture to which the present application may be applied;
fig. 2 is a flowchart of a data processing method according to an embodiment of the present application;
fig. 3 is a flowchart of another data processing method provided in an embodiment of the present application;
fig. 4 is a schematic flowchart of a data processing method in an application scenario according to an embodiment of the present application;
fig. 5 is a block diagram of a data processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device suitable for executing a data processing method according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the data processing method, apparatus, electronic device, and computer-readable storage medium of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101 and 102, a first party server 103 and a second party server 104, and a network 105 for mutual communication between the terminal devices and the servers. The network 105 is used to provide a medium for communication links between terminal devices and terminal devices, between terminal devices and servers, and between servers. Network 105 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user can use the terminal devices 101 and 102 to interact with the first-party server 103 and the second-party server 104 via the network 105 to send raw data, receive processing results, and the like. Correspondingly, after receiving the to-be-processed data sent by the terminal device used by the user, the first party server 101 or the second party server 102 encrypts the to-be-processed data through an encryption algorithm corresponding to a local multi-party secure computing protocol to obtain corresponding ciphertext data.
After obtaining the ciphertext data in the first-party server 103 and the second-party server 104, the local ciphertext data is sent to the other-party server to implement the synchronous collaborative operation based on the multi-party secure computing protocol, for example, after obtaining the ciphertext data, the first-party server 103 sends the ciphertext data to the second-party server 104, receives the ciphertext data sent by the second-party server 104 and transmitted by the second-party server 104, and then the first-party server 103 and the second-party server 104 synchronously execute the data processing method in the present application to complete the data processing.
Various applications for realizing information communication and multi-party secure computing between the first party server 103 and the second party server 104, such as a multi-party machine learning application, a cloud data processing application, a cooperative processing application, and the like, may be installed on the first party server 103 and the second party server.
The terminal devices 101 and 102, and the first-party server 103 and the second-party server 104 may be hardware or software. When the terminal devices 101 and 102 are hardware, they may be various electronic devices with a display screen, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like; when the terminal devices 101 and 102 are software, they may be installed in the electronic devices listed above, and they may be implemented as a plurality of software or software modules, or may be implemented as a single software or software module, and are not limited in this respect. When the first-party server 101, the second-party server 102 and the third-party server 103 are hardware, a distributed server cluster formed by a plurality of servers can be realized, and a single server can also be realized; when the server is software, the server may be implemented as a plurality of software or software modules, or may be implemented as a single software or software module, which is not limited herein.
The first party server 103 and the second party server 104 can provide various services through various built-in applications, taking a multi-party machine learning application capable of providing multi-party machine learning as an example, the first party server 103 can achieve the following effects when running the multi-party machine learning application: firstly, ciphertext data transmitted based on a multi-party secure computing protocol is acquired from a second-party server 104 through a network 105; then, the first party server 103 updates the old operation mode with division operation as core included in the multi-party secure computation protocol to a new operation mode formed by at least one of addition, subtraction and multiplication to obtain a new multi-party secure computation protocol; finally, the first party server 103 processes the ciphertext data according to the new multiparty security computing protocol, and returns a processing result.
It should be noted that, besides being acquired from the first-party server 103 and the second-party server 104 through the network 105, the ciphertext data transmitted based on the multi-party secure computing protocol may also be stored locally in the first-party server 103 and the second-party server 104 in advance in various ways. Therefore, when the first-party server 103 and the second-party server 104 detect that the data are already stored locally (for example, ciphertext data retained before starting processing), the data can be selected to be acquired directly from the local.
However, it should be noted that, when the terminal devices 101 and 102 also have the computation capability and computation resource meeting the requirements, the terminal devices 101 and 102 may also be used as an execution main body of the data processing method, and as a processing device of data of other terminal devices through the multi-party machine learning application installed thereon, so as to complete the above-mentioned computations performed by the first party server 103 and the second party server 104, and further output the same results as the first party server 103 and the second party server 104, and accordingly, a data processing apparatus may also be disposed in the terminal devices 101 and 102.
It should be understood that the number of networks and servers in fig. 1 is merely illustrative. There may be any number of networks and servers, as desired for implementation.
Referring to fig. 2, fig. 2 is a flowchart of a data processing method according to an embodiment of the present application, in which the process 200 includes the following steps:
step 201, ciphertext data transmitted based on a multi-party secure computing protocol is acquired.
In this embodiment, an executing body (e.g., the first party server 103 and the second party server 104 shown in fig. 1) of the data processing method acquires ciphertext data incoming based on the multi-party secure computing protocol, where the ciphertext data is obtained by encrypting through an encryption algorithm corresponding to the secure multi-party computing protocol.
It should be noted that the ciphertext data that is transmitted based on the multi-party secure computing protocol may be directly obtained by the execution main body from a local storage device, or may be obtained from a non-local storage device. The local storage device may be a data storage module arranged in the execution main body, for example, a server hard disk, in which case, two original pictures and their sorting information can be quickly read locally; the non-local storage device may also be any other electronic device configured to store data, such as some user terminals, in which case the execution subject may obtain the required ciphertext data based on the incoming multiparty secure computing protocol by sending a obtain command to the electronic device.
Step 202, updating the old operation mode with division operation as core included in the multi-party secure computation protocol to a new operation mode composed of at least one of addition, subtraction and multiplication to obtain a new multi-party secure computation protocol.
In this embodiment, the multi-party secure computing protocol refers to a computing protocol generated based on a multi-party secure computing technology, the multi-party secure computing protocol employs many basic operator functions, the simplest computing logics constituting the operator functions include addition, subtraction, and multiplication, and a higher-level algorithm is usually implemented by combining and jointly using the simplest computing logics.
Step 203, processing the ciphertext data according to the new multi-party secure computing protocol, and returning a processing result.
In this embodiment, after the new multi-party secure computing protocol is generated in step 202, the ciphertext data is processed according to the new multi-party secure computing protocol, and a corresponding processing result is obtained and returned to the ciphertext data importing party.
It should be understood that, in practice, when performing multi-party secure computation, a party that transmits ciphertext data may desire to return a processing result to another destination, or there are multiple parties that transmit ciphertext data, and the data processing job is a content that is processed jointly with the content of multiple pieces of ciphertext data, and the corresponding execution subject may return all the processing results to multiple different parties that transmit ciphertext data or return to a desired destination according to an instruction of the party that transmits ciphertext data.
The data processing method provided by the embodiment of the application updates the complex operation which takes division operation as a core and needs more computing resources compared with addition, subtraction and multiplication and is contained in the original multi-party secure computing protocol into a new operation mode formed based on other operations, and then processes the ciphertext data through the new operation mode, so that the effects of simplifying operation and improving data processing capacity are achieved.
In combination with practical data analysis, it is found that in an old operation mode in the prior art, which takes division operation as total, operations with higher frequency are used in square root inverse operation, activation function Softmax operation and activation function Sigmoid operation, so that in order to further improve the update efficiency of the operation mode, an old operation mode which is expected to be updated can be predetermined, so that a corresponding algorithm is predetermined to replace the operation mode for the part, and a better update effect is achieved.
In some optional implementations of the embodiment, when the old operation manner is an inverse square root operation, the updating process specifically includes:
determining an initial value x that is less than a target calculation result0(ii) a Wherein the target result is obtained by calculating the inverse square root of the original value x
Figure BDA0002839015040000071
By predetermined iterative equations
Figure BDA0002839015040000072
Performing preset n times of iterative operation, and calculating to obtain xnWherein i is the current iteration number;
x is to benAs a result of the target calculation
Figure BDA0002839015040000073
The substitute value of (a).
The method can be based on the thought of Newton iteration method through the operation, achieves the effect of complex operation through multiple iteration approximation of simple operation, and is based on the rapid and approximate determination of the characteristics of machine operation
Figure BDA0002839015040000077
The inverse square root operation is completed.
It should be understood that, when the preset iteration number is not determined, it may also be correspondingly set to end the iteration when the difference between the result of the current calculation and the result of the last calculation is smaller than a preset threshold, and determine the result of the current iteration as xn
In some optional implementations of the embodiment, when the old operation mode is the activation function Softmax operation, according to the definition of the activation function Softmax, the vector x is equal to (x)0,x1,…,xk) Activating a function
Figure BDA0002839015040000074
The arithmetic operation involved in the Softmax operation of the activation function is thus split into division-dependent and exponential-dependent operations, wherein for an approximation operation of the division, which is similar to the above-described operation for the reciprocal of the square root, only the iterative formula needs to be updated to xi+1=xi·(2-x·xi) To finally obtain xnThe result of (1) is a target calculation result
Figure BDA0002839015040000075
The substitute value of (a).
For the operation of exponential correlation, a definitional formula is adopted
Figure BDA0002839015040000076
Determining an exponential calculation value of the original value x, wherein n is preset according to the calculation precisionThe number of iterations.
The new operation mode can update the operation of the activation function related to the old operation mode, realize the operation of the activation function by simpler operation logic and improve the efficiency of data processing.
In addition, the secure multiparty computing protocol often involves the operation of an activation function Sigmoid, which is a common biological Sigmoid function and is also called a Sigmoid growth curve. In the information science, due to the properties of single increment, single increment of an inverse function and the like, a Sigmoid function is often used as an activation function of a neural network, is also called a Logistic function and is used for hidden layer neuron output, the value range is (0,1), a real number can be mapped to an interval of (0,1), and the interval can be used for two-classification.
In order to update the Sigmoid operation of the active function to a new operation mode formed by at least one of addition, subtraction and multiplication, so as to achieve the purpose of reducing the operation performance overhead, in some optional implementation modes of this embodiment, when the old operation mode is the Sigmoid operation of the active function, the old operation mode is defined according to the definition of the Sigmoid operation of the active function
Figure BDA0002839015040000081
Therefore, the updating can be carried out by the related updating mode aiming at the operation of the activating function.
Furthermore, the approximation can also be achieved by means of a more efficient piecewise polynomial, i.e. a piecewise polynomial approximation as follows:
Figure BDA0002839015040000082
firstly, the x is compared and calculated by the safe multiparty calculation to obtain the interval position results of is _ less, is _ gt and is _ between, and then the calculation out is 10-4Is _ less + (0.17x +0.5) is _ between +0.9999 is _ gt, with the result approximated
Figure BDA0002839015040000083
The value obtained.
It should be understood that the results of is _ less, is _ gt and is _ between in the calculation process are ciphertext data results, and data privacy cannot be leaked.
Referring to fig. 3, fig. 3 is a flowchart of another data processing method according to an embodiment of the present application, where the process 300 includes the following steps:
step 301, ciphertext data transmitted based on a multi-party secure computing protocol is acquired.
Step 302, in response to determining that a plurality of ciphertext data based on different operations of the same multi-party secure computing protocol are transmitted, integrating the different operations to generate a target multi-party secure computing protocol.
In this embodiment, a detection time may be preset, after a plurality of ciphertext data based on different operations of the same multi-party secure computing protocol are determined to be transmitted within the detection time, operations corresponding to the plurality of ciphertext data are determined, and the operations are integrated to generate a target multi-party secure computing protocol, so that the plurality of obtained ciphertext data may be integrally processed according to the target multi-party secure computing protocol.
The ciphertext data which are based on the same multi-party secure computing protocol and operated differently can be sent by the same terminal equipment, and also can be sent by different terminal equipment, so that the purposes of single-party multi-file decentralized processing and further data privacy enhancement are achieved, or multi-party cooperative processing is achieved, so that data processing samples are further perfected through processing data provided by other users, and the purpose of data processing quality is improved.
It should be understood that, besides the setting of the detection time, different generation triggering conditions of the target multi-party secure computing protocol may also be set according to different requirements, for example, the execution main body may be set to continuously acquire the ciphertext data until the number of acquired ciphertext data meets a preset number requirement, or the execution main body may execute the operation of generating the target multi-party secure computing protocol when the number of different clients that send the ciphertext data meets the preset requirement.
Step 303, updating the old operation mode with division operation as core included in the target multi-party secure computation protocol to a new operation mode with at least one of addition, subtraction and multiplication to obtain a new multi-party secure computation protocol.
And step 304, processing the ciphertext data according to the new multi-party secure computing protocol, and returning a processing result.
The above steps 301, 303 and 304 are the same as the step 201-203 shown in fig. 2, and the contents of the same portions refer to the corresponding portions of the previous embodiment, which are not described herein again.
Based on the embodiment shown in fig. 2, the data processing method provided in this embodiment may further support the purpose of performing cooperative processing on the acquired multiple ciphertext data based on different operations included in the same multi-party secure computing protocol, and may further improve the processing efficiency of the multiple ciphertext data while satisfying more user requirements.
For further understanding, the present application also provides a specific implementation scheme in conjunction with a specific application scenario, please refer to a flow 400 shown in fig. 4.
In order to facilitate understanding of the specific process of the data processing method, the plaintext content corresponding to the ciphertext data is correspondingly explained so as to better understand the quality of the processing result of the data. ,
step 401, ciphertext data incoming based on a multi-party secure computing protocol is obtained from a client.
Illustratively, the plaintext data corresponding to the ciphertext data is number 9, and it is desirable to find the inverse square root of number 9 based on the multiparty security computing protocol.
Step 402, in response to the old operation mode (i.e. reciprocal square root operation) with division operation as the core included in the multi-party secure computation protocol being updated to a new operation mode formed by at least one of addition, subtraction and multiplication, a new multi-party secure computation protocol is obtained.
Step 403, processing the ciphertext data according to the new multiparty security computing protocol.
Specifically, an initial value smaller than a target calculation result is determined
Figure BDA0002839015040000101
Wherein the target result is the result of the original value 9 after the inverse square root calculation
Figure BDA0002839015040000102
By predetermined iterative equations
Figure BDA0002839015040000103
And performing iteration, wherein the process of the first iteration is as follows:
Figure BDA0002839015040000104
the process of the second iteration is as follows:
Figure BDA0002839015040000105
performing iterative operation by analogy, and presetting a threshold condition that the difference range between the result of the current calculation and the substitution value is within 0.0001;
in response to determining that the substituted value of the iteration is 0.33266, the calculation result of the iteration is 0.33267, the two are compared, the difference value meets the preset threshold condition, and the final processing result x of the operation is determinedn0.33267, and mixing the xnAs a result of the target calculation
Figure BDA0002839015040000106
The substitute value of (a).
Step 404, returning the processing result to the client end which has transmitted the ciphertext data.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present application provides an embodiment of a data processing apparatus, which corresponds to the method embodiment shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 5, the data processing apparatus 500 of the present embodiment may include: ciphertext data acquisition unit 501, calculation protocol updating unit 502 and data processing unit 503. The ciphertext data acquiring unit 501 is configured to acquire ciphertext data transmitted based on a multi-party secure computing protocol, where the ciphertext data is obtained by encrypting an encryption algorithm corresponding to the secure multi-party computing protocol; a computation protocol updating unit 502 configured to update an old operation mode, which takes division operation as a core, included in the multi-party secure computation protocol to a new operation mode, which is formed by at least one of addition, subtraction and multiplication, to obtain a new multi-party secure computation protocol; and the data processing unit 503 is configured to process the ciphertext data according to the new multiparty secure computing protocol, and return a processing result.
In the present embodiment, the data processing apparatus 500 includes: the detailed processing of the ciphertext data obtaining unit 501, the calculation protocol updating unit 502, and the data processing unit 503 and the technical effects thereof may refer to the related descriptions of step 201 and step 203 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the old operation manner includes: at least one of an inverse square root operation, an activation function Softmax, and an activation function Sigmoid operation.
In some optional implementations of this embodiment, the calculation protocol updating unit 502 includes: a reciprocal-square root operation updating subunit configured to determine an initial value x smaller than the target calculation result0(ii) a Wherein the target result is obtained by calculating the inverse square root of the original value x
Figure BDA0002839015040000107
By predetermined iterative equations
Figure BDA0002839015040000111
Performing preset n times of iterative operation, and calculating to obtain xnWherein i is the current iteration number; will x isnAs a result of the target calculation
Figure BDA0002839015040000112
The substitute value of (a).
In bookIn some optional implementations of the embodiment, the calculation protocol updating unit 502 includes: a first activation-function-operation updating subunit configured to determine an exponential operation included in the activation-function Softmax operation, using a definitional expression
Figure BDA0002839015040000113
Determining an exponential operation value of the original value x; and n is the iteration number preset according to the calculation precision.
In some optional implementations of this embodiment, the calculation protocol updating unit 502 includes: a second activation function operation updating subunit configured to determine a calculation manner corresponding to the original value x according to a relationship between the original value x and a screening range determined by the first threshold condition and the second threshold condition; wherein the first threshold condition is less than the second threshold condition; determining a target calculation result of the activation function Sigmoid operation to be 10 in response to the original value x being less than the first threshold condition-4(ii) a Determining a target calculation result of the Sigmoid operation of the activation function to be 0.17 · x +0.5 in response to the original value x being greater than or equal to the first threshold condition and less than or equal to the second threshold condition; in response to the original value x being greater than the second threshold condition, the target calculation result of the activation function Sigmoid operation is determined to be 0.9999.
In some optional implementations of the present embodiment, the data processing apparatus 500 further includes: a ciphertext data integration unit configured to, in response to determining that a plurality of ciphertext data of different operations based on a same multi-party secure computing protocol are incoming, integrate the different operations to generate a target multi-party secure computing protocol; and the calculation protocol updating unit is further configured to update an old operation mode taking division operation as a core and contained in the target multi-party secure calculation protocol to a new operation mode formed by at least one of addition, subtraction and multiplication to obtain a new multi-party secure calculation protocol.
The present embodiment exists as an apparatus embodiment corresponding to the above method embodiment, and the data processing apparatus provided in the present embodiment updates a complex operation, which uses a division operation as a core and needs more computing resources than addition, subtraction, and multiplication, included in an original multi-party secure computing protocol to a new operation mode formed based on other operations, and then processes ciphertext data through the new operation mode, so as to achieve the effects of simplifying the operation and improving data processing capability.
There is also provided, in accordance with an embodiment of the present application, an electronic device, a computer-readable storage medium, and a computer program product.
FIG. 6 illustrates a schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The calculation unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 601 executes the respective methods and processes described above, for example, a method of data processing. For example, in some embodiments, the method of data processing may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method of data processing described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured in any other suitable way (e.g., by means of firmware) as a method of performing data processing.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in the conventional physical host and Virtual Private Server (VPS) service.
According to the technical scheme of the embodiment of the application, the complex operation which is contained in the original multi-party secure computing protocol and takes division operation as a core and needs more computing resources compared with addition, subtraction and multiplication is updated to a new operation mode formed based on other operations, and ciphertext data is processed through the new operation mode subsequently, so that the effects of simplifying operation and improving data processing capacity are achieved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (15)

1. A method of processing data, comprising:
acquiring ciphertext data transmitted based on a multi-party secure computing protocol; the ciphertext data is obtained by encrypting through an encryption algorithm corresponding to the multi-party secure computing protocol;
updating an old operation mode which takes division operation as a core and is included in the multi-party secure computation protocol into a new operation mode which is formed by at least one of addition, subtraction and multiplication to obtain a new multi-party secure computation protocol;
and processing the ciphertext data according to the new multi-party secure computing protocol, and returning a processing result.
2. The method of claim 1, wherein the old operation comprises:
at least one of an inverse square root operation, an activation function Softmax operation, and an activation function Sigmoid operation.
3. The method of claim 2, wherein updating the reciprocal square root operation to a new operation comprising at least one of addition, subtraction, and multiplication when the old operation is specifically the reciprocal square root operation comprises:
determining an initial value x that is less than a target calculation result0(ii) a Wherein the target result is the result obtained by the original value x through the inverse square root calculation
Figure FDA0002839015030000011
By predetermined iterative equations
Figure FDA0002839015030000012
Performing preset n times of iterative operation, and calculating to obtain xnWherein i is the current iteration number;
the x is measurednAs a result of the target calculation
Figure FDA0002839015030000013
The substitute value of (a).
4. The method of claim 2, wherein updating the activation function operation to a new operation mode of at least one of addition, subtraction, and multiplication when the old operation mode is specifically the activation function Softmax operation comprises:
determining exponential operation included in the Softmax operation of the activation function, and adopting a definition formula
Figure FDA0002839015030000014
Determining an exponential operation value of the original value x; and n is the iteration number preset according to the calculation precision.
5. The method according to claim 2, wherein, when the old operation mode is specifically the active function Sigmoid operation, updating the active function Sigmoid operation to a new operation mode formed by at least one of addition, subtraction and multiplication includes:
determining a calculation mode corresponding to the original value x according to the relation between the original value x and a screening range determined by a first threshold condition and a second threshold condition; wherein the first threshold condition is less than the second threshold condition;
determining a target computation result of the activation function Sigmoid operation to be 10 in response to the original value x being less than the first threshold condition-4
Determining a target calculation result of the active function Sigmoid operation to be 0.17 · x +0.5 in response to the original value x being greater than or equal to the first threshold condition and less than or equal to the second threshold condition;
in response to the original value x being greater than the second threshold condition, determining a target computation result of the activation function Sigmoid operation to be 0.9999.
6. The method of any of claims 1-5, further comprising:
in response to determining that a plurality of ciphertext data of different operations based on the same multi-party secure computing protocol are transmitted, integrating the different operations to generate a target multi-party secure computing protocol; and
updating an old operation mode which takes division operation as a core and is included in the multi-party secure computation protocol into a new operation mode which is formed by at least one of addition, subtraction and multiplication to obtain a new multi-party secure computation protocol, wherein the new operation mode comprises the following steps:
and updating an old operation mode which takes division operation as a core and is contained in the target multi-party secure computation protocol into a new operation mode which is formed by at least one of addition, subtraction and multiplication to obtain a new multi-party secure computation protocol.
7. An apparatus for processing data, comprising:
a ciphertext data acquisition unit configured to acquire ciphertext data incoming based on a multi-party secure computing protocol; the ciphertext data is obtained by encrypting through an encryption algorithm corresponding to the multi-party secure computing protocol;
the calculation protocol updating unit is configured to update an old operation mode which takes division operation as a core and is contained in the multi-party secure calculation protocol to a new operation mode which is formed by at least one of addition, subtraction and multiplication, so as to obtain a new multi-party secure calculation protocol;
and the data processing unit is configured to process the ciphertext data according to the new multi-party secure computing protocol and return a processing result.
8. The apparatus of claim 7, wherein the old operation comprises:
at least one of an inverse square root operation, an activation function Softmax operation, and an activation function Sigmoid operation.
9. The apparatus of claim 8, wherein the calculation protocol update unit comprises:
a reciprocal-square root operation updating subunit configured to determine an initial value x smaller than the target calculation result0(ii) a Wherein the target result is the result obtained by the original value x through the inverse square root calculation
Figure FDA0002839015030000031
By predetermined iterative equations
Figure FDA0002839015030000032
Performing preset n times of iterative operation, and calculating to obtain xnWherein i is the current iteration number;
the x is measurednAs a result of the target calculation
Figure FDA0002839015030000033
The substitute value of (a).
10. The apparatus of claim 8, wherein the calculation protocol update unit comprises:
a first activation-function-operation updating subunit configured to determine an exponential operation included in the activation-function Softmax operation, using a definitional expression
Figure FDA0002839015030000034
Determining an exponential operation value of the original value x; and n is the iteration number preset according to the calculation precision.
11. The apparatus of claim 8, wherein the calculation protocol update unit comprises:
a second activation function operation updating subunit configured to determine a calculation manner corresponding to the original value x according to a relationship between the original value x and a screening range determined by the first threshold condition and the second threshold condition; wherein the first threshold condition is less than the second threshold condition;
determining a target computation result of the activation function Sigmoid operation to be 10 in response to the original value x being less than the first threshold condition-4
Determining a target calculation result of the active function Sigmoid operation to be 0.17 · x +0.5 in response to the original value x being greater than or equal to the first threshold condition and less than or equal to the second threshold condition;
in response to the original value x being greater than the second threshold condition, determining a target computation result of the activation function Sigmoid operation to be 0.9999.
12. The apparatus of any of claims 7-10, further comprising:
a ciphertext data integration unit configured to, in response to determining that a plurality of ciphertext data of different operations based on a same multi-party secure computing protocol are incoming, integrate the different operations to generate a target multi-party secure computing protocol; and
the calculation protocol updating unit is further configured to update an old operation mode taking division operation as a core and contained in the target multi-party secure calculation protocol to a new operation mode formed by at least one of addition, subtraction and multiplication to obtain a new multi-party secure calculation protocol.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of processing data according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method of processing data recited in any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements a method of processing data according to any one of claims 1-6.
CN202011484630.2A 2020-12-16 2020-12-16 Data processing method, related device and computer program product Pending CN112615852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011484630.2A CN112615852A (en) 2020-12-16 2020-12-16 Data processing method, related device and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011484630.2A CN112615852A (en) 2020-12-16 2020-12-16 Data processing method, related device and computer program product

Publications (1)

Publication Number Publication Date
CN112615852A true CN112615852A (en) 2021-04-06

Family

ID=75239660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011484630.2A Pending CN112615852A (en) 2020-12-16 2020-12-16 Data processing method, related device and computer program product

Country Status (1)

Country Link
CN (1) CN112615852A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420338A (en) * 2021-05-21 2021-09-21 华控清交信息科技(北京)有限公司 Data processing method and device and data processing device
CN114915455A (en) * 2022-04-24 2022-08-16 华控清交信息科技(北京)有限公司 Ciphertext data transmission method and device for ciphertext data transmission
CN115361131A (en) * 2022-10-21 2022-11-18 华控清交信息科技(北京)有限公司 Ciphertext data calculation method and device and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070073798A1 (en) * 2005-09-28 2007-03-29 Donofrio David D Enhanced floating-point unit for extended functions
CN111783130A (en) * 2020-09-04 2020-10-16 支付宝(杭州)信息技术有限公司 Data processing method and device for privacy protection and server

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070073798A1 (en) * 2005-09-28 2007-03-29 Donofrio David D Enhanced floating-point unit for extended functions
CN111783130A (en) * 2020-09-04 2020-10-16 支付宝(杭州)信息技术有限公司 Data processing method and device for privacy protection and server

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
EMMMMM: "softmax与sigmoid函数的理解", 《知乎 HTTPS://ZHUANLAN.ZHIHU.COM/P/197343412》 *
韩纪庆等: "TMS320C30的典型函数运算", 《数据采集与处理》 *
高杰等: "复指数函数的定义及欧拉公式的教学探讨", 《巢湖学院学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420338A (en) * 2021-05-21 2021-09-21 华控清交信息科技(北京)有限公司 Data processing method and device and data processing device
CN114915455A (en) * 2022-04-24 2022-08-16 华控清交信息科技(北京)有限公司 Ciphertext data transmission method and device for ciphertext data transmission
CN115361131A (en) * 2022-10-21 2022-11-18 华控清交信息科技(北京)有限公司 Ciphertext data calculation method and device and electronic equipment
CN115361131B (en) * 2022-10-21 2022-12-13 华控清交信息科技(北京)有限公司 Ciphertext data calculation method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN112561078B (en) Distributed model training method and related device
WO2021068444A1 (en) Data processing method and device, computer apparatus, and storage medium
CN112615852A (en) Data processing method, related device and computer program product
CN109214543B (en) Data processing method and device
CN114612600B (en) Virtual image generation method and device, electronic equipment and storage medium
CN113065660B (en) Quantum state measurement method, device, equipment, storage medium and system
CN112434620A (en) Scene character recognition method, device, equipment and computer readable medium
CN114186256A (en) Neural network model training method, device, equipment and storage medium
CN113449872A (en) Parameter processing method, device and system based on federal learning
CN113691374B (en) Data encryption method and device, storage medium and electronic equipment
CN113052962B (en) Model training method, information output method, device, equipment and storage medium
CN116633688B (en) AIGC service privacy protection method and device
CN113098624A (en) Quantum state measurement method, device, equipment, storage medium and system
CN116108473B (en) Data processing method and device in multiparty security calculation
CN114466012B (en) Content initialization method, device, electronic equipment and storage medium
CN113691937B (en) Method for determining position information, cloud mobile phone and terminal equipment
CN115545215A (en) Decentralized federal cluster learning method, decentralized federal cluster learning device, decentralized federal cluster learning equipment and decentralized federal cluster learning medium
CN112598127B (en) Federal learning model training method and device, electronic equipment, medium and product
CN114584284A (en) Homomorphic encryption operation method and device and electronic equipment
CN114359015A (en) Data transmission method and device and graphic processing server
CN113726883A (en) Cloud data processing method, related device and computer program product
CN116089991B (en) Data alignment method, device, equipment and storage medium
CN112434619A (en) Case information extraction method, case information extraction device, case information extraction equipment and computer readable medium
CN117009723B (en) Multiparty computing method, device, equipment and storage medium
CN112615712B (en) Data processing method, related device and computer program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination