A data processing method, device, storage medium and electronic equipment

By quantizing floating-point data into integers and performing calculations in multi-party secure computation, the problem of high-precision data transmission resource consumption is solved, and efficient and low-cost computation results are obtained.

CN119254422BActive Publication Date: 2025-11-25ZHEJIANG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411312592.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-11-25
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

Secure multi-party computation consumes a lot of communication resources and leads to low computational efficiency and high cost when transmitting high-precision data.

Method used

By quantizing the encrypted data, which is represented by a high-precision floating-point number, into a low-precision integer representation, and then performing the calculation in a multi-party secure computation system, the data is dequantized back into a high-precision floating-point representation to obtain the plaintext calculation result.

Benefits of technology

It reduces the communication resource requirements during data transmission, improves the computational efficiency of multi-party secure computation and reduces costs, while ensuring the accuracy of computation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254422B_ABST
    Figure CN119254422B_ABST
Patent Text Reader

Abstract

The specification discloses a data processing method, device, storage medium and electronic equipment. Ciphertext data transmitted by at least one participant for participating in multi-party secure calculation is acquired. The ciphertext data is quantized based on a preset ciphertext quantization parameter. The quantization processing includes converting the ciphertext data represented by a floating-point number based on a first set number of bits into ciphertext data represented by an integer number based on a second set number of bits. Then, multi-party secure calculation is performed on the ciphertext data. Next, the ciphertext calculation result of the multi-party secure calculation is dequantized based on the ciphertext quantization parameter, and the dequantized ciphertext calculation result is sent to the at least one participant, so that the at least one participant decrypts the dequantized ciphertext calculation result to obtain a plaintext calculation result. Thus, the required communication resources during data transmission are reduced, and the calculation efficiency of the multi-party secure calculation and the cost are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of computer technology, and particularly relates to a data processing method and device, a storage medium and an electronic device. BACKGROUND

[0002] With the rapid development of computer technology, machine learning is increasingly applied in various scenarios. In some application scenarios, the data held by different data providers may contain user privacy information, and data sharing between data providers may infringe on the privacy of users. In order to enable data flow between multiple parties, multi-party secure computing can be used to support joint computing between multiple parties, mine the value of data, and ensure that the privacy of each party is not disclosed when interacting.

[0003] At present, although multi-party secure computing provides strict security protection, transmitting high-precision data consumes a large amount of communication resources and may cause processing delay. Therefore, the computing efficiency of multi-party secure computing is low and the cost is high. SUMMARY

[0004] The present specification provides a data processing method and device, a storage medium and an electronic device to effectively improve the computing efficiency of multi-party secure computing and reduce costs.

[0005] The present specification adopts the following technical solutions:

[0006] The present specification provides a data processing method, which is applied to a multi-party secure computing (MPC) system; the method comprises:

[0007] Obtaining ciphertext data transmitted by at least one participant for participating in multi-party secure computing; wherein the ciphertext data is quantized based on a preset ciphertext quantization parameter; the quantization processing comprises converting ciphertext data represented by a floating-point number based on a first set number of bits into ciphertext data represented by an integer number based on a second set number of bits, the first set number of bits being greater than the second set number of bits;

[0008] Performing multi-party secure computing on the ciphertext data;

[0009] Based on the ciphertext quantization parameter, performing dequantization processing on the ciphertext calculation result of the multi-party secure computing, and sending the ciphertext calculation result after dequantization processing to the at least one participant, so that the at least one participant decrypts the ciphertext calculation result after dequantization processing to obtain a plaintext calculation result corresponding to the ciphertext calculation result; wherein the dequantization processing comprises converting the ciphertext calculation result represented by an integer number based on a second set number of bits into a ciphertext calculation result represented by a floating-point number based on a first set number of bits.

[0010] Optionally, the ciphertext quantization parameter comprises a mapping parameter and a correction parameter; the quantization processing comprises a first sub-operation of mapping a first set numerical value range of the ciphertext data in floating-point number representation to a second set numerical value range of the ciphertext data in integer number representation based on the mapping parameter, and a second sub-operation of correcting an error of the ciphertext data in integer number representation mapped to the second set numerical value range based on the correction parameter.

[0011] Optionally, the mapping parameter comprises a scaling factor; the first sub-operation is an operation of reducing the first set numerical value range of the ciphertext data in floating-point number representation to the second set numerical value range of the ciphertext data in integer number representation based on the scaling factor, and truncating a decimal part of the ciphertext data.

[0012] Optionally, the correction parameter comprises a zero-point offset error corresponding to the ciphertext data; the second sub-operation comprises an operation of adding the zero-point offset error to the ciphertext data mapped to the first set numerical value range.

[0013] Optionally, the ciphertext data is ciphertext data obtained by homomorphic encryption of target data provided by the at least one participant for participating in the secure multi-party computation;

[0014] The secure multi-party computation is performed on the ciphertext data, comprising:

[0015] The homomorphic computation is performed on the ciphertext data based on a preset homomorphic encryption algorithm.

[0016] Optionally, the homomorphic computation comprises a homomorphic addition computation, and the ciphertext data comprises first ciphertext data and second ciphertext data;

[0017] The homomorphic computation is performed on the ciphertext data based on a preset homomorphic encryption algorithm, comprising:

[0018] If numerical value ranges of the first ciphertext data and the second ciphertext data for the homomorphic addition computation are same, the first ciphertext data, the second ciphertext data, a correction parameter corresponding to the first ciphertext data, a correction parameter corresponding to the second ciphertext data, and a correction parameter corresponding to a homomorphic computation result of the homomorphic addition computation are added to obtain the homomorphic computation result of the homomorphic addition computation.

[0019] Optionally, the method further comprises:

[0020] If the numerical range of the first ciphertext data and the second ciphertext data used for the homomorphic addition calculation is not the same, multiply the first ratio of the mapping parameter corresponding to the first ciphertext data and the mapping parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation by the first ciphertext data, to obtain first ciphertext product data; and

[0021] multiply the second ratio of the mapping parameter corresponding to the second ciphertext data and the mapping parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation by the quantized second ciphertext data, to obtain second ciphertext product data;

[0022] add the first ciphertext product data, the second ciphertext product data, and the correction parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation, to obtain the homomorphic calculation result of the homomorphic addition calculation.

[0023] Optionally, the homomorphic calculation includes a homomorphic multiplication calculation, and the ciphertext data includes first ciphertext data and second ciphertext data;

[0024] Based on a preset homomorphic encryption algorithm, performing homomorphic calculation on the ciphertext data includes:

[0025] adding the first ciphertext data and the correction parameter corresponding to the first ciphertext data to obtain corrected first ciphertext data, and adding the second ciphertext data and the correction parameter corresponding to the second ciphertext data to obtain corrected second ciphertext data;

[0026] Based on the mapping parameter corresponding to the first encrypted data, the mapping parameter corresponding to the second encrypted data, and the reciprocal of the mapping parameter corresponding to the homomorphic calculation result of the homomorphic multiplication calculation, a third ratio is obtained;

[0027] multiply the corrected first ciphertext data, the corrected second ciphertext data, and the third ratio to obtain ciphertext product data, and add the ciphertext product data and the correction parameter corresponding to the homomorphic calculation result of the homomorphic multiplication calculation to obtain the homomorphic calculation result of the homomorphic multiplication calculation.

[0028] Optionally, the homomorphic calculation includes a homomorphic activation function calculation;

[0029] Based on a preset homomorphic encryption algorithm, performing homomorphic calculation on the ciphertext data includes:

[0030] If the ciphertext data for the homomorphic activation function calculation is not less than the correction parameter corresponding to the ciphertext data, the ciphertext data, the correction parameter corresponding to the ciphertext data, and the correction parameter corresponding to the homomorphic calculation result of the homomorphic activation function calculation are added to obtain the homomorphic calculation result of the homomorphic activation function calculation.

[0031] If the ciphertext data for the homomorphic activation function calculation is less than the correction parameter corresponding to the ciphertext data, the homomorphic calculation result of the homomorphic activation function calculation is the correction parameter corresponding to the homomorphic calculation result of the homomorphic activation function calculation.

[0032] Optionally, the dequantization processing includes a third sub-operation of correcting an error of the ciphertext calculation result mapped to the second numerical range based on the correction parameter; and a fourth sub-operation of mapping the second set numerical range of the ciphertext calculation result in the integer number representation to the first set numerical range of the ciphertext calculation result in the floating point number representation based on the mapping parameter.

[0033] Optionally, the correction parameter includes a zero point offset error corresponding to the ciphertext calculation result; and the third sub-operation includes an operation of adding the zero point offset error to the ciphertext calculation result mapped to the second set numerical range.

[0034] Optionally, the mapping parameter includes a scaling factor; and the fourth sub-operation is an operation of amplifying the second set numerical range of the ciphertext calculation result in the integer number representation to the first set numerical range of the ciphertext calculation result in the floating point number representation based on the scaling factor.

[0035] Optionally, the multi-party secure calculation system includes at least two calculation parties; and the ciphertext calculation result is obtained by adding the ciphertext calculation sub-results held by the at least two calculation parties.

[0036] Before the dequantization processing of the ciphertext calculation result of the multi-party secure calculation based on the ciphertext quantization parameter, the method further includes:

[0037] If the ciphertext calculation result obtained by adding the ciphertext calculation sub-results held by the at least two calculation parties is less than a set value, the ciphertext calculation result is a sum value obtained by adding the ciphertext calculation sub-results held by the at least two calculation parties.

[0038] If the ciphertext calculation result obtained by adding the ciphertext calculation sub-results held by the at least two calculation parties is not less than a set value, the ciphertext calculation result is a sum value obtained by adding the ciphertext calculation sub-results held by the at least two calculation parties and a negative value of the set value.

[0039] The specification provides a data processing apparatus applied to a multi-party secure computation (MPC) system, the apparatus comprising:

[0040] An acquisition module is configured to acquire ciphertext data transmitted by at least one participant for participating in multi-party secure computation, wherein the ciphertext data is quantized based on a preset ciphertext quantization parameter, and the quantization includes converting the ciphertext data represented by a floating-point number based on a first set of bits into ciphertext data represented by an integer number based on a second set of bits, the first set of bits being greater than the second set of bits.

[0041] A calculation module is configured to perform multi-party secure computation on the ciphertext data.

[0042] A sending module is configured to perform dequantization on a ciphertext calculation result of the multi-party secure computation based on the ciphertext quantization parameter, and send the dequantized ciphertext calculation result to the at least one participant, so that the at least one participant decrypts the dequantized ciphertext calculation result to obtain a plaintext calculation result corresponding to the ciphertext calculation result, wherein the dequantization includes converting the ciphertext calculation result represented by an integer number based on the second set of bits into a ciphertext calculation result represented by a floating-point number based on the first set of bits.

[0043] The specification provides an electronic device comprising a communication interface, a processor, a memory, and a bus connecting the communication interface, the processor, and the memory to each other.

[0044] The memory stores machine-readable instructions, and the processor executes the above-mentioned data processing method by invoking the machine-readable instructions.

[0045] The specification provides a machine-readable storage medium storing machine-readable instructions, which, when invoked and executed by a processor, implement the above-mentioned data processing method.

[0046] The above-mentioned at least one technical solution adopted by the specification can achieve the following beneficial effects:

[0047] In the specification, a participant can convert ciphertext data represented by a floating-point number with high precision into ciphertext data represented by an integer number with low precision based on a ciphertext quantization parameter, and then transmit the ciphertext data to a multi-party secure computation system. This reduces the communication resources required for data transmission.

[0048] Then, the multi-party secure computation system can perform multi-party secure computation on the ciphertext data represented by an integer number with low precision, which can effectively improve the calculation efficiency of multi-party secure computation and reduce costs.

[0049] Finally, the multi-party secure computing system can convert the ciphertext calculation result represented by the low-precision integer number into a ciphertext calculation result represented by a high-precision floating point number based on the ciphertext quantization parameter, and send the dequantized ciphertext calculation result to the participant, so that the participant decrypts the dequantized ciphertext calculation result to obtain an accurate plaintext calculation result. BRIEF DESCRIPTION OF DRAWINGS

[0050] The accompanying drawings, which are included to provide a further understanding of the specification, constitute a part of the specification, illustrate exemplary embodiments of the specification, and serve to explain the specification, and do not constitute an improper limitation of the specification. In the drawings:

[0051] Figure 1 FIG. 1 is a flowchart of a data processing method according to an exemplary embodiment;

[0052] Figure 2 FIG. 2 is a schematic diagram of multi-party interaction according to an exemplary embodiment;

[0053] Figure 3 FIG. 3 is a schematic diagram of multi-party secure computing according to an exemplary embodiment;

[0054] Figure 4 FIG. 4 is a structural diagram of an electronic device in which a data processing apparatus is located according to an exemplary embodiment;

[0055] Figure 5 FIG. 5 is a structural diagram of a data processing apparatus according to an exemplary embodiment. DETAILED DESCRIPTION

[0056] In order to enable those skilled in the art to better understand the technical solutions in the specification, the technical solutions in the specification will be clearly and completely described below in conjunction with the drawings in the embodiments of the specification. Obviously, the described embodiments are only part of the embodiments of the specification, not all the embodiments. Based on the embodiments in the specification, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the specification.

[0057] It should be noted that: in other embodiments, the steps of the corresponding method do not necessarily follow the order shown and described in the specification. In some other embodiments, the steps included in the method can be more or less than described in the specification. In addition, a single step described in the specification may, in other embodiments, be divided into multiple steps for description; and multiple steps described in the specification may, in other embodiments, be combined into a single step for description.

[0058] In order for those skilled in the art to better understand the technical solutions in the embodiments of the present specification, the related technologies involved in the embodiments of the present specification will be briefly described below.

[0059] Secure Multi-Party Computation (SMPC): used to solve the problem of collaborative calculation of protecting privacy among a group of mutually distrustful participants. Secure multi-party computation can ensure the independence of data input and the correctness of data calculation, while not leaking each input data to other parties participating in the calculation. In secure multi-party computation, how to securely calculate addition and multiplication are two most important problems. For contemporary computers, after supporting secure addition and multiplication, any secure calculation task can be supported in theory.

[0060] Homomorphic Encryption (HE): a cryptography technology based on the computational complexity theory of mathematical problems. Processing the data encrypted by homomorphic encryption obtains an output, and the result of decrypting this output is the same as the output obtained by processing the original unencrypted data with the same method. That is, the ciphertext is directly processed, and the result is the same as that obtained by encrypting the result after processing the plaintext.

[0061] Secret Sharing (SS): a secret information is split in an appropriate way, and each part of the split is managed by different participants. Each participant cannot recover the secret information alone, and only a number of participants can recover the secret information together. Secret sharing is a common security protocol in secure multi-party computation.

[0062] Quantization: the process of converting high-precision floating-point numbers into low-precision integer numbers.

[0063] The technical solutions provided by the embodiments of the present specification will be described in detail below with reference to the accompanying drawings.

[0064] Figure 1 is a flowchart of a data processing method according to an exemplary embodiment, which specifically includes the following steps:

[0065] S100: Obtain the ciphertext data transmitted by at least one participant for participating in secure multi-party computation; wherein the ciphertext data is quantized based on a preset ciphertext quantization parameter; the quantization processing includes converting the ciphertext data represented by a floating-point number based on a first set of digits into ciphertext data represented by an integer number based on a second set of digits, the first set of digits being greater than the second set of digits.

[0066] S102: Perform multi-party secure computation on the ciphertext data.

[0067] S104: Perform dequantization processing on the ciphertext computation result of the multi-party secure computation based on the ciphertext quantization parameter, and send the dequantization-processed ciphertext computation result to the at least one participant, so that the at least one participant decrypts the dequantization-processed ciphertext computation result to obtain a plaintext computation result of the multi-party secure computation on the target data; wherein the dequantization processing includes converting the ciphertext computation result represented by an integer number based on a second set number of bits into a ciphertext computation result represented by a floating point number based on a first set number of bits.

[0068] In the embodiments of the present specification, the multi-party secure computation system can obtain the ciphertext data transmitted by the at least one participant for participating in the multi-party secure computation. The ciphertext data is quantized based on a preset ciphertext quantization parameter. The quantization processing includes converting the ciphertext data represented by a floating point number based on a first set number of bits into ciphertext data represented by an integer number based on a second set number of bits, and the first set number of bits is greater than the second set number of bits.

[0069] Then, the multi-party secure computation system can perform multi-party secure computation on the ciphertext data.

[0070] Finally, the multi-party secure computation system can perform dequantization processing on the ciphertext computation result of the multi-party secure computation based on the ciphertext quantization parameter, and send the dequantization-processed ciphertext computation result to the at least one participant, so that the at least one participant decrypts the dequantization-processed ciphertext computation result to obtain a plaintext computation result of the multi-party secure computation on the target data. The dequantization processing includes converting the ciphertext computation result represented by an integer number based on a second set number of bits into a ciphertext computation result represented by a floating point number based on a first set number of bits.

[0071] Figure 2 FIG. 1 is an exemplary embodiment illustrating a schematic diagram of multi-party interaction.

[0072] In Figure 2In the method, the participants can include a data provider and a model provider. The model provider can homomorphically encrypt the model data and the quantization parameter to obtain ciphertext model data and ciphertext quantization parameter, and perform quantization processing on the ciphertext model data represented by a floating-point number based on a first set of bits based on the ciphertext quantization parameter to obtain ciphertext model data represented by an integer based on a second set of bits. Of course, the model provider can also perform quantization processing on the model data represented by a floating-point number based on a first set of bits based on the quantization parameter to obtain model data represented by an integer based on a second set of bits. Then, the model data represented by an integer based on a second set of bits and the quantization parameter are homomorphically encrypted to obtain ciphertext model data represented by an integer based on a second set of bits and ciphertext quantization parameter.

[0073] Then, the model provider can send the preset ciphertext quantization parameter to the data provider. The data provider can homomorphically encrypt the user data to obtain ciphertext user data, and perform quantization processing on the ciphertext user data represented by a floating-point number based on a first set of bits based on the preset ciphertext quantization parameter to obtain ciphertext user data represented by an integer based on a second set of bits.

[0074] Next, the data provider can send the ciphertext user data represented by an integer based on a second set of bits to the multi-party secure computing system. The model provider can send the ciphertext model data represented by an integer based on a second set of bits and the ciphertext quantization parameter to the multi-party secure computing system.

[0075] Then, the multi-party secure computing system can perform multi-party secure computation on the ciphertext user data represented by an integer based on a second set of bits, the ciphertext model data represented by an integer based on a second set of bits, and the ciphertext quantization parameter represented by an integer based on a second set of bits to obtain ciphertext computation results.

[0076] Finally, the multi-party secure computing system performs dequantization processing on the multi-party secure computation ciphertext computation results represented by an integer based on a second set of bits based on the ciphertext quantization parameter to obtain ciphertext computation results represented by a floating-point number based on a first set of bits, and sends the ciphertext computation results represented by a floating-point number based on a first set of bits to the data provider, so that the data provider decrypts the ciphertext computation results after dequantization processing to obtain plaintext computation results corresponding to the ciphertext computation results.

[0077] The relationship formula between the ciphertext data represented by a floating-point number based on a first set of bits and the ciphertext data represented by an integer based on a second set of bits is as follows:

[0078] [r i ] l =[S i ] l ([qi ] l′ -[Z i ] l′

[0079] In the above formula, [r i ] l is used to represent the i-th ciphertext data based on the first set of floating-point number representation. [q i ] l′ is used to represent the i-th ciphertext data based on the second set of integer number representation. [S i ] l is used to represent the scaling factor of the i-th floating-point number representation based on the first set of floating-point number representation. [Z i ] l′ is used to represent the zero-point offset error of the i-th ciphertext data. Wherein, [S i ] l and [Z i ] l′ are sent by the model provider.

[0080] In the embodiments of the present specification, in order to ensure the accuracy of the ciphertext quantization parameter, the model provider can obtain a test data set, analyze the test data set, obtain the numerical range of the ciphertext data corresponding to each test data in the test data set, and perform homomorphic calculation on the test data according to the calculation steps corresponding to the model structure of the model, and determine the numerical range of the intermediate value of each calculation step.

[0081] Then, the model provider can determine the ciphertext quantization parameter of the ciphertext data corresponding to each test data and the ciphertext quantization parameter of the intermediate value of each calculation step based on the numerical range of the ciphertext data corresponding to each test data and the numerical range of the intermediate value of each calculation step.

[0082] As can be seen from the above embodiments, by obtaining and analyzing the test data set, the model provider can determine the numerical range of the ciphertext data. Further, according to the calculation steps corresponding to the model structure of the model, the homomorphic calculation is performed on the test data, which can simulate the actual homomorphic calculation process, determine the appropriate ciphertext quantization parameter, and thus ensure the accuracy of the ciphertext calculation result.

[0083] In practical applications, the numerical range of floating-point numbers and the numerical range of integer numbers are not the same. For example, in the IEEE754 standard double-precision floating-point number, there are 52 bits for mantissa, 11 bits for exponent, and 1 bit for sign. This makes the double-precision floating-point number can represent the numerical range of -1.7*10 -308 to 1.7*10 308 . For another example, a 16-bit integer number can represent -2 -15 to 2 15 ​It can be seen that the numerical range of the floating-point number is much larger than the numerical range of the integer number, and in this case, the floating-point number exceeding the numerical range of the integer number can be rounded to the maximum or minimum value of the numerical range of the integer number. Therefore, in the quantization process, it is necessary to convert the numerical range of the floating-point number to the numerical range of the integer number.

[0084] In the embodiments of the present specification, the ciphertext quantization parameter includes a mapping parameter and a correction parameter. The quantization process includes a first sub-operation of mapping a first set numerical range of the ciphertext data represented by the floating-point number to a second set numerical range of the ciphertext data represented by the integer number based on the mapping parameter. And a second sub-operation of correcting the error of the ciphertext data represented by the integer number mapped to the second set numerical range based on the correction parameter.

[0085] Further, the mapping parameter includes a scaling factor. The first sub-operation is an operation of reducing the first set numerical range of the ciphertext data represented by the floating-point number to the second set numerical range of the ciphertext data represented by the integer number based on the scaling factor, and truncating the decimal part of the ciphertext data. The correction parameter includes a zero-point offset error corresponding to the ciphertext data. The second sub-operation includes an operation of adding the zero-point offset error to the ciphertext data mapped to the first set numerical range. The specific formula is as follows:

[0086]

[0087] In the formula, [r i ] l is used to represent the i-th ciphertext data represented by the floating-point number based on the first set number of bits, [q i ] l′ is used to represent the i-th ciphertext data represented by the integer number based on the second set number of bits, is used to represent the i-th scaling factor of the floating-point number based on the first set number of bits, is used to represent the operation of reducing the first set numerical range of the ciphertext data represented by the floating-point number to the second set numerical range of the ciphertext data represented by the integer number based on the scaling factor, and truncating the decimal part of the ciphertext data, [Z i ] l′ is used to represent the zero-point offset error of the i-th ciphertext data.

[0088] As can be seen from the above embodiments, after reducing the numerical range of the floating-point number to the numerical range of the integer number, the floating-point number needs to be truncated to make the number of bits of the floating-point number the same as the number of bits of the integer number, so as to reduce the communication resources required for transmitting data by reducing the number of bits of the ciphertext data. For example, the number of bits of the floating-point number is 64 bits, the number of bits of the integer number is 16 bits, and the communication resources required for transmitting data is one fourth of the original.

[0089] Further, the zero point offset error can be used to correct the error in the quantization process, to ensure that the ciphertext data based on the integer number representation of the second set of bits is closer to the true value of the ciphertext data based on the floating point number representation of the first set of bits.

[0090] In the embodiments of the present specification, the ciphertext data can be ciphertext data obtained by homomorphically encrypting target data provided by at least one participant for participating in secure multi-party computation.

[0091] It should be noted that there can be many homomorphic encryption algorithms. For example, a full homomorphic encryption scheme based on the RLWE (Ring-Learning With Errors) problem (BFV), a fully homomorphic encryption without bootstrapping (BGV), a floating point number addition and multiplication homomorphic operation supporting real numbers or complex numbers (Cheon-Kim-Kim-Song, CKKS), and the like. The present specification does not limit the homomorphic encryption algorithm.

[0092] Specifically, the secure multi-party computation system can perform homomorphic computation on the ciphertext data based on a preset homomorphic encryption algorithm. The homomorphic computation mentioned here includes homomorphic addition computation, homomorphic multiplication computation, homomorphic activation function computation, and the like.

[0093] In actual applications, in order to improve the performance and generalization ability of the model, the input data is usually standardized or normalized to make the distribution range consistent. This makes the distribution of the input data of most models consistent. However, in homomorphic addition computation, it is required to perform effective computation without relying on the consistency of the data distribution, which leads to a relatively complex computation formula of homomorphic addition computation.

[0094] Based on this, before performing homomorphic addition computation, it can be determined whether the numerical ranges of the first ciphertext data and the second ciphertext data used for homomorphic addition computation are the same, to select a suitable computation formula of homomorphic addition computation.

[0095] In the embodiments of the present specification, the original computation formula of homomorphic addition computation is [r z ] l = [r x ] l + [r y ] l , and the relationship formula of the ciphertext data based on the floating point number representation of the first set of bits and the ciphertext data based on the integer number representation of the second set of bits is substituted to obtain [S z ] l ([q z ] l′ - [Z z] l′ ) = [S x ] l ([q x ] l′ -[Z x ] l′ )+[S y ] l ([q y ] l′ -[Z y ] l′ )。

[0096] Then, the original calculation formula of the above homomorphic addition calculation is transformed to obtain the calculation formula of the homomorphic calculation result

[0097] If the numerical range of the first ciphertext data and the second ciphertext data used for the homomorphic addition calculation is the same, it is determined that S xl′ = S yl′ , 1 can be directly used instead of and in the calculation formula of the homomorphic calculation result.

[0098] add * ([q x ] l′ , [q y ] l′ ) = [q x ] l′ + [q y ] l′ -[Z x ] l′ -[Z y ] l′ +[Z z ] l′

[0099] In the formula, [q x ] l′ is used to represent the first ciphertext data based on the integer type number representation of the second set of bits, [q y ] l′ is used to represent the second ciphertext data based on the integer type number representation of the second set of bits, [Z x ] l′ is used to represent the zero point offset error corresponding to the first ciphertext data, and [Z y ] l′is used to represent the zero-point offset error corresponding to the second ciphertext data, [Z z ] l′ is used to represent the zero-point offset error corresponding to the homomorphic calculation result of the homomorphic addition calculation.

[0100] From the above embodiments, when the numerical ranges of the first ciphertext data and the second ciphertext data used for the homomorphic addition calculation are the same, the simplified homomorphic addition calculation formula can be selected for the homomorphic addition calculation. This method not only simplifies the calculation process, but also significantly improves the operation speed, making the entire homomorphic encryption calculation more efficient.

[0101] In practical applications, whether to perform the uniformization processing on the data distribution needs to be determined according to the specific problems and model requirements, and not all cases require the uniform distribution of input data. In some application scenarios, maintaining the original distribution of data may be more helpful to the performance and interpretability of the model.

[0102] In the embodiments of the present specification, if the numerical ranges of the first ciphertext data and the second ciphertext data used for the homomorphic addition calculation are not the same, the first ciphertext product data is obtained by multiplying the first ratio of the mapping parameter corresponding to the first ciphertext data and the mapping parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation, and the first ciphertext data. And the second ciphertext product data is obtained by multiplying the second ratio of the mapping parameter corresponding to the second ciphertext data and the mapping parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation, and the quantized second ciphertext data.

[0103] Then, the first ciphertext product data, the second ciphertext product data, and the correction parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation are added to obtain the homomorphic calculation result of the homomorphic addition calculation. The specific formula is as follows:

[0104]

[0105] In the formula, S xl′ is used to represent the scaling factor corresponding to the first ciphertext data, S yl′ is used to represent the scaling factor corresponding to the second ciphertext data, S zl′ is used to represent the scaling factor corresponding to the homomorphic calculation result of the homomorphic addition calculation.[q x ] l′ is used to represent the first ciphertext data based on the integer type representation of the second set of bits, [q y ] l′ is used to represent the second ciphertext data based on the integer type representation of the second set of bits, [Z x ] l′ is used to represent the zero-point offset error corresponding to the first ciphertext data, [Z y ]l′ for representing a zero-point offset error corresponding to the second ciphertext data, [Z z ] l′ for representing a zero-point offset error corresponding to the homomorphic calculation result of the homomorphic addition calculation.

[0106] From the above embodiments, it can be known that when the numerical ranges of the first ciphertext data and the second ciphertext data used for the homomorphic addition calculation are different, the original calculation formula of the homomorphic addition calculation can be selected to perform the homomorphic addition calculation. Thus, the homomorphic addition calculation is performed on the ciphertext data of different numerical ranges, and the versatility of the homomorphic addition calculation is enhanced.

[0107] In the embodiments of the present specification, the multi-party secure calculation system can add the first ciphertext data and the correction parameter corresponding to the first ciphertext data to obtain the corrected first ciphertext data, and add the second ciphertext data and the correction parameter corresponding to the second ciphertext data to obtain the corrected second ciphertext data.

[0108] Then, the third ratio is obtained based on the mapping parameter corresponding to the first encrypted data, the mapping parameter corresponding to the second encrypted data, and the reciprocal of the mapping parameter corresponding to the homomorphic calculation result of the homomorphic multiplication calculation.

[0109] Next, the corrected first ciphertext data, the corrected second ciphertext data, and the third ratio are multiplied to obtain ciphertext product data, and the ciphertext product data and the correction parameter corresponding to the homomorphic calculation result of the homomorphic multiplication calculation are added to obtain the homomorphic calculation result of the homomorphic multiplication calculation.

[0110] It should be noted that the original calculation formula of the homomorphic multiplication calculation is [r z ] l = [r x ] l *[r y ] l , the relationship formula of the ciphertext data based on the floating-point number representation of the first set of bits and the ciphertext data based on the integer number representation of the second set of bits is substituted to obtain [S z ] l ([q z ] l′ -[Z z ] l′ ) = [S x ] l ([q x ] l′ -[Z x ] l′ *[S y ] l ([q y ] l′ -[Zy l′ .

[0111] Then, the original calculation formula of the above homomorphic multiplication calculation is transformed to obtain the calculation formula of the homomorphic calculation result, which is specifically as follows:

[0112]

[0113] In the formula, S xl′ is used to represent the scaling factor corresponding to the first ciphertext data, S yl′ is used to represent the scaling factor corresponding to the second ciphertext data, S zl′ is used to represent the scaling factor corresponding to the homomorphic calculation result of the homomorphic multiplication calculation. x l′ is used to represent the first ciphertext data based on the integer type number representation of the second set of bit positions, y l′ is used to represent the second ciphertext data based on the integer type number representation of the second set of bit positions, x l′ is used to represent the zero point offset error corresponding to the first ciphertext data, y l′ is used to represent the zero point offset error corresponding to the second ciphertext data, z l′ is used to represent the zero point offset error corresponding to the homomorphic calculation result of the homomorphic multiplication calculation.

[0114] As can be seen from the above embodiment, although there is a multiplication operation with a depth of 3 in the homomorphic multiplication calculation of the ciphertext data based on the integer type number representation of the second set of bit positions, the required calculation resources are the same as those required by the multiplication operation with a depth of 2 of the ciphertext data based on the floating point number representation of the first set of bit positions. For example, the first set of bit positions is 64 bits, and the second set of bit positions is 16 bits. The required calculation resources of the homomorphic multiplication calculation of the ciphertext data based on the integer type number representation of the second set of bit positions are 16X16X16 = 4096. The required calculation resources of the multiplication operation with a depth of 2 of the ciphertext data based on the floating point number representation of the first set of bit positions are also 64X64 = 4096.

[0115] However, the required communication resources of the homomorphic multiplication calculation of the ciphertext data based on the integer type number representation of the second set of bit positions are one fourth of the required communication resources of the homomorphic multiplication calculation of the ciphertext data based on the floating point number representation of the first set of bit positions, thereby reducing the required communication resources for transmitting data without additional consumption of calculation resources.

[0116] ​​​​​​In the embodiments of the present specification, if the ciphertext data for the homomorphic activation function calculation is not less than the correction parameter corresponding to the ciphertext data, the ciphertext data, the correction parameter corresponding to the ciphertext data, and the correction parameter corresponding to the homomorphic calculation result of the homomorphic activation function calculation are added to obtain the homomorphic calculation result of the homomorphic activation function calculation.

[0117] If the ciphertext data for the homomorphic activation function calculation is less than the correction parameter corresponding to the ciphertext data, the homomorphic calculation result of the homomorphic activation function calculation is the correction parameter corresponding to the homomorphic calculation result of the homomorphic activation function calculation.

[0118] It should be noted that the original calculation formula of the homomorphic activation function calculation is The relationship formula of the ciphertext data based on the floating-point number representation of the first set of bits and the ciphertext data based on the integer number representation of the second set of bits is substituted to obtain

[0119] Then, the original calculation formula of the homomorphic activation function calculation is transformed to obtain the calculation formula of the homomorphic calculation result

[0120] Since the input and output of the activation function have consistent distribution, S xl′ =S zl′ 1 can be directly used to replace in the calculation formula of the homomorphic calculation result The specific formula is as follows:

[0121]

[0122] In the above formula, [q x ] l′ is used to represent the ciphertext data based on the integer number representation of the second set of bits.[Z x ] l′ is used to represent the zero point offset error corresponding to the ciphertext data.[Z z ] l′ is used to represent the zero point offset error corresponding to the homomorphic calculation result of the homomorphic activation function calculation.

[0123] As can be seen from the above embodiments, the communication resources required for the homomorphic activation function calculation of the ciphertext data based on the integer number representation of the second set of bits is one fourth of the communication resources required for the homomorphic activation function calculation of the ciphertext data based on the floating-point number representation of the first set of bits, thereby reducing the communication resources required for transmitting data without additional consumption of calculation resources.

[0124] It should be noted that the homomorphic calculation can also include homomorphic matrix calculation and homomorphic convolution calculation. The homomorphic matrix calculation and the homomorphic convolution calculation can complete the homomorphic calculation on the basis of the homomorphic addition calculation and the homomorphic multiplication calculation. For example, the homomorphic matrix calculation can use the SecureML method. The homomorphic convolution calculation can use the CrypTFlow method.

[0125] Further, the homomorphic calculation can also include homomorphic nonlinear calculation. The homomorphic nonlinear calculation can complete the homomorphic calculation on the basis of the homomorphic addition calculation, the homomorphic multiplication calculation, and the homomorphic activation function calculation. For example, the homomorphic nonlinear calculation can use the Maxpool method.

[0126] In the embodiments of the present specification, after the homomorphic calculation is performed on the ciphertext data after the quantization processing, the ciphertext calculation result needs to be dequantized to ensure that the ciphertext calculation result represented by the floating-point number based on the first set of bits converted from the integer number based on the second set of bits is closer to the calculation result of the original data.

[0127] The dequantization processing includes a third sub-operation of correcting the error of the integer number represented ciphertext calculation result mapped to the second numerical range based on a correction parameter, and a fourth sub-operation of mapping the second set of numerical values of the integer number represented ciphertext calculation result to the first set of numerical values of the floating-point number represented ciphertext calculation result based on a mapping parameter.

[0128] The correction parameter includes a zero point offset error corresponding to the ciphertext calculation result, and the third sub-operation includes an operation of adding the zero point offset error to the ciphertext calculation result mapped to the second set of numerical values. The mapping parameter includes a scaling factor, and the fourth sub-operation is to enlarge the second set of numerical values of the integer number represented ciphertext calculation result to the first set of numerical values of the floating-point number represented ciphertext calculation result based on the scaling factor.

[0129] In actual application, to expand an unencrypted integer number, only zero needs to be added in front of the integer number. However, the ciphertext calculation result in the present specification is calculated by the method of secret sharing, and cannot be expanded by adding zero in front of the ciphertext calculation result. Taking two-part secret sharing as an example, [q z ] l′ =([q z ] (1) l′ +[q z ] (2) l′ )mod2 l′ , the calculation parties respectively hold [q z ] (1) l′ , [q z ](2) l′ to ensure that [q z ] l′ is not known by any party. If [q z ] (1) is directly extended, it can lead to [q l′ ] z , which is an incorrect ciphertext calculation result. For example, when [q (2) ] l′ > 2, it can lead to [q z ] (1) l′ + [q z ] (2) l′ > 2 l′ , which is an incorrect ciphertext calculation result. For example, when [q z ] (1) l′ + [q z ] (2) l′ > 2 l′ , it can lead to [q z ] (1) l + [q z ] (2) l = [q z ] l + 2 l′ .

[0130] In the embodiments of the present specification, the multi-party secure calculation system comprises at least two calculation parties. The ciphertext calculation result is calculated by at least two calculation parties holding a ciphertext calculation sub-result represented by an integer number based on a second set of bits. Taking a two-part secret sharing as an example, the calculation formula of the first calculation party is as follows:

[0131]

[0132] In the above formula, [q z ] (1) l is used to represent the first ciphertext calculation sub-result held by the first calculation party, which is represented by a floating-point number based on a first set of bits. is used to represent the extension of the first ciphertext calculation sub-result held by the first calculation party, which is represented by an integer number based on a second set of bits. Wherein, [t] l = 1{[q z ] (1) l′ + [q z ] (2) l′ > 2 l′} l is used to represent when [qz ] (1) l′ +[q z ] (2) l′ >2 l′ At that time, [t] l =1, when [q z ] (1) l′ +[q z ] (2) l′ ≤2 l′ At that time, [t] l =0.

[0133] And, the calculation formula for the second calculation method is as follows:

[0134]

[0135] In the above formula, [q z ] (2) l This is used to represent the second ciphertext computation result held by the second computer, which is a floating-point number based on a first set number of bits. This is used to represent an extension of the second ciphertext computation result held by the second computer, based on an integer representation with a second set number of bits. Where, [t] l =1{[q z ] (1) l′ +[q z ] (2) l′ >2 l′} l Used to indicate when [q] z ] (1) l′ +[q z ] (2) l′ >2 l′ At that time, [t] l =1, when [q z ] (1) l′ +[q z ] (2) l′ ≤2 l′ At that time, [t] l =0.

[0136] Furthermore, before performing dequantization processing on the ciphertext computation result of the multi-party secure computation based on the ciphertext quantization parameters, the ciphertext computation sub-results held by at least two computing parties, represented by integers based on a second set number of bits, are extended to obtain ciphertext computation sub-results represented by floating-point numbers based on a first set number of bits.

[0137] The expansion of the ciphertext calculation result mentioned here can refer to zero padding in front of the ciphertext calculation result based on the integer type number representation of the second set of digits. For example, the ciphertext calculation result based on the floating point number representation of the first set of digits is 64 bits, and the ciphertext calculation result based on the integer type number representation of the second set of digits is 16 bits, then 48 zeros are padded in front of the ciphertext calculation result based on the integer type number representation of the second set of digits.

[0138] If the ciphertext calculation result obtained by adding the ciphertext calculation sub-results held by at least two calculation parties based on the integer type number representation of the second set of digits is less than the set value, then the ciphertext calculation result is the sum value obtained by adding the ciphertext calculation sub-results held by at least two calculation parties based on the floating point number representation of the first set of digits.

[0139] If the ciphertext calculation result obtained by adding the ciphertext calculation sub-results held by at least two calculation parties based on the integer type number representation of the second set of digits is not less than the set value, then the ciphertext calculation result is the sum value obtained by adding the ciphertext calculation sub-results held by at least two calculation parties based on the floating point number representation of the first set of digits and the negative value of the set value. The specific formula is as follows:

[0140]

[0141] In the above formula, [q z ] (1) l is used to represent the first ciphertext calculation sub-result held by the first calculation party based on the floating point number representation of the first set of digits.[q z ] (2) l is used to represent the second ciphertext calculation sub-result held by the second calculation party based on the floating point number representation of the first set of digits.[q z ] l is used to represent the ciphertext calculation result based on the floating point number representation of the first set of digits.

[0142] As can be seen from the above embodiment, the communication resources required in the dequantization process are O(l'logl'). Further, although the transmission to the data provider is the ciphertext calculation result based on the floating point number representation of the first set of digits, the data amount of the ciphertext calculation result itself is small, and therefore the communication resources required for transmitting the ciphertext calculation result based on the floating point number representation of the first set of digits are also small.

[0143] Figure 3 is a schematic diagram of a multi-party secure calculation according to an exemplary embodiment.

[0144] In Figure 3In the method, the multi-party secure computing system can receive the ciphertext user data sent by the data provider and represented by the integer of the second set of bits, and receive the ciphertext model data and the ciphertext quantization parameter sent by the model provider and represented by the integer of the second set of bits.

[0145] Then, according to the calculation steps corresponding to the model structure of the model provided by the model provider, homomorphic addition calculation, homomorphic multiplication calculation, homomorphic activation function calculation and other homomorphic calculations are performed to determine the ciphertext calculation result represented by the integer of the second set of bits.

[0146] Next, the ciphertext calculation result of the multi-party secure computation represented by the integer of the second set of bits is dequantized based on the ciphertext quantization parameter to obtain the ciphertext calculation result represented by the floating point number of the first set of bits.

[0147] As can be seen from the above method, the participant can convert the ciphertext data represented by the floating point number of high precision into the ciphertext data represented by the integer of low precision based on the ciphertext quantization parameter, and then transmit the ciphertext data to the multi-party secure computing system. Thus, the communication resources required during data transmission are reduced.

[0148] Then, the multi-party secure computing system can perform multi-party secure computation on the ciphertext data represented by the integer of low precision, which can effectively improve the calculation efficiency of the multi-party secure computation and reduce the cost.

[0149] Finally, the multi-party secure computing system can convert the ciphertext calculation result represented by the integer of low precision into the ciphertext calculation result represented by the floating point number of high precision based on the ciphertext quantization parameter, and send the dequantized ciphertext calculation result to the participant, so that the participant decrypts the dequantized ciphertext calculation result to obtain the accurate plaintext calculation result.

[0150] Corresponding to the above-mentioned embodiment of the method of data processing, the present specification also provides an embodiment of a device for data processing.

[0151] Please refer to Figure 4 , Figure 4is a structural diagram of an electronic device in which a data processing apparatus shown in an exemplary embodiment is located. At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and can also include other required hardware. One or more embodiments of the present specification can be implemented in a software manner, such as reading a corresponding computer program from the non-volatile memory 410 into the memory 408 by the processor 402 and then running. Of course, in addition to the software implementation, one or more embodiments of the present specification do not exclude other implementation manners, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.

[0152] Please refer to Figure 5 , Figure 5 is a structural diagram of a data processing apparatus shown in an exemplary embodiment. The data processing apparatus can be applied to an electronic device as shown in Figure 4 , so as to realize the technical solutions of the present specification. Among them, the apparatus can include:

[0153] The acquisition module 500 is configured to acquire ciphertext data transmitted by at least one participant for participating in multi-party secure calculation, wherein the ciphertext data is quantized based on a preset ciphertext quantization parameter; the quantization processing includes converting the ciphertext data represented by a floating-point number based on a first set of digits into ciphertext data represented by an integer number based on a second set of digits, and the first set of digits is greater than the second set of digits;

[0154] The calculation module 502 is configured to perform multi-party secure calculation on the ciphertext data;

[0155] The sending module 504 is configured to perform dequantization processing on the ciphertext calculation result of the multi-party secure calculation based on the ciphertext quantization parameter, and send the ciphertext calculation result after the dequantization processing to the at least one participant, so that the at least one participant decrypts the ciphertext calculation result after the dequantization processing to obtain a plaintext calculation result corresponding to the ciphertext calculation result; wherein the dequantization processing includes converting the ciphertext calculation result represented by an integer number based on a second set of digits into a ciphertext calculation result represented by a floating-point number based on a first set of digits.

[0156] Optionally, the ciphertext quantization parameter includes a mapping parameter and a correction parameter; the quantization processing includes a first sub-operation of mapping a first set of value ranges of the ciphertext data represented by a floating-point number to a second set of value ranges of the ciphertext data represented by an integer number based on the mapping parameter; and a second sub-operation of correcting errors of the ciphertext data represented by an integer number mapped to the second set of value ranges based on the correction parameter.

[0157] Optionally, the mapping parameter comprises a scaling factor; and the first sub-operation is to scale a first set of numerical range of the ciphertext data in floating-point number representation to a second set of numerical range of the ciphertext data in integer number representation based on the scaling factor, and to truncate a decimal part of the ciphertext data.

[0158] Optionally, the correction parameter comprises a zero-point offset error corresponding to the ciphertext data; and the second sub-operation comprises an operation of adding the zero-point offset error to the ciphertext data mapped to the first set of numerical range.

[0159] Optionally, the ciphertext data is ciphertext data obtained by homomorphic encryption of target data provided by the at least one participant for participating in secure multi-party computation; and the computing module 502 is specifically configured to perform homomorphic computation on the ciphertext data based on a preset homomorphic encryption algorithm.

[0160] Optionally, the homomorphic computation comprises homomorphic addition computation, and the ciphertext data comprises first ciphertext data and second ciphertext data; and the computing module 502 is specifically configured to, if the numerical range of the first ciphertext data and the second ciphertext data for the homomorphic addition computation is same, add the first ciphertext data, the second ciphertext data, a correction parameter corresponding to the first ciphertext data, a correction parameter corresponding to the second ciphertext data, and a correction parameter corresponding to a homomorphic computation result of the homomorphic addition computation, to obtain the homomorphic computation result of the homomorphic addition computation.

[0161] Optionally, the computing module 502 is specifically further configured to, if the numerical range of the first ciphertext data and the second ciphertext data for the homomorphic addition computation is different, multiply a first ratio of a mapping parameter corresponding to the first ciphertext data and a mapping parameter corresponding to a homomorphic computation result of the homomorphic addition computation, and the first ciphertext data to obtain first ciphertext product data; multiply a second ratio of a mapping parameter corresponding to the second ciphertext data and the mapping parameter corresponding to the homomorphic computation result of the homomorphic addition computation, and the quantized second ciphertext data to obtain second ciphertext product data; and add the first ciphertext product data, the second ciphertext product data, and the correction parameter corresponding to the homomorphic computation result of the homomorphic addition computation to obtain the homomorphic computation result of the homomorphic addition computation.

[0162] Optionally, the homomorphic computation includes a homomorphic multiplication computation, and the ciphertext data includes first ciphertext data and second ciphertext data; the computation module 502 is specifically configured to add the first ciphertext data and a correction parameter corresponding to the first ciphertext data to obtain corrected first ciphertext data, and add the second ciphertext data and a correction parameter corresponding to the second ciphertext data to obtain corrected second ciphertext data; obtain a third ratio based on a mapping parameter corresponding to the first encrypted data, a mapping parameter corresponding to the second encrypted data, and an inverse of a mapping parameter corresponding to a homomorphic computation result of the homomorphic multiplication computation; multiply the corrected first ciphertext data, the corrected second ciphertext data, and the third ratio to obtain ciphertext product data, and add the ciphertext product data and a correction parameter corresponding to the homomorphic computation result of the homomorphic multiplication computation to obtain the homomorphic computation result of the homomorphic multiplication computation.

[0163] Optionally, the homomorphic computation includes a homomorphic activation function computation; the computation module 502 is specifically configured to, if the ciphertext data for the homomorphic activation function computation is not less than a correction parameter corresponding to the ciphertext data, add the ciphertext data, the correction parameter corresponding to the ciphertext data, and a correction parameter corresponding to a homomorphic computation result of the homomorphic activation function computation to obtain the homomorphic computation result of the homomorphic activation function computation; if the ciphertext data for the homomorphic activation function computation is less than the correction parameter corresponding to the ciphertext data, the homomorphic computation result of the homomorphic activation function computation is the correction parameter corresponding to the homomorphic computation result of the homomorphic activation function computation.

[0164] Optionally, the correction parameter includes a zero-point offset error corresponding to the ciphertext computation result; and the third sub-operation includes an operation of adding the zero-point offset error to the ciphertext computation result mapped to the second set numerical range.

[0165] Optionally, the mapping parameter includes a scaling factor; and the fourth sub-operation is an operation of enlarging the second set numerical range of the ciphertext computation result in an integer type to the first set numerical range of the ciphertext computation result in a floating-point type based on the scaling factor.

[0166] Optionally, the mapping parameter includes a scaling factor; and the fourth sub-operation is an operation of enlarging the second set numerical range of the ciphertext computation result in an integer type to the first set numerical range of the ciphertext computation result in a floating-point type based on the scaling factor.

[0167] Optionally, the multi-party secure computing system comprises at least two computing parties; the ciphertext calculation result is calculated by the ciphertext calculation sub-results held by the at least two computing parties and represented by the integer number based on the second set of bits; the calculation module 502 is specifically further configured to expand the ciphertext calculation sub-results held by the at least two computing parties and represented by the integer number based on the second set of bits to obtain the ciphertext calculation sub-results represented by the floating point number based on the first set of bits; if the ciphertext calculation result obtained by adding the ciphertext calculation sub-results held by the at least two computing parties and represented by the integer number based on the second set of bits is less than a set value, the ciphertext calculation result is the sum value obtained by adding the ciphertext calculation sub-results held by the at least two computing parties and represented by the floating point number based on the first set of bits; if the ciphertext calculation result obtained by adding the ciphertext calculation sub-results held by the at least two computing parties and represented by the integer number based on the second set of bits is not less than a set value, the ciphertext calculation result is the sum value obtained by adding the ciphertext calculation sub-results held by the at least two computing parties and represented by the floating point number based on the first set of bits and the negative value of the set value.

[0168] The implementation process of the functions and roles of the units in the above device is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here.

[0169] Based on the same idea as the above method, the present specification also provides an electronic device, comprising: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method according to any one of the above embodiments by running the executable instructions.

[0170] Based on the same idea as the above method, the present specification also provides a computer readable storage medium having computer instructions stored thereon, which are executed by a processor to implement the steps of the method according to any one of the above embodiments.

[0171] Based on the same idea as the above method, the present specification also provides a computer program product, comprising computer program / instructions, which are executed by a processor to implement the steps of the method according to any one of the above embodiments.

[0172] It should be understood that although one or more embodiments of the present specification can employ the terms first, second, third, etc. to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present specification, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "upon determining" or "in response to determining".

[0173] The above description is merely that of a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Modification, equivalent replacements, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the protection of the present disclosure.

Claims

1. A data processing method, said method being applied to a multi-party secure computation (MPC) system; said method comprising: Acquire ciphertext data transmitted by at least one participant for participating in multi-party secure computation; wherein the ciphertext data has been quantized based on preset ciphertext quantization parameters; the quantization process includes converting the ciphertext data represented by a floating-point number based on a first set number of bits into ciphertext data represented by an integer number based on a second set number of bits, wherein the first set number of bits is greater than the second set number of bits. Perform multi-party secure computation on the encrypted data; Based on the ciphertext quantization parameters, the ciphertext calculation result of the multi-party secure computation is dequantized, and the dequantized ciphertext calculation result is sent to the at least one participant, so that the at least one participant can decrypt the dequantized ciphertext calculation result to obtain the plaintext calculation result corresponding to the ciphertext calculation result; wherein, the dequantization process includes converting the ciphertext calculation result represented by an integer based on a second set number of bits into a ciphertext calculation result represented by a floating-point number based on a first set number of bits.

2. The method as described in claim 1, wherein the ciphertext quantization parameters include: The mapping parameters and correction parameters; the quantization process includes a first sub-operation that maps a first set range of values ​​of ciphertext data represented by floating-point numbers to a second set range of values ​​of ciphertext data represented by integer numbers based on the mapping parameters; and a second sub-operation that corrects the error of the ciphertext data represented by integer numbers mapped to the second set range of values ​​based on the correction parameters.

3. The method as described in claim 2, wherein the mapping parameter includes a scaling factor; the first sub-operation is to reduce the first set value range of the ciphertext data represented by floating-point numbers to the second set value range of the ciphertext data represented by integer numbers based on the scaling factor, and to truncate the decimal part of the ciphertext data.

4. The method of claim 3, wherein the correction parameter includes a zero-point offset error corresponding to the ciphertext data; the second sub-operation includes adding the zero-point offset error to the ciphertext data mapped to a first set numerical range.

5. The method as described in claim 2, wherein the ciphertext data is ciphertext data obtained by homomorphically encrypting the target data provided by the at least one participant for participating in multi-party secure computation; Perform multi-party secure computation on the encrypted data, including: Based on a preset homomorphic encryption algorithm, homomorphic computation is performed on the ciphertext data.

6. The method as described in claim 5, wherein the homomorphic computation includes homomorphic addition computation, and the ciphertext data includes first ciphertext data and second ciphertext data; Based on a preset homomorphic encryption algorithm, homomorphic computation is performed on the ciphertext data, including: If the numerical ranges of the first ciphertext data and the second ciphertext data used for homomorphic addition calculation are the same, then the first ciphertext data, the second ciphertext data, the correction parameter corresponding to the first ciphertext data, the correction parameter corresponding to the second ciphertext data, and the correction parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation are added together to obtain the homomorphic calculation result of the homomorphic addition calculation.

7. The method of claim 6, further comprising: If the numerical ranges of the first ciphertext data and the second ciphertext data used for homomorphic addition calculation are not the same, the first ratio of the mapping parameter corresponding to the first ciphertext data and the mapping parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation, and the first ciphertext data are multiplied together to obtain the first ciphertext product data. as well as, The second ratio of the mapping parameter corresponding to the second ciphertext data and the mapping parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation, and the quantized second ciphertext data are multiplied together to obtain the second ciphertext product data. The first ciphertext product data, the second ciphertext product data, and the correction parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation are added together to obtain the homomorphic calculation result of the homomorphic addition calculation.

8. The method as described in claim 5, wherein the homomorphic computation includes homomorphic multiplication computation, and the ciphertext data includes first ciphertext data and second ciphertext data; Based on a preset homomorphic encryption algorithm, homomorphic computation is performed on the ciphertext data, including: Add the first ciphertext data and the correction parameter corresponding to the first ciphertext data to obtain the corrected first ciphertext data, and add the second ciphertext data and the correction parameter corresponding to the second ciphertext data to obtain the corrected second ciphertext data; The third ratio is obtained based on the mapping parameters corresponding to the first ciphertext data, the mapping parameters corresponding to the second ciphertext data, and the reciprocal of the mapping parameters corresponding to the homomorphic calculation result of the homomorphic multiplication calculation. The first ciphertext data after correction, the second ciphertext data after correction, and the third ratio are multiplied together to obtain the ciphertext product data. The ciphertext product data is then added to the correction parameter corresponding to the homomorphic calculation result of the homomorphic multiplication to obtain the homomorphic calculation result of the homomorphic multiplication.

9. The method of claim 5, wherein the homomorphic computation includes homomorphic activation function computation; Based on a preset homomorphic encryption algorithm, homomorphic computation is performed on the ciphertext data, including: If the ciphertext data used for homomorphic activation function calculation is not less than the correction parameter corresponding to the ciphertext data, then the ciphertext data, the correction parameter corresponding to the ciphertext data, and the correction parameter corresponding to the homomorphic calculation result of the homomorphic activation function calculation are added together to obtain the homomorphic calculation result of the homomorphic activation function calculation. If the ciphertext data used for homomorphic activation function calculation is less than the correction parameter corresponding to the ciphertext data, then the homomorphic calculation result of the homomorphic activation function calculation is the correction parameter corresponding to the homomorphic calculation result of the homomorphic activation function calculation.

10. The method of claim 2, wherein the dequantization process includes a third sub-operation of correcting an error in the ciphertext calculation result mapped to a second numerical range by the correction parameter; and a fourth sub-operation of mapping a second predetermined numerical range of the ciphertext calculation result in integer representation to a first predetermined numerical range of the ciphertext calculation result in floating-point representation by the mapping parameter.

11. The method of claim 10, wherein the correction parameter includes a zero-point offset error corresponding to the ciphertext calculation result; the third sub-operation includes adding the zero-point offset error to the ciphertext calculation result mapped to a second set numerical range.

12. The method of claim 11, wherein the mapping parameter includes a scaling factor; and the fourth sub-operation is to scale the second set value range of the ciphertext calculation result represented by an integer to the first set value range of the ciphertext calculation result represented by a floating-point number based on the scaling factor.

13. The method of claim 10, wherein the multi-party secure computation system comprises: At least two calculation methods; The ciphertext calculation result is obtained by calculating the ciphertext calculation sub-result held by the at least two calculating parties, which is represented by an integer based on a second set number of bits; Before performing dequantization processing on the ciphertext computation result of the multi-party secure computation based on the ciphertext quantization parameters, the method further includes: The ciphertext computation results held by the at least two computing parties, which are represented by integers based on a second set number of bits, are extended to obtain ciphertext computation results represented by floating-point numbers based on a first set number of bits. If the ciphertext calculation result obtained by adding the ciphertext calculation results of the at least two computing parties in integer representation based on a second set number of bits is less than a set value, then the ciphertext calculation result is the sum of the ciphertext calculation results of the at least two computing parties in floating-point representation based on a first set number of bits. If the ciphertext calculation result obtained by adding the ciphertext calculation results held by the at least two computing parties in the form of integers based on a second set number of bits is not less than a set value, then the ciphertext calculation result is the sum obtained by adding the ciphertext calculation results held by the at least two computing parties in the form of floating-point numbers based on a first set number of bits and the negative value of the set value.

14. A data processing apparatus, said apparatus being applied to a multi-party secure computation (MPC) system; said apparatus comprising: An acquisition module is used to acquire ciphertext data transmitted by at least one participant for participating in multi-party secure computation; wherein the ciphertext data has been quantized based on preset ciphertext quantization parameters; the quantization process includes converting the ciphertext data represented by a floating-point number based on a first set number of bits into ciphertext data represented by an integer number based on a second set number of bits, wherein the first set number of bits is greater than the second set number of bits. The calculation module is used to perform multi-party secure calculations on the encrypted data; The sending module is configured to perform dequantization processing on the ciphertext calculation result of the multi-party secure computation based on the ciphertext quantization parameters, and send the dequantized ciphertext calculation result to the at least one participant, so that the at least one participant can decrypt the dequantized ciphertext calculation result to obtain the plaintext calculation result corresponding to the ciphertext calculation result; wherein, the dequantization processing includes converting the ciphertext calculation result represented by an integer based on a second set number of bits into a ciphertext calculation result represented by a floating-point number based on a first set number of bits.

15. An electronic device, comprising a communication interface, a processor, a memory, and a bus, wherein the communication interface, the processor, and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the method according to any one of claims 1 to 13 by invoking the machine-readable instructions.

16. A machine-readable storage medium storing machine-readable instructions that, when invoked and executed by a processor, implement the method of any one of claims 1 to 13.