CN114006689B - Data processing method, device and medium based on federal learning - Google Patents

Data processing method, device and medium based on federal learning Download PDF

Info

Publication number
CN114006689B
CN114006689B CN202111623493.0A CN202111623493A CN114006689B CN 114006689 B CN114006689 B CN 114006689B CN 202111623493 A CN202111623493 A CN 202111623493A CN 114006689 B CN114006689 B CN 114006689B
Authority
CN
China
Prior art keywords
data
plaintext
polynomial
power
monomial
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.)
Active
Application number
CN202111623493.0A
Other languages
Chinese (zh)
Other versions
CN114006689A (en
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.)
Beijing Real AI Technology Co Ltd
Original Assignee
Beijing Real AI Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Real AI Technology Co Ltd filed Critical Beijing Real AI Technology Co Ltd
Priority to CN202111623493.0A priority Critical patent/CN114006689B/en
Publication of CN114006689A publication Critical patent/CN114006689A/en
Application granted granted Critical
Publication of CN114006689B publication Critical patent/CN114006689B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption
    • 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/602Providing cryptographic facilities or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments of the present application relate to the technical field of data security, and some embodiments provide a data processing method, apparatus, and medium based on federal learning. The method is applied to first terminal equipment and comprises the following steps: receiving ciphertext data from the second terminal device; the ciphertext data is obtained by homomorphic encryption of a first plaintext by a second terminal device, and the first plaintext is obtained by encoding a first data to be encrypted by the second terminal device; encoding second data to be encrypted to obtain second plaintext, wherein the first plaintext and the second plaintext are identical in data structure; obtaining target data according to the second plaintext and the ciphertext data; and packaging the target data to obtain packaged data, and sending the packaged data to the second terminal equipment. The method can ensure the safety of data transmission between the two parties, and in the data encryption process, the rotation function is not used in the calculation process of the result data, thereby improving the efficiency of data processing.

Description

Data processing method, device and medium based on federal learning
Technical Field
The embodiment of the application relates to the technical field of data security, in particular to a data processing method, a data processing device and a data processing medium based on federal learning.
Background
With the rapid development of social informatization and networking, data is growing explosively. Many enterprises or organizations generally need to use a large amount of data to optimize respective business functions, and as the enterprises or organizations generally have single business functions and acquire one-sided data, the enterprises or organizations need to jointly optimize the business functions of the enterprises or organizations in combination with data of other parties. However, the data of each enterprise or organization usually contains some sensitive information such as personal privacy, business confidentiality and the like, and the data cannot be freely disclosed in order to ensure the data security.
At present, homomorphic encryption technology can be introduced on the basis of federal learning, and business functions of enterprises or organizations are optimized by using data of other parties on the premise of ensuring data safety. At present, in the calculation process, it is usually necessary to encrypt the data of the enterprise or the organization by using a homomorphic encryption technology, and send the encrypted data to the other party, and the other party can calculate the encrypted data and the data of the other party by using a rotation function to obtain a calculation result, combine the calculation result into a ciphertext to be packaged, and feed back the packaged ciphertext to the enterprise or the organization, so that the enterprise or the organization can decrypt the packaged ciphertext to obtain the required data.
Disclosure of Invention
However, due to the encryption method, in the prior art, the rotation function is called for many times in the process of calculating the operation result and packaging the ciphertext, and the rotation function consumes much time in the operation process.
Thus, in the prior art, using a spin function results in inefficient data processing which is a very annoying process.
For this reason, an improved federal learning-based data processing method is highly desirable to improve the efficiency of data processing.
In this context, embodiments of the present application are intended to provide a method, an apparatus, and a medium for data processing based on federal learning.
In a first aspect of the present application, a data processing method based on federal learning is provided, which is applied to a first terminal device, and includes:
receiving ciphertext data from the second terminal device; the ciphertext data is obtained by homomorphic encryption of a first plaintext by the second terminal equipment, and the first plaintext is obtained by encoding the first data to be encrypted by the second terminal equipment;
encoding second data to be encrypted to obtain second plaintext, wherein the first plaintext and the second plaintext are identical in data structure;
obtaining target data according to the second plaintext and the ciphertext data;
and packaging the target data to obtain packaged data, and sending the packaged data to the second terminal equipment.
In a second aspect of the present application, there is provided another data processing method based on federal learning, which is applied to a second terminal device, and the method includes:
encoding first data to be encrypted to obtain a first plaintext;
homomorphic encryption is carried out on the first plaintext to obtain ciphertext data, and the ciphertext data are sent to first terminal equipment;
receiving packed data from the first terminal device, wherein the packed data is obtained by encrypting target data obtained according to a second plaintext and the ciphertext data by the first terminal device; the second plaintext is obtained by encoding according to second data to be encrypted; the first plaintext and the second plaintext are identical in data structure;
and decrypting the packed data to obtain the target data.
In a third aspect of the present application, there is provided a data processing apparatus based on federal learning, applied to a first terminal device, the apparatus including:
a first receiving unit configured to receive ciphertext data from a second terminal apparatus; the ciphertext data is obtained by homomorphic encryption of a first plaintext by the second terminal equipment, and the first plaintext is obtained by encoding the first data to be encrypted by the second terminal equipment;
the first encoding unit is used for encoding second data to be encrypted to obtain second plaintext, and the first plaintext and the second plaintext are identical in data structure;
the target data operation unit is used for obtaining target data according to the second plaintext and the ciphertext data;
and the packaging unit is used for packaging the target data to obtain packaged data and sending the packaged data to the second terminal equipment.
In a fourth aspect of the present application, there is provided another data processing apparatus based on federal learning, applied to a second terminal device, the apparatus including:
the second encoding unit is used for encoding the first data to be encrypted to obtain a first plaintext;
the encryption unit is used for homomorphic encryption of the first plaintext to obtain ciphertext data and sending the ciphertext data to the first terminal equipment;
a second receiving unit, configured to receive packed data from the first terminal device, where the packed data is obtained by encrypting, by the first terminal device, target data obtained according to a second plaintext and the ciphertext data; the second plaintext is obtained by encoding according to second data to be encrypted; the first plaintext and the second plaintext are identical in data structure;
and the decryption unit is used for decrypting the packed data to obtain the target data.
In a fifth aspect of the present application, a storage medium storing a program is provided, wherein the storage medium stores a computer program which, when executed by a processor, is capable of implementing the method of any one of the first or second aspects.
In a sixth aspect of the present application, there is provided a computing device comprising a processor and a memory:
the memory is used for storing program codes;
the processor is configured to perform the method of any of the first or second aspects in accordance with instructions in the program code.
According to the data processing method, the data processing system, the data processing medium and the data processing computing device based on the federal learning in the embodiments of the present application, since the ciphertext data is obtained by encrypting the first plaintext, and the first plaintext is obtained by encoding the first to-be-encrypted data, after the second terminal device sends the ciphertext data to the first terminal device, the ciphertext data sent by the second terminal device is not directly exposed to the first terminal device due to the dual security mechanism. In addition, in one aspect, since the target data is obtained from the second plaintext and the ciphertext data, the target data does not directly include data stored in the first terminal device, and therefore, the first terminal device can only perform an operation on the ciphertext data to obtain the target data, and therefore, it can be seen that, for the first terminal device that transmits data and the second terminal device that receives data, both the first terminal device and the second terminal device do not directly obtain data of the other party, and therefore, the security of data transmission between the two parties can be ensured. In another aspect, the second terminal device may obtain a result of common calculation of the data stored in the first terminal device and the second terminal device through the data transmission manner, and in the data encryption process, a rotation function is not used in a calculation process of the result data, so that the efficiency of data processing may be improved on the premise of ensuring data security.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
fig. 1 is a schematic application scenario diagram of a data processing system based on federal learning according to an embodiment of the present application;
fig. 2 is a schematic signaling interaction diagram of a data processing method based on federal learning according to an embodiment of the present application;
fig. 3 is a block chain network diagram of a data processing method based on federal learning according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a processing method of a first plaintext according to an embodiment of the application;
fig. 5 is a flowchart illustrating a processing method of packed data according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data processing apparatus based on federal learning according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data processing apparatus based on federal learning according to another embodiment of the present application;
FIG. 8 schematically illustrates a schematic structural diagram of a medium according to an embodiment of the present application;
fig. 9 schematically shows a structural diagram of a computing device according to an embodiment of the present application.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present application will be described with reference to a number of exemplary embodiments. It is understood that these examples are given solely to enable those skilled in the art to better understand and to practice the present application, and are not intended to limit the scope of the present application in any way. 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.
As will be appreciated by one skilled in the art, embodiments of the present application may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the application, a data processing method, a data processing device and a data processing medium based on federal learning are provided.
In this context, it is to be understood that the terms referred to:
machine Learning (ML) is a multi-domain cross discipline, and relates to a plurality of disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and the like. The special research on how a computer simulates or realizes the learning behavior of human beings so as to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve the performance of the computer. Machine learning is the core of artificial intelligence, is the fundamental approach for computers to have intelligence, and is applied to all fields of artificial intelligence. Machine learning and deep learning generally include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and the like.
Federal Learning (Federal Machine Learning/Federal Learning), also known as Federal Machine Learning, Joint Learning, or Federal Learning; federal learning is a machine learning framework, and can effectively help a plurality of organizations to perform data use and machine learning modeling under the condition of meeting the requirements of user privacy protection, data safety and government regulations.
Homomorphic Encryption (Homomorphic Encryption) is a cryptographic technique based on the theory of computational complexity of mathematical problems. The homomorphic encrypted data is processed to produce an output, which is decrypted, the result being the same as the output obtained by processing the unencrypted original data in the same way.
Moreover, any number of elements in the drawings are by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
In this embodiment of the application, the terminal device processes the transmitted data based on federal learning, the first terminal device may receive ciphertext data from the second terminal device, the ciphertext data may be obtained by homomorphic encryption of a first plaintext by the second terminal device, the first plaintext may be obtained by encoding first data to be encrypted by the second terminal device, and the first data to be encrypted may be data stored by the second terminal device; the first terminal device may encode the second data to be encrypted to obtain a second plaintext, and the second data to be encrypted may be data stored by the first terminal device; the first terminal device can obtain target data according to the second plaintext and the ciphertext data, wherein the data structures of the first plaintext and the second plaintext are the same; the first terminal device may package the target data to obtain packaged data, and send the packaged data to the second terminal device, so that the second terminal device decrypts the packaged data received from the first terminal device to obtain a required result.
By way of example, with reference to fig. 1 in an incorporated manner, a schematic diagram of an application scenario of a data processing system based on federal learning provided by an embodiment of the present application is shown. The federal learning based data processing system may include a first terminal device 10 and a second terminal device 20.
The second terminal device 20 is configured to encode the first data to be encrypted to obtain a first plaintext; homomorphic encryption is performed on the first plaintext to obtain ciphertext data, and the ciphertext data is sent to the first terminal device 10; here, the second terminal device 20 refers to a terminal used by an arbitrary user. Alternatively, the second terminal device 20 may be a terminal device such as a mobile phone, a tablet Computer, a game console, an e-book reader, a multimedia playing device, a wearable device, a Personal Computer (PC), a server, a cloud server, and the like. A client of the application can be installed in the second terminal device 20. The application program refers to any computer program that can provide an interactive platform between the second terminal device 20 and the first terminal device 10. Optionally, the first terminal device 10 may also be a terminal device such as a mobile phone, a tablet computer, a game console, an electronic book reader, a multimedia playing device, a wearable device, a PC, a server, a cloud server, and the like, which is not limited in this embodiment of the present application. The application program may be an application program that needs to be downloaded and installed, or may be an application program that is to be used on demand, and the present embodiment is not limited to this.
The first terminal device 10 is configured to receive ciphertext data from the second terminal device; coding the second data to be encrypted to obtain a second plaintext; obtaining target data according to the second plaintext and the ciphertext data; and packaging the target data to obtain packaged data, and sending the packaged data to the second terminal device 20, where the first plaintext and the second plaintext are identical in data structure.
The second terminal device 20 is further configured to receive the packed data from the first terminal device 10, and decrypt the packed data to obtain the target data.
Alternatively, the first terminal device 10 and the second terminal device 20 communicate with each other via a network.
The technical solution of the present application will be described in detail with reference to several embodiments.
Exemplary method
Fig. 2 is a signaling interaction diagram of a data processing method based on federal learning according to another embodiment of the present application, where the embodiment of the present application is applied to the data processing system based on federal learning shown in fig. 1, the data processing system based on federal learning includes a first terminal device and a second terminal device, the data processing process based on federal learning is described in the embodiment of the present application by taking only one interaction process of the first terminal device and the second terminal device as an example, it should be noted that the above application scenarios are only shown for facilitating understanding of the spirit and principle of the present application, and the embodiment of the present application is not limited in any way in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable. Referring to fig. 2, the method includes the following steps:
step S201, the second terminal device encodes the first to-be-encrypted data to obtain a first plaintext.
The federal learning-based data processing method provided in the application aims at a data processing model realized based on artificial intelligence represented by machine learning, particularly federal learning, and includes, but is not limited to, data processing models suitable for different application scenarios such as multi-party data transmission and multi-party data operation.
In this embodiment of the application, the first terminal device and the second terminal device may be terminal devices such as a mobile phone, a tablet computer, a game console, an electronic book reader, a multimedia playing device, a wearable device, a PC, and a server, where the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and a cloud server providing cloud computing services, but is not limited thereto. The terminal devices may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
In the embodiment of the application, the first terminal device may store second data to be encrypted, the second terminal device may store first data to be encrypted, the second terminal device may need to acquire second data to be encrypted stored by the first terminal device, and the second data to be encrypted and the first data to be encrypted are operated together to obtain an operation result. The data types of the first data to be encrypted and the second data to be encrypted may be a text type, an image type, an audio type, a video type, or the like, which is not limited in this embodiment.
Specifically, the second terminal device may encode the stored first data to be encrypted to obtain a first plaintext, where the data structure of the first plaintext may be a polynomial structure, the number of polynomials included in the polynomial may be the same as the number of data included in the first data to be encrypted, and the power number of each polynomial in the polynomials is different, the power number of each polynomial in the polynomial of the first plaintext may be determined according to the position of the first data to be encrypted, for example, the first data to be encrypted may include n feature values, the first feature value to be sorted may be a first polynomial in the polynomial of the first plaintext, and the power number of the unknown number in the first polynomial may be a value corresponding to the first sorted first feature value, such as 0,1, or 2, and the embodiment of the present application is not limited; and the powers of the unknowns in each monomial corresponding to the n eigenvalues are all different.
For example, the first data to be encrypted stored in the second terminal device may include 4 eigenvalues (1, 2,3, 4), the eigenvalues (1, 2,3, 4) may be respectively used as coefficients of each polynomial in the polynomial, and the obtained polynomial may be, for example, m (x) =1+2x +3x2+4x3It can be seen that the first monomial of the polynomial is 1, where 1 is the first eigenvalue 1 in the first data to be encrypted, and the power of the unknown number x is 0; and the second monomial of the polynomial is 2x, wherein 2 is the second eigenvalue 2 in the first data to be encrypted, and the power number of the unknown number x is 1; and the third monomial of the polynomial is 3 ×2Wherein 3 is a third eigenvalue 3 in the first data to be encrypted, and the power of the unknown number x is 2; and the fourth monomial of the polynomial is 4 ×3Wherein 4 is a fourth eigenvalue 4 in the first data to be encrypted, and the power number of the unknown number x is 3; the powers of each of the polynomials m (x) are different, and therefore, the polynomial m (x) can be determined as the first plaintext.
Step S202, the second terminal device encrypts the first plaintext in a homomorphic manner to obtain ciphertext data, and sends the ciphertext data to the first terminal device.
In this embodiment, the second terminal device may further perform homomorphic encryption or fully homomorphic encryption on the first plaintext to obtain ciphertext data, and the second terminal device may send the ciphertext data to the first terminal device, so that the first terminal device performs the next operation according to the received ciphertext data.
In step S203, the first terminal device receives ciphertext data from the second terminal device.
Step S204, the first terminal equipment encodes the second data to be encrypted to obtain a second plaintext.
Wherein the first plaintext and the second plaintext are identical in data structure.
In this embodiment of the application, the first terminal device may receive ciphertext data from the second terminal device, and then, the first terminal device may encode the second data to be encrypted to obtain a second plaintext, a data structure of the second plaintext may also be a polynomial structure, the number of the monomials included in the polynomial may be the same as the number of the data included in the second data to be encrypted, and the power number of each monomial in the polynomial is different. And the polynomials in the second plaintext correspond to the polynomials in the first plaintext, i.e., the number of the polynomials in the second plaintext is the same as the number of the polynomials in the first plaintext, and each of the polynomials in the second plaintext has the same power as the polynomial in the corresponding position in the first plaintext.
Step S205, the first terminal device obtains target data according to the second plaintext and the ciphertext data.
In this embodiment of the application, the first terminal device may further obtain target data according to the second plaintext and the ciphertext data, the target data may be data obtained by calculation from the second plaintext and the ciphertext data, and the ciphertext data is obtained by homomorphic encryption or fully homomorphic encryption, so that the ciphertext data and the second plaintext may be directly calculated to obtain the target data, and the data structure of the target data may also be the same as that of the first plaintext and the second plaintext, and both may be a polynomial structure.
Step S206, the first terminal device packages the target data to obtain packaged data, and sends the packaged data to the second terminal device.
In the embodiment of the application, the target data can be encrypted to obtain the packed data, so that the safety of the target data is ensured. Since the data format of the target data may be a polynomial format, the target data may be encrypted by encrypting the polynomial. For example, the target data may be in a two-dimensional polynomial format, the target data may be converted into a ciphertext in a fault-tolerant Learning (LWE) format, and then the ciphertext in the LWE format may be packed in a plurality of LWE-to-RLWE modes to obtain packed data, so that the target data in the two-dimensional polynomial format is encrypted to obtain the packed data; wherein, the RLWE may be in a Ring fault tolerance Learning (Ring Learning with Errors) format.
Step S207, the second terminal device receives the packed data from the first terminal device.
And step S208, the second terminal equipment decrypts the packed data to obtain the target data.
In the embodiment of the application, the second terminal device may decrypt the packed data after receiving the packed data to obtain target data, where the target data may be an inner product of second data to be encrypted and the first data to be encrypted, the second terminal device may construct a decision model according to the stored first data to be encrypted, the second terminal device may calculate a residual value of the decision model according to the inner product calculated from the first data to be encrypted and the second data to be encrypted, and may construct a new decision model according to the calculated residual value, so that the inner product of the first data to be encrypted and the second data to be encrypted may be obtained without revealing the first data to be encrypted and the second data to be encrypted, and the decision model may be updated based on the calculated inner product.
In one aspect of the present application, since the target data is obtained from the second plaintext and the ciphertext data, the target data does not directly include data stored by the first terminal device, and therefore, the first terminal device can only perform an operation on the ciphertext data to obtain the target data, and therefore, it can be seen that, for the first terminal device that transmits data and the second terminal device that receives data, both the first terminal device and the second terminal device do not directly obtain data of the other side, so that the security of data transmission between the two sides can be ensured. In another aspect, the second terminal device may obtain a result of common calculation of the data stored in the first terminal device and the second terminal device through the data transmission manner, and in the data encryption process, a rotation function is not used in a calculation process of the result data, so that the efficiency of data processing may be improved on the premise of ensuring data security.
In another embodiment of the present application, the target data is stored in a Blockchain node, and a Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, and an encryption algorithm. The blockchain is essentially a decentralized database, which is a string of data blocks associated by using cryptography, each data block contains information of a batch of network transactions, and the information is used for verifying the validity (anti-counterfeiting) of the information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
Referring to fig. 3, a block chain network of the data processing method based on federated learning includes a participant node, where the participant node is used to store data generated by a federated learning node in a data processing process based on federated learning, as shown in fig. 3, the block chain network includes a participant node 1 and a participant node 2, the federated learning node 1 may be a terminal device, the federated learning node 2 may also be a terminal device, the federated learning node 1 may send ciphertext data to the federated learning node 2, the federated learning node 2 may calculate target data and packed data based on the ciphertext data, the federated learning node 2 may store the target data to the corresponding participant node 2 and send the packed data to the federated learning node 1, the federated learning node 1 may decrypt the comparative data to obtain the target data, and stores the target data in the participant node 1 corresponding to the federal learning node 1. In order to ensure information intercommunication in the blockchain network, information connection can exist between each node in the blockchain network, and information transmission can be carried out between the nodes through the information connection.
Each node in the blockchain network has a corresponding node identifier, and each node in the blockchain network can store node identifiers of other nodes in the blockchain network, so that blocks generated by encryption can be broadcast to other nodes in the blockchain network according to the node identifiers of other nodes. Each node may maintain a node identifier list as shown in the following table, and store the node name and the node identifier in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol) address and any other information that can be used to identify the node, and table 1 only illustrates the IP address as an example.
TABLE 1
Node name Node identification
Node
1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
Optionally, the data processing method based on federal learning may be applied to a blockchain device, where the first terminal device and the second terminal device are the blockchain device, the blockchain device is a node in a blockchain, and the target data may be stored on the blockchain node.
In another embodiment of the present application, in order to improve the accuracy of the first plaintext calculation, the first plaintext may be obtained by encoding the first to-be-encrypted data in a preset manner, as shown in fig. 4, the step S201 is replaced by the following steps S401 to S402:
step S401, determining the first data to be encrypted as a polynomial coefficient.
Step S402, the polynomial coefficients are encoded into a first plaintext according to a preset mode.
The data structure in the first plain text is a polynomial structure, and the powers of any two monomials in the first plain text are different.
By implementing the above steps S401 to S402, the first to-be-encrypted data may be determined as polynomial coefficients, the polynomial coefficients may be encoded into the first plaintext, the data format of the first plaintext is a polynomial format, and the power numbers of any two monomials in the first plaintext are different, so that the first plaintext may be subjected to power differentiation on different monomials during the operation process, thereby improving the accuracy of the first plaintext calculation.
In this embodiment of the application, the first data to be encrypted may be determined as a polynomial coefficient, and the polynomial coefficient may be encoded into the first plaintext in a preset manner, the preset manner encoding may be the same as the encoding manner of the second plaintext, and the data formats of the obtained plaintext may all be in a polynomial format, for example, the first data to be encrypted may include n characteristic values, and the first characteristic value in the ordering may be n1The coefficient of the first monomial in the polynomial of the first plaintext may be n1The power of the unknown number in the first polynomial may be a numerical value corresponding to the first order, for example, may be 0,1, or 2, and the like, which is not limited in the embodiments of the present application; and the power of the unknown number in each monomial corresponding to the n characteristic valuesAre all different.
As an alternative embodiment, in order to improve the calculation efficiency of the packed data, a second plaintext may be obtained by encoding the second data to be encrypted in a preset manner, and the packed data is obtained by calculating the second plaintext and the ciphertext data, as shown in fig. 5, the steps S204 to S206 are replaced by the following steps S501 to S508:
step S501, inverting the second data to be encrypted to obtain a polynomial coefficient;
step S502, the polynomial coefficients are encoded into a second plaintext in a preset manner, the data structure of the second plaintext is a polynomial structure, the numbers of the power of any two monomials in the second plaintext are different, the number of the power of each monomial in the second plaintext corresponds to the number of the power of each monomial in the first plaintext one by one, and the number of the power of any one monomial in the second plaintext is the same as the number of the power of the corresponding monomial in the first plaintext.
By implementing the steps S501 to S502, the second data to be encrypted may be inverted to obtain polynomial coefficients, and the polynomial coefficients are encoded into the second plaintext in a preset manner, the obtained data formats of the second plaintext and the first plaintext are both polynomial structures, each polynomial in the first plaintext corresponds to one polynomial in the second plaintext, the polynomials in the second plaintext corresponding to any two polynomials in the first plaintext are different, the power number of any one polynomial in the first plaintext is the same as the power number of the corresponding polynomial in the second plaintext, and the accuracy of the encryption operation in the homomorphic encryption process may be ensured by the same data format of the first plaintext and the second plaintext.
In this embodiment of the application, the format of the polynomial in the second plaintext is the same as the format of the polynomial in the first plaintext, the second data to be encrypted may be inverted first to obtain a polynomial coefficient, and the polynomial coefficient may be encoded into the second plaintext in a preset manner, the preset manner encoding may be the same as the encoding manner of the first plaintext, for example, the second data to be encrypted may include n tag values, the first tag value sorted in the polynomial in the second plaintext may be a first monomial, and the power of the unknown number in the first monomial may be the same as the power of the first monomial in the polynomial in the first plaintext, and the powers of the unknown numbers in each monomial corresponding to the n tag values are different.
For example, the second data to be encrypted stored in the first terminal device may include 4 tag values (0, 1,0, 1), the tag values (0, 1,0, 1) may be inverted first to obtain inverted tag values (1, 0,1, 0), the inverted tag values (1, 0,1, 0) may be used as coefficients of each polynomial, for example, the obtained polynomial may be f (x) =1+ x2It can be seen that the first monomial of the polynomial is 1, where 1 is the first label value after inversion 1, and the power of the unknown number x is 0; and the second monomial of the polynomial is 0 because the inverted second label value is 0 and the power of the unknown x is 1, and thus the second monomial is 0; and the third monomial of the polynomial is x2Wherein 1 is the inverted third label value 1, and the power of the unknown number x is 2; and the fourth polynomial of the polynomial is 0 because the inverted fourth label value is 0 and the power of the unknown number x is 3, and thus the fourth polynomial is 0; it can be seen that the power of the unknown x in the first polynomial in polynomial f (x) is the same as the power of the unknown x in the first polynomial in polynomial m (x); the power of the unknown x in the second polynomial in polynomial f (x) is the same as the power of the unknown x in the second polynomial in polynomial m (x); the power of the unknown x in the third monomial in polynomial f (x) is the same as the power of the unknown x in the third monomial in polynomial m (x); the power of the unknown x in the fourth monomial in polynomial f (x) is the same as the power of the unknown x in the fourth monomial in polynomial m (x); and the powers of the unknowns of each of the polynomials f (x) are different, the polynomial f (x) can be determined as the second plaintext.
Step S503, multiplying the second plaintext by the ciphertext data to obtain a target polynomial;
step S504, obtain the coefficient of the appointed monomial from the said goal polynomial; wherein the power number of the specified monomial is the same as the power number of the last monomial of the first plaintext;
step S505, determining the coefficient and the target polynomial as the target data, where the first plaintext, the second plaintext and the target data are identical in data structure.
By implementing the above steps S503 to S505, the second plaintext may be multiplied by the ciphertext data to obtain the target polynomial, and the coefficient of the single polynomial specified in the target polynomial and the target polynomial may be determined as the target data together, so that the target data is more comprehensive.
In the embodiment of the present application, the target polynomial may be obtained by multiplying the second plaintext by the ciphertext data, and because the data formats of the second plaintext and the ciphertext data are both polynomial formats, the target polynomial in the polynomial format may also be obtained after the multiplication, and the power number of the specified single-term in the target polynomial may be the same as the power number of the last single-term in the first plaintext.
For example, the second plaintext may be f (x) =1+ x2The ciphertext data may be m (x) =1+2x +3x2+4x3Multiplying the second plaintext by the ciphertext data to obtain a target polynomial h (x) =1+2x +4x2+6x3+3x4+4x5Wherein the last monomial of the polynomial in the first plaintext for generating the ciphertext data is 4 ×3Thus, the specified monomials in the target polynomial h (x) may be 6x with the same 3 degree power3It can be seen that the coefficient of the specified monomial is 6.
Step S506, acquiring the coefficient of the specified polynomial from the target data and acquiring a vector formed by the coefficient of each polynomial in the target polynomial;
step S507, encrypting the coefficient of the specified monomial expression and the vector to obtain a target ciphertext;
and step S508, packaging the target ciphertext to obtain the packaged data.
By implementing the steps S506 to S508, the target polynomial may be encrypted according to the coefficient of the specified polynomial and the coefficient of each polynomial in the target polynomial to obtain a target ciphertext, and the target ciphertext is packed into packed data, so that the target polynomial is safer in the transmission process.
In the embodiment of the application, a coefficient of each polynomial in a target polynomial can be obtained from target data, a vector is formed by the coefficient of each polynomial, the coefficient and the vector of a specified polynomial can be determined as a ciphertext in an LWE format, it can be seen that a second data to be encrypted stored in a first terminal device cannot be directly seen by the ciphertext in the LWE format, therefore, the ciphertext in the LWE format can ensure the security of the second data to be encrypted, the ciphertext in the LWE format can be determined as a target ciphertext, the target ciphertext can be packaged to obtain packaged data, the packaging process can be performed by packaging the ciphertext in the LWE format by using a plurality of LWE-to-RLWE, in the embodiment of the application, a rotation function is used only in the packaging process, a rotation function is not used in other processes, the rotation function reduces the amplitude to be expected to be O (n/log (n)), the efficiency of data processing of the first terminal device and the second terminal device can be greatly improved.
The data processing method and the data processing device can improve the data processing efficiency while ensuring the safety of data transmission between two parties. In addition, the method and the device can also ensure the accuracy of encryption operation in the homomorphic encryption process. In addition, the target data can be more comprehensive. In addition, the target polynomial can be safer in the transmission process. In addition, the accuracy of the first plaintext calculation can be improved.
Exemplary devices
Having described the method according to the exemplary embodiment of the present application, next, a data processing apparatus based on federal learning according to the exemplary embodiment of the present application, which is applied to a first terminal device, will be described with reference to fig. 6, where the apparatus includes:
a first receiving unit 601 configured to receive ciphertext data from a second terminal apparatus; the ciphertext data is obtained by homomorphic encryption of a first plaintext by the second terminal equipment, and the first plaintext is obtained by encoding the first data to be encrypted by the second terminal equipment;
a first encoding unit 602, configured to encode second data to be encrypted to obtain a second plaintext, where the first plaintext and the second plaintext are identical in data structure;
a target data operation unit 603, configured to obtain target data according to the second plaintext obtained by the first encoding unit 602 and the ciphertext data obtained by the first receiving unit 601;
a packing unit 604, configured to pack the target data obtained by the target data operation unit 603 to obtain packed data, and send the packed data to the second terminal device.
As an optional implementation manner, the data structure of the first plaintext is a polynomial structure, and the manner of encoding the second data to be encrypted by the first encoding unit 602 to obtain the second plaintext specifically is:
inverting the second data to be encrypted to obtain a polynomial coefficient;
and coding the polynomial coefficients into a second plaintext in a preset mode, wherein the data structure of the second plaintext is a polynomial structure, the numbers of the power of any two monomials in the second plaintext are different, the number of the power of each monomial in the second plaintext is in one-to-one correspondence with the number of the power of each monomial in the first plaintext, and the number of the power of any one monomial in the second plaintext is the same as the number of the power of the corresponding monomial in the first plaintext.
By implementing the implementation mode, the second data to be encrypted can be inverted to obtain polynomial coefficients, the polynomial coefficients are encoded into the second plaintext in a preset mode, the obtained data formats of the second plaintext and the first plaintext are both polynomial structures, each polynomial in the first plaintext corresponds to one polynomial in the second plaintext, the polynomials in the second plaintext corresponding to any two polynomials in the first plaintext are different, the power number of any one polynomial in the first plaintext is the same as the power number of the corresponding polynomial in the second plaintext, and the accuracy of encryption operation in the homomorphic encryption process can be ensured through the data format with the same first plaintext and the same second plaintext.
As an optional implementation manner, the manner of obtaining the target data according to the second plaintext and the ciphertext data by the target data operation unit 603 is specifically:
multiplying the second plaintext by the ciphertext data to obtain a target polynomial;
obtaining coefficients specifying a monomial from the target polynomial; wherein the power number of the specified monomial is the same as the power number of the last monomial of the first plaintext;
determining the coefficients and the target polynomial as the target data, the target data being stored on blockchain nodes.
In this embodiment, the second plaintext may be multiplied by the ciphertext data to obtain the target polynomial, and the coefficient of the single polynomial specified in the target polynomial and the target polynomial may be determined together as the target data, so that the target data is more comprehensive.
As an optional implementation manner, the packing unit 604 packs the target data, and the manner of obtaining the packed data specifically is:
obtaining the coefficients of the specified monomials from the target data and obtaining a vector formed by the coefficients of each monomial in the target polynomial;
encrypting the coefficient of the specified monomial and the vector to obtain a target ciphertext;
and packaging the target ciphertext to obtain the packaged data.
By implementing the implementation mode, the target polynomial can be encrypted according to the coefficient of the specified polynomial in the target polynomial and the coefficient of each polynomial to obtain a target ciphertext, and the target ciphertext is packaged into packaged data, so that the target polynomial is safer in the transmission process.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a data processing apparatus based on federal learning according to another embodiment of the present application, where the apparatus is applied to a second terminal device, and the apparatus includes:
a second encoding unit 701, configured to encode the first data to be encrypted to obtain a first plaintext;
an encrypting unit 702, configured to perform homomorphic encryption on the first plaintext obtained by the second encoding unit 701 to obtain ciphertext data, and send the ciphertext data to a first terminal device;
a second receiving unit 703, configured to receive packed data from the first terminal device, where the packed data is obtained by encrypting, by the first terminal device, target data obtained according to a second plaintext and the ciphertext data; the second plaintext is obtained by encoding according to second data to be encrypted; the first plaintext and the second plaintext are identical in data structure;
a decrypting unit 704, configured to decrypt the packed data obtained by the second receiving unit 703 to obtain the target data, where the target data is stored in a block chain node.
As an optional implementation manner, the manner of encoding the first to-be-encrypted data by the second encoding unit 701 to obtain the first plaintext is specifically:
determining the first data to be encrypted as a polynomial coefficient;
and coding the polynomial coefficient into a first plaintext in a preset mode, wherein the data structure in the first plaintext is a polynomial structure, and the power numbers of any two monomials in the first plaintext are different.
By implementing the implementation mode, the first to-be-encrypted data can be determined as the polynomial coefficient, the polynomial coefficient is encoded into the first plaintext, the data format of the first plaintext is the polynomial format, and the power numbers of any two monomials in the first plaintext are different, so that the first plaintext can be used for distinguishing different monomials through the power numbers in the operation process, and the accuracy of the calculation of the first plaintext is improved.
Exemplary Medium
Having described the method and apparatus of the exemplary embodiments of the present application, next, a computer-readable storage medium of the exemplary embodiments of the present application will be described with reference to fig. 8, please refer to fig. 8, which illustrates a computer-readable storage medium, which is an optical disc 800 having a computer program (i.e., a program product) stored thereon, which when executed by a processor, implements the steps described in the above-mentioned method embodiments, for example, receiving ciphertext data from a second terminal device; the ciphertext data is obtained by homomorphic encryption of a first plaintext by a second terminal device, and the first plaintext is obtained by encoding a first data to be encrypted by the second terminal device; coding the second data to be encrypted to obtain a second plaintext; obtaining target data according to the second plaintext and the ciphertext data; encrypting the target data to obtain packed data, and sending the packed data to the second terminal device, wherein the first plaintext, the second plaintext and the target data are the same in data structure; the specific implementation of each step is not repeated here.
It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory, or other optical and magnetic storage media, which are not described in detail herein.
Exemplary computing device
Having described the methods, media, and apparatus of the exemplary embodiments of the present application, a computing device for federated learning-based data processing of the exemplary embodiments of the present application is next described with reference to FIG. 9.
FIG. 9 illustrates a block diagram of an exemplary computing device 90 suitable for use in implementing embodiments of the present application, the computing device 90 may be a computer system or server. The computing device 90 shown in fig. 9 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the present application.
As shown in fig. 9, components of computing device 90 may include, but are not limited to: one or more processors or processing units 901, a system memory 902, and a bus 903 that couples the various system components including the system memory 902 and the processing unit 901.
Computing device 90 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computing device 90 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 902 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 9021 and/or cache memory 9022. Computing device 90 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, ROM9023 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 9, and commonly referred to as a "hard drive"). Although not shown in FIG. 9, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 903 by one or more data media interfaces. At least one program product may be included in system memory 902 having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the application.
A program/utility 9025 having a set (at least one) of program modules 9024 may be stored, for example, in system memory 902, and such program modules 9024 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment. Program modules 9024 generally perform the functions and/or methods of the embodiments described herein.
Computing device 90 may also communicate with one or more external devices 904 (e.g., keyboard, pointing device, display, etc.). Such communication may occur via input/output (I/O) interfaces 605. Moreover, computing device 90 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via network adapter 906. As shown in FIG. 9, network adapter 906 communicates with other modules of computing device 90, such as processing unit 901, via bus 903. It should be appreciated that although not shown in FIG. 9, other hardware and/or software modules may be used in conjunction with computing device 90.
The processing unit 901 executes various functional applications and data processing by executing a program stored in the system memory 902, for example, receiving ciphertext data from the second terminal apparatus; the ciphertext data is obtained by homomorphic encryption of a first plaintext by a second terminal device, and the first plaintext is obtained by encoding a first data to be encrypted by the second terminal device; coding the second data to be encrypted to obtain a second plaintext; obtaining target data according to the second plaintext and the ciphertext data; and encrypting the target data to obtain packed data, and sending the packed data to the second terminal equipment, wherein the first plaintext, the second plaintext and the target data are identical in data structure. The specific implementation of each step is not repeated here. It should be noted that although in the above detailed description several units/modules or sub-units/sub-modules of the artificial intelligence based appliance tagging apparatus are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module, according to embodiments of the application. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
In the description of the present application, it is noted that the terms "first", "second", and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the application have been described with reference to several particular embodiments, it is to be understood that the application is not limited to the particular embodiments disclosed, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit from the present disclosure. The application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (11)

1. A data processing method based on federal learning is applied to a first terminal device, and the method comprises the following steps:
receiving ciphertext data from the second terminal device; the ciphertext data is obtained by fully homomorphic encryption of a first plaintext by the second terminal equipment, and the first plaintext is obtained by encoding first data to be encrypted by the second terminal equipment; wherein the data structure of the first plaintext is a polynomial structure;
encoding second data to be encrypted to obtain second plaintext, wherein the first plaintext and the second plaintext are identical in data structure;
obtaining target data according to the second plaintext and the ciphertext data;
packaging the target data to obtain packaged data, and sending the packaged data to the second terminal equipment;
wherein, the encoding the second data to be encrypted to obtain a second plaintext includes:
inverting the second data to be encrypted to obtain a polynomial coefficient;
and coding the polynomial coefficients into a second plaintext in a preset mode, wherein the data structure of the second plaintext is a polynomial structure, the numbers of the power of any two monomials in the second plaintext are different, the number of the power of each monomial in the second plaintext is in one-to-one correspondence with the number of the power of each monomial in the first plaintext, and the number of the power of any one monomial in the second plaintext is the same as the number of the power of the corresponding monomial in the first plaintext.
2. The federal learning based data processing method as claimed in claim 1, wherein the obtaining target data from the second plaintext and the ciphertext data comprises:
multiplying the second plaintext by the ciphertext data to obtain a target polynomial;
obtaining coefficients specifying a monomial from the target polynomial; wherein the power number of the specified monomial is the same as the power number of the last monomial of the first plaintext;
determining the coefficients and the target polynomial as the target data.
3. The federal learning-based data processing method as claimed in claim 2, wherein the packaging the target data to obtain packaged data comprises:
obtaining the coefficients of the specified monomials from the target data and obtaining a vector formed by the coefficients of each monomial in the target polynomial;
encrypting the coefficient of the specified monomial and the vector to obtain a target ciphertext;
and packaging the target ciphertext to obtain the packaged data.
4. The federated learning-based data processing method of any one of claims 1-3, wherein the target data is stored on blockchain nodes.
5. A data processing method based on federal learning is applied to a second terminal device, and the method comprises the following steps:
encoding first data to be encrypted to obtain a first plaintext, wherein the data structure of the first plaintext is a polynomial structure;
carrying out full homomorphic encryption on the first plaintext to obtain ciphertext data, and sending the ciphertext data to first terminal equipment;
receiving packed data from the first terminal device, wherein the packed data is obtained by encrypting target data obtained according to a second plaintext and the ciphertext data by the first terminal device; the second plaintext is obtained by encoding in a preset mode according to a polynomial coefficient obtained by inverting the second data to be encrypted; the first plaintext and the second plaintext are identical in data structure; the data structure of the second plaintext is a polynomial structure, the number of the power of any two monomials in the second plaintext is different, the number of the power of each monomial in the second plaintext corresponds to the number of the power of each monomial in the first plaintext one by one, and the number of the power of any one monomial in the second plaintext is the same as the number of the power of the corresponding monomial in the first plaintext;
and decrypting the packed data to obtain the target data.
6. The federal learning-based data processing method as claimed in claim 5, wherein said encoding the first to-be-encrypted data to obtain a first plaintext includes:
determining the first data to be encrypted as a polynomial coefficient;
and coding the polynomial coefficient into a first plaintext in a preset mode, wherein the data structure in the first plaintext is a polynomial structure, and the power numbers of any two monomials in the first plaintext are different.
7. The federated learning-based data processing method of claim 5 or 6, the target data being saved on blockchain nodes.
8. A data processing device based on federal learning is applied to a first terminal device, and the device comprises:
a first receiving unit configured to receive ciphertext data from a second terminal apparatus; the ciphertext data is obtained by fully homomorphic encryption of a first plaintext by the second terminal equipment, and the first plaintext is obtained by encoding first data to be encrypted by the second terminal equipment; wherein the data structure of the first plaintext is a polynomial structure;
the first encoding unit is used for encoding second data to be encrypted to obtain second plaintext, and the first plaintext and the second plaintext are identical in data structure;
the target data operation unit is used for obtaining target data according to the second plaintext and the ciphertext data;
the packaging unit is used for packaging the target data to obtain packaged data and sending the packaged data to the second terminal equipment;
the method for encoding the second to-be-encrypted data by the first encoding unit to obtain the second plaintext specifically comprises the following steps:
inverting the second data to be encrypted to obtain a polynomial coefficient; and coding the polynomial coefficients into a second plaintext in a preset mode, wherein the data structure of the second plaintext is a polynomial structure, the numbers of the power of any two monomials in the second plaintext are different, the number of the power of each monomial in the second plaintext is in one-to-one correspondence with the number of the power of each monomial in the first plaintext, and the number of the power of any one monomial in the second plaintext is the same as the number of the power of the corresponding monomial in the first plaintext.
9. A data processing device based on federal learning is applied to a second terminal device, and the device comprises:
the second encoding unit is used for encoding first data to be encrypted to obtain a first plaintext, and the data structure of the first plaintext is a polynomial structure;
the encryption unit is used for carrying out full homomorphic encryption on the first plaintext to obtain ciphertext data and sending the ciphertext data to the first terminal equipment;
a second receiving unit, configured to receive packed data from the first terminal device, where the packed data is obtained by encrypting, by the first terminal device, target data obtained according to a second plaintext and the ciphertext data; the second plaintext is obtained by encoding in a preset mode according to a polynomial coefficient obtained by inverting the second data to be encrypted; the first plaintext and the second plaintext are identical in data structure; the data structure of the second plaintext is a polynomial structure, the number of the power of any two monomials in the second plaintext is different, the number of the power of each monomial in the second plaintext corresponds to the number of the power of each monomial in the first plaintext one by one, and the number of the power of any one monomial in the second plaintext is the same as the number of the power of the corresponding monomial in the first plaintext;
and the decryption unit is used for decrypting the packed data to obtain the target data.
10. A storage medium storing a program, wherein the storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 4 or performs the method of any one of claims 5 to 7.
11. A computing device, the computing device comprising a processor and a memory:
the memory is used for storing program codes;
the processor is configured to perform the method of any one of claims 1 to 4 or to perform the method of any one of claims 5 to 7 according to instructions in the program code.
CN202111623493.0A 2021-12-28 2021-12-28 Data processing method, device and medium based on federal learning Active CN114006689B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111623493.0A CN114006689B (en) 2021-12-28 2021-12-28 Data processing method, device and medium based on federal learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111623493.0A CN114006689B (en) 2021-12-28 2021-12-28 Data processing method, device and medium based on federal learning

Publications (2)

Publication Number Publication Date
CN114006689A CN114006689A (en) 2022-02-01
CN114006689B true CN114006689B (en) 2022-04-12

Family

ID=79932076

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111623493.0A Active CN114006689B (en) 2021-12-28 2021-12-28 Data processing method, device and medium based on federal learning

Country Status (1)

Country Link
CN (1) CN114006689B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368320A (en) * 2020-03-06 2020-07-03 同盾控股有限公司 Secure multiparty computing method and device based on homomorphic encryption
CN112906044A (en) * 2021-05-10 2021-06-04 腾讯科技(深圳)有限公司 Multi-party security calculation method, device, equipment and storage medium
CN113542228A (en) * 2021-06-18 2021-10-22 腾讯科技(深圳)有限公司 Data transmission method and device based on federal learning and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11599832B2 (en) * 2019-06-27 2023-03-07 The Regents Of The University Of California Systems, circuits and computer program products providing a framework for secured collaborative training using hyper-dimensional vector based data encoding/decoding and related methods

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368320A (en) * 2020-03-06 2020-07-03 同盾控股有限公司 Secure multiparty computing method and device based on homomorphic encryption
CN112906044A (en) * 2021-05-10 2021-06-04 腾讯科技(深圳)有限公司 Multi-party security calculation method, device, equipment and storage medium
CN113542228A (en) * 2021-06-18 2021-10-22 腾讯科技(深圳)有限公司 Data transmission method and device based on federal learning and readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于NTRU的多密钥同态代理重加密方案及其应用;李瑞琪等;《通信学报》;20210331;第42卷(第3期);全文 *
机器学习的隐私保护研究综述;刘俊旭等;《计算机研究与发展》;20200229;第57卷(第2期);全文 *

Also Published As

Publication number Publication date
CN114006689A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
TWI734368B (en) Data homomorphic encryption and decryption method and device for realizing privacy protection
TWI701623B (en) Logistics information transmission method, system and device based on blockchain
US20200177366A1 (en) Homomorphic data encryption method and apparatus for implementing privacy protection
JP6674961B2 (en) Computer-implemented method for adapting a deterministically reproducible, cryptographic representation to a group of all associated items in a lot of similar items across a distribution chain
Alowolodu et al. Elliptic curve cryptography for securing cloud computing applications
CN109687952A (en) Data processing method and its device, electronic device and storage medium
US20150172044A1 (en) Order-preserving encryption system, encryption device, decryption device, encryption method, decryption method, and programs thereof
WO2022035909A1 (en) Methods for somewhat homomorphic encryption and key updates based on geometric algebra for distributed ledger technology
CN111950022A (en) Desensitization method, device and system based on structured data
CN112199697A (en) Information processing method, device, equipment and medium based on shared root key
CN108170753B (en) Key-Value database encryption and security query method in common cloud
US11356254B1 (en) Encryption using indexed data from large data pads
JP2014137474A (en) Tamper detection device, tamper detection method, and program
CN113055153A (en) Data encryption method, system and medium based on fully homomorphic encryption algorithm
JP7233265B2 (en) Signature device, verification device, signature method, verification method, signature program and verification program
JP7117964B2 (en) Decryption device, encryption system, decryption method and decryption program
CN114006689B (en) Data processing method, device and medium based on federal learning
CN115225367A (en) Data processing method, device, computer equipment, storage medium and product
CN115085897A (en) Data processing method and device for protecting privacy and computer equipment
US11374753B2 (en) System and method for selective transparency for public ledgers
CN113645022A (en) Method and device for determining privacy set intersection, electronic equipment and storage medium
Liu et al. Video data integrity verification method based on full homomorphic encryption in cloud system
CN117061128B (en) Verification method and device for data replacement, storage medium and electronic equipment
CN111008236A (en) Data query method and system
CN114817970B (en) Data analysis method and system based on data source protection and related 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
GR01 Patent grant
GR01 Patent grant