Data processing method and device, storage medium and electronic equipment

By quantizing and inversely quantizing the ciphertext data, the problem of high-precision data transmission resources in multi-party secure calculations is solved, which improves calculation efficiency and reduces costs, and ensures the accuracy of the calculation results.

CN119254422AActive Publication Date: 2025-01-03ZHEJIANG UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Multi-party secure computing consumes a large amount of communication resources when transmitting high-precision data, resulting in low computing efficiency and high cost.

Method used

By quantizing the ciphertext data, the floating-point representation is converted into an integer representation, and homomorphic addition, multiplication and activation function calculations are performed in multi-party security calculations, and then inverse quantization is performed to restore the calculation results of the floating-point representation.

Benefits of technology

It reduces the communication resources required for data transmission, improves the computing efficiency of multi-party security computing, and reduces costs, while ensuring the accuracy of the calculation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254422A_ABST
    Figure CN119254422A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a storage medium and electronic equipment. And acquiring ciphertext data transmitted by at least one participant and used for participating in multi-party security calculation. Wherein the ciphertext data is quantized based on a preset ciphertext quantization parameter. The quantization processing includes converting the ciphertext data represented by the floating-point number based on the first set number of bits into the ciphertext data represented by the integer number based on the second set number of bits. Then, multi-party security calculation is carried out on the ciphertext data; and then, based on the ciphertext quantization parameter, carrying out inverse quantization processing on the ciphertext calculation result of the multi-party security calculation, and sending the ciphertext calculation result subjected to the inverse quantization processing to at least one participant, so that the at least one participant decrypts the ciphertext calculation result subjected to the inverse quantization processing to obtain a plaintext calculation result. Therefore, communication resources required during data transmission are reduced, the calculation efficiency of multi-party security calculation can be effectively improved, and the cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for data processing. Background Art

[0002] The rapid development of computer technology has enabled machine learning to be used more and more widely in various scenarios. In some application scenarios, the data held by different data providers may contain the user's private information, and data sharing between data providers may infringe on the user's privacy. In order to facilitate the flow of data between multiple parties, multi-party secure computing can be used to support joint computing between multiple parties, tap the value of data, and ensure that the privacy information of each party will not be leaked during multi-party interaction.

[0003] At present, although multi-party secure computing provides strict security guarantees, the transmission of high-precision data consumes a lot of communication resources and may also cause processing delays, resulting in low computational efficiency and high costs of multi-party secure computing. Summary of the invention

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

[0005] This manual adopts the following technical solutions:

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

[0007] Acquire 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 includes converting the ciphertext data represented by a floating point number based on a first set number of bits into the 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;

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

[0009] Based on the ciphertext quantization parameter, 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 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 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 parameters include: a mapping parameter and a correction parameter; the quantization processing includes a first sub-operation of mapping a first set numerical range of the ciphertext data represented by a floating point number to a second set numerical range 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 numerical range based on the correction parameter.

[0011] Optionally, the mapping parameters include a scaling factor; the first sub-operation is to reduce a first set numerical range of the ciphertext data represented by a floating point number to a second set numerical range of the ciphertext data represented by an integer number based on the scaling factor, and to truncate the decimal part of the ciphertext data.

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

[0013] Optionally, the ciphertext data is ciphertext data obtained by homomorphically encrypting target data provided by the at least one participant for participating in multi-party secure computing;

[0014] Performing multi-party secure computing on the ciphertext data includes:

[0015] Based on a preset homomorphic encryption algorithm, homomorphic calculation is performed on the ciphertext data.

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

[0017] Based on a preset homomorphic encryption algorithm, homomorphic calculation is performed on the ciphertext data, including:

[0018] If the numerical ranges of the first ciphertext data and the second ciphertext data used for homomorphic addition calculation are the same, 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 to obtain the homomorphic calculation result of the homomorphic addition calculation.

[0019] Optionally, the method further comprises:

[0020] If the numerical ranges of the first ciphertext data and the second ciphertext data used for homomorphic addition calculation are different, multiplying a first ratio of a mapping parameter corresponding to the first ciphertext data and a mapping parameter corresponding to a homomorphic calculation result of the homomorphic addition calculation, and the first ciphertext data to obtain first ciphertext product data; and,

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

[0022] The first ciphertext product data, the second ciphertext product data, and a correction parameter corresponding to a homomorphic calculation result of the homomorphic addition calculation are added together to obtain a homomorphic calculation result of the homomorphic addition calculation.

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

[0024] Based on a preset homomorphic encryption algorithm, homomorphic calculation is performed on the ciphertext data, including:

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

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

[0027] 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 a correction parameter corresponding to a homomorphic calculation result of the homomorphic multiplication calculation are added to obtain a homomorphic calculation result of the homomorphic multiplication calculation.

[0028] Optionally, the homomorphic computation includes homomorphic activation function computation;

[0029] Based on a preset homomorphic encryption algorithm, homomorphic calculation is performed on the ciphertext data, including:

[0030] If the ciphertext data used for homomorphic activation function calculation is not less than the correction parameter corresponding to the ciphertext data, then adding 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 to obtain the homomorphic calculation result of the homomorphic activation function calculation;

[0031] If the ciphertext data used for 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 inverse quantization processing includes a third sub-operation of correcting the error of the ciphertext calculation result represented by an integer number mapped to a 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 represented by an integer number to a first set numerical range of the ciphertext calculation result represented by a floating-point number 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 a second set numerical range.

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

[0035] Optionally, the multi-party secure computing system includes: at least two computing parties; the ciphertext computing result is calculated by computing ciphertext computing sub-results held by the at least two computing parties;

[0036] Before performing dequantization processing on the ciphertext calculation result of the multi-party secure computation 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 the set value, the ciphertext calculation result is the sum of 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 computing parties is not less than the set value, the ciphertext calculation result is the sum of the ciphertext calculation sub-results held by the at least two computing parties and the negative value of the set value.

[0039] This specification provides a data processing device, which is applied to a multi-party secure computing (MPC) system; the device includes:

[0040] An acquisition module, used to acquire 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 includes converting the ciphertext data represented by a floating point number based on a first set number of bits into the 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;

[0041] A computing module, used for performing multi-party secure computing on the ciphertext data;

[0042] A sending module is used to perform dequantization processing on the ciphertext calculation result of the multi-party secure calculation 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 processing includes 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.

[0043] This specification provides an electronic device, including a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;

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

[0045] This specification provides a machine-readable storage medium, which stores machine-readable instructions. When the machine-readable instructions are called and executed by a processor, the above-mentioned data processing method is implemented.

[0046] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0047] In this specification, the participants can convert the ciphertext data represented by high-precision floating point numbers into ciphertext data represented by low-precision integer numbers based on the ciphertext quantization parameter, and then transmit the ciphertext data to the multi-party secure computing system, thereby reducing the communication resources required for data transmission.

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

[0049] Finally, the multi-party secure computing system can convert the ciphertext calculation results represented by low-precision integer numbers into ciphertext calculation results represented by high-precision floating-point numbers based on the ciphertext quantization parameters, and send the dequantized ciphertext calculation results to the participants, so that the participants can decrypt the dequantized ciphertext calculation results to obtain accurate plaintext calculation results. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0051] Figure 1 is a flow chart of a data processing method shown in an exemplary embodiment;

[0052] Figure 2 is a schematic diagram of a multi-party interaction shown in an exemplary embodiment;

[0053] Figure 3 is a schematic diagram of a multi-party secure computation shown in an exemplary embodiment;

[0054] Figure 4 is a structural diagram of an electronic device in which a data processing device is located, shown in an exemplary embodiment;

[0055] Figure 5 It is a structural diagram of a data processing device shown in an exemplary embodiment. DETAILED DESCRIPTION

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

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

[0058] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the relevant technologies involved in the embodiments of this specification are briefly described below.

[0059] Secure Multi-Party Computation (SMPC): It is used to solve the problem of privacy-preserving collaborative computing between a group of mutually distrusting parties. SMPC can ensure the independence of data input and the correctness of data calculation, while not leaking the input data to other parties involved in the calculation. In SMPC, how to securely calculate addition and multiplication are the two most important issues. For modern computers, after supporting secure addition and multiplication, they can theoretically support any secure computing task.

[0060] Homomorphic Encryption (HE): It is a cryptographic technology based on the computational complexity theory of mathematical problems. The output obtained by processing the homomorphically encrypted data is decrypted, and the result is the same as the output obtained by processing the unencrypted original data in the same way. That is, directly processing the ciphertext and encrypting the processed result after processing the plaintext will obtain the same result.

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

[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 this specification are described in detail below in conjunction with the accompanying drawings.

[0064] Figure 1 The following is a flow chart of a data processing method shown in an exemplary embodiment, wherein the method specifically comprises the following steps:

[0065] S100: Obtain 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 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.

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

[0067] S104: Based on the ciphertext quantization parameter, the ciphertext calculation result of the multi-party secure computing is dequantized, 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 the plaintext calculation result of the multi-party secure computing for the target data; wherein the dequantization includes 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.

[0068] In an embodiment of the present specification, a multi-party secure computing system can obtain ciphertext data transmitted by at least one participant for participating in multi-party secure computing. The ciphertext data is quantized based on a preset ciphertext quantization parameter. The quantization 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 computing system can perform multi-party secure computing on the encrypted data.

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

[0071] Figure 2 It is a schematic diagram of a multi-party interaction shown in an exemplary embodiment.

[0072] exist Figure 2In the process, the participants may include: data providers and model providers. The model provider may perform homomorphic encryption on the model data and quantization parameters to obtain ciphertext model data and ciphertext quantization parameters, and quantize the ciphertext model data represented by floating-point numbers based on the first set number of bits based on the ciphertext quantization parameters to obtain ciphertext model data represented by integer numbers based on the second set number of bits. Of course, the model provider may also perform quantization on the model data represented by floating-point numbers based on the first set number of bits based on the quantization parameters to obtain model data represented by integer numbers based on the second set number of bits. Then, the model data and quantization parameters represented by integer numbers based on the second set number of bits are homomorphically encrypted to obtain ciphertext model data and ciphertext quantization parameters represented by integer numbers based on the second set number of bits.

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

[0074] Next, the data provider may send the encrypted user data represented by the second set number of integers to the multi-party secure computing system. The model provider may send the encrypted model data represented by the second set number of integers and the encrypted quantization parameter to the multi-party secure computing system.

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

[0076] Finally, the multi-party secure computing system performs dequantization processing on the ciphertext calculation result represented by the integer number of the second set bit number of the multi-party secure computing based on the ciphertext quantization parameter, and obtains the ciphertext calculation result represented by the floating-point number of the first set bit number, and sends the ciphertext calculation result represented by the floating-point number of the first set bit number to the data provider, so that the data provider can decrypt the dequantized ciphertext calculation result to obtain the plaintext calculation result corresponding to the ciphertext calculation result.

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

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

[0079] In the above formula, [r i ] l Used to represent the ciphertext data represented by the i-th floating point number based on the first set number of bits. i ] l′ Used to represent the ciphertext data represented by the i-th integer based on the second set number of digits. i ] l Used to represent the scaling factor of the i-th floating point number based on the first set number of bits. [Z i ] l′ It is used to represent the zero-point offset error of the i-th ciphertext data. i ] l and [Z i ] l′ Sent by the model provider.

[0080] In an embodiment of the present specification, in order to ensure the accuracy of the ciphertext quantization parameters, 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 calculations on the test data according to the calculation steps corresponding to the model structure of the model to determine the numerical range of the intermediate values ​​of each calculation step.

[0081] Then, the model provider can determine the ciphertext quantization parameters of the ciphertext data corresponding to each test data and the ciphertext quantization parameters of the intermediate values ​​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 values ​​of each calculation step.

[0082] It can be seen from the above embodiments that by acquiring and analyzing the test data set, the model provider can determine the numerical range of the ciphertext data. Furthermore, by performing homomorphic calculations on the test data according to the calculation steps corresponding to the model structure of the model, the actual homomorphic calculation process can be simulated to determine the appropriate ciphertext quantization parameters, thereby ensuring the accuracy of the ciphertext calculation results.

[0083] In practical applications, the numerical range of floating-point numbers is different from that of integer numbers. For example, in the IEEE754 standard double-precision floating-point number, 52 bits are used for the mantissa, 11 bits for the exponent, and 1 bit for the sign. This allows a double-precision floating-point number to represent -1.7*10 -308 To 1.7*10 308 For example, a 16-bit integer can represent -2 -15 To 2 15It can be seen that the numerical range of floating-point numbers is much larger than that of integer numbers. In this case, floating-point numbers that exceed the numerical range of integer numbers may be rounded to the maximum or minimum value of the numerical range of integer numbers. Therefore, in the quantization process, the numerical range of floating-point numbers needs to be converted to the numerical range of integer numbers.

[0084] In the embodiment 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 a floating point number to a second set numerical range of the ciphertext data represented by an 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] Furthermore, the mapping parameters include a scaling factor. The first sub-operation is an operation of reducing a first set numerical range of the ciphertext data represented by a floating point number to a second set numerical range of the ciphertext data represented by an integer number based on the scaling factor, and truncating the decimal part of the ciphertext data. The correction parameter includes a zero offset error corresponding to the ciphertext data. The second sub-operation includes an operation of adding a zero 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 Used to represent the ciphertext data represented by the i-th floating point number based on the first set number of digits, [q i ] l′ Used to represent the ciphertext data represented by the i-th integer based on the second set number of digits, Used to represent the scaling factor of the i-th floating point number based on the first set number of bits, It is used to indicate that the first set numerical range of the ciphertext data represented by the floating point number is reduced to the second set numerical range of the ciphertext data represented by the integer number based on the scaling factor, and the decimal part of the ciphertext data is truncated, [Z i ] l′ Used to represent the zero offset error of the i-th ciphertext data.

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

[0089] Furthermore, the zero offset error can be used to correct errors in the quantization process, ensuring that the ciphertext data represented by the integer number based on the second set number of bits is closer to the true value of the ciphertext data represented by the floating-point number based on the first set number of bits.

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

[0091] It should be noted that there can be many homomorphic encryption algorithms. For example, the fully homomorphic encryption scheme (BFV) based on the RLWE (Ring-Learning With Errors) problem, the fully homomorphic encryption without bootstrapping (BGV), the Cheon-Kim-Kim-Song (CKKS) that supports homomorphic operations of floating-point addition and multiplication for real or complex numbers, etc. This specification does not limit the homomorphic encryption algorithm.

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

[0093] In practical applications, in order to improve the performance and generalization ability of the model, the input data is usually standardized or normalized to make its distribution range consistent. This makes the distribution of input data of most models consistent. However, in homomorphic addition calculation, it is required to be able to perform effective calculations without relying on the consistency of data distribution, which makes the calculation formula of homomorphic addition calculation more complicated.

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

[0095] In the embodiment of this specification, the original calculation formula of homomorphic addition calculation is [r z ] l =[r x ] l +[r y ] l , substituting the relationship formula between the ciphertext data represented by the floating point number based on the first set number of digits and the ciphertext data represented by the integer number based on the second set number of digits, we get [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 ranges of the first ciphertext data and the second ciphertext data used for homomorphic addition calculation are the same, then determine S xl′ =S yl′ , you can directly use 1 to replace the calculation formula of the homomorphic calculation result as well as 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. The specific formula is as follows:

[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′ Used to represent the first ciphertext data represented by an integer based on the second set number of bits, [q y ] l′ Used to represent the second ciphertext data represented by an integer based on the second set number of bits, [Z x ] l′ Used to represent the zero offset error corresponding to the first ciphertext data, [Z y ] l′Used to represent the zero offset error corresponding to the second ciphertext data, [Z z ] l′ Used to represent the zero offset error corresponding to the homomorphic calculation result of the homomorphic addition calculation.

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

[0101] In practical applications, whether the data distribution needs to be consistent depends on the specific problem and model requirements. Not all cases require consistent input data distribution. In some application scenarios, maintaining the original distribution of the data may be more helpful for the performance and interpretability of the model.

[0102] In the embodiment of the present specification, if the numerical ranges of the first ciphertext data and the second ciphertext data used for homomorphic addition calculation are different, 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 to obtain the first ciphertext product data. And, 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 to obtain the second ciphertext product 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′ It is used to represent the scaling factor corresponding to the first ciphertext data, S yl′ Used to represent the scaling factor corresponding to the second ciphertext data, S zl′ Used to represent the scaling factor corresponding to the homomorphic calculation result of the homomorphic addition calculation. [q x ] l′ Used to represent the first ciphertext data represented by an integer based on the second set number of bits, [q y ] l′ Used to represent the second ciphertext data represented by an integer based on the second set number of bits, [Z x ] l′ Used to represent the zero offset error corresponding to the first ciphertext data, [Z y ]l′ Used to represent the zero offset error corresponding to the second ciphertext data, [Z z ] l′ Used to represent the zero offset error corresponding to the homomorphic calculation result of the homomorphic addition calculation.

[0106] It can be seen from the above embodiment that when the numerical ranges of the first ciphertext data and the second ciphertext data used for homomorphic addition calculation are different, the above original homomorphic addition calculation formula can be selected to perform homomorphic addition calculation. Thus, homomorphic addition calculation is performed on ciphertext data with different numerical ranges, which enhances the versatility of homomorphic addition calculation.

[0107] In an embodiment of the present specification, the multi-party secure computing 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, a third ratio is obtained based on a mapping parameter corresponding to the first encrypted data, a mapping parameter corresponding to the second encrypted data, and a reciprocal of a mapping parameter corresponding to a 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 for homomorphic multiplication is [r z ] l =[r x ] l *[r y ] l , substituting the relationship formula between the ciphertext data represented by the floating point number based on the first set number of digits and the ciphertext data represented by the integer number based on the second set number of digits, we get [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 as follows:

[0112]

[0113] In the formula, S xl′ It is used to represent the scaling factor corresponding to the first ciphertext data, S yl′ Used to represent the scaling factor corresponding to the second ciphertext data, S zl′ Used to represent the scaling factor corresponding to the homomorphic result of the homomorphic multiplication. x ] l′ Used to represent the first ciphertext data represented by an integer based on the second set number of bits, [q y ] l′ Used to represent the second ciphertext data represented by an integer based on the second set number of bits, [Z x ] l′ Used to represent the zero offset error corresponding to the first ciphertext data, [Z y ] l′ Used to represent the zero offset error corresponding to the second ciphertext data, [Z z ] l′ Used to represent the zero offset error corresponding to the homomorphic calculation result of the homomorphic multiplication calculation.

[0114] It can be seen from the above embodiments that although there is a multiplication operation with a depth of 3 in the homomorphic multiplication calculation of the ciphertext data represented by the integer number of the second set bit number, this is the same as the computing resources required for the multiplication operation with a depth of 2 based on the ciphertext data represented by the floating-point number of the first set bit number. For example, the first set bit number is 64 bits, the second set bit number is 16 bits, and the computing resources required for the homomorphic multiplication calculation of the ciphertext data represented by the integer number of the second set bit number are 16X16X16=4096. The computing resources required for the multiplication operation with a depth of 2 based on the ciphertext data represented by the floating-point number of the first set bit number are also 64X64=4096.

[0115] However, the communication resources required for the homomorphic multiplication calculation of the ciphertext data represented by the integer number of the second set bit number are one-fourth of the communication resources required for the homomorphic multiplication calculation of the ciphertext data represented by the floating-point number of the first set bit number, thereby reducing the communication resources required for transmitting data without consuming additional computing resources.

[0116] In an embodiment of the present specification, if the ciphertext data used for 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 used for 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 for the homomorphic activation function is Substitute the relationship formula between the ciphertext data represented by the floating point number based on the first set number of digits and the ciphertext data represented by the integer number based on the second set number of digits to obtain

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

[0120] Since the input and output distributions of the activation function are consistent, S xl′ =S zl′ , you can directly use 1 to replace the calculation formula of the homomorphic calculation result The specific formula is as follows:

[0121]

[0122] In the above formula, [q x ] l′ Used to represent the ciphertext data represented by an integer based on the second set number of digits. x ] l′ Used to indicate the zero offset error corresponding to the ciphertext data. [Z z ] l′ Used to represent the zero offset error corresponding to the homomorphic calculation result of the homomorphic activation function calculation.

[0123] It can be seen from the above embodiments that the communication resources required for calculating the homomorphic activation function of the ciphertext data represented by an integer number of the second set number of bits are one quarter of the communication resources required for calculating the homomorphic activation function of the ciphertext data represented by a floating-point number of the first set number of bits. Therefore, the communication resources required for transmitting data are reduced without consuming additional computing resources.

[0124] It should be noted that homomorphic computing can also include: homomorphic matrix computing and homomorphic convolution computing. Both homomorphic matrix computing and homomorphic convolution computing can complete homomorphic computing on the basis of homomorphic addition computing and homomorphic multiplication computing. For example, homomorphic matrix computing can use methods such as SecureML. Homomorphic convolution computing can use methods such as CrypTFlow.

[0125] Furthermore, homomorphic computing may also include: homomorphic nonlinear computing. Homomorphic nonlinear computing may be completed on the basis of homomorphic addition computing, homomorphic multiplication computing, and homomorphic activation function computing. For example, homomorphic nonlinear computing may adopt methods such as Maxpool.

[0126] In the embodiments of the present specification, after performing homomorphic calculations on the quantized ciphertext data, the ciphertext calculation results need to be dequantized to ensure that the ciphertext calculation results represented by floating-point numbers based on the first set number of bits, obtained by converting the ciphertext calculation results represented by integer numbers based on the second set number of bits, are closer to the calculation results of the original data.

[0127] The dequantization process includes a third sub-operation of correcting the error of the ciphertext calculation result represented by the integer number 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 represented by the integer number to the first set numerical range of the ciphertext calculation result represented by the floating point number based on the mapping parameter.

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

[0129] In practical applications, to expand an unencrypted integer, you only need to add zeros to the front of the integer. However, the ciphertext calculation results in this specification are calculated using the secret sharing method, and cannot be expanded by adding zeros to the front of the ciphertext calculation results. Taking binary secret sharing as an example, [q z ] l′ =([q z ] (1) l′ +[q z ] (2) l′ )mod2 l′ , the computing parties hold [q z ] (1) l′ , [q z ](2) l′ , to ensure [q z ] l′ Not known by any party. z ] (1) l′ , [q z ] (2) l′ Expansion may result in [q z ] (1) l′ +[q z ] (2) l′ >2 l′ , the wrong ciphertext calculation result is obtained. For example, when [q z ] (1) l′ +[q z ] (2) l′ >2 l′ When z ] (1) l +[q z ] (2) l =[q z ] l +2 l′ .

[0130] In an embodiment of the present specification, a multi-party secure computing system includes: at least two computing parties. A ciphertext computing result is obtained by computing a ciphertext computing sub-result represented by an integer number of a second set number of digits held by at least two computing parties. Taking binary secret sharing as an example, the computing formula of the first computing party is as follows:

[0131]

[0132] In the above formula, [q z ] (1) l Used to represent a first ciphertext calculation sub-result represented by a floating-point number based on a first set number of bits held by a first calculation party. It is used to indicate that the first ciphertext calculation result represented by the second set number of digits held by the first calculation party is expanded. Where, [t] l =1{[q z ] (1) l′ +[q z ] (2) l′ >2 l′} l Used to indicate when [qz ] (1) l′ +[q z ] (2) l′ >2 l′ When [t] l =1, when [q z ] (1) l′ +[q z ] (2) l′ ≤2 l′ When [t] l =0.

[0133] And, the calculation formula of the second calculation side is as follows:

[0134]

[0135] In the above formula, [q z ] (2) l Used to represent a second ciphertext calculation sub-result held by a second calculation party and represented by a floating-point number based on a first set number of bits. It is used to indicate that the second ciphertext calculation result represented by the second set number of digits held by the second calculation party is expanded. 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′ When [t] l =1, when [q z ] (1) l′ +[q z ] (2) l′ ≤2 l′ When [t] l =0.

[0136] Furthermore, before dequantizing the ciphertext calculation results of the multi-party secure computing based on the ciphertext quantization parameter, the ciphertext calculation sub-results represented by integer numbers based on the second set number of bits held by at least two computing parties are expanded to obtain ciphertext calculation sub-results represented by floating-point numbers based on the first set number of bits.

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

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

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

[0140]

[0141] In the above formula, [q z ] (1) l Used to represent the first ciphertext calculation result represented by a floating point number based on a first set number of bits held by the first calculation party. z ] (2) l Used to represent the second ciphertext calculation result held by the second calculation party represented by a floating point number based on the first set number of digits. z ] l Used to represent the ciphertext calculation result represented by a floating point number based on the first set number of digits.

[0142] It can be seen from the above embodiment that the communication resources required in the dequantization process are O(l′logl′). Furthermore, although the ciphertext calculation result represented by the floating point number based on the first set number of bits is transmitted to the data provider, the data volume of the ciphertext calculation result itself is small, and therefore, the communication resources required for transmitting the ciphertext calculation result represented by the floating point number based on the first set number of bits are also small.

[0143] Figure 3 It is a schematic diagram of a multi-party secure computation shown in an exemplary embodiment.

[0144] exist Figure 3In the multi-party secure computing system, the ciphertext user data represented by an integer based on a second set number of bits sent by a data provider can be received, and the ciphertext model data and ciphertext quantization parameters represented by an integer based on a second set number of bits sent by a model provider can be received.

[0145] Then, according to the calculation steps corresponding to the model structure of the model provided by the model provider, homomorphic calculations such as homomorphic addition calculations, homomorphic multiplication calculations, and homomorphic activation function calculations are performed to determine the ciphertext calculation result represented by an integer number based on the second set number of digits.

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

[0147] From the above method, it can be seen that the participants can convert the ciphertext data represented by high-precision floating-point numbers into ciphertext data represented by low-precision integer numbers based on the ciphertext quantization parameters, and then transmit the ciphertext data to the multi-party secure computing system, thereby reducing the communication resources required for data transmission.

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

[0149] Finally, the multi-party secure computing system can convert the ciphertext calculation results represented by low-precision integer numbers into ciphertext calculation results represented by high-precision floating-point numbers based on the ciphertext quantization parameters, and send the dequantized ciphertext calculation results to the participants, so that the participants can decrypt the dequantized ciphertext calculation results to obtain accurate plaintext calculation results.

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

[0151] See also Figure 4 , Figure 4It is a structural diagram of an electronic device in which a data processing device is located, which is shown in an exemplary embodiment. 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 of course may also include other required hardware. One or more embodiments of this specification can be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0152] See also Figure 5 , Figure 5 FIG. 1 is a structural diagram of a data processing device shown in an exemplary embodiment. The data processing device can be applied to Figure 4 In the electronic device shown in the figure, the technical solution of this specification is implemented. The device may include:

[0153] The acquisition module 500 is used to acquire 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 includes converting the ciphertext data represented by a floating point number based on a first set number of bits into the 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;

[0154] A computing module 502, configured to perform multi-party secure computing on the ciphertext data;

[0155] The sending module 504 is used to perform dequantization processing on the ciphertext calculation result of the multi-party secure calculation 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 processing includes 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.

[0156] Optionally, the ciphertext quantization parameters include: a mapping parameter and a correction parameter; the quantization processing includes a first sub-operation of mapping a first set numerical range of ciphertext data represented by floating point numbers to a second set numerical range of ciphertext data represented by integer numbers based on the mapping parameters; and a second sub-operation of correcting errors of the ciphertext data represented by integer numbers mapped to the second set numerical range based on the correction parameters.

[0157] Optionally, the mapping parameters include a scaling factor; the first sub-operation is to reduce a first set numerical range of the ciphertext data represented by a floating point number to a second set numerical range of the ciphertext data represented by an integer number based on the scaling factor, and to truncate the decimal part of the ciphertext data.

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

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

[0160] Optionally, the homomorphic calculation includes homomorphic addition calculation, and the ciphertext data includes first ciphertext data and second ciphertext data; the calculation module 502 is specifically used to add 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 if the numerical ranges of the first ciphertext data and the second ciphertext data used for the homomorphic addition calculation are the same, so as to obtain the homomorphic calculation result of the homomorphic addition calculation.

[0161] Optionally, the calculation module 502 is further specifically used for multiplying a first ratio of a mapping parameter corresponding to the first ciphertext data and a mapping parameter corresponding to a homomorphic calculation result of the homomorphic addition calculation, and the first ciphertext data to obtain first ciphertext product data if the numerical ranges of the first ciphertext data and the second ciphertext data used for the homomorphic addition calculation are different; and multiplying a second ratio of a mapping parameter corresponding to the second ciphertext data and a mapping parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation, and the quantized second ciphertext data to obtain second ciphertext product data; and adding the first ciphertext product data, the second ciphertext product data, and a correction parameter corresponding to the homomorphic calculation result of the homomorphic addition calculation to obtain the homomorphic calculation result of the homomorphic addition calculation.

[0162] Optionally, the homomorphic calculation includes homomorphic multiplication calculation, and the ciphertext data includes first ciphertext data and second ciphertext data; the calculation module 502 is specifically used to 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; based on the mapping parameter corresponding to the first encrypted data, the mapping parameter corresponding to the second encrypted data, and the inverse of the mapping parameter corresponding to the homomorphic calculation result of the homomorphic multiplication calculation, obtain a third ratio; 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.

[0163] Optionally, the homomorphic calculation includes homomorphic activation function calculation; the calculation module 502 is specifically used to add 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 to obtain the homomorphic calculation result of the homomorphic activation function calculation if the ciphertext data used for the homomorphic activation function calculation is not less than the correction parameter corresponding to the ciphertext data; if the ciphertext data used 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.

[0164] Optionally, the inverse quantization processing includes a third sub-operation of correcting the error of the ciphertext calculation result represented by an integer number mapped to a 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 represented by an integer number to a first set numerical range of the ciphertext calculation result represented by a floating-point number based on the mapping parameter.

[0165] 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 a second set numerical range.

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

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

[0168] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0169] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.

[0170] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0171] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.

[0172] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, 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 this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0173] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A data processing method, the method being applied to a multi-party secure computing (MPC) system; the method comprising: Acquire 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 includes converting the ciphertext data represented by a floating point number based on a first set number of bits into the 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; Performing multi-party secure computing on the ciphertext data; Based on the ciphertext quantization parameter, 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 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 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 according to claim 1, wherein the ciphertext quantization parameter comprises: Mapping parameters and correction parameters; the quantization processing includes a first sub-operation of mapping a first set numerical range of ciphertext data represented by floating point numbers to a second set numerical range of ciphertext data represented by integer numbers based on the mapping parameters; and a second sub-operation of correcting errors of the ciphertext data represented by integer numbers mapped to the second set numerical range based on the correction parameters.

3. In the method as claimed in claim 2, the mapping parameters include a scaling factor; the first sub-operation is to reduce the first set numerical range of the ciphertext data represented by a floating point number to a second set numerical range of the ciphertext data represented by an integer number based on the scaling factor, and to truncate the decimal part of the ciphertext data.

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

5. The method according to claim 2, wherein the ciphertext data is ciphertext data obtained by homomorphically encrypting target data provided by the at least one participant for participating in multi-party secure computing; Performing multi-party secure computing on the ciphertext data includes: Based on a preset homomorphic encryption algorithm, homomorphic calculation is performed on the ciphertext data.

6. The method according to claim 5, wherein the homomorphic computation comprises homomorphic addition computation, and the ciphertext data comprises first ciphertext data and second ciphertext data; Based on a preset homomorphic encryption algorithm, homomorphic calculation 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, 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 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 different, multiplying a first ratio of a mapping parameter corresponding to the first ciphertext data and a mapping parameter corresponding to a homomorphic calculation result of the homomorphic addition calculation, and the first ciphertext data to obtain first ciphertext product data; as well as, multiplying a second ratio of a mapping parameter corresponding to the second ciphertext data and a mapping parameter corresponding to a homomorphic calculation result of the homomorphic addition calculation, and the quantized second ciphertext data to obtain second ciphertext product data; The first ciphertext product data, the second ciphertext product data, and a correction parameter corresponding to a homomorphic calculation result of the homomorphic addition calculation are added together to obtain a homomorphic calculation result of the homomorphic addition calculation.

8. The method according to claim 5, wherein the homomorphic computation comprises homomorphic multiplication computation, and the ciphertext data comprises first ciphertext data and second ciphertext data; Based on a preset homomorphic encryption algorithm, homomorphic calculation is performed on the ciphertext data, including: adding the first ciphertext data and a correction parameter corresponding to the first ciphertext data to obtain corrected first ciphertext data, and adding the second ciphertext data and a correction parameter corresponding to the second ciphertext data to obtain corrected second ciphertext data; obtaining a third ratio based on a mapping parameter corresponding to the first encrypted data, a mapping parameter corresponding to the second encrypted data, and a reciprocal of a mapping parameter corresponding to a homomorphic calculation result of the homomorphic multiplication calculation; 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 a correction parameter corresponding to a homomorphic calculation result of the homomorphic multiplication calculation are added to obtain a homomorphic calculation result of the homomorphic multiplication calculation.

9. The method of claim 5, wherein the homomorphic computation comprises homomorphic activation function computation; Based on a preset homomorphic encryption algorithm, homomorphic calculation 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 adding 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 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, 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. According to the method as claimed in claim 2, the dequantization processing includes a third sub-operation of correcting the error of the ciphertext calculation result represented by an integer number mapped to a 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 represented by an integer number to a first set numerical range of the ciphertext calculation result represented by a floating-point number based on the mapping parameter.

11. The method of claim 10, wherein the correction parameter comprises a zero-point offset error corresponding to the ciphertext calculation result; and the third sub-operation comprises an operation of 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 parameters include a scaling factor; and the fourth sub-operation is to enlarge the second set numerical range of the ciphertext calculation result represented by an integer to the first set numerical 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 computing system comprises: At least two computing parties; The ciphertext calculation result is calculated by using the ciphertext calculation sub-results represented by an integer number based on a second set number of digits held by the at least two calculation parties; Before performing dequantization processing on the ciphertext calculation result of the multi-party secure computation based on the ciphertext quantization parameter, the method further includes: Expanding the ciphertext calculation sub-results represented by the integer number based on the second set number of bits held by the at least two calculation parties to obtain the ciphertext calculation sub-results represented by the floating-point number based on the first set number of bits; If the ciphertext calculation result obtained by adding the ciphertext calculation sub-results represented by the integer number based on the second set number of digits held by the at least two calculation parties is less than the set value, the ciphertext calculation result is the sum of the ciphertext calculation sub-results represented by the floating-point number based on the first set number of digits held by the at least two calculation parties; If the ciphertext calculation result obtained by adding the ciphertext calculation sub-results represented by the integer number based on the second set bit number held by the at least two calculation parties is not less than the set value, then the ciphertext calculation result is the sum of the ciphertext calculation sub-results represented by the floating-point number based on the first set bit number held by the at least two calculation parties and the negative value of the set value.

14. A data processing device, the device being applied to a multi-party secure computing (MPC) system; the device comprising: An acquisition module, used to acquire 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 includes converting the ciphertext data represented by a floating point number based on a first set number of bits into the 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; A computing module, used for performing multi-party secure computing on the ciphertext data; A sending module is used to perform dequantization processing on the ciphertext calculation result of the multi-party secure calculation 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 processing includes 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.

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 calling the machine-readable instructions.

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

Citation Information

Patent Citations

  • Data processing method, ciphertext computing platform and plaintext and ciphertext hybrid computing system

    CN113824550A

  • Neural network model reasoning system based on secure multi-party computing

    CN115526290A

  • Data processing method and device, computer apparatus, and storage medium

    WO2021068444A1