Ciphertext compression method, ciphertext decompression method, device, equipment and storage medium
Through grouping and parallel compression processing of homomorphically encrypted ciphertext in federated learning, the problem of low data transmission efficiency is solved and more efficient data transmission and computing efficiency are achieved.
Patent Information
- Application Number
- CN202210096146.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-01-26
AI Technical Summary
Homomorphic encryption leads to data bit width expansion in federated learning, resulting in reduced data transmission efficiency and increased communication overhead between participants.
By grouping and parallel compression processing of ciphertext based on homomorphic encryption, the amount of data is reduced and the transmission efficiency is improved. The ciphertext grouping module, the ciphertext coefficient determination module, the first compression processing module and the second compression processing module are used to ciphertext Compression,utilizing GPU for parallel computing.
It reduces communication overhead and improves ciphertext compression speed, improves data transmission efficiency between different participants, and improves the operating efficiency of federated learning tasks.
Smart Images

Figure CN114448598B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a ciphertext compression method, a ciphertext decompression method, a device, a equipment and a storage medium. Background Art
[0002] Federated learning is a new machine learning paradigm. During the process of machine learning, each participant can use the data of other parties for joint modeling. The parties do not need to share data resources, that is, the data does not leave the local area, and joint data training is carried out to establish a shared machine learning model. In order to protect the data security of all participants, during the training process, homomorphic encryption technology is often used to perform secret calculation and encrypted transmission of model parameters or gradients. This technology can realize the calculation and update of the model under the premise of ciphertext.
[0003] However, the encryption of plaintext into ciphertext by homomorphic encryption will lead to the expansion of data bit width. This data expansion will cause huge communication overhead between the participants, and ultimately reduce the efficiency of data transmission between different participants. Summary of the invention
[0004] Based on this, it is necessary to provide a ciphertext compression method, ciphertext decompression method, device, equipment and storage medium that can improve the data transmission efficiency between different parameter parties in federated learning in response to the above technical problems.
[0005] In a first aspect, the present application provides a ciphertext compression method. The method comprises:
[0006] The ciphertexts obtained by encrypting the plaintexts based on the homomorphic encryption method are grouped to obtain ciphertext groups;
[0007] Determining a ciphertext coefficient corresponding to each ciphertext in the ciphertext group;
[0008] Based on the ciphertext coefficients, performing a first compression process on the ciphertexts in each of the ciphertext groups in parallel to obtain a sub-compressed ciphertext corresponding to the ciphertexts in each of the ciphertext groups;
[0009] The second compression process is performed on the compressed sub-ciphertexts corresponding to the ciphertexts in each of the ciphertext groups in parallel to obtain the compressed ciphertexts corresponding to each of the ciphertext groups.
[0010] In a second aspect, the present application also provides a ciphertext compression device. The device comprises:
[0011] A ciphertext grouping module is used to group the ciphertexts obtained by encrypting the plaintexts based on the homomorphic encryption method to obtain ciphertext groups;
[0012] A ciphertext coefficient determination module, used to determine the ciphertext coefficient corresponding to each ciphertext in the ciphertext group;
[0013] A first compression processing module, configured to perform first compression processing on the ciphertexts in each of the ciphertext groups in parallel based on the ciphertext coefficients, to obtain sub-compressed ciphertexts corresponding to the ciphertexts in each of the ciphertext groups;
[0014] The second compression processing module is used to perform second compression processing on the sub-compressed ciphertexts corresponding to the ciphertexts in each of the ciphertext groups in parallel to obtain compressed ciphertexts corresponding to each of the ciphertext groups.
[0015] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0016] The ciphertexts obtained by encrypting the plaintexts based on the homomorphic encryption method are grouped to obtain ciphertext groups;
[0017] Determining a ciphertext coefficient corresponding to each ciphertext in the ciphertext group;
[0018] Based on the ciphertext coefficients, performing a first compression process on the ciphertexts in each of the ciphertext groups in parallel to obtain a sub-compressed ciphertext corresponding to the ciphertexts in each of the ciphertext groups;
[0019] The second compression process is performed on the compressed sub-ciphertexts corresponding to the ciphertexts in each of the ciphertext groups in parallel to obtain the compressed ciphertexts corresponding to each of the ciphertext groups.
[0020] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0021] The ciphertexts obtained by encrypting the plaintexts based on the homomorphic encryption method are grouped to obtain ciphertext groups;
[0022] Determining a ciphertext coefficient corresponding to each ciphertext in the ciphertext group;
[0023] Based on the ciphertext coefficients, performing a first compression process on the ciphertexts in each of the ciphertext groups in parallel to obtain a sub-compressed ciphertext corresponding to the ciphertexts in each of the ciphertext groups;
[0024] The second compression process is performed on the compressed sub-ciphertexts corresponding to the ciphertexts in each of the ciphertext groups in parallel to obtain the compressed ciphertexts corresponding to each of the ciphertext groups.
[0025] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0026] The ciphertexts obtained by encrypting the plaintexts based on the homomorphic encryption method are grouped to obtain ciphertext groups;
[0027] Determining a ciphertext coefficient corresponding to each ciphertext in the ciphertext group;
[0028] Based on the ciphertext coefficients, performing a first compression process on the ciphertexts in each of the ciphertext groups in parallel to obtain a sub-compressed ciphertext corresponding to the ciphertexts in each of the ciphertext groups;
[0029] The second compression process is performed on the compressed sub-ciphertexts corresponding to the ciphertexts in each of the ciphertext groups in parallel to obtain the compressed ciphertexts corresponding to each of the ciphertext groups.
[0030] The above-mentioned ciphertext compression method, device, equipment and storage medium group the ciphertexts obtained by encrypting each plaintext based on the homomorphic encryption method to obtain a ciphertext group, determine the ciphertext coefficient corresponding to each ciphertext in the ciphertext group, and based on the ciphertext coefficient, perform a first compression process on the ciphertext in each ciphertext group in parallel to obtain a sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group, and perform a second compression process on the sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group in parallel to obtain a compressed ciphertext corresponding to each ciphertext group. On the one hand, compressing multiple ciphertexts together can reduce the data volume of the ciphertext after data expansion, and then when the ciphertext is transmitted, the communication overhead can be reduced by transmitting the compressed ciphertext. On the other hand, by grouping and compressing multiple ciphertexts in parallel, the speed of ciphertext compression can be increased, thereby improving the data transmission efficiency between different participants by reducing communication overhead and increasing the ciphertext compression speed, thereby improving the operation efficiency of the federated learning task.
[0031] In a sixth aspect, the present application provides a ciphertext decompression method. The method comprises:
[0032] Obtaining compressed ciphertext corresponding to each ciphertext group and a shift parameter corresponding to the ciphertext group;
[0033] Decrypting the compressed ciphertexts in parallel to obtain compressed plaintext groups corresponding to the ciphertext groups;
[0034] Based on the shift parameter, performing a first decompression process on each of the compressed plaintext groups in parallel to obtain at least two sub-compressed plaintexts corresponding to each of the compressed plaintext groups;
[0035] A modulus parameter is determined based on the shift parameter, and a second decompression process is performed on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group.
[0036] In a seventh aspect, the present application also provides a ciphertext compression device. The device comprises:
[0037] A ciphertext acquisition module, used to obtain the compressed ciphertext corresponding to each ciphertext group and the shift parameter corresponding to the ciphertext group;
[0038] A ciphertext decryption module, used to decrypt the compressed ciphertexts in parallel to obtain compressed plaintext groups corresponding to the ciphertext groups;
[0039] A first decompression processing module, configured to perform a first decompression processing on each of the compressed plaintext groups in parallel based on the shift parameter, to obtain at least two sub-compressed plaintexts corresponding to each of the compressed plaintext groups;
[0040] The second decompression processing module is used to determine the modulus parameter based on the shift parameter, and perform second decompression processing on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group.
[0041] In an eighth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0042] Obtaining compressed ciphertext corresponding to each ciphertext group and a shift parameter corresponding to the ciphertext group;
[0043] Decrypting the compressed ciphertexts in parallel to obtain compressed plaintext groups corresponding to the ciphertext groups;
[0044] Based on the shift parameter, performing a first decompression process on each of the compressed plaintext groups in parallel to obtain at least two sub-compressed plaintexts corresponding to each of the compressed plaintext groups;
[0045] A modulus parameter is determined based on the shift parameter, and a second decompression process is performed on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group.
[0046] In a ninth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0047] Obtaining compressed ciphertext corresponding to each ciphertext group and a shift parameter corresponding to the ciphertext group;
[0048] Decrypting the compressed ciphertexts in parallel to obtain compressed plaintext groups corresponding to the ciphertext groups;
[0049] Based on the shift parameter, performing a first decompression process on each of the compressed plaintext groups in parallel to obtain at least two sub-compressed plaintexts corresponding to each of the compressed plaintext groups;
[0050] A modulus parameter is determined based on the shift parameter, and a second decompression process is performed on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group.
[0051] In a tenth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0052] Obtaining compressed ciphertext corresponding to each ciphertext group and a shift parameter corresponding to the ciphertext group;
[0053] Decrypting the compressed ciphertexts in parallel to obtain compressed plaintext groups corresponding to the ciphertext groups;
[0054] Based on the shift parameter, performing a first decompression process on each of the compressed plaintext groups in parallel to obtain at least two sub-compressed plaintexts corresponding to each of the compressed plaintext groups;
[0055] A modulus parameter is determined based on the shift parameter, and a second decompression process is performed on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group.
[0056] The above-mentioned ciphertext decompression method, device, equipment and storage medium obtain the compressed ciphertext corresponding to each ciphertext group and the shift parameter corresponding to the ciphertext group; decrypt each compressed ciphertext in parallel to obtain the compressed plaintext group corresponding to each ciphertext group; based on the shift parameter, perform a first decompression process on each compressed plaintext group in parallel to obtain at least two sub-compressed plaintexts corresponding to each compressed plaintext group; determine the modulus parameter based on the shift parameter, and perform a second decompression process on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group. By decrypting and decompressing the compressed ciphertext in parallel, the speed of ciphertext decryption and decompression can be improved, thereby improving the operating efficiency of the federated learning task. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A diagram of an application environment of a ciphertext compression method and a ciphertext decompression method in an embodiment;
[0058] Figure 2 It is an application environment diagram of a ciphertext compression method and a ciphertext decompression method in another embodiment;
[0059] Figure 3 Schematic diagram of a flow chart of a ciphertext compression method in one embodiment;
[0060] Figure 4 is a schematic flow chart of a first compression processing step in one embodiment;
[0061] Figure 5 is a schematic flow chart of a second compression process step in one embodiment;
[0062] Figure 6 A schematic diagram of a flow chart of a ciphertext decompression method in an embodiment;
[0063] Figure 7 is a schematic flow chart of a first decompression processing step in an embodiment;
[0064] Figure 8 is a schematic flow chart of a second decompression processing step in one embodiment;
[0065] Fig. 9 is a schematic flow chart of a ciphertext compression method in another embodiment;
[0066] Fig.10 It is a flowchart of a ciphertext decompression method in another embodiment;
[0067] Fig.11 is a structural block diagram of a ciphertext compression device in one embodiment;
[0068] Fig.12 is a structural block diagram of a ciphertext decompression device in one embodiment;
[0069] Fig.13 is an internal structure diagram of a computer device in one embodiment;
[0070] Fig.14 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0072] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0073] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, mechatronics and other technologies. Artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, as well as machine learning / deep learning, autonomous driving, smart transportation and other major directions.
[0074] Federated learning (Federated machine learning / Federated Learning), also known as federated machine learning, joint learning, and alliance learning, is a machine learning framework that can effectively help multiple institutions use data and conduct machine learning modeling while meeting the requirements of user privacy protection, data security, and government regulations. According to the distribution characteristics of data, federated learning can be divided into three categories: horizontal federated learning, vertical federated learning, and federated transfer learning. As a distributed machine learning paradigm, federated learning can effectively solve the "data island" problem, allowing participants to jointly model without sharing data, thereby technically breaking the "data island" and realizing AI collaboration.
[0075] The ciphertext compression method and ciphertext decompression method provided in the embodiments of the present application involve technologies such as federated learning of artificial intelligence and deep learning, and can be specifically applied to Figure 1 In the federated learning system 100 shown, Figure 1 The federated learning system shown in includes at least two participating nodes, such as Figure 1Participating nodes 102, 104, 106 and 108 are shown in the figure. Each participating node can store data that the corresponding participating node needs to process. The data storage system used by each participating node to store data can be integrated on the server, or placed on the cloud or other network servers. There is a communication connection between any two participating nodes among participating nodes 102, 104, 106 and 108, and data is transmitted between participating nodes through the communication connection. It can be understood that the above-mentioned communication connection does not limit the connection method, and can be directly or indirectly connected by wired communication, directly or indirectly connected by wireless communication, or by other methods, which are not limited in this application.
[0076] It can be understood that the above-mentioned participating nodes can be distributed in different teams, departments or companies, that is, each participating node can store its own data. When training a model based on federated learning, federated learning does not need to centrally collect data distributed on each participating node, but directly uses the data distributed on each participating node and cooperates and interacts within the federated learning system to eventually learn a trained model. During the model training process, the data exchanged by each participating node is encrypted, and no participating node can guess the private data content of other participating nodes. Among them, the data exchanged by each participating node can be some data generated during the model training process (such as gradients), rather than the initial data stored by the participating nodes.
[0077] The ciphertext compression method and ciphertext decompression method provided in this application can be applied to Figure 1 Any participating node in the federated learning training model is participated in by participating node 102 and participating node 104, that is, there are only participating node 102 and participating node 104 in the federated learning system 100. Figure 2As shown, the participating node 102 and the participating node 104 respectively store their own training data for model training. After receiving the model training related instructions, the participating node 102 and the participating node 104 respectively build models locally, and then use the local training data to train the models respectively. In the process of model training, the participating node 102 can obtain plaintext X, and the participating node 104 can obtain plaintext Y, wherein the plaintext X can be the data stored locally by the participating node 102, or it can be the data (such as gradient or partial derivative) generated in the process of training the model by the participating node 102 based on the locally stored data, and the plaintext Y can be the data stored locally by the participating node 104, or it can be the data (such as gradient or partial derivative) generated in the process of training the model by the participating node 104 based on the locally stored data. In the process of training of both parties, the participating node 102 and the participating node 104 can continuously exchange intermediate calculation results under encryption protection. For example, the participating node 10 2 After the plaintext X is encrypted and compressed by the ciphertext compression method described in the present application to obtain the compressed ciphertext X', the compressed ciphertext X' is sent to the participating node 104, so that the participating node 104 performs model training based on the obtained compressed ciphertext X'; after the participating node 104 encrypts and compresses the plaintext Y by the ciphertext compression method described in the present application to obtain the compressed ciphertext Y', the compressed ciphertext Y' is sent to the participating node 102, so that the participating node 102 performs model training based on the obtained compressed ciphertext Y', and then the participating node 102 and the participating node 104 can continuously update their respective model parameters according to the interaction results. When the model converges, the training task is not completed. At this time, the participating node 102 and the participating node 104 respectively hold the model parameters related to their own data features in the model, and can subsequently use the final model to jointly provide corresponding services. For example, using the trained personalized recommendation model, personalized advertising push can be provided to platform users on the social network platform.
[0078] When the ciphertext compression method provided in the present application is executed on the participating node 102, after obtaining each plaintext, the participating node 102 can encrypt each plaintext separately based on the homomorphic encryption method to obtain a ciphertext, and group the obtained ciphertexts to obtain a ciphertext group; and determine the ciphertext coefficient corresponding to each ciphertext in the ciphertext group pair, and based on the ciphertext coefficient, perform a first compression process on the ciphertexts in each ciphertext group in parallel to obtain a sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group; and perform a second compression process on the sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group in parallel to obtain a compressed ciphertext corresponding to each ciphertext group.
[0079] After obtaining the compressed ciphertext, the participating node 102 may send the compressed ciphertext to the participating node 104. It should be noted that when the ciphertext compressed by the participating node 102 is the result obtained by indirectly performing homomorphic encryption on each plaintext, that is, when the ciphertext compressed by the participating node 102 is the ciphertext obtained by performing privacy calculation on the exchange ciphertext sent by the participating node 104 based on each plaintext of the participating node 102, the participating node 104 may use the ciphertext decompression provided by the present application to decrypt the calculated compressed ciphertext after receiving the compressed ciphertext sent by the participating node 102, specifically to obtain the compressed ciphertext corresponding to each ciphertext group and the ciphertext coefficient corresponding to each ciphertext in the ciphertext group; decrypt each compressed ciphertext in parallel to obtain the compressed plaintext group corresponding to each ciphertext group; and decompress each compressed plaintext group in parallel based on the ciphertext coefficient to obtain the plaintext in each compressed plaintext group.
[0080] When the ciphertext compressed by the participating node 102 is the result obtained by directly performing homomorphic encryption on each plaintext, after receiving the compressed ciphertext sent by the participating node 102, the participating node 104 can decompress the compressed ciphertext sent by the participating node 102 to obtain each ciphertext, and perform privacy calculation on each ciphertext obtained by decompression based on each plaintext of the participating node 104 to obtain a new ciphertext, and use the ciphertext compression method provided in the present application to compress the new ciphertext to obtain a new compressed ciphertext, and return the new compressed ciphertext to the participating node 102. After obtaining the new compressed ciphertext, the participating node 102 can use the ciphertext decompression provided in the present application to decrypt the calculated compressed ciphertext, specifically to obtain the compressed ciphertext corresponding to each ciphertext group and the ciphertext coefficient corresponding to each ciphertext in the ciphertext group; decrypt each compressed ciphertext in parallel to obtain a compressed plaintext group corresponding to each ciphertext group; based on the ciphertext coefficient, decompress each compressed plaintext group in parallel to obtain the plaintext in each compressed plaintext group.
[0081] It is understandable that the above-mentioned participating nodes may be various computer devices, the computer devices may be terminals or servers, the terminals may be but are not limited to various personal computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices, IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server may be implemented as an independent server or a server cluster consisting of multiple servers.
[0082] It should be noted that, since homomorphic encryption often leads to serious data expansion, before sending the ciphertext to other participating nodes, the participating nodes can use the ciphertext compression method provided by the present application to compress the ciphertext, so as to reduce the communication overhead during data transmission and improve the data transmission efficiency between different participants. After receiving the compressed ciphertext, the participating nodes can use the ciphertext decompression method provided by the present application to decompress the compressed ciphertext, so as to quickly realize the ciphertext decompression, thereby improving the data transmission efficiency between different participants. In addition, since the parallel computing capability of the CPU of the computer device is relatively weak, the present application scheme can realize the compression processing of the ciphertext and the decompression processing of the compressed ciphertext through the GPU of the computer device for parallel computing, thereby reducing the algorithm time complexity, thereby improving the efficiency of the ciphertext compression and decompression processing, and further improving the data transmission efficiency between different participants. GPU (Graphics Processing Unit, image processing unit) is the core processing chip on the graphics card, which is mainly used for a large number of repeated calculations. A GPU has thousands of computing cores (core), which can effectively process workloads in parallel. The time complexity of an algorithm is a function of how much the algorithm's time complexity is related to the size of the input data. If the algorithm's time complexity is independent of the size of the input data, it is expressed as O(1), which means constant time. If the algorithm's time complexity is linearly related to the size of the input data n, it is expressed as O(n). Another common expression is O(n). 2 ) and O(log(n)), representing the square relationship and logarithmic relationship respectively.
[0083] In addition, the ciphertext compression method and ciphertext decompression method provided in the embodiments of the present application can support any federated learning algorithm that uses a semi-homomorphic encryption algorithm that satisfies the additive property, such as the vertical federated LR algorithm, the vertical federated GBDT algorithm (also known as the vertical federated XGB algorithm), the vertical federated neural network algorithm, etc. This method can be integrated into the federated learning platform as a model training and model reasoning module for federated learning tasks, and provide federated learning services to the public cloud or private cloud, which can be applied to financial risk control, advertising recommendation, crowd profiling, information query and other scenarios. The method provided in the embodiments of the present application can effectively reduce communication overhead and decryption overhead, improve the efficiency of ciphertext compression and ciphertext decompression, improve the availability of the federated learning platform (or system), and further improve the effect of the federated learning model.
[0084] In one embodiment, Figure 3 As shown, a ciphertext compression method is provided, which is applied to Figure 2 Taking the participating node 102 or the participating node 104 in the example as an example, the method includes the following steps:
[0085] S302, grouping the ciphertexts obtained by encrypting the plaintexts based on the homomorphic encryption method to obtain a ciphertext group.
[0086] Among them, homomorphic encryption is a cryptographic technology based on the computational complexity theory of mathematical problems. The data that has been homomorphically encrypted is processed to obtain an output, and this output is decrypted. The result is the same as the output result obtained by processing the unencrypted original data in the same way. Homomorphic encryption can be divided into semi-homomorphic encryption and fully homomorphic encryption. If a cryptographic algorithm only satisfies multiplicative homomorphism or additive homomorphism, it is called semi-homomorphic encryption (SHE (Somewhat Homomorphic Encryption) or PHE (Partially Homomorphic Encryption)); and if a cryptographic algorithm satisfies both multiplicative homomorphism and additive homomorphism, it is called fully homomorphic encryption (FHE, Fully Homomorphic Encryption). In an embodiment of the present application, semi-homomorphic encryption technology that satisfies the additive property can be used to perform privacy operations, such as the Paillier homomorphic encryption scheme, the Okamoto-Uchiyama homomorphic encryption scheme, and the like.
[0087] The ciphertext may be the result obtained by directly performing homomorphic encryption on each plaintext, or the result obtained by indirectly performing homomorphic encryption on each plaintext. Indirect homomorphic encryption of each plaintext refers to performing privacy calculation on the ciphertext obtained by performing homomorphic encryption on other participating nodes based on each plaintext. It should be noted that when the ciphertext is the result obtained by directly performing homomorphic encryption on each plaintext, the participating nodes simultaneously have public keys and private keys for homomorphic encryption and decryption. After completing the compression of the ciphertext, the participating nodes may send the compressed ciphertext and the public key together to other participating nodes; when the ciphertext is the result obtained by indirectly performing homomorphic encryption on each plaintext, that is, the ciphertext is the result obtained by performing privacy calculation on the ciphertext obtained by the participating nodes based on each plaintext on other participating nodes, the other participating nodes simultaneously have public keys and private keys for homomorphic encryption and decryption, and when the other participating nodes send the ciphertext obtained by homomorphic encryption to the participating nodes on the local end, they also send the public key to the participating nodes on the local end.
[0088] Specifically, the participating nodes can encrypt each plaintext based on the homomorphic encryption method to obtain the ciphertext corresponding to each plaintext, and group each ciphertext to obtain each ciphertext group, wherein each ciphertext group contains multiple ciphertexts.
[0089] For example, the ciphertext set V obtained by the participating nodes contains n ciphertexts, namely v1, v2, ..., v n-1 , v n, divide m ciphertexts into a group. If n is divisible by m, then r = n / m ciphertext groups can be obtained, where each ciphertext group contains m ciphertexts. A ciphertext group is defined as a ciphertext set, that is, r ciphertext sets U1, U2, ..., U r-1 , U r , Formula (1) is the matrix representation of the ciphertext set V, where the ciphertext set U1 contains the ciphertexts “v1, …, v m ", the ciphertext set Uj contains the ciphertext "v (j-1)m+1 , ..., v jm ", and so on, the ciphertext set U m Contains the ciphertext "v (r-1)m+1 , ..., v n ”.
[0090]
[0091] If n is not divisible by m, a preset number z of basic ciphertexts can be added so that n+z can be divisible by m, where the added basic ciphertext can be 0, and r = (n+z) / m ciphertext groups can be obtained, where each ciphertext group contains m ciphertexts. A ciphertext group is defined as a ciphertext set, that is, r ciphertext sets U1, U2, ..., U r-1 , U r , reference matrix (2) is the matrix representation of the ciphertext set V, where the ciphertext set U1 contains the ciphertexts “v1, …, v m ", the ciphertext set Uj contains the ciphertext "v (j-1)m+1 , ..., v jm ", and so on, the ciphertext set U m Contains the ciphertext "v (r-1)m+1 ,……,0".
[0092]
[0093] S304, determining the ciphertext coefficient corresponding to each ciphertext in the ciphertext group.
[0094] The ciphertext coefficients are coefficients of polynomial terms corresponding to each ciphertext when the ciphertext of the ciphertext group is compressed.
[0095] Specifically, after obtaining each ciphertext, the participating nodes can also estimate the plaintext boundary value of the ciphertext, obtain the plaintext boundary value of the plaintext corresponding to the ciphertext, and determine the ciphertext coefficient corresponding to each ciphertext in the ciphertext group based on the plaintext boundary value.
[0096] The plaintext limit value is used to characterize the value range of the plaintext corresponding to the ciphertext, specifically including an upper limit and a lower limit, wherein the upper limit is the maximum value among the plaintext limit values, and the lower limit is the lower limit among the plaintext limit values.
[0097] It can be understood that when the ciphertext is the result obtained by the participating nodes directly performing homomorphic encryption on each plaintext, the plaintext corresponding to the ciphertext is the directly encrypted plaintext; when the ciphertext is the result obtained by the participating nodes indirectly performing homomorphic encryption on each plaintext, that is, the ciphertext is the result obtained by the participating nodes performing privacy calculation on the ciphertext obtained by homomorphically encrypting other participating nodes based on each plaintext, the plaintext corresponding to the ciphertext is the plaintext corresponding to the result obtained by the privacy calculation.
[0098] In one embodiment, when the ciphertext is the result obtained by directly performing homomorphic encryption on each plaintext by the participating nodes, the participating nodes can directly determine the value range of the plaintext based on the value of each plaintext, that is, obtain the plaintext boundary value.
[0099] In one embodiment, when the ciphertext is the result obtained by the participating nodes indirectly performing homomorphic encryption on each plaintext, that is, the ciphertext is the result obtained by the participating nodes performing privacy calculation on the ciphertext obtained by the participating nodes performing homomorphic encryption on other participating nodes based on each plaintext, the participating nodes can perform numerical limit estimation on the ciphertext, obtain the plaintext estimated limit value corresponding to the ciphertext, and determine the plaintext estimated limit value as the plaintext limit value corresponding to the ciphertext.
[0100] It is understandable that the results obtained by privacy calculation have upper and lower bounds, and the upper and lower bounds can be estimated. Specifically, the participating nodes can obtain the numerical range and data dimension corresponding to the initial plaintext corresponding to the ciphertext obtained by other participating nodes through homomorphic encryption, and obtain the numerical range and data dimension corresponding to each local plaintext of the participating nodes, and then determine the plaintext estimated limit value corresponding to the ciphertext based on the operation type of the privacy operation, the determined numerical ranges and data dimensions, and determine the plaintext estimated limit value as the plaintext limit value corresponding to the ciphertext.
[0101] It should be noted that the numerical ranges and data dimensions mentioned above are public information, that is, all participating nodes know this information. Therefore, there is no possibility of privacy leakage in the numerical limit estimation.
[0102] In one embodiment, after obtaining the plaintext boundary value corresponding to the ciphertext, the participating nodes can determine the ciphertext coefficient corresponding to each ciphertext in the ciphertext group based on the plaintext boundary value, wherein the process of the participating nodes determining the ciphertext coefficient corresponding to each ciphertext in the ciphertext group based on the plaintext boundary value includes the following steps: determining a shift parameter based on the plaintext boundary value; determining the ciphertext coefficient corresponding to each ciphertext in the ciphertext group based on the shift parameter, the number of ciphertexts in the ciphertext group and preset parameters.
[0103] Among them, the shift parameter is used to characterize the plaintext boundary value, and the preset parameter is the radix of the shift parameter corresponding to the shift parameter. For example, if the radix corresponding to the shift parameter is binary, then the radix 2 is the preset parameter. Assuming that the plaintext boundary value is [0, 8] in decimal, that is, the value range of the description text is [0, 8], then a 3-bit binary sequence can be used to represent each plaintext within the range. The shift parameter is 3 and the preset parameter is 2.
[0104] Specifically, after obtaining the plaintext boundary value, the participating nodes can obtain the preset parameters and determine the shift parameters based on the preset parameters. Then, for any target ciphertext, the order of the ciphertext in the ciphertext group is determined according to the number of ciphertexts in the ciphertext group, and the ciphertext coefficient corresponding to the ciphertext is determined based on the shift parameter, the preset parameter and the order of the ciphertext in the ciphertext group, thereby obtaining the ciphertext coefficient corresponding to each ciphertext.
[0105] Among them, the ciphertext coefficient can be determined according to the following formula:
[0106] a k =b (k-1)T (3)
[0107] Among them, a k is the ciphertext coefficient corresponding to the kth ciphertext in the ciphertext group, the maximum value of k is equal to the number of ciphertexts in the ciphertext group, m, b is a preset parameter, and T is a shift parameter. For example, when b is equal to 2, the ciphertext coefficient a1 corresponding to the first ciphertext in the ciphertext group is 1, and the ciphertext coefficient a1 corresponding to the kth ciphertext in the ciphertext group is 1. k For 2 (k-1)T , ..., the ciphertext coefficient a corresponding to the mth ciphertext in the ciphertext group m For 2 (m-1)T .
[0108] In one embodiment, after obtaining the plaintext boundary value, the participating nodes can obtain preset parameters, determine shift parameters based on the preset parameters, determine basic ciphertext coefficients based on the preset parameters and the shift parameters, and then for any target ciphertext, determine the order of the ciphertext in the ciphertext group according to the number of ciphertexts in the ciphertext group, and determine the ciphertext coefficient corresponding to the ciphertext based on the basic ciphertext coefficient and the order of the ciphertext in the ciphertext group, thereby obtaining the ciphertext coefficients corresponding to each ciphertext.
[0109] Among them, the ciphertext coefficient can be determined according to the following formula:
[0110] a k =s (k-1) (4)
[0111] s=b T (5)
[0112] Among them, ak is the ciphertext coefficient corresponding to the kth ciphertext in the ciphertext group, the maximum value of k is equal to the number of ciphertexts in the ciphertext group m, s is the basic ciphertext coefficient, b is the preset parameter, and T is the shift parameter. For example, when b is equal to 2, the ciphertext coefficient a1 corresponding to the first ciphertext in the ciphertext group is 1, and the ciphertext coefficient a1 corresponding to the kth ciphertext in the ciphertext group is k For 2 (k-1)T , ..., the ciphertext coefficient a corresponding to the mth ciphertext in the ciphertext group m For 2 (m-1)T .
[0113] In this embodiment, the participating nodes determine the shift parameter based on the plaintext boundary value, and thus can determine the ciphertext coefficient corresponding to each ciphertext in the ciphertext group based on the shift parameter, thereby facilitating compression of the ciphertext in the ciphertext group based on the determined ciphertext coefficient.
[0114] S306: Based on the ciphertext coefficients, perform first compression processing on the ciphertexts in each ciphertext group in parallel to obtain sub-compressed ciphertexts corresponding to the ciphertexts in each ciphertext group.
[0115] Specifically, after determining the ciphertext coefficient corresponding to each ciphertext in each ciphertext group, the participating nodes can perform a first compression process on the ciphertext in each ciphertext group based on the ciphertext coefficient, wherein, for each ciphertext group, the first compression process can be performed on the ciphertext in each ciphertext group in parallel, and for each ciphertext in any ciphertext group, the first compression process can be performed on each ciphertext in parallel, so as to obtain a sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group.
[0116] In one embodiment, the sub-compressed ciphertext includes a scalar product. For each ciphertext in any ciphertext group, the participating nodes perform a first compression process on each ciphertext to obtain a sub-compressed ciphertext corresponding to each ciphertext in the ciphertext group, including the following steps: calculating the scalar product of each ciphertext in the ciphertext group and the corresponding ciphertext coefficient to obtain a scalar product result corresponding to each ciphertext, and determining the scalar product result as a sub-compressed ciphertext of the corresponding ciphertext.
[0117] Specifically, for each ciphertext in the ciphertext group, the participating nodes can calculate the scalar product of each ciphertext and the corresponding ciphertext coefficient in parallel. Figure 4 As shown in FIG. 1 , it is a schematic diagram of the first compression process of the ciphertext group U1. The ciphertext group U1 contains m=8 ciphertexts. The participating nodes use the multi-core advantage of GPU to parallelly calculate the scalar product of each ciphertext and the corresponding ciphertext coefficient. The scalar product can also be called the ciphertext product, so as to obtain the sub-compressed ciphertext v corresponding to each ciphertext. i+1 a i , where a1=1, and the computational complexity is O(1).
[0118] It can be understood that the participating nodes perform the first compression processing on the ciphertexts in each ciphertext group in parallel, and the process of performing the first compression processing on each ciphertext in any ciphertext group in parallel can utilize the multi-core advantage of GPU for parallel computing, that is, for each ciphertext in the ciphertext set, the first compression processing is performed on each ciphertext in parallel, and the computational complexity is O(1).
[0119] In one embodiment, the process in which the participating nodes perform a first compression processing on the ciphertexts in each ciphertext group in parallel based on the ciphertext coefficients includes the following steps: combining all ciphertexts into a ciphertext matrix; constructing a ciphertext coefficient matrix based on the ciphertext coefficients corresponding to each ciphertext in the ciphertext group; and determining the scalar product between the ciphertexts of each ciphertext group in the ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix in parallel.
[0120] Specifically, the participating nodes arrange the ciphertexts in each ciphertext group in order to obtain a ciphertext matrix, and arrange the ciphertext coefficients corresponding to each ciphertext in the order of each ciphertext to obtain a ciphertext coefficient matrix, and calculate the scalar product between each ciphertext in the ciphertext matrix and the ciphertext coefficients corresponding to the ciphertext coefficient matrix in parallel.
[0121] For example, the obtained ciphertext matrix is as shown in the above formula (1), and the constructed ciphertext coefficient matrix S is as shown in the following formula (6). Then, the ciphertext v in the ciphertext matrix is calculated as (j-1)m+k The s between the corresponding ciphertext coefficients in the ciphertext coefficient matrix S k-1 Scalar product, v (j-1)m+k is the ciphertext corresponding to the jth row and kth column of the ciphertext matrix. This ciphertext is the (j-1)m+kth ciphertext among the n ciphertexts. k-1 The ciphertext coefficient corresponding to the k-th row in the ciphertext coefficient matrix S is also the ciphertext coefficient corresponding to the k-th ciphertext in any ciphertext group.
[0122]
[0123] In this embodiment, the participating nodes combine all ciphertexts into a ciphertext matrix and construct a ciphertext coefficient matrix, so that the scalar product between the ciphertext and the corresponding ciphertext coefficient can be quickly determined in parallel based on the ciphertext matrix and the ciphertext coefficient matrix, thereby improving the speed of ciphertext compression.
[0124] S308, performing a second compression process on the compressed sub-ciphertexts corresponding to the ciphertexts in each ciphertext group in parallel, to obtain compressed ciphertexts corresponding to each ciphertext group.
[0125] Specifically, after obtaining the sub-compressed ciphertext corresponding to each ciphertext in each ciphertext group, the participating nodes may perform a second compression process on each sub-compressed ciphertext in the ciphertext group for each ciphertext group, that is, compress each sub-compressed ciphertext into a compressed ciphertext, wherein, for each ciphertext group, the second compression process may be performed on the sub-compressed ciphertext in each ciphertext group in parallel, and for each sub-compressed ciphertext in any ciphertext group, the second compression process may be performed on each sub-compressed ciphertext in a parallel manner, so as to obtain the compressed ciphertext corresponding to each ciphertext group.
[0126] In one embodiment, the process of performing a second compression process on each sub-compressed ciphertext in any ciphertext group by participating nodes in parallel specifically includes the following steps: for each ciphertext group in the ciphertext matrix, summing up the sub-compressed ciphertexts corresponding to the ciphertext in the current ciphertext group in parallel, and summing up the sum values corresponding to the obtained current ciphertext group in parallel until the sum value corresponding to the current ciphertext group is obtained; and determining the sum values corresponding to each current ciphertext group as the compressed ciphertext in turn.
[0127] Specifically, for the sub-compressed ciphertexts in each ciphertext group, the participating nodes can sum the sub-compressed ciphertexts in each ciphertext group in parallel, wherein, for the sub-compressed ciphertexts in any ciphertext group, the participating nodes group the sub-compressed ciphertexts in the ciphertext group to obtain a sub-compressed ciphertext group, and then sum the sub-compressed ciphertexts in each sub-compressed ciphertext group in parallel to obtain the sum value corresponding to each sub-compressed ciphertext group, and then sum the sum values corresponding to the sub-compressed ciphertext groups to obtain the total value corresponding to the ciphertext group, and the total value is the compressed ciphertext corresponding to the ciphertext group.
[0128] In the process of summing the sum values corresponding to the sub-compressed ciphertext groups, the sum values may be grouped again to obtain a sum value group, and then the sum values in each sum value group may be summed in parallel until the total sum value corresponding to the ciphertext group is obtained.
[0129] like Figure 5 As shown in FIG. 1 , a schematic diagram of the second compression process of the sub-compressed ciphertext corresponding to the ciphertext group U1 is shown. The ciphertext group U1 includes m=8 ciphertexts. The ciphertext v i The corresponding sub-compressed ciphertext is denoted as v i+1 a i , 8 ciphertexts correspond to 8 sub-compressed ciphertexts. By grouping the 8 sub-compressed ciphertexts into two sub-compressed ciphertexts, 4 compressed ciphertext groups can be obtained. The participating nodes use the multi-core advantage of GPU to sum the sub-compressed ciphertexts in each sub-ciphertext group in parallel, as shown in Figure 4As shown, the sub-compressed ciphertext corresponding to v1 and the sub-compressed ciphertext corresponding to v5 are divided into one group, the sub-compressed ciphertext corresponding to v2 and the sub-compressed ciphertext corresponding to v6 are divided into one group, the sub-compressed ciphertext corresponding to v3 and the sub-compressed ciphertext corresponding to v7 are divided into one group, and the sub-compressed ciphertext corresponding to v4 and the sub-compressed ciphertext corresponding to v8 are divided into one group. Then, the sub-compressed ciphertext corresponding to v1 and the sub-compressed ciphertext corresponding to v5 are summed up in parallel using the multi-core advantage of GPU to obtain the sum 1, and the sub-compressed ciphertext corresponding to v2 and the sub-compressed ciphertext corresponding to v6 are summed up to obtain The sum is obtained by summing up the sub-compressed ciphertext corresponding to v3 and the sub-compressed ciphertext corresponding to v7 to obtain the sum 3, and the sub-compressed ciphertext corresponding to v4 and the sub-compressed ciphertext corresponding to v8 to obtain the sum 4. Then, the sum 1 and the sum 3 are grouped together, and the sum 2 and the sum 4 are grouped together. The GPU multi-core advantage is used to sum the sum 1 and the sum 3 in parallel to obtain the sum 5, the sum 2 and the sum 4 are summed to obtain the sum 6, and then the sum 5 and the sum 6 are summed to obtain the sum 7. The sum 7 is the total value corresponding to the ciphertext group U1.
[0130] For any ciphertext group U j , the corresponding compressed ciphertext can be expressed by the following formula (7):
[0131]
[0132] Where m is the number of ciphertexts contained in any ciphertext group, U′ j is the jth ciphertext group U j The corresponding compressed ciphertext, T is the shift parameter.
[0133] In this embodiment, the participating nodes sum the sub-compressed ciphertexts in each ciphertext group in parallel, and sum the sub-compressed ciphertexts in the current ciphertext group in parallel, so as to quickly compress the sub-compressed ciphertexts in each ciphertext group, thereby improving the speed of ciphertext compression.
[0134] In one embodiment, the process of the participating nodes compressing the ciphertexts in each ciphertext group in parallel based on the ciphertext coefficients includes the following steps: combining all ciphertexts into a ciphertext matrix; constructing a ciphertext coefficient matrix based on the ciphertext coefficients corresponding to each ciphertext in the ciphertext group; and determining the product of the ciphertext matrix and the ciphertext coefficient matrix in parallel to obtain a ciphertext compression matrix. Each element in the ciphertext compression matrix is a compressed ciphertext corresponding to the corresponding ciphertext group.
[0135] For example, the ciphertext matrix is the ciphertext matrix V shown in formula (1) or formula (2), and the determined ciphertext coefficient matrix is the ciphertext coefficient matrix S shown in formula (6). Then the ciphertext compression matrix is as shown in formula (8), which is the product of the ciphertext matrix V and the ciphertext coefficient matrix S, where the jth compressed ciphertext U′ in the ciphertext compression matrix U′ is j The expression of is shown in formula (7):
[0136]
[0137] In the above-mentioned ciphertext compression method, the ciphertexts obtained by encrypting each plaintext based on the homomorphic encryption method are grouped to obtain a ciphertext group, the ciphertext coefficient corresponding to each ciphertext in the ciphertext group is determined, and based on the ciphertext coefficient, the ciphertexts in each ciphertext group are respectively subjected to a first compression process in parallel to obtain a sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group, and the sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group is respectively subjected to a second compression process in parallel to obtain a compressed ciphertext corresponding to each ciphertext group. On the one hand, compressing multiple ciphertexts together can reduce the data volume of the ciphertext after data expansion, and then by transmitting the compressed ciphertext when transmitting the ciphertext, the communication overhead can be reduced. On the other hand, by grouping and compressing multiple ciphertexts in parallel, the speed of ciphertext compression can be increased, thereby reducing the communication overhead and increasing the ciphertext compression speed, improving the data transmission efficiency between different participants, and thereby improving the operation efficiency of the federated learning task.
[0138] In one embodiment, after determining the plaintext boundary value, the participating nodes may also perform forward offset processing on the ciphertexts in each ciphertext group based on the plaintext boundary value to obtain the intermediate ciphertexts corresponding to each ciphertext, and perform first compression processing on the intermediate ciphertexts in each ciphertext group in parallel based on the ciphertext coefficient to obtain the sub-compressed ciphertexts corresponding to the ciphertexts in each ciphertext group.
[0139] Among them, the forward offset processing can also be called the additive offset processing.
[0140] It should be noted that the ciphertext compression method provided in the embodiment of the present application is a polynomial-based ciphertext compression method. This method requires that the plaintext corresponding to the ciphertext to be compressed is a non-negative number. Assuming that the determined ciphertext v i The corresponding plaintext boundary value is [-α, α], that is, the upper limit value of the plaintext is α, and the lower limit value is -α. Then the participating nodes can perform scalar addition operations on each ciphertext in the ciphertext group based on the upper limit value α of the plaintext to obtain the intermediate ciphertext corresponding to each ciphertext, where the ciphertext v i The corresponding intermediate ciphertext v′ i As shown in the following formula (9):
[0141]
[0142] In this embodiment, the participating nodes obtain intermediate ciphertexts for compression by performing forward offset processing on the ciphertexts in each ciphertext group, thereby ensuring that the value of the plaintext corresponding to the intermediate ciphertext meets the compression condition requirements, and further the ciphertext can be compressed based on the intermediate ciphertext.
[0143] In one embodiment, after combining all ciphertexts into a ciphertext matrix, the participating nodes may also perform forward offset processing on the ciphertexts of each ciphertext group in the ciphertext matrix in parallel based on the plaintext boundary value to obtain an intermediate ciphertext matrix, and determine the scalar products between the intermediate ciphertexts corresponding to each ciphertext group in the intermediate ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix in parallel to obtain the scalar products corresponding to each ciphertext in each ciphertext group.
[0144] The intermediate ciphertext in the intermediate ciphertext matrix is obtained by performing a forward offset process on the ciphertext.
[0145] Assume that the determined ciphertext v i The corresponding plaintext boundary value is [-α, α], that is, the upper limit value of the plaintext is α, and the lower limit value is -α. Then the participating nodes can perform scalar addition operations on each ciphertext in the ciphertext group based on the upper limit value α of the plaintext to obtain the intermediate ciphertext corresponding to each ciphertext. Assuming that the ciphertext matrix is the ciphertext matrix shown in formula (1), the corresponding intermediate ciphertext matrix is shown in formula (10):
[0146]
[0147] After the participating nodes determine the ciphertext coefficients corresponding to each ciphertext in each ciphertext group, they arrange the ciphertext coefficients corresponding to each ciphertext in the order of each ciphertext to obtain a ciphertext coefficient matrix, and calculate the scalar product between each ciphertext in the ciphertext matrix and the ciphertext coefficient matrix corresponding to the ciphertext coefficient matrix in parallel. For example, the constructed ciphertext coefficient matrix S is shown in formula (6), then the ciphertext v′ in the intermediate ciphertext matrix is calculated (j-1)m+k The s between the corresponding ciphertext coefficients in the ciphertext coefficient matrix S k-1 Scalar product, v′ (j-1)m+k is the intermediate ciphertext corresponding to the jth row and kth column of the intermediate ciphertext matrix. The intermediate ciphertext is the (j-1)m+kth intermediate ciphertext among the n intermediate ciphertexts. k-1 The ciphertext coefficient corresponding to the k-th row in the ciphertext coefficient matrix S is also the ciphertext coefficient corresponding to the k-th intermediate ciphertext in any intermediate ciphertext group.
[0148] In the above embodiment, the participating nodes obtain an intermediate ciphertext matrix for compression by performing forward offset processing on the ciphertext in the ciphertext matrix, which can ensure that the value of the plaintext corresponding to the intermediate ciphertext matrix meets the compression condition requirements, and then the ciphertext matrix can be compressed based on the intermediate ciphertext matrix.
[0149] In one embodiment, the above-mentioned ciphertext compression method also includes a process of obtaining the ciphertext to be compressed, and the ciphertext to be compressed is the ciphertext obtained by encrypting each plaintext separately based on the homomorphic encryption method. The process of obtaining the ciphertext to be compressed includes the following steps: obtaining the plaintext to be encrypted; based on the homomorphic encryption method, homomorphically encrypting each plaintext in parallel to obtain the ciphertext.
[0150] The plaintext to be encrypted may be data generated by participating nodes in the process of training the model based on locally stored data, such as gradients or partial derivatives.
[0151] Specifically, after obtaining each plaintext to be encrypted, the participating node obtains the public key and private key used for homomorphic encryption, and uses the private key to encrypt each plaintext based on homomorphic encryption. When encrypting each plaintext, the multi-core advantage of the GPU can be used to encrypt each plaintext in a parallel manner.
[0152] For example, assuming that there are n plaintexts, the n plaintexts can be encrypted simultaneously by n computing cores of the GPU, wherein each computing core is used to implement encryption calculation of one plaintext.
[0153] In the above embodiment, the participating nodes can increase the speed of plaintext encryption by performing homomorphic encryption on the plaintext in parallel, reduce the time consumption of the encryption process, and thus improve the data transmission efficiency between different participants.
[0154] In one embodiment, the above-mentioned ciphertext compression method also includes a process of obtaining the ciphertext to be compressed, and the ciphertext to be compressed is the ciphertext obtained by encrypting each plaintext separately based on the homomorphic encryption method. The process of obtaining the ciphertext to be compressed includes the following steps: receiving the exchange ciphertext sent by other nodes; performing privacy calculation on the exchange ciphertext based on each plaintext of the local node to obtain the ciphertext.
[0155] Among them, other nodes are other participating nodes participating in federated learning, and the exchange ciphertext sent by other nodes is the data obtained by other participating nodes based on the plaintext they own through homomorphic encryption. The plaintext owned by other nodes can be the data generated by other participating nodes in the process of training the model based on the data they store, such as gradients or partial derivatives. The plaintext of the local node can be the data stored by the participating node, or the data generated by the participating node in the process of training the model based on the data stored locally, such as gradients or partial derivatives. Privacy computing is the data processing performed on the encrypted ciphertext, which can be a linear algebra operation or a histogram aggregation operation. The linear algebra operation or the histogram aggregation operation will involve at least one of homomorphic addition operation, scalar addition operation, and scalar multiplication operation.
[0156] It can be understood that other nodes simultaneously have their corresponding private keys and public keys for homomorphic encryption. When sending the exchanged ciphertext to the local node, the other participating nodes can send the public key together with the local node, that is, the local node has the public keys of other nodes but knows nothing about the private keys of other nodes.
[0157] In the above embodiment, the participating nodes perform privacy calculations on the exchanged ciphertexts based on the plaintexts of the local nodes to obtain the ciphertexts, which can realize data joint training with other nodes, and avoid privacy leakage of other nodes during the joint training process, thereby improving data security.
[0158] In one embodiment, the participating nodes perform privacy calculations on the exchanged ciphertexts based on the plaintexts of the local nodes, and the process of obtaining the ciphertexts includes the following steps: homomorphically encrypting the plaintexts in parallel to obtain the initial ciphertexts; and performing privacy calculations on the exchanged ciphertexts based on the initial ciphertexts to obtain the ciphertexts.
[0159] Specifically, after the participating node obtains the exchange ciphertext sent by other nodes, it obtains the plaintext owned by the local node, as well as the public key and private key corresponding to the local node for homomorphic encryption, and uses the public key to encrypt each plaintext based on homomorphic encryption to obtain the initial ciphertext corresponding to each plaintext, and performs privacy calculation on the received exchange ciphertext based on each initial ciphertext to obtain the ciphertext. When encrypting each plaintext, the advantage of GPU multi-core can be used to encrypt each plaintext in parallel.
[0160] In the above embodiment, the participating nodes perform privacy calculations on the exchanged ciphertexts of other nodes based on the initial ciphertexts obtained by encrypting the plaintexts of the local node to obtain the ciphertexts, thereby realizing joint data training with other nodes. In the process of joint training, the privacy leakage of the local node and other nodes is avoided, thereby improving data security. In addition, when encrypting the plaintexts of the local node, parallel encryption is used to increase the speed of plaintext encryption, reduce the time consumption of the encryption process, and thereby improve the data transmission efficiency between different participants.
[0161] In one embodiment, Figure 6 As shown, a ciphertext decompression method is provided, which is applied to Figure 2 Taking the participating node 102 or the participating node 104 in the example as an example, the method includes the following steps:
[0162] S602, obtaining compressed ciphertexts corresponding to each ciphertext group and shift parameters corresponding to the ciphertext group.
[0163] Among them, the compressed ciphertext in the compressed ciphertext is obtained by encrypting the plaintext based on the homomorphic encryption method. The ciphertext can be the result obtained by the sending party participating node directly performing homomorphic encryption on each plaintext, or it can be the result obtained by the sending party participating node indirectly performing homomorphic encryption on each plaintext.
[0164] In one embodiment, after receiving the compressed ciphertext corresponding to each ciphertext group, the participating nodes can estimate the plaintext boundary value of the ciphertext, obtain the plaintext boundary value of the plaintext corresponding to the ciphertext, obtain the preset parameters, and determine the shift parameters corresponding to the ciphertext group based on the plaintext boundary value and the preset parameters.
[0165] The plaintext boundary value is used to characterize the value range of the plaintext corresponding to the ciphertext, specifically including an upper limit and a lower limit, wherein the upper limit is the maximum value in the plaintext boundary value, and the lower limit is the lower limit in the plaintext boundary value. The shift parameter is used to characterize the plaintext boundary value, and the preset parameter is the base of the radix corresponding to the shift parameter. For example, if the radix corresponding to the shift parameter is binary, then the base 2 is the preset parameter. Assuming that the plaintext boundary value is [0, 8] in decimal, that is, the value range of the explanatory text is [0, 8], then a 3-bit binary sequence can be used to represent each plaintext within the range, then the shift parameter is 3, and the preset parameter is 2.
[0166] In one embodiment, after receiving the compressed ciphertext corresponding to each ciphertext group, the participating node may also directly obtain the ciphertext coefficient corresponding to each compressed ciphertext in the ciphertext group, and determine the shift parameter corresponding to the ciphertext group based on the ciphertext coefficient.
[0167] The ciphertext coefficient can be expressed as the following formula. The participating nodes can obtain the ciphertext coefficients of at least two compressed ciphertexts, and determine the shift parameter T by combining the at least two ciphertext coefficients obtained:
[0168] a k =b (k-1)T (3)
[0169] Among them, a k is the ciphertext coefficient corresponding to the kth compressed ciphertext in the ciphertext group, the maximum value of k is equal to the number of ciphertexts m in the ciphertext group, b is the preset parameter, and T is the shift parameter.
[0170] S604, decrypting each compressed ciphertext in parallel to obtain a compressed plaintext group corresponding to each ciphertext group.
[0171] Each compressed plaintext group contains multiple plaintexts compressed together. For example, a compressed ciphertext of a ciphertext group is obtained by compressing m ciphertexts together. Then, the compressed plaintext group obtained by decrypting the compressed ciphertext also contains m compressed plaintexts.
[0172] Specifically, after obtaining the compressed ciphertext of each ciphertext group, the participating node can obtain the private key used to decrypt the compressed ciphertext, and use the obtained private key to decrypt the compressed ciphertext corresponding to each ciphertext group to obtain the compressed plaintext group corresponding to each ciphertext group. When the participating node uses the private key to decrypt the compressed ciphertext corresponding to each ciphertext group, it can take advantage of the multi-core advantage of the GPU to decrypt the compressed ciphertext corresponding to each ciphertext group in parallel.
[0173] For example, assuming that there are r compressed ciphertexts, the r compressed ciphertexts can be decrypted simultaneously by r computing cores of the GPU, wherein each computing core is used to implement the decryption of the compressed ciphertext corresponding to a ciphertext group.
[0174] S606: Based on the shift parameter, perform a first decompression process on each compressed plaintext group in parallel to obtain at least two sub-compressed plaintexts corresponding to each compressed plaintext group.
[0175] The first decompression process may be a shift operation, which is also called a shift operation, for determining the compressed plaintext contained in the compressed plaintext group, namely the sub-compressed plaintext. The sub-compressed plaintext is the character sequence corresponding to the plaintext to be determined in the compressed plaintext group.
[0176] It should be noted that the compressed plaintext group obtained by decompressing the compressed ciphertext in the embodiment of the present application is a compressed plaintext in a polynomial format. For example, when the preset parameter is 2, the shift parameter is T, and the number of ciphertexts is m, the compressed plaintext group is a group of m*T-bit character sequences composed of "0" and "1", wherein the character sequence from the 1st to Tth bits in the sequence corresponds to the first compressed plaintext, the character sequence from the T+1th to 2Tth bits corresponds to the second compressed plaintext, and so on, the character sequence from the (m-1)*T+1th to the m*Tth bits corresponds to the mth compressed plaintext.
[0177] Specifically, after obtaining each compressed plaintext group and the shift parameter, the participating node can perform a first decompression process on the compressed plaintext group based on the shift parameter to obtain at least two sub-compressed plaintexts corresponding to each compressed plaintext group. For each compressed plaintext group, the participating node can utilize the multi-core advantage of the GPU to perform the first decompression process in parallel.
[0178] S608, determining a modulus parameter based on the shift parameter, and performing a second decompression process on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group.
[0179] The modulo parameter is used to decompress each compressed plaintext to obtain the plaintext corresponding to each compressed plaintext. The second decompression process may be a modulo operation, which is also called a modulo operation.
[0180] Specifically, after obtaining the preset parameters and the shift parameters, the participating nodes determine the modulus parameters based on the preset parameters and the shift parameters, and perform the second decompression processing on each sub-compressed plaintext based on the modulus parameters to obtain the plaintext corresponding to each sub-compressed plaintext, thereby obtaining each plaintext compressed in each compressed plaintext. For each sub-compressed plaintext, the participating nodes can use the multi-core advantage of the GPU to perform the second decompression processing in parallel.
[0181] In the above embodiment, the participating nodes obtain the compressed ciphertext corresponding to each ciphertext group and the shift parameter corresponding to the ciphertext group; decrypt each compressed ciphertext in parallel to obtain a compressed plaintext group corresponding to each ciphertext group; based on the shift parameter, perform a first decompression process on each compressed plaintext group in parallel to obtain at least two sub-compressed plaintexts corresponding to each compressed plaintext group; determine the modulus parameter based on the shift parameter, and perform a second decompression process on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group. By decrypting and decompressing the compressed ciphertext in parallel, the speed of ciphertext decryption and decompression can be improved, thereby improving the operating efficiency of the federated learning task.
[0182] In one embodiment, S606 specifically includes the following steps: based on the shift parameter and the number of ciphertexts in the ciphertext group, determining the number of shift bits corresponding to each compressed plaintext in the compressed plaintext group; taking each compressed plaintext group as a shift template, performing at least two shift processes on each shift template in parallel according to the number of shift bits, to obtain the sub-compressed plaintext corresponding to each compressed plaintext group.
[0183] The number of shift processing times and the number of sub-compressed plaintexts corresponding to each compressed plaintext group are the same as the number of ciphertexts in the ciphertext group.
[0184] It can be understood that the compressed plaintext group obtained by decompressing the compressed ciphertext in the embodiment of the present application is a compressed plaintext in a polynomial format. For example, when the preset parameter is 2, the shift parameter is T, and the number of ciphertexts is m, the compressed plaintext group is a group of m*T-bit character sequences composed of "0" and "1", wherein the character sequence from the 1st to Tth bits in the sequence corresponds to the first compressed plaintext, the character sequence from the T+1th to 2Tth bits corresponds to the second compressed plaintext, and so on, the character sequence from the (m-1)*T+1th to the m*Tth bits corresponds to the mth compressed plaintext.
[0185] Specifically, after obtaining the number of ciphertexts in the ciphertext group, the participating nodes determine the number as the number of compressed plaintexts in the compressed plaintext group, and determine the number of shift bits corresponding to each compressed plaintext in the compressed plaintext group based on the shift parameter and the number of plaintexts, and use the compressed plaintext group as a shift template, and perform shift processing on the shift template according to the determined number of shift bits to obtain the sub-compressed plaintexts corresponding to each compressed plaintext in the compressed plaintext group.
[0186] For example, the shift parameter is T, and the number of ciphertexts in each ciphertext group is m. Then the number of compressed plaintexts in each compressed plaintext group is determined to be m. Then the number of shift bits corresponding to the kth plaintext in any compressed plaintext group is (k-1)*T, k≤m.
[0187] refer to Figure 7 A compressed plaintext group is shown, the compressed plaintext group has a total of 128 bits, and the shift parameter is 32, wherein the sub-compressed plaintext represented by the 0th to 31st bits corresponds to the first plaintext, the sub-compressed plaintext represented by the 32th to 63rd bits corresponds to the second plaintext, the sub-compressed plaintext represented by the 64th to 95th bits corresponds to the third plaintext, and the sub-compressed plaintext represented by the 96th to 127th bits corresponds to the fourth plaintext. The compressed plaintext group is determined as a shift template. Before the shift template is shifted, it is determined that the number of shifts corresponding to the first plaintext is 0, the number of shifts corresponding to the second plaintext is 32, the number of shifts corresponding to the third plaintext is 64, and the number of shifts corresponding to the fourth plaintext is 96. After obtaining the number of shifts corresponding to each compressed plaintext, based on each The number of shift bits corresponding to the plaintexts is used to shift the shift template. Specifically, the parallel multi-core advantage of the GPU can be used to shift the shift template in parallel, so as to obtain the sub-compressed plaintexts corresponding to each compressed plaintext. For example, the core 1, core 2, core 3 and core 4 of the GPU are used to right-shift the shift template according to the number of shift bits 0, 32, 64 and 96, respectively, and the same number of 0s as the number of shift bits are added before the sequence obtained after the shift, so as to obtain new sequence 1, new sequence 2, new sequence 3 and new sequence 4, in which bits 0-32 of the new sequence 1, new sequence 2, new sequence 3 and new sequence 4 are the sub-compressed plaintexts corresponding to the first plaintext, the second plaintext, the third plaintext and the fourth plaintext, respectively.
[0188] In the above embodiment, the participating nodes determine the number of shift bits corresponding to each compressed plaintext in the compressed plaintext group based on the shift parameter and the number of ciphertexts in the ciphertext group; each compressed plaintext group is used as a shift template, and each shift template is shifted at least twice in parallel according to the number of shift bits to obtain the sub-compressed plaintext corresponding to each compressed plaintext group, so that the sub-compressed plaintext to be decompressed can be accurately and quickly extracted from the compressed plaintext group, thereby improving the efficiency of ciphertext decompression.
[0189] In one embodiment, the participating nodes perform a second decompression process on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulo parameter, and the process of obtaining the plaintext in each compressed plaintext group specifically includes the following steps: according to the modulo parameter, the sub-compressed plaintexts corresponding to each compressed plaintext group are respectively performed modulo processing in parallel to obtain the plaintext in each compressed plaintext group.
[0190] Specifically, after the participating nodes obtain the corresponding sub-compressed plaintexts in the compressed plaintext group, they can perform modulo processing on the sub-compressed plaintexts according to the modulo parameter to obtain the modulo result, and determine the obtained modulo result as the plaintext corresponding to the sub-compressed plaintext, thereby obtaining the plaintext in each compressed plaintext group. When the participating nodes perform modulo processing on the sub-compressed plaintexts according to the modulo parameter, the participating nodes can use the multi-core advantage of the GPU to perform modulo processing on each sub-compressed plaintext in parallel.
[0191] For example, Figure 7 The compressed plaintext group shown in the figure, after the shift processing, the 0-32 bits of the new sequence 1, the new sequence 2, the new sequence 3 and the new sequence 4 are the sub-compressed plaintexts corresponding to the first plaintext, the second plaintext, the third plaintext and the fourth plaintext respectively, and the modulus parameter is "2 T ", then in parallel, the sub-compressed plaintexts of the first plaintext, the second plaintext, the third plaintext, and the fourth plaintext are taken as "2 T ", thus obtaining the first plaintext, the second plaintext, the third plaintext and the fourth plaintext respectively.
[0192] In one embodiment, after the participating nodes perform at least two shift processes on each shift template in parallel according to the number of shift bits to obtain a new sequence, they directly perform modulo processing on each new sequence according to the modulo parameter to obtain a modulo result, and determine the new modulo result as the plaintext corresponding to the corresponding sub-compressed plaintext, thereby obtaining the plaintext in each compressed plaintext group.
[0193] For example, Figure 7 The compressed plaintext group shown in the figure is shifted to obtain new sequence 1, new sequence 2, new sequence 3 and new sequence 4. The modulus parameter is "2 T ", then directly take "2" for the new sequence 1, the new sequence 2, the new sequence 3 and the new sequence 4 in parallel T ", thus we can get the first plaintext, the second plaintext, the third plaintext and the fourth plaintext respectively.
[0194] In the above embodiment, the participating nodes can quickly decompress the sub-compressed plaintexts by performing modulo processing on each sub-compressed plaintext in parallel, thereby improving the efficiency of ciphertext decompression.
[0195] As an example, the above ciphertext decompression process is explained. Assume that the participating nodes obtain a compressed ciphertext matrix U′, which contains compressed ciphertexts U′1, U′2, …, U′ corresponding to each ciphertext group. r , where each compressed ciphertext contains m ciphertexts, and there are m*r=n ciphertexts in total. The compressed ciphertexts are v1, v2, ..., v n-1 , v n , after obtaining each compressed ciphertext, the participating nodes can decrypt each to obtain the corresponding compressed plaintext group, which are W′1, W′2, …, W′ r After determining the shift parameter T, decompress each compressed plaintext group based on the shift parameter, thereby completing the decompression of each compressed plaintext group and obtaining the plaintexts corresponding to the n ciphertexts. The plaintexts are represented as p1, p2, ..., p n-1 , p n , wherein the process of decompressing any compressed plaintext can adopt the following formula (11), and the decompression process includes shift processing and modulo processing:
[0196] p (j-1)m+k =(W′ j >>(k-1)T)%s,j∈[1,r],k∈[1,m] (11)
[0197] In the above formula, p (j-1)m+k The compressed ciphertext is v1, v2, ..., v n-1 , v n The plaintext corresponding to the (j-1)m+kth ciphertext in the j-th compressed plaintext group W′ j The kth plaintext compressed in, T is the shift parameter, (k-1)T is the number of shifts, W′ j >>(k-1)T is the compressed plaintext group W′ j Shift right by the number of shift bits (k-1)T, s is the modulus parameter, (W′ j >>(k-1)T)%s represents the difference between W′ j >>(k-1)T takes the modulus of s.
[0198] When a participating node decompresses any compressed plaintext, it can use the advantage of GPU multi-core parallelism to decompress each sub-compressed plaintext in the compressed plaintext, for example Figure 8As shown in the schematic diagram of parallel decryption of each sub-compressed plaintext in the compressed plaintext group W′1, assuming that the compressed plaintext group W′1 contains 8 sub-compressed plaintexts, the 8 cores of the GPU can be used to decompress the 8 sub-compressed plaintexts to obtain the corresponding 8 plaintexts.
[0199] In one embodiment, the above-mentioned ciphertext decompression method also includes the following steps: obtaining a plaintext boundary value; based on the plaintext boundary value, performing negative offset processing on the plaintext in each compressed plaintext group in parallel to obtain the final plaintext.
[0200] It should be noted that the plaintext in each compressed plaintext group obtained by the participating nodes when performing the second decompression processing on the sub-compressed plaintext can be the plaintext obtained by forward offset processing before compression. The plaintext can specifically be obtained by adding a plaintext boundary value to the original plaintext.
[0201] Specifically, after the participating nodes perform the second decompression process on the sub-compressed plaintext to obtain the plaintext in each compressed plaintext group, they can perform negative offset processing on each obtained plaintext based on the plaintext boundary value to obtain the final plaintext, which is the restored plaintext. When the participating nodes perform negative offset processing on each plaintext, they can use the multi-core advantage of GPU to perform negative offset processing on each plaintext in parallel.
[0202] Assuming that the plaintext boundary value is determined to be [-α, α], that is, the upper limit value of the plaintext is α and the lower limit value is -α, then the participating nodes can perform subtraction operations on each plaintext based on the upper limit value α of the plaintext to obtain the final plaintext corresponding to each plaintext, where the plaintext p i The corresponding final plaintext p′ i As shown below:
[0203] p′ i =p i -α,i=1,2,…,n (12)
[0204] In the above embodiment, the participating nodes perform negative offset processing on the decompressed plaintext based on the plaintext boundary value to obtain the final plaintext, thereby ensuring that the final plaintext obtained is consistent with the true value and improving the accuracy of ciphertext decompression; and in the process of negative offset processing, the participating nodes perform negative offset processing on the plaintext in parallel, thereby improving the efficiency of negative offset processing and thereby improving the efficiency of ciphertext decompression.
[0205] The present application also provides an application scenario, and the application scenario applies the above-mentioned ciphertext compression method. Specifically, the application of the ciphertext compression method in the application scenario is as follows: Fig. 9 :
[0206] Step 1: GPU encrypts the plaintexts in the plaintext set P in parallel to obtain the ciphertext set V.
[0207] Among them, the plaintext set P contains n plaintexts, namely p1, p2, ..., p n-1 , p n , encrypt the plaintext set P to obtain the ciphertext set V, which contains n ciphertexts, namely v1, v2, ..., v n-1 , v n .
[0208] Step 2: Group the ciphertexts in the ciphertext set V to obtain ciphertext groups, and determine the ciphertext coefficient matrix (Scale) corresponding to each ciphertext group.
[0209] Specifically, the ciphertext set V can be grouped into groups of m ciphertexts to obtain r ciphertext groups, r = n / m, which are U1, U2, ..., U r-1 , U r , where the ciphertext set U1 contains the ciphertext “v1, …, v m ”, ciphertext set U j Contains the ciphertext "v (j-1)m+1 , ..., v jm ", and so on, the ciphertext set U m Contains the ciphertext "v (r-1)m+1 , ..., v n ". Obtain the plaintext boundary value corresponding to each plaintext, and determine the shift parameter T based on the plaintext boundary value. Determine the ciphertext coefficient corresponding to each ciphertext in the ciphertext group based on the shift parameter T, and obtain the ciphertext coefficient matrix S:
[0210]
[0211] s=2 T
[0212] Step 3: The GPU calculates in parallel the product of each ciphertext in each ciphertext group and the corresponding ciphertext coefficient in the ciphertext coefficient matrix.
[0213] Step 4: The GPU calculates the sum of the products of each ciphertext group in parallel to obtain the compressed ciphertext set U′.
[0214] Among them, step 3 and step 4 can be calculated by referring to the following formula:
[0215]
[0216] Among them, the jth compressed ciphertext in the compressed ciphertext set U′ is as follows:
[0217]
[0218] Where m is the number of ciphertexts contained in any ciphertext group, U′ j is the jth ciphertext group U j The corresponding compressed ciphertext, T is the shift parameter.
[0219] By using GPU parallel computing in each step of the ciphertext compression process, the computational complexity is reduced from O(rm) to O(log(m)), significantly improving the computational efficiency and ciphertext compression efficiency.
[0220] The present application also provides an application scenario, which applies the above-mentioned ciphertext decompression method. Specifically, the application of the ciphertext compression method in this application scenario is described in detail in the following sections. Fig.10 :
[0221] Step 1: GPU decrypts the compressed ciphertext set U′ in parallel to obtain the compressed plaintext set W′.
[0222] Among them, the compressed ciphertext set U′ contains r compressed ciphertext groups, namely U′1, U′2, …, U′ r-1 , U′ r , decompress the compressed ciphertext group to obtain the corresponding compressed plaintext set W′, which contains r compressed plaintext groups, namely W′1, W′2, …, W′ r-1 , W′ r .
[0223] Step 2: GPU decompresses the compressed plaintext groups under the compressed plaintext set W′ in parallel to obtain the entire plaintext set P.
[0224] Specifically, the following formula is used to decompress the compressed plaintext set W′ to obtain the plaintext set P, which contains plaintexts p1, p2, ..., p n-1 , p n .
[0225] p (j-1)m+k =(W′ j >>(k-1)T)%s,j∈[1,r],k∈[1,m]
[0226] In the above formula, p (j-1)m+k The compressed ciphertext is v1, v2, ..., v n-1 , v n The plaintext corresponding to the (j-1)m+kth ciphertext in the j-th compressed plaintext group W′ j The kth plaintext compressed in, T is the shift parameter, (k-1)T is the number of shifts, W′ j >>(k-1)T is the compressed plaintext group W′ j Shift right by the number of shift bits (k-1)T, s is the modulus parameter, (W′ j>>(k-1)T)%s represents the difference between W′ j >>(k-1)T takes the modulus of s.
[0227] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0228] Based on the same inventive concept, the embodiment of the present application also provides a ciphertext compression device for implementing the ciphertext compression method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more ciphertext compression device embodiments provided below can refer to the limitations on the ciphertext compression method above, and will not be repeated here.
[0229] In one embodiment, Fig.11 As shown, a ciphertext compression device is provided, comprising: a ciphertext grouping module 1102, a ciphertext coefficient determination module 1104, a first compression processing module 1106 and a second compression processing module 1108, wherein:
[0230] The ciphertext grouping module 1102 is used to group the ciphertexts obtained by encrypting the plaintexts based on the homomorphic encryption method to obtain ciphertext groups.
[0231] The ciphertext coefficient determination module 1104 is used to determine the ciphertext coefficient corresponding to each ciphertext in the ciphertext group.
[0232] The first compression processing module 1106 is used to perform first compression processing on the ciphertexts in each ciphertext group in parallel based on the ciphertext coefficients to obtain sub-compressed ciphertexts corresponding to the ciphertexts in each ciphertext group.
[0233] The second compression processing module 1108 is used to perform second compression processing on the compressed sub-ciphertexts corresponding to the ciphertexts in each ciphertext group in parallel to obtain compressed ciphertexts corresponding to each ciphertext group.
[0234] In the above embodiment, the ciphertexts obtained by encrypting each plaintext based on the homomorphic encryption method are grouped to obtain a ciphertext group, and the ciphertext coefficient corresponding to each ciphertext in the ciphertext group is determined. Based on the ciphertext coefficient, the ciphertexts in each ciphertext group are respectively subjected to a first compression process in parallel to obtain a sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group. The sub-compressed ciphertexts corresponding to the ciphertext in each ciphertext group are respectively subjected to a second compression process in parallel to obtain a compressed ciphertext corresponding to each ciphertext group. On the one hand, compressing multiple ciphertexts together can reduce the data volume of the ciphertext after data expansion, and then by transmitting the compressed ciphertext when the ciphertext is transmitted, the communication overhead can be reduced. On the other hand, by grouping and compressing multiple ciphertexts in parallel, the speed of ciphertext compression can be increased, thereby reducing the communication overhead and increasing the ciphertext compression speed, improving the data transmission efficiency between different participants, and thereby improving the operation efficiency of the federated learning task.
[0235] In one embodiment, the ciphertext coefficient determination module 1104 is further used to: determine a shift parameter according to a plaintext boundary value; and determine a ciphertext coefficient corresponding to each ciphertext in the ciphertext group according to the shift parameter, the number of ciphertexts in the ciphertext group and a preset parameter.
[0236] In one embodiment, the sub-compressed ciphertext includes a scalar product; the first compression processing module 1106 is further used to: combine all ciphertexts into a ciphertext matrix; construct a ciphertext coefficient matrix based on the ciphertext coefficients corresponding to each ciphertext in the ciphertext group; and determine the scalar product between the ciphertext of each ciphertext group in the ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix in a parallel manner.
[0237] In one embodiment, the first compression processing module 1106 is further used to: based on the plaintext boundary value, perform forward offset processing on the ciphertext of each ciphertext group in the ciphertext matrix in parallel to obtain an intermediate ciphertext matrix; the intermediate ciphertext in the intermediate ciphertext matrix is obtained by performing forward offset processing on the ciphertext; and determine the scalar product between the intermediate ciphertext corresponding to each ciphertext group in the intermediate ciphertext matrix and the ciphertext coefficient in the ciphertext coefficient matrix in parallel to obtain the scalar product corresponding to each ciphertext in each ciphertext group.
[0238] In one embodiment, the second compression processing module 1108 is further used to: for each ciphertext group in the ciphertext matrix, sum the sub-compressed ciphertexts corresponding to the ciphertext in the current ciphertext group in parallel, and sum the sum values corresponding to the obtained current ciphertext group in parallel, until the total sum value corresponding to the current ciphertext group is obtained; and determine the total sum value corresponding to each current ciphertext group as the compressed ciphertext in turn.
[0239] In one embodiment, the ciphertext grouping module 1102 is further used to: obtain plaintext to be encrypted; and based on the homomorphic encryption method, homomorphically encrypt each plaintext in parallel to obtain the ciphertext.
[0240] In one embodiment, the ciphertext grouping module 1102 is further used to: receive exchange ciphertexts sent by other nodes; and perform privacy calculations on the exchange ciphertexts based on the plaintexts of the local node to obtain ciphertexts.
[0241] In one embodiment, the ciphertext grouping module 1102 is further used to: perform homomorphic encryption on each plaintext in parallel to obtain an initial ciphertext; and perform privacy calculation on the exchanged ciphertext based on the initial ciphertext to obtain a ciphertext.
[0242] Based on the same inventive concept, the embodiment of the present application also provides a ciphertext decompression device for implementing the ciphertext decompression method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more ciphertext decompression device embodiments provided below can refer to the limitations on the ciphertext decompression method above, and will not be repeated here.
[0243] In one embodiment, Fig.12 As shown, a ciphertext decompression device is provided, comprising: a ciphertext acquisition module 1202, a ciphertext decryption module 1204, a first decompression processing module 1206 and a second decompression processing module 1208, wherein:
[0244] The ciphertext acquisition module 1202 is used to obtain the compressed ciphertext corresponding to each ciphertext group and the shift parameter corresponding to the ciphertext group.
[0245] The ciphertext decryption module 1204 is used to decrypt each compressed ciphertext in parallel to obtain a compressed plaintext group corresponding to each ciphertext group.
[0246] The first decompression processing module 1206 is used to perform a first decompression processing on each compressed plaintext group in parallel based on the shift parameter to obtain at least two sub-compressed plaintexts corresponding to each compressed plaintext group.
[0247] The second decompression processing module 1208 is used to determine the modulus parameter based on the shift parameter, and perform a second decompression process on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group.
[0248] In the above embodiment, compressed ciphertexts corresponding to each ciphertext group and shift parameters corresponding to the ciphertext group are obtained; each compressed ciphertext is decrypted in parallel to obtain a compressed plaintext group corresponding to each ciphertext group; based on the shift parameter, a first decompression process is performed on each compressed plaintext group in parallel to obtain at least two sub-compressed plaintexts corresponding to each compressed plaintext group; a modulus parameter is determined based on the shift parameter, and a second decompression process is performed on at least two sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintext in each compressed plaintext group. By decrypting and decompressing the compressed ciphertext in parallel, the speed of ciphertext decryption and decompression can be improved, thereby improving the operating efficiency of the federated learning task.
[0249] In one embodiment, the first decompression processing module 1206 is further used to: determine the number of shift bits corresponding to each compressed plaintext in the compressed plaintext group based on the shift parameter and the number of ciphertexts in the ciphertext group;
[0250] Each compressed plaintext group is used as a shift template, and each shift template is shifted at least twice in parallel according to the number of shift bits to obtain a sub-compressed plaintext corresponding to each compressed plaintext group; wherein the number of shift processes and the number of sub-compressed plaintexts corresponding to each compressed plaintext group are the same as the number of ciphertexts in the ciphertext group.
[0251] In one embodiment, the second decompression processing module 1208 is further used to: perform modulo processing on the sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulo parameter to obtain the plaintexts in each compressed plaintext group.
[0252] In one embodiment, the device also includes a plaintext recovery module, which is used to: obtain a plaintext boundary value; based on the plaintext boundary value, perform negative offset processing on the plaintext in each compressed plaintext group in parallel to obtain the final plaintext.
[0253] Each module in the above-mentioned ciphertext compression device or ciphertext decompression device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0254] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.13As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store plaintext and / or ciphertext data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a ciphertext compression method and / or a ciphertext decompression method is implemented.
[0255] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.14 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a ciphertext compression method and / or a ciphertext decompression method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0256] Those skilled in the art will understand that Fig.13 or Fig.14The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0257] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0258] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0259] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0260] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0261] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0262] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0263] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A ciphertext compression method, It is characterized in that The method comprises: The ciphertexts obtained by encrypting the plaintexts based on the homomorphic encryption method are grouped to obtain ciphertext groups; Determining a ciphertext coefficient corresponding to each ciphertext in the ciphertext group; Combining all the ciphertexts into a ciphertext matrix; constructing a ciphertext coefficient matrix based on the ciphertext coefficients corresponding to each ciphertext in the ciphertext group; determining in parallel the scalar product between the ciphertext of each ciphertext group in the ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix, respectively, to obtain a sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group; For each of the ciphertext groups in the ciphertext matrix, the sub-compressed ciphertexts corresponding to the ciphertexts in the current ciphertext group are grouped in parallel to obtain sub-compressed ciphertext groups, the sub-compressed ciphertexts in each of the sub-compressed ciphertext groups are summed in parallel to obtain the sum values corresponding to each of the sub-compressed ciphertext groups, and the sum values corresponding to the sub-compressed ciphertext groups are grouped and summed until the sum value corresponding to the current ciphertext group is obtained; the sum values corresponding to each of the current ciphertext groups are sequentially determined as compressed ciphertexts to obtain compressed ciphertexts corresponding to each of the ciphertext groups.
2. The method according to claim 1, It is characterized in that The determining of the ciphertext coefficient corresponding to each ciphertext in the ciphertext group includes: Determine the shift parameter according to the plaintext boundary value; The ciphertext coefficient corresponding to each ciphertext in the ciphertext group is determined according to the shift parameter, the number of ciphertexts in the ciphertext group and a preset parameter.
3. The method according to claim 1, It is characterized in that The method further comprises: Based on the plaintext boundary value, forward offset processing is performed on the ciphertexts of each of the ciphertext groups in the ciphertext matrix in parallel to obtain an intermediate ciphertext matrix; the intermediate ciphertexts in the intermediate ciphertext matrix are obtained by forward offset processing of the ciphertexts; The step of respectively determining in parallel the scalar product between the ciphertext of each ciphertext group in the ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix comprises: The scalar products between the intermediate ciphertexts corresponding to each of the ciphertext groups in the intermediate ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix are determined in parallel to obtain the scalar products corresponding to each ciphertext in each of the ciphertext groups.
4. The method according to claim 1, It is characterized in that The method further comprises: Get the plaintext to be encrypted; Based on the homomorphic encryption method, each of the plaintexts is homomorphically encrypted in parallel to obtain the ciphertext.
5. The method according to claim 1, It is characterized in that The method further comprises: Receive exchange ciphertext sent by other nodes; The exchanged ciphertext is privacy-calculated based on the plaintexts of the local node to obtain the ciphertext.
6. The method according to claim 5, It is characterized in that The performing privacy calculation on the exchanged ciphertext based on each plaintext of the local node to obtain the ciphertext includes: Performing homomorphic encryption on each of the plaintexts in parallel to obtain an initial ciphertext; The exchange ciphertext is subjected to privacy calculation based on the initial ciphertext to obtain the ciphertext.
7. A ciphertext decompression method, It is characterized in that The method comprises: Obtain compressed ciphertexts corresponding to each ciphertext group and shift parameters corresponding to the ciphertext group; the compressed ciphertext is obtained by determining the ciphertext coefficients corresponding to each ciphertext in the ciphertext group; combining all the ciphertexts into a ciphertext matrix; constructing a ciphertext coefficient matrix based on the ciphertext coefficients corresponding to each ciphertext in the ciphertext group; determining the scalar product between the ciphertext of each ciphertext group in the ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix in parallel to obtain sub-compressed ciphertexts corresponding to the ciphertexts in each ciphertext group; for each ciphertext group in the ciphertext matrix, grouping the sub-compressed ciphertexts corresponding to the ciphertexts in the current ciphertext group in parallel to obtain sub-compressed ciphertext groups, summing the sub-compressed ciphertexts in each sub-compressed ciphertext group in parallel to obtain the sum values corresponding to each sub-compressed ciphertext group, grouping and summing the sum values corresponding to the sub-compressed ciphertext groups until the sum value corresponding to the current ciphertext group is obtained; sequentially determining the sum values corresponding to each current ciphertext group as compressed ciphertexts; Decrypting the compressed ciphertexts in parallel to obtain compressed plaintext groups corresponding to the ciphertext groups; Based on the shift parameter and the number of ciphertexts in the ciphertext group, determine the number of shift bits corresponding to each compressed plaintext in the compressed plaintext group; use each compressed plaintext group as a shift template, and perform at least two shift processes on each shift template in parallel according to the number of shift bits to obtain a sub-compressed plaintext corresponding to each compressed plaintext group; wherein the number of shift processes and the number of sub-compressed plaintexts corresponding to each compressed plaintext group are the same as the number of ciphertexts in the ciphertext group; A modulo parameter is determined based on the shift parameter, and a modulo process is performed on the sub-compressed plaintexts corresponding to each of the compressed plaintext groups in parallel according to the modulo parameter to obtain the plaintexts in each of the compressed plaintext groups.
8. The method according to claim 7, It is characterized in that The method further comprises: Get the plaintext boundary value; Based on the plaintext boundary value, negative offset processing is performed on the plaintexts in each of the compressed plaintext groups in parallel to obtain final plaintexts.
9. A ciphertext compression device, It is characterized in that The device comprises: A ciphertext grouping module is used to group the ciphertexts obtained by encrypting the plaintexts based on the homomorphic encryption method to obtain ciphertext groups; A ciphertext coefficient determination module, used to determine the ciphertext coefficient corresponding to each ciphertext in the ciphertext group; The first compression processing module is used to combine all the ciphertexts into a ciphertext matrix; construct a ciphertext coefficient matrix based on the ciphertext coefficients corresponding to each ciphertext in the ciphertext group; and determine the scalar product between the ciphertext of each ciphertext group in the ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix in a parallel manner to obtain a sub-compressed ciphertext corresponding to the ciphertext in each ciphertext group; The second compression processing module is used for grouping the sub-compressed ciphertexts corresponding to the ciphertexts in the current ciphertext group in parallel for each ciphertext group in the ciphertext matrix to obtain sub-compressed ciphertext groups, summing the sub-compressed ciphertexts in each sub-compressed ciphertext group in parallel to obtain the sum value corresponding to each sub-compressed ciphertext group, grouping and summing the sum values corresponding to the sub-compressed ciphertext groups until the sum value corresponding to the current ciphertext group is obtained; and determining the sum values corresponding to each current ciphertext group as compressed ciphertext in turn to obtain the compressed ciphertext corresponding to each ciphertext group.
10. The device according to claim 9, It is characterized in that The ciphertext coefficient determination module is also used for: Determine the shift parameter according to the plaintext boundary value; The ciphertext coefficient corresponding to each ciphertext in the ciphertext group is determined according to the shift parameter, the number of ciphertexts in the ciphertext group and a preset parameter.
11. The device according to claim 9, It is characterized in that The first compression processing module is also used for: Based on the plaintext boundary value, performing forward offset processing on the ciphertext of each of the ciphertext groups in the ciphertext matrix in parallel to obtain an intermediate ciphertext matrix; The intermediate ciphertext in the intermediate ciphertext matrix is obtained by performing a forward offset process on the ciphertext; The scalar products between the intermediate ciphertexts corresponding to each of the ciphertext groups in the intermediate ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix are determined in parallel to obtain the scalar products corresponding to each ciphertext in each of the ciphertext groups.
12. The device according to claim 9, It is characterized in that The ciphertext grouping module is also used for: Get the plaintext to be encrypted; Based on the homomorphic encryption method, each of the plaintexts is homomorphically encrypted in parallel to obtain the ciphertext.
13. The device according to claim 9, It is characterized in that The ciphertext grouping module is also used for: Receive exchange ciphertext sent by other nodes; The exchanged ciphertext is privacy-calculated based on the plaintexts of the local node to obtain the ciphertext.
14. The device according to claim 13, It is characterized in that The ciphertext grouping module is also used for: Performing homomorphic encryption on each of the plaintexts in parallel to obtain an initial ciphertext; The exchange ciphertext is subjected to privacy calculation based on the initial ciphertext to obtain the ciphertext.
15. A ciphertext decompression device, It is characterized in that The device comprises: A ciphertext acquisition module is used to obtain compressed ciphertexts corresponding to each ciphertext group and shift parameters corresponding to the ciphertext group; the compressed ciphertext is obtained by determining the ciphertext coefficients corresponding to each ciphertext in the ciphertext group; combining all the ciphertexts into a ciphertext matrix; constructing a ciphertext coefficient matrix based on the ciphertext coefficients corresponding to each ciphertext in the ciphertext group; determining the scalar product between the ciphertext of each ciphertext group in the ciphertext matrix and the ciphertext coefficients in the ciphertext coefficient matrix in parallel to obtain sub-compressed ciphertexts corresponding to the ciphertexts in each ciphertext group; for each ciphertext group in the ciphertext matrix, grouping the sub-compressed ciphertexts corresponding to the ciphertexts in the current ciphertext group in parallel to obtain sub-compressed ciphertext groups, summing the sub-compressed ciphertexts in each sub-compressed ciphertext group in parallel to obtain the sum values corresponding to each sub-compressed ciphertext group, grouping and summing the sum values corresponding to the sub-compressed ciphertext groups until the sum value corresponding to the current ciphertext group is obtained; and sequentially determining the sum values corresponding to each current ciphertext group as compressed ciphertexts; A ciphertext decryption module, used to decrypt the compressed ciphertexts in parallel to obtain compressed plaintext groups corresponding to the ciphertext groups; A first decompression processing module is used to determine the number of shift bits corresponding to each compressed plaintext in the compressed plaintext group based on the shift parameter and the number of ciphertexts in the ciphertext group; using each compressed plaintext group as a shift template, and performing at least two shift processes on each shift template in parallel according to the number of shift bits, to obtain a sub-compressed plaintext corresponding to each compressed plaintext group; wherein the number of shift processes and the number of sub-compressed plaintexts corresponding to each compressed plaintext group are the same as the number of ciphertexts in the ciphertext group, and at least two sub-compressed plaintexts corresponding to each compressed plaintext group are obtained; The second decompression processing module is used to determine a modulus parameter based on the shift parameter, and perform modulus processing on the sub-compressed plaintexts corresponding to each compressed plaintext group in parallel according to the modulus parameter to obtain the plaintexts in each compressed plaintext group.
16. The device according to claim 15, It is characterized in that The device also includes a plaintext recovery module, which is used to: Get the plaintext boundary value; Based on the plaintext boundary value, negative offset processing is performed on the plaintexts in each of the compressed plaintext groups in parallel to obtain final plaintexts.
17. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
18. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
19. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
