CN114444706A - Data processing method, device, equipment and storage medium - Google Patents

Data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114444706A
CN114444706A CN202011193765.3A CN202011193765A CN114444706A CN 114444706 A CN114444706 A CN 114444706A CN 202011193765 A CN202011193765 A CN 202011193765A CN 114444706 A CN114444706 A CN 114444706A
Authority
CN
China
Prior art keywords
right shift
data
encrypted
client terminal
subdata
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011193765.3A
Other languages
Chinese (zh)
Inventor
卓本刚
黄启军
陈瑞钦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202011193765.3A priority Critical patent/CN114444706A/en
Publication of CN114444706A publication Critical patent/CN114444706A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption

Abstract

The invention discloses a data processing method, a device, equipment and a storage medium, wherein the method is applied to a first client terminal and comprises the following steps: the first client terminal determines right shift digits of a plurality of right shift stages according to the total digits of the data to be encrypted, wherein the right shift is that bit data in the data to be encrypted moves from the high order of the data to be encrypted to the low order of the data to be encrypted; and each subdata divided by the data to be encrypted is subjected to right shift processing sequentially according to the right shift number of each right shift stage to obtain a right shift result, the right shift result is used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning. The invention improves the encryption efficiency of federal learning by improving the right shift efficiency.

Description

Data processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a data processing method, apparatus, device, and storage medium.
Background
In the machine learning modeling process, data plays a vital role in the performance of the machine learning model, and the more high-quality data, the better the performance of the machine learning model. Since the data usually contains the private information of the user, the data is often required to be encrypted and protected in the machine learning modeling process.
As a novel machine Learning framework, Federal Learning (also called joint Learning and league Learning) helps multiple organizations to use data and model machine Learning by distributed training and data encryption under the condition of meeting the requirements of user privacy protection and data safety, and can protect user privacy and fully mine data values of all parties.
In order to improve the encryption effect, the encryption mode used by federal study is asymmetric encryption. However, the BIT width of data participating in calculation in asymmetric encryption is large, for example, 256 BITs (BIT for short, also referred to as "BIT"), 512 BITs, and 1024 BITs, and in shift operation, the shift efficiency of these high BIT widths still needs to be improved, which results in that the encryption efficiency in federal learning also needs to be improved.
Disclosure of Invention
The invention mainly aims to provide a data processing method, a data processing device, data processing equipment and a data processing storage medium, and aims to solve the technical problem that the encryption efficiency needs to be improved in federal learning.
In order to achieve the above object, the present invention provides a data processing method, which is applied to a first client terminal, and includes:
the first client terminal determines right shift digits of a plurality of right shift stages according to the total digits of the data to be encrypted, wherein the right shift refers to the movement of bit data in the data to be encrypted from the high order of the data to be encrypted to the low order of the data to be encrypted;
and carrying out right shift processing on each subdata divided by the data to be encrypted according to the right shift number of each right shift stage in sequence to obtain a right shift result, wherein the right shift result is used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning.
In a possible implementation manner, the right shift stages include a first right shift stage and a second right shift stage, and performing right shift processing on each subdata obtained by dividing the data to be encrypted according to the right shift number of each right shift stage in sequence to obtain a right shift result, including:
performing right shift processing on each subdata according to the right shift number of the first right shift stage to obtain intermediate data;
and performing right shift processing on the intermediate data according to the right shift number of the second right shift stage to obtain a right shift result.
In a possible implementation manner, the right shift number of the first right shift stage is a first right shift number, the right shift number of the second right shift stage is a second right shift number, the first right shift number is an integer multiple of the bit width of the sub data, and performing right shift processing on each sub data according to the right shift number of the first right shift stage to obtain intermediate data includes:
with subdata as a unit, parallelly right-shifting each subdata by the first right-shift number to obtain intermediate data;
the right shift processing is performed on the intermediate data according to the right shift number of the second right shift stage to obtain a right shift result, including:
and with the bit data in the intermediate data as a unit, performing parallel right shift on each bit data by the second right shift number to obtain the right shift result.
In a possible implementation manner, the determining, by the first client terminal, right shift bits of multiple right shift stages according to a total number of bits to be right-shifted of the data to be encrypted includes:
and determining the right shift digits of the multiple right shift stages according to the total digit of the data to be encrypted needing right shift and the bit width of the subdata.
In a possible implementation manner, the determining the right shift numbers of the multiple right shift stages according to the total number of bits to be right-shifted of the data to be encrypted and the bit width of the sub data includes:
determining a first right shift digit according to the total digit and the bit width of the subdata, wherein the first right shift digit is a right shift digit of the first right shift stage, and the first right shift digit is an integral multiple of the bit width of the subdata;
and determining a second right shift number according to the bit width of the subdata, the total bit number and the first right shift number, wherein the second right shift number is the right shift number of the second right shift stage, the second right shift number is smaller than the bit width of the subdata, and the sum of the first right shift number and the second right shift number is equal to the total bit number.
In one possible implementation manner, the data to be encrypted includes one or more of the following items: the local training user data of the first client terminal and the model parameters of the federal learning model obtained by the training of the first client terminal are obtained;
wherein the training user data is used to train the federated learning model.
In a possible implementation manner, before the determining, by the first client terminal, the right shift number of the multiple right shift stages according to the total number of bits to be right-shifted of the data to be encrypted, the method further includes:
the first client terminal receives a request message from a second client terminal or a server, wherein the request message requests to acquire data for federal learning;
acquiring the total number of bits of the data to be encrypted, which need to be shifted to the right, according to the encryption mode of the data used for federal learning;
and after each subdata divided by the data to be encrypted is subjected to right shift processing sequentially according to the right shift number of the right shift stage to obtain a right shift result, the method further comprises the following steps:
obtaining the encrypted data to be encrypted according to the right shift result;
and the first client terminal sends the encrypted data to be encrypted to the second client terminal or the server.
In a possible implementation manner, the obtaining of the total number of bits to be right-shifted of the data to be encrypted according to the encryption mode of the data for federal learning includes
And if the encryption mode comprises division operation on the data to be encrypted, the first client terminal acquires the total digit of the data to be encrypted, which needs to be shifted to the right, according to the division operation.
The present invention also provides a data processing apparatus comprising:
the determining module is used for determining right shift numbers of a plurality of right shift stages according to the total number of bits of the data to be encrypted, wherein the right shift refers to the movement of bit data in the data to be encrypted from the high bit of the data to be encrypted to the low bit of the data to be encrypted;
and the right shift module is used for performing right shift processing on each subdata divided by the data to be encrypted according to the right shift number of each right shift stage in sequence to obtain a right shift result, wherein the right shift result is used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning.
The present invention also provides a data processing apparatus, including: memory, a processor and a data processing program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the data processing method according to any of the preceding claims.
The invention also provides a computer readable storage medium having stored thereon a data processing program which, when executed by a processor, implements the steps of the data processing method as claimed in any one of the preceding claims.
In the invention, on one hand, the first client terminal performs right shift on the subdata with smaller bit width to replace the right shift of the data to be encrypted, so that the right shift efficiency of the data to be encrypted is improved; and on the other hand, the right shift numbers of a plurality of right shift stages are determined according to the total number of bits to be shifted to the right of the data to be encrypted, and each subdata is subjected to right shift processing sequentially according to the right shift number of each right shift stage to obtain a right shift result, so that the right shift efficiency of the data to be encrypted is improved. The right shift result can be used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning, so that the data safety protection of the federal learning is realized. Therefore, the invention effectively improves the encryption efficiency of the federal learning by improving the right shift efficiency of the data to be encrypted, thereby improving the model training efficiency of the federal learning.
Drawings
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present invention;
fig. 2 is a schematic flow chart of a data processing method according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating another data processing method according to an embodiment of the present invention;
fig. 4 is a diagram illustrating an example of a process of right-shifting data to be encrypted according to an embodiment of the present invention;
FIG. 5 is a flow chart illustrating another data processing method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention;
FIG. 7 is a block diagram of another data processing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
With the development of computer technology and the popularization of big data application, the machine learning model can dig out valuable information from the big data, and meanwhile, the high-quality data is beneficial to improving the performance of the machine learning model. Since the big data usually contains user information, data encryption is needed in the machine learning modeling process in order to protect the user information.
Under the technical framework of federal learning, data encryption is particularly needed to meet the requirements of user privacy protection and data security, and the data encryption method can help multi-party organizations to use data and learn machines.
For further understanding of the embodiment of the present invention, fig. 1 is a schematic view of an application scenario provided in the embodiment of the present invention. As shown in fig. 1, the application scenario is a federal learning scenario in which a server and a plurality of client terminals (client terminal 1, client terminal 2, … …, client terminal k) may participate in the federal learning process.
As shown in fig. 1, the server issues a global federal learning model to each client terminal, where the federal learning model is a machine learning model, such as a convolutional neural network model. And each client terminal trains the federal learning model issued by the server by using the local data to obtain model parameters of the federal learning model. And each client terminal uploads the model parameters of the federal learning model obtained by respective training to a server. And the server aggregates the model parameters uploaded by each client terminal to obtain an updated global federal learning model. And repeating the processes in sequence until the global federal learning model converges.
The model parameters of the federal learning model include one or more of neural network weights of the federal learning model and loss values of a loss function after the federal learning model is trained. The neural network weights and the loss values of the loss functions of the federated learning model may specifically refer to the relevant knowledge of the machine learning model training, which is not described in detail in the embodiments of the present invention.
In the federal learning process, in addition to data communication between the server and each client terminal, each client terminal may also perform data communication with each other.
For example, since different client terminals have different user data, the client terminals communicate the user data to each other in order to improve the training effect of the federal learning model of the client terminals.
When a client terminal sends data to a server or sends data to another client terminal, the client terminal encrypts the data locally and sends the encrypted data to the server or the client terminal so as to realize the safety protection of the data in federal learning.
For example, before a client terminal sends locally stored user data to other client terminals, the user data may be encrypted and then sent out to protect user privacy.
The user data includes, for example, one or more of the following: age, occupation, income amount, expenditure amount, debt amount, and credit rating of the user.
The client terminal may be a computer, a server, or other devices.
In order to solve the problem of low data encryption efficiency in a federal learning scene, the embodiment of the invention provides a scheme, which relates to a data encryption process in federal learning. In the scheme, a first client terminal in a federal learning scene determines the right shift bits of a plurality of right shift stages according to the total bits to be shifted to the right of data to be encrypted. And performing right shift processing on each subdata in the data to be encrypted according to the right shift numbers of the plurality of right shift stages in sequence to obtain a right shift result, wherein the right shift result is used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning. According to the scheme, the right shift efficiency of the data to be encrypted is improved, and the encryption efficiency of the data to be encrypted is further improved. The first client terminal and the second client terminal are different client terminals under the same federal learning scene.
In this scheme, the right shift refers to the shift of each bit of data in the data to be encrypted from the upper bits of the data to be encrypted to the lower bits of the data to be encrypted.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The features of the embodiments and examples described below may be combined with each other without conflict between the embodiments.
Fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present invention. The execution subject of the method in this embodiment may be the client terminal in fig. 1. The method in this embodiment may be implemented by software, hardware, or a combination of software and hardware. As shown in fig. 2, the method may include:
step 201, the first client terminal determines the right shift digits of a plurality of right shift stages according to the total digits of the data to be encrypted, which need to be shifted to the right.
Wherein the data to be encrypted may be stored in a memory local to the first client terminal. In memory, the data to be encrypted is typically stored in memory in a particular data format, such as a floating point number format.
Optionally, the data to be encrypted includes one or more of the following items: the user data of the local training of the first client terminal and the model parameters of the federal learning model obtained by the training of the first client terminal.
Wherein the training user data comprises user data managed by the first client terminal, and the training user data can be used by the first client terminal to train the federal learning model in the federal learning. For example, the training user data includes one or more of age, occupation, income amount, expenditure amount, debt amount, and credit rating of the user. Further, the data content of the data to be encrypted may include, for example, image information such as an image of the face of the user, text information such as a debit record of the user, and the like.
The model parameters of the federal learning model obtained by the first client terminal training are model parameters of the federal learning model obtained by the first client terminal training based on training user data.
Specifically, the first client terminal may read data to be encrypted from a local memory to encrypt the data to be encrypted. In the encryption process, the encrypted data may be converted into a binary integer from a data format during storage, so as to perform encryption processing on the encrypted data, for example, converting from a floating point number format into a binary integer. For example, the data to be encrypted represented in floating point number format is 1.0 × e10Since the exponent of the floating-point number is large, the bit width of the binary integer obtained by conversion is also large.
It should be noted that, in the encryption process, except before right shift processing is performed on the data to be encrypted, which may be converted into a binary format, has undergone multiplication, addition, and left shift processing. Therefore, when the data to be encrypted is right-shifted, the output of the previous processing operation needs to be obtained, that is, the processing result obtained by performing one or more processing operations on the data to be encrypted in the encryption process is right-shifted.
Specifically, after the data to be encrypted that has undergone the previous processing is obtained, the data to be encrypted may be divided into one or more sub-data. In order to uniformly shift each sub data, each sub data may be divided into binary integers with equal bit width during division, in other words, each sub data has the same bit width.
Taking the binary data with 256 bits as an example, the binary data with 256 bits can be divided into 2 128-bit subdata, 4 64-bit subdata, or 8 32-bit subdata, because the bit width of the binary data with 256 bits is large.
Optionally, in the process of dividing the local data to be encrypted into one or more sub-data, the first client terminal obtains one or more sub-data in sequence from the lower bit to the higher bit of the data to be encrypted, and in accordance with the data type of the data to be encrypted, every bit width occupied by the integer number of the data type.
When the data type of the data to be encrypted is a binary integer, the bit width of the sub-data may be the bit width of the integer number in the binary integer. In binary, the integer number includes a short integer number having a bit width of 16 bits and a long integer number having a bit width of 32 bits. Therefore, one or more sub-data with a bit width of 16 bits may be obtained by division, or one or more sub-data with a bit width of 32 bits may be obtained by division.
Optionally, a bit width threshold is preset, and it is detected whether the bit width of the data to be encrypted, which has undergone the previous processing procedure, exceeds the bit width threshold, if so, the data to be encrypted is divided into one or more subdata with the same bit width. When the bit width of the data to be encrypted exceeds the bit width threshold, performing sub-data division and subsequent staged right shift processing on the data to be encrypted, otherwise, directly performing right shift on the data to be encrypted, namely, directly moving each bit data in the data to be encrypted from a high bit to a low bit. Therefore, the situation division processing is carried out according to the bit width of the data to be encrypted, and the right shift effect of the data to be encrypted is improved.
Specifically, in the process of encrypting the data to be encrypted, a plurality of different processing operations may all require right-shifting the data to be encrypted. For example, when the data to be encrypted is divided, the division operation of the data to be encrypted is required to be implemented by right shifting the data to be encrypted. Therefore, the total number of bits that the data to be encrypted needs to be right-shifted can be obtained from the processing operation for calling the right shift processing, which is preset by the developer in the process of designing the encryption processing of the data to be encrypted. Or, the total number of bits that the data to be encrypted needs to be right shifted, which is preset by the user, can be obtained.
Specifically, after the total digits of the data to be encrypted, which need to be right-shifted, are obtained, the total digits can be divided into the right-shift digits of each right-shift stage according to the number of the preset right-shift stages, so that after the data to be encrypted is right-shifted by each right-shift stage, the number of the digits of the data to be encrypted, which are moved to the right, is the total digits.
Optionally, the total number of bits is divided averagely according to the number of the right shift stages to obtain the right shift number of each right shift stage, and the right shift numbers of each right shift stage are equal.
Optionally, the total number of bits is divided according to the bit width of the sub-data, the right shift number of the first right shift stage is determined as h times of the bit width of the sub-data, the right shift number of the second right shift stage is determined as h-1 times of the bit width of the sub-data, and so on until the divided remaining right shift number is smaller than the bit width of the sub-data, and the remaining right shift number is determined as the right shift number of the last right shift stage. Wherein h is a preset integer and h is greater than or equal to 2. Therefore, by dividing according to the bit width of the subdata, it is beneficial to perform right shift processing on each subdata according to the right shift number of each right shift stage.
Step 202, performing right shift processing on each subdata obtained by dividing the data to be encrypted according to the right shift number of each right shift stage in sequence to obtain a right shift result, wherein the right shift result is used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning.
Specifically, after obtaining the right shift numbers of the right shift stages, the first client terminal performs right shift processing on each subdata sequentially according to the right shift numbers of the right shift stages to obtain a right shift result.
Specifically, in the first right shift stage, each sub-data is shifted to the right by the right shift number of the first right shift stage, so as to obtain a right shift result of the first right shift stage. In the second right shift stage, the right shift result of the first right shift stage is moved to the right shift number of the second right shift stage, and the right shift result of the second right shift stage is obtained. And repeating the steps until the right shift processing of the last right shift stage is finished, and obtaining a final right shift result.
Optionally, when the total number of bits is divided according to the bit width of the sub-data, and the right shift number of the first right shift stage is determined as h times of the bit width of the sub-data, and the right shift number of the second right shift stage is determined as h-1 times of the bit width of the sub-data, each sub-data may be shifted to the right by h sub-data in the first right shift stage, each sub-data shifted to the right by h-1 sub-data in the second right shift stage, and so on. Therefore, the method is used for carrying out stage division, the right shift efficiency of the subdata is effectively improved, and the right shift efficiency of the data to be encrypted is further improved.
In the embodiment of the invention, on the first client terminal, the local data to be encrypted is divided into one or more subdata with the same bit width, and the right shift numbers of a plurality of right shift stages are determined according to the total number of bits to be shifted to the right of the data to be encrypted. And carrying out right shift processing on each subdata according to the right shift numbers of the plurality of right shift stages in sequence to obtain a right shift result. Therefore, the data to be encrypted is subjected to sub-data division and right shift of multiple stages, so that the right shift processing efficiency of the data to be encrypted is improved, the encryption efficiency of the data to be encrypted is improved, the data communication efficiency among the client terminals and between the client terminals and the server in the federal learning process can be improved, and the model training efficiency of the federal learning is further improved.
Optionally, the processor of the first client terminal reads the data to be encrypted from the memory of the first client terminal, and converts the data to be encrypted into a binary integer, so as to encrypt the data to be encrypted. In the encryption processing process, if the right shift processing is involved, the processor calls the auxiliary arithmetic unit, the data to be encrypted and the right shift number of the data to be encrypted are transmitted to the auxiliary arithmetic unit, and the auxiliary arithmetic unit carries out the right shift processing on the data to be encrypted.
The auxiliary arithmetic Unit is a Programmable circuit chip, such as a Graphics Processing Unit (GPU) or a Programmable Gate Array (Programmable Gate Array) chip. In the auxiliary arithmetic unit, 1 is represented by high level and 0 is represented by low level, and further, the right shift processing of binary data is realized by a multi-path circuit.
In particular, the auxiliary operator may be a Field Programmable Gate Array (FPGA) chip. The FPGA chip is a semi-customized circuit chip, is a programmable logic array, and has the characteristics of rich wiring resources, repeated programming and high integration level. For example, a developer can design a right shift operation code, and finally configure the code in the FPGA chip by using a programmable logic block in the FPGA chip through processes of simulation, debugging and the like of the code, so that the FPGA chip realizes a right shift operation function.
Fig. 3 is a flowchart illustrating a data processing method according to an embodiment of the present invention. The execution subject of the method in this embodiment may be the client terminal in fig. 1. The method in this embodiment may be implemented by software, hardware, or a combination of software and hardware. As shown in fig. 3, the method may include:
step 301, the first client terminal determines a first right shift number and a second right shift number according to the total number of bits to be right-shifted of the data to be encrypted and the bit width of the subdata obtained by dividing the data to be encrypted.
For a specific implementation principle and process of dividing data to be encrypted to obtain sub-data, reference may be made to the foregoing embodiments, which are not described herein again.
The plurality of right shift stages of the data to be encrypted comprise a first right shift stage and a second right shift stage, so that the two right shift stages of the first right shift stage and the second right shift stage are used for realizing the staged right shift of the data to be encrypted and improving the right shift efficiency of the data to be encrypted.
The first right shift number refers to a right shift number of each subdata in the first right shift stage. The second right shift number is the right shift number of each bit of data in the second right shift stage.
Specifically, the total number of bits to be right-shifted of the data to be encrypted is obtained. After determining the bit width of the subdata, a first right shift number can be determined according to the total bit number of the data to be encrypted, which needs to be shifted to the right, and the bit width of the subdata, a second right shift number is determined according to the bit width, the total bit number and the second right shift number of the subdata, so that the first right shift number is determined first, then the second right shift number is determined, the correlation between the first right shift number and the second right shift number is ensured, the first right shift number and the second right shift number are determined based on the bit width and the total bit number of the right shift, and the rationality of the first right shift number and the second right shift number is ensured.
Optionally, the first right shift number is an integer multiple of the bit width of the sub data, for example, if the bit width of the sub data is 32, the first right shift number may be 32, 64, and so on. The first right shift number is 32, which indicates that each sub data is shifted to the right by a bit width of 1 sub data, and the first right shift number is 64, which indicates that each sub data is shifted to the right by a bit width of 2 sub data. Therefore, the sum of the first right-shifted number and the second right-shifted number is equal to the total number of bits.
Optionally, the second right shift number is smaller than the bit width of the sub data. Therefore, in the second right shift stage, each bit data in the right shift result of the first right shift stage only needs to be shifted between adjacent subdata, and the shift amount of the second right shift stage is effectively reduced.
Further, when the first right shift number and the second right shift number are determined, the total number of right shifts and the bit width of the subdata can be divided to obtain a quotient value and a remainder, the product of the quotient value and the subdata bit width is determined as the first right shift number, and the remainder is determined as the second right shift number, so that the correlation between the bit width and the first right shift number and the characteristic that the second right shift number depends on the first right shift number are guaranteed, the synchronous determination of the first right shift number and the second right shift number can be realized, and the generation efficiency of determining the first right shift number and the second right shift number is improved.
For example, the total number of bits shifted to the right is 100, the bit width of the sub-data is 32, and the quotient value of the total number of bits shifted to the right and the bit width are obtained as 3 and the remainder is 4. Therefore, the first right shift number is determined to be 96 and the second right shift number is determined to be 4.
When the total digit shifted to the right is divided by the bit width of the subdata to obtain a quotient value and a remainder, the total digit shifted to the right can be subjected to right shift processing according to the bit width of the subdata to obtain the quotient value and the remainder of the total digit shifted to the right and the bit width. For example, when the bit width is 32, since 32 is a power of 5 of 2, the total number of bits shifted to the right can be shifted to the right by 5 bits of data, and a quotient and a remainder of the division of the total number of bits and the bit width can be obtained.
And step 302, performing right shift processing on each subdata according to the first right shift number to obtain intermediate data.
The right shift number of the first right shift stage is equal to the product of the first right shift number and the bit width of the subdata.
Specifically, according to the right shift number of the first stage, that is, according to the first right shift number, the first client terminal moves each subdata to the right, and the right shift processing of the first right shift stage of the data to be encrypted is completed. And obtaining intermediate data from each subdata subjected to right shift processing in the first right shift stage.
Specifically, when the first client terminal moves each sub-data to the right for processing according to the first right shift number, the sub-data is used as a unit, and one or more sub-data are moved to the right in parallel according to the first right shift number. And in the process of moving to the right, simultaneously performing zero padding on the left side of the leftmost subdata of the data to be encrypted according to the first right shift number, namely performing zero padding on the high order of the data to be encrypted, and finally obtaining intermediate data. Therefore, the parallel right shift of each subdata in the first right shift stage is realized, the efficiency of right shift processing is improved, and the subdata after each right shift is stored as intermediate data, so that the mutual coverage in the subdata right shift process is avoided, and each subdata can be subjected to parallel right shift.
Wherein the intermediate data may be stored in a register in the helper operator of the first client terminal.
In other words, when the first right shift number is a bit width of 1 sub-data, each sub-data is shifted to the right by a bit width of 1 sub-data in parallel, instead of shifting only one bit data, and when the first right shift number is a bit width of 2 sub-data, each sub-data is shifted to the right by a bit width of 2 sub-data in parallel, and so on. In the right shift operation, the data on the left side moves to the right, and the data beyond the bit width range of the data to be encrypted is discarded. For example, the first sub-data on the right side is shifted to the right each time, the sub-data exceeds the bit width range of the data to be encrypted. Similarly, the left data is also vacant, and the vacant bits can be filled with zero. I.e. the value of the empty bit is set to zero. For example, the first sub-data on the left side is shifted to the right by 1 sub-data bit width, and then the original position of the first sub-data is padded with zero at the position of the second sub-data on the left side. Therefore, through zero filling operation, the right shift processing is prevented from generating errors.
Wherein, for the auxiliary shifter, both right shifting one bit at a time and right shifting multiple bits at a time can be completed in one clock cycle. Therefore, the parallel right shift of each subdata according to the first right shift number can be completed in one clock cycle, and compared with the multiple right shifts of each data, the right shift operation efficiency is effectively improved.
And step 303, the first client terminal performs right shift processing on the intermediate data according to the second right shift number to obtain a right shift result, wherein the right shift result is used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning.
Wherein the right shift number of the second right shift stage is equal to the second right shift number.
Specifically, after the second right shift value is determined and the intermediate data is obtained, the intermediate data may be right-shifted according to the second right shift value to obtain the final data. The intermediate data and the data to be encrypted are independently stored in the auxiliary arithmetic unit, so that the dependence and influence of the right shift of the intermediate data on the right shift of each subdata are reduced, the time interval of the right shift of each subdata and the right shift of the intermediate data is effectively shortened, and the right shift calculation efficiency can be effectively improved. Furthermore, the intermediate data may be shifted right once by a second right shift number, which may also be done in one clock cycle for the circuits in the auxiliary operator.
Specifically, when the intermediate data is right-shifted according to the second right-shift number, each bit data may be parallel right-shifted by the second right-shift number in the unit of the bit data in the intermediate data, so as to obtain a right-shift result.
Taking the bit data as a shift unit, in other words, the second right shift number is 1, each bit data of the intermediate data is shifted right by 1 bit data in parallel, and the second right shift number is 2, the intermediate data is shifted right by 2 bit data in parallel. In the right shift operation, the data on the left side moves to the right, and the data beyond the bit width range of the data to be encrypted is discarded. For example, the first bit of data on the right side, which exceeds the bit width of the data to be encrypted each time the right shift of the intermediate data is performed. Similarly, the left data is also vacant, and the vacant bits can be filled with zero. I.e. the value of the empty bit is set to zero. For example, the first bit data on the left side is shifted to the right by 1 bit data, and the original position of the first bit data is zero-padded by shifting the position of the second bit data on the left side. Therefore, through zero filling operation, the right shift processing is prevented from generating errors.
The total number of bits of the right shift is divided into a first right shift number and a second right shift number, each subdata is right-shifted according to the first right shift number to obtain intermediate data, the intermediate data is right-shifted according to the second right shift number to obtain final data, the staged right shift of the data to be encrypted is achieved, the number of wiring branches in the auxiliary arithmetic unit can be effectively reduced, and resource consumption is greatly reduced.
For example, the data to be encrypted is binary data with 256 bit width, the total number of bits to be right-shifted is 36, and if the above-mentioned stepwise right-shifting is not adopted, the data is right-shifted for each bitFor one bit data, there are 36 choices for shifting the bit number, for example, 32 bits at a time, or 19 bits at a time, and for 256 bit data, there are 36 choices256The more possibilities, the greater the number of routing branches and the more resources consumed. If the staged right shift is adopted, assuming bit width bit 32 of the sub-data, the first right shift number is 1, and the second right shift number is 4, in the first stage, each sub-data is shifted to the right by 1 bit width of the sub-data, there are only 1 possibility for each bit data, in the second stage, there are 4 possibilities for each bit data of the intermediate data to be shifted to the right by 1 bit, 2 bits, 3 bits, and 4 bits, respectively, and there are 4 possibilities for each bit data of the intermediate data to be shifted to the right, respectively, in total256And (4) carrying out the following steps. It can be seen that the improved phased right shift approach of the present embodiment greatly reduces resource consumption.
In the embodiment of the invention, a first client terminal performs data division on local data to be encrypted and divides the total number of bits of the local data to be encrypted, which need to be shifted to the right, to obtain one or more subdata, a first right shift number of a first right shift stage and a second right shift number of a second right shift stage, performs right shift of the first right shift stage on each subdata to obtain intermediate data, and performs right shift of the second right shift stage on the intermediate data to obtain a right shift result.
Therefore, the embodiment of the invention effectively improves the rationality of right shift stage division, improves the rationality of combination of each subdata and the first right shift stage, improves the right shift efficiency, reduces the resource consumption of an auxiliary arithmetic unit, further improves the encryption efficiency of data to be encrypted, further can improve the data communication efficiency between each client terminal and a server in the process of federal learning, and further improves the model training efficiency of federal learning.
As an example, fig. 4 is an exemplary diagram of right-shifting 512 bits of data to be encrypted. As shown in fig. 4, the data to be encrypted is first split into 16 sub-data, which can be respectively expressed as: a15, A14, … … and A0. The bit width of each array is 32. In the process of right shift in the first stage, each subdata is moved to the right to obtain intermediate data: b15, … …, Bj-1, … … and B0. Wherein, B [ j ] ═ a [15], B [ j-1] ═ a [14], … …, a [0] is out of the data bit width range and discarded after right shift, and B [15] is the sub data obtained after zero padding. Wherein j is an integer, and B [ j ] represents the jth sub-data in the intermediate data.
In fig. 4, after the intermediate data is obtained, the intermediate data is right-shifted by a second right-shift number, and since the second right-shift number is smaller than the bit width of the array, each bit of data only needs to be shifted in the sub data and the sub data adjacent to the right side of the sub data. The numerical value of the second right shift value is small, the right shift of the intermediate data can be completed through one-time shift, and the right shift operation efficiency is improved. After the intermediate data is right shifted, the final data C15, … …, cj-1, … …, C0 are obtained.
Fig. 5 is a flowchart illustrating a data processing method according to an embodiment of the present invention. The execution subject of the method in this embodiment may be the client terminal in fig. 1. The method in this embodiment may be implemented by software, hardware, or a combination of software and hardware. As shown in fig. 5, the method may include:
step 501, a first client terminal receives a request message from a second client terminal or a server, and the request message requests to acquire data for federal learning.
The request message may be a data request message, which is used to obtain data local to the first client terminal for federal learning. For example, the second client terminal may send a user data request message to the first client terminal, and the server may send a model parameter request message to the first client terminal.
And 502, acquiring the total number of bits of the data to be encrypted, which need to be shifted to the right, according to the encryption mode of the data used for federal learning.
Specifically, after receiving a request message from a second client terminal or a server, a first client terminal locally obtains data to be sent to the second client terminal or the server, that is, obtains data to be encrypted. And acquiring the total number of bits of the data to be encrypted, which need to be shifted to the right, according to a preset encryption mode of the data for federal learning. The user data and the model parameters may be encrypted in the same way or in different ways, and may be determined by developers. The encryption mode relates to a specific process of encryption processing of data to be encrypted, and in the embodiment of the present invention, the encryption mode is not described in detail.
Optionally, if the encryption mode includes a division operation on the data to be encrypted, the first client terminal may obtain the total number of bits to be right-shifted of the data to be encrypted according to the division operation. The total number of bits to be right-shifted for the data to be encrypted can be determined according to the divisor in the division operation, for example, if the divisor is 64, the total number of bits to be right-shifted is 6. The division operation is, for example, a modulo operation or a remainder operation.
Optionally, if the encryption mode includes subtraction of the data to be encrypted, the first client terminal may obtain the total number of bits to be right-shifted of the data to be encrypted according to the subtraction. The total number of bits to be right-shifted for the data to be encrypted can be determined according to the borrow condition in the subtraction operation. For example, if 1 borrow is performed in the subtraction operation, the right shift is performed by 1 bit according to the borrow.
Step 503, determining the right shift digits of the multiple right shift stages according to the total digits of the data to be encrypted, which need to be right shifted.
And step 504, performing right shift processing on each subdata which is divided into the data to be encrypted according to the right shift number of each right shift stage in sequence to obtain a right shift result.
Specifically, the specific implementation principle and process of step 503 and step 504 may refer to the foregoing embodiments, and are not described herein again.
And 505, obtaining the encrypted data to be encrypted according to the right shift result.
Specifically, after the final right shift result is obtained, if other operation processing, such as addition processing and multiplication processing, needs to be performed on the right shift result after the right shift processing in the encryption process, the operation processing is continuously performed on the right shift result to complete the encryption of the data to be encrypted, so as to obtain the encrypted data to be encrypted. If the right shift process is the last operation process of the data to be encrypted in the encryption process, the right shift result can be determined as the encrypted data to be encrypted.
And 507, the first client terminal sends the encrypted data to be encrypted to a second client terminal or a server, and the encrypted data to be encrypted is used for federal learning.
Specifically, after obtaining the encrypted data to be encrypted, the first client terminal may send the encrypted data to be encrypted to the second client terminal or the server, so that the second client terminal or the server performs federal learning by using the encrypted data to be encrypted.
For example, the first client terminal may send the encrypted user data to the second client terminal, and the second client terminal performs a training process of the model parameters of the federal learning model locally by using the encrypted user data and local user data of the second client terminal, so as to improve a training effect of the federal learning model.
For another example, the first client terminal may send the encrypted model parameters to the server, where the server generally has a private key for decryption, and the private key is used to decrypt the encrypted model parameters to obtain the decrypted model parameters. And the server integrates the model parameters by using the decrypted model parameters of each client to obtain a global federal learning model.
In the embodiment of the invention, after receiving the request message of the second client terminal, the first client terminal divides the local data to be encrypted into one or more subdata with the same bit width and divides the right shift process of the data to be encrypted into a plurality of right shift stages, so that the right shift processing efficiency of the data to be encrypted is improved, the encryption efficiency of the data to be encrypted is improved, the data communication efficiency between the client terminals and the server in the federal learning process can be further improved, and the model training efficiency of the federal learning is further improved.
Fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention. As shown in fig. 5, the data processing apparatus may include:
the determining module 61 is configured to determine, by the first client terminal, right shift numbers of the multiple right shift stages according to a total number of bits to be shifted to the right of the data to be encrypted, where the right shift is a shift of bit data in the data to be encrypted from a high bit of the data to be encrypted to a low bit of the data to be encrypted;
and the right shift module 62 is configured to perform right shift processing on each subdata obtained by dividing the data to be encrypted according to the right shift number of each right shift stage in sequence to obtain a right shift result, where the right shift result is used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning.
The data processing apparatus provided in this embodiment may be configured to execute the technical solution provided in any of the foregoing method embodiments, and the implementation principle and technical effect are similar.
In one possible implementation, the plurality of right shift stages includes a first right shift stage and a second right shift stage, and the right shift module 62 is specifically configured to:
performing right shift processing on each subdata according to the right shift number of the first right shift stage to obtain intermediate data;
and performing right shift processing on the intermediate data according to the right shift number of the second right shift stage to obtain a right shift result.
In a possible implementation manner, the right shift number of the first right shift stage is a first right shift number, the right shift number of the second right shift stage is a second right shift number, the first right shift number is an integer multiple of the bit width of the sub data, and the right shift module 62 is specifically configured to:
with the subdata as a unit, carrying out parallel right shift on each subdata by a first right shift number to obtain intermediate data;
and with the bit data in the intermediate data as a unit, carrying out parallel right shift on each bit data by a second right shift number to obtain a right shift result.
In a possible implementation manner, the determining module 61 is specifically configured to:
and determining the right shift digits of a plurality of right shift stages according to the total digits of the data to be encrypted, which need to be shifted to the right, and the bit width of the subdata.
In a possible implementation manner, the multiple right shift stages include a first right shift stage and a second right shift stage, and the determining module 61 is specifically configured to:
determining a first right shift number according to the total number of bits and the bit width of the subdata, wherein the first right shift number is a right shift number of a first right shift stage, and the first right shift number is an integral multiple of the bit width of the subdata;
and determining a second right shift number according to the bit width, the total number and the first right shift number of the subdata, wherein the second right shift number is the right shift number of a second right shift stage, the second right shift number is smaller than the bit width of the subdata, and the sum of the first right shift number and the second right shift number is equal to the total number.
In one possible implementation, the data to be encrypted includes one or more of the following: training user data of a first client terminal locally, and model parameters of a federal learning model obtained by training of the first client terminal;
wherein the training user data is used to train the federated learning model.
In one possible implementation, as shown in fig. 7, the apparatus further includes a receiving module 63 and an obtaining module 64, where:
a receiving module 63, configured to receive, by a first client terminal, a request message from a second client terminal or a server, where the request message requests to acquire data used for federal learning;
and the obtaining module 64 is configured to obtain the total number of bits to be right-shifted of the data to be encrypted according to the encryption mode of the data for federal learning.
In one possible implementation, as shown in fig. 7, the apparatus further includes an encryption module 65 and a sending module 66, where:
the encryption module 65 is configured to obtain encrypted data to be encrypted according to the right shift result;
and a sending module 66, configured to send the encrypted data to be encrypted to a second client terminal or a server by the first client terminal.
In a possible implementation manner, the obtaining module 64 is specifically configured to:
and if the encryption mode comprises division operation of the data to be encrypted, the first client terminal acquires the total digit of the data to be encrypted, which needs to be shifted to the right, according to the division operation.
The data processing apparatus provided in any of the foregoing embodiments is configured to execute the technical solution of any of the foregoing method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 8 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention. As shown in fig. 8, the apparatus may include: a memory 801, a processor 802 and a data processing program stored on the memory 801 and executable on the processor 802, the data processing program implementing the steps of the data processing method according to any of the preceding embodiments when executed by the processor 802.
Alternatively, the memory 801 may be separate or integrated with the processor 802.
For the implementation principle and the technical effect of the device provided by this embodiment, reference may be made to the foregoing embodiments, and details are not described here.
An embodiment of the present invention further provides a computer-readable storage medium, where a data processing program is stored on the computer-readable storage medium, and when the data processing program is executed by a processor, the data processing program implements the steps of the data processing method according to any of the foregoing embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and other divisions may be realized in practice, for example, a plurality of modules may be combined or integrated into another system, or some features may be omitted, or not executed.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute some steps of the methods according to the embodiments of the present invention.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The storage medium may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the storage medium may reside as discrete components in an electronic device or host device.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A data processing method, applied to a first client terminal, comprising:
the first client terminal determines right shift digits of a plurality of right shift stages according to the total digits of the data to be encrypted, wherein the right shift refers to the movement of bit data in the data to be encrypted from the high order of the data to be encrypted to the low order of the data to be encrypted;
and carrying out right shift processing on each subdata divided by the data to be encrypted according to the right shift number of each right shift stage in sequence to obtain a right shift result, wherein the right shift result is used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning.
2. The method of claim 1, wherein the right shift stages include a first right shift stage and a second right shift stage, and the performing, for each sub-data divided from the data to be encrypted, right shift processing according to the right shift number of each right shift stage in sequence to obtain a right shift result includes:
performing right shift processing on each subdata according to the right shift number of the first right shift stage to obtain intermediate data;
and performing right shift processing on the intermediate data according to the right shift number of the second right shift stage to obtain a right shift result.
3. The method of claim 2, wherein the right shift number of the first right shift stage is a first right shift number, the right shift number of the second right shift stage is a second right shift number, the first right shift number is an integer multiple of the bit width of the sub data, and the right shift processing is performed on each sub data according to the right shift number of the first right shift stage to obtain intermediate data, including:
with subdata as a unit, parallelly right-shifting each subdata by the first right-shift number to obtain intermediate data;
the right shift processing is performed on the intermediate data according to the right shift number of the second right shift stage to obtain a right shift result, including:
and with the bit data in the intermediate data as a unit, performing parallel right shift on each bit data by the second right shift number to obtain the right shift result.
4. The method of claim 1, wherein the determining, by the first client terminal, the number of right shifts for the plurality of right shift stages based on the total number of bits to be right shifted for the data to be encrypted comprises:
and determining the right shift digits of the multiple right shift stages according to the total digits of the data to be encrypted, which need to be shifted to the right, and the bit width of the subdata.
5. The method of claim 4, wherein the plurality of right shift stages includes a first right shift stage and a second right shift stage, and the determining the number of right shifts of the plurality of right shift stages according to the total number of bits to be right shifted for the data to be encrypted and the bit width of the sub data comprises:
determining a first right shift digit according to the total digit and the bit width of the subdata, wherein the first right shift digit is a right shift digit of the first right shift stage, and the first right shift digit is an integral multiple of the bit width of the subdata;
and determining a second right shift number according to the bit width of the subdata, the total bit number and the first right shift number, wherein the second right shift number is a right shift number of the second right shift stage, the second right shift number is smaller than the bit width of the subdata, and the sum of the first right shift number and the second right shift number is equal to the total bit number.
6. The method of any of claims 1-5, wherein the data to be encrypted comprises one or more of: the local training user data of the first client terminal and the model parameters of the federal learning model obtained by the training of the first client terminal are obtained;
wherein the training user data is used to train the federated learning model.
7. The method according to any one of claims 1 to 5, wherein before the first client terminal determines the right shift number of the plurality of right shift stages according to the total number of bits to be right-shifted for the data to be encrypted, the method further comprises:
the first client terminal receives a request message from a second client terminal or a server, wherein the request message requests to acquire data for federal learning;
acquiring the total number of bits of the data to be encrypted, which need to be shifted to the right, according to the encryption mode of the data for federal learning;
and after each subdata divided by the data to be encrypted is subjected to right shift processing sequentially according to the right shift number of the right shift stage to obtain a right shift result, the method further comprises the following steps:
obtaining the encrypted data to be encrypted according to the right shift result;
and the first client terminal sends the encrypted data to be encrypted to the second client terminal or the server.
8. The method according to claim 7, wherein the obtaining the total number of bits of the data to be encrypted that need to be right-shifted according to the encryption mode of the data used for federal learning comprises:
and if the encryption mode comprises division operation on the data to be encrypted, the first client terminal acquires the total digit of the data to be encrypted, which needs to be shifted to the right, according to the division operation.
9. A data processing apparatus, comprising:
the determining module is used for determining right shift numbers of a plurality of right shift stages according to the total number of bits of the data to be encrypted, wherein the right shift refers to the movement of bit data in the data to be encrypted from the high bit of the data to be encrypted to the low bit of the data to be encrypted;
and the right shift module is used for performing right shift processing on each subdata divided by the data to be encrypted according to the right shift number of each right shift stage in sequence to obtain a right shift result, wherein the right shift result is used for encrypting the data to be encrypted, and the encrypted data to be encrypted is used for federal learning.
10. A data processing apparatus, characterized in that the data processing apparatus comprises: memory, processor and data processing program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the data processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, on which a data processing program is stored, which when executed by a processor implements the steps of the data processing method according to any one of claims 1 to 8.
CN202011193765.3A 2020-10-30 2020-10-30 Data processing method, device, equipment and storage medium Pending CN114444706A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011193765.3A CN114444706A (en) 2020-10-30 2020-10-30 Data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011193765.3A CN114444706A (en) 2020-10-30 2020-10-30 Data processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114444706A true CN114444706A (en) 2022-05-06

Family

ID=81357905

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011193765.3A Pending CN114444706A (en) 2020-10-30 2020-10-30 Data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114444706A (en)

Similar Documents

Publication Publication Date Title
US10778410B2 (en) Homomorphic data encryption method and apparatus for implementing privacy protection
CN113765657A (en) Key data processing method and device and server
CN107819569A (en) The encryption method and terminal device of log-on message
CN112200713A (en) Business data processing method, device and equipment in federated learning
Fang et al. Secure function evaluation using an fpga overlay architecture
WO2018135563A1 (en) Secure computing system, secure computing device, secure computing method, and program
CN108959168B (en) SHA512 full-flow water circuit based on-chip memory and implementation method thereof
CN112114776A (en) Quantum multiplication method and device, electronic device and storage medium
CN114329644B (en) Method, device and storage medium for carrying out encryption simulation on logic system design
Fang et al. SIFO: Secure computational infrastructure using FPGA overlays
JP6844897B2 (en) Bit decomposition secret calculator, bit join secret calculator, method and program
EP3483867B1 (en) System, device, method, and program for indexing a secret-shared array with secure multiparty computations
CN112214200A (en) Quantum subtraction operation method and device, electronic device and storage medium
CN114444706A (en) Data processing method, device, equipment and storage medium
CN113094735B (en) Privacy model training method
US9762285B1 (en) Compression using mu-law approximation
CN114444707A (en) Data processing method, device, equipment and storage medium
CN112434317A (en) Data processing method, device, equipment and storage medium
CN115085897A (en) Data processing method and device for protecting privacy and computer equipment
CN111061720B (en) Data screening method and device and electronic equipment
JP6321216B2 (en) Matrix / key generation device, matrix / key generation system, matrix combination device, matrix / key generation method, program
CN112417478A (en) Data processing method, device, equipment and storage medium
CN110543777B (en) Image processing method, device, equipment and storage medium
Addabbo et al. Efficient implementation of pseudochaotic piecewise linear maps with high digitization accuracies
CN112182593A (en) Data processing method and device and electronic equipment

Legal Events

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