Data processing method, device, computer equipment, storage medium and product

Through hidden processing and encryption and decryption technology on the index, the problem of low data processing efficiency when K is large in Oblivious Transfer is solved, and efficient data interaction and index information security are achieved.

CN115225367BActive Publication Date: 2024-12-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210835257.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-15
Publication Date
2024-12-03
Estimated Expiration
2042-07-15

AI Technical Summary

Technical Problem

On the premise of ensuring data security, when the existing Oblivious Transfer technology is large, the amount of data sent by Party A is large and Party B is long processing time, resulting in low data processing efficiency.

Method used

By hiding the index, the second data end cannot know the index of the first data end, and data encryption and decryption are used to encrypt and decrypt data, reducing the data transmission and processing amount.

Benefits of technology

It improves data processing efficiency, reduces the data transmission volume of Party A and the data processing volume of Party B, and ensures that index information is not leaked.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115225367B_ABST
    Figure CN115225367B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a data processing method, apparatus, computer equipment, storage medium and product. The embodiments of the present application obtain an index and a first character string and a negated character string of the first character string for encryption; perform an AND calculation on the index to obtain first index hidden data; perform an AND calculation on the negated index to obtain second index hidden data; encrypt the first index hidden data by the first character string to obtain first encrypted index data, and encrypt the second index hidden data by the negated character string to obtain second encrypted index data; send the first encrypted index data and the second encrypted index data to a second data end so that the second data end can predict the second character string, and encrypt each data to obtain candidate encrypted data; receive the encrypted candidate data, decrypt the encrypted candidate data according to the first character string, obtain the target data corresponding to the index, and improve data processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and specifically to a data processing method, apparatus, computer equipment, storage medium and product, wherein the storage medium is a computer-readable storage medium and the product is a computer program product. Background Art

[0002] With the development of computer technology and the increasing attention paid to data security, how to interact with data under the premise of ensuring data security is a major problem at present. Assuming that Party A needs to obtain k pieces of data from Party B's n pieces of data without letting Party B know which k pieces of data it has obtained, it can usually be achieved through oblivious transfer (OT). Specifically, Party A needs to encrypt the data identifiers corresponding to the k pieces of data to be obtained, obtain k pieces of data, and send the k pieces of data to Party B. Party B encrypts the n pieces of data based on the received k pieces of data and returns k×n pieces of decrypted data to Party A. Party A can obtain k pieces of data from the k×n pieces of decrypted data. In this process, Party A cannot obtain other data except k pieces of data, and Party B cannot know which k pieces of data Party A has obtained. However, when k is larger, the amount of data sent by Party A is larger, and the amount of data that Party B needs to process is also larger, resulting in a longer data processing process, occupying more computer resources, and low data processing efficiency. Summary of the invention

[0003] The embodiments of the present application provide a data processing method, apparatus, computer equipment, storage medium and product. The index can be hidden by performing data and calculation on the index, so that the second data end cannot know the index of the first data end. The second data end predicts a second character string for encrypting each candidate data based on the first encrypted index data and the second encrypted index data, and encrypts the candidate data based on the second character string to obtain the candidate encrypted data. When the candidate data is the target data corresponding to the index, the second character string predicted by the second data end is the same as the first character string. The first data end can decrypt the candidate encrypted data sent by the second data end based on the first character string to obtain the target data corresponding to the index. The first data end only needs to send the first encrypted index data and the second encrypted index data to obtain the required target data from the second data end without leaking the index information. This scheme reduces the amount of data sent by the first data end, while reducing the amount of data processing by the second data end, thereby improving data processing efficiency.

[0004] A data processing method provided in an embodiment of the present application includes:

[0005] Obtaining indexes of a plurality of pieces of data to be received from a second data end at the second data end, as well as a first character string used to encrypt the plurality of pieces of data and a negated character string of the first character string;

[0006] Performing AND calculation on the index to obtain first index hidden data;

[0007] Performing AND calculation on the inverted index to obtain second index hidden data, wherein the inverted index is obtained by performing logical inversion processing on the index;

[0008] Encrypt the first index hidden data using the first character string to obtain first encrypted index data, and encrypt the second index hidden data using the inverted character string to obtain second encrypted index data;

[0009] Sending the first encrypted index data and the second encrypted index data to a second data end, so that the second data end predicts a second string used to encrypt each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypts each data according to the second string to obtain the candidate encrypted data;

[0010] The encrypted candidate data is received, and the encrypted candidate data is decrypted according to the first character string to obtain target data corresponding to the index.

[0011] Accordingly, another data processing method provided in an embodiment of the present application includes:

[0012] Receiving first encrypted index data and second encrypted index data sent by the first data end;

[0013] respectively performing AND calculation on the inverted index corresponding to each candidate data in the second data end and the first encrypted index data to obtain first decrypted data corresponding to the candidate data, wherein the inverted index is obtained by performing logical inversion processing on the index;

[0014] Respectively performing AND calculation on the index corresponding to each candidate data and the second encrypted index data to obtain the second decrypted data corresponding to each candidate data;

[0015] Performing data calculation on the first decrypted data and the second decrypted data corresponding to each piece of the candidate data to obtain a second character string used for encrypting each piece of the candidate data;

[0016] Performing an XOR calculation on each piece of the candidate data and the corresponding second character string to obtain encrypted candidate data of each piece of the candidate data;

[0017] The encrypted candidate data is sent to the first data end, so that the first data end decrypts the encrypted candidate data based on the first character string to obtain the target data.

[0018] Accordingly, an embodiment of the present application further provides a data processing device, including:

[0019] An acquisition unit, used for acquiring indexes of a plurality of pieces of data to be received from a second data end at the second data end, and a first character string used for encrypting the plurality of pieces of data and a negated character string of the first character string;

[0020] A first calculation unit, configured to perform an AND calculation on the index to obtain first index hidden data;

[0021] A second calculation unit is used to perform an AND calculation on the inverted index to obtain second index hidden data, wherein the inverted index is obtained by performing a logical inversion process on the index;

[0022] an encryption unit, configured to encrypt the first index hidden data by using the first character string to obtain first encrypted index data, and to encrypt the second index hidden data by using the inverted character string to obtain second encrypted index data;

[0023] a sending unit, configured to send the first encrypted index data and the second encrypted index data to a second data end, so that the second data end predicts a second character string used to encrypt each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypts each data according to the second character string to obtain the candidate encrypted data;

[0024] A decryption unit is used to receive the encrypted candidate data, decrypt the encrypted candidate data according to the first character string, and obtain the target data corresponding to the index.

[0025] In one embodiment, the plurality of pieces of data are included in a second data set, and the data processing device further includes:

[0026] A set acquisition unit, configured to acquire a first data set from the first data end;

[0027] A data acquisition unit, configured to acquire query data from the first data set;

[0028] A data generating unit is used to generate sample alignment data between the first data set and the second data set according to the target data and the query data.

[0029] In one embodiment, the encryption unit comprises:

[0030] A first OR calculation subunit, configured to perform an OR calculation on the first character string and the first index hidden data to obtain first encrypted index data;

[0031] The second OR calculation subunit is used to perform an OR calculation on the inverted character string and the second index hidden data to obtain second encrypted index data.

[0032] In one embodiment, the acquisition unit includes:

[0033] A first data acquisition subunit, used to acquire a first initial character string and key data;

[0034] an encryption processing subunit, configured to encrypt the first initial character string using the key data to obtain the first character string;

[0035] The logical negation subunit is used to perform logical negation processing on the first character string to obtain a negated character string of the first character string.

[0036] In one embodiment, the acquisition unit includes:

[0037] A second data acquisition subunit is used to receive a second encrypted candidate index and set XOR data sent by the second data end based on a second index set;

[0038] A first summary mapping subunit is used to perform data summary mapping on a first candidate index in a first index set of the first data end to obtain first summary data corresponding to the first candidate index;

[0039] A first hiding subunit is used to perform data hiding processing on the first summary data based on the set XOR data to obtain a first encryption candidate index;

[0040] A comparison subunit is used to compare the first encryption candidate index with the second encryption candidate index to determine an index intersection between the first index set and the second index set, and obtain the index from the index intersection.

[0041] In one embodiment, the first hidden subunit includes:

[0042] A first key acquisition module, used to acquire a first key of the first data terminal;

[0043] A first key encryption module, configured to perform key encryption on the first summary data based on the first key to obtain a first initial encryption candidate index;

[0044] The first data encryption module is used to perform data encryption calculation on the first summary data based on the set XOR data and the first initial encryption candidate index to obtain a first encryption candidate index.

[0045] Accordingly, another data processing device provided in an embodiment of the present application includes:

[0046] A receiving unit, configured to receive first encrypted index data and second encrypted index data sent by a first data terminal;

[0047] a third calculation unit, configured to respectively perform AND calculation on the inverted index corresponding to each candidate data in the second data end and the first encrypted index data to obtain first decrypted data corresponding to the candidate data, wherein the inverted index is obtained by performing a logical inversion process on the index;

[0048] a fourth calculation unit, configured to respectively calculate an index corresponding to each piece of candidate data and the second encrypted index data to obtain second decrypted data corresponding to each piece of candidate data;

[0049] A data calculation unit, used for performing data calculation on the first decrypted data and the second decrypted data corresponding to each piece of the candidate data, to obtain a second character string used for encrypting each piece of the candidate data;

[0050] an XOR calculation unit, used for performing an XOR calculation on each of the candidate data and the corresponding second character string to obtain encrypted candidate data of each of the candidate data;

[0051] The second sending unit is used to send the encrypted candidate data to the first data end, so that the first data end decrypts the encrypted candidate data based on the first character string to obtain target data.

[0052] In one embodiment, the receiving unit includes:

[0053] A set acquisition subunit, used to acquire a second index set about the candidate data;

[0054] A second summary mapping subunit is used to perform data summary mapping on a second candidate index in the second index set to obtain second summary data corresponding to the second candidate index;

[0055] a set XOR calculation subunit, configured to perform an XOR calculation on the second summary data corresponding to the second candidate index to obtain set XOR data of the second index set;

[0056] A second hiding subunit is used to perform data hiding processing on each piece of the second summary data based on the set XOR data to obtain a second encryption candidate index;

[0057] a data sending subunit, configured to send the second encryption candidate index and the set XOR data to the first data end, so that the first data performs index encryption on the first candidate index in the first index set to obtain the first encryption candidate index, and determine the index intersection between the first index set and the second index set by comparing the first encryption candidate index with the second encryption candidate index;

[0058] The index acquisition subunit is used to receive the first encrypted index data and the second encrypted index data sent by the first data end after obtaining the index from the index intersection and performing index hiding processing on the index.

[0059] In one embodiment, the second hidden subunit includes:

[0060] A second key acquisition module, used to acquire a second key of the second data terminal;

[0061] A second key encryption module, configured to perform key encryption on the second summary data based on the second key to obtain a second initial encryption candidate index;

[0062] The second data encryption module is used to perform data encryption calculation on the second initial encryption candidate index based on the set XOR data to obtain a second encryption candidate index.

[0063] In one embodiment, the data calculation unit includes:

[0064] a data decryption subunit, configured to perform OR calculation on the first decrypted data and the second decrypted data to obtain target decrypted data of the candidate data;

[0065] An encryption string subunit, used for performing an XOR calculation on the index of the candidate data and the target decryption data to obtain an encrypted second string;

[0066] The character string decryption subunit is used to decrypt the encrypted second character string based on the key data of the second data end to obtain the second character string.

[0067] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any data processing method provided in the embodiment of the present application.

[0068] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any data processing method provided in the embodiment of the present application.

[0069] Correspondingly, an embodiment of the present application further provides a computer program product, including a computer program, which implements any data processing method provided in the embodiment of the present application when executed by a processor.

[0070] The embodiment of the present application obtains the index of multiple data that need to be received from the second data end, as well as the first string and the inverted string of the first string used to encrypt the multiple data through the embodiment of the present application; performs an AND calculation on the index to obtain the first index hidden data; performs an AND calculation on the inverted index to obtain the second index hidden data, and the inverted index is obtained by logically inverting the index; encrypts the first index hidden data through the first string to obtain the first encrypted index data, and encrypts the second index hidden data through the inverted string to obtain the second encrypted index data; sends the first encrypted index data and the second encrypted index data to the second data end, so that the second data end can predict the second string used to encrypt each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypts each data according to the second string to obtain the candidate encrypted data; receives the encrypted candidate data, decrypts the encrypted candidate data according to the first string, and obtains the target data corresponding to the index.

[0071] The embodiment of the present application can hide the index by performing data and calculation on the index, so that the second data end cannot know the index of the first data end. The second data end predicts the second character string for encrypting each candidate data based on the first encrypted index data and the second encrypted index data, and encrypts the candidate data based on the second character string to obtain the candidate encrypted data. When the candidate data is the target data corresponding to the index, the second character string predicted by the second data end is the same as the first character string. The first data end can decrypt the candidate encrypted data sent by the second data end according to the first character string to obtain the target data corresponding to the index. The first data end only needs to send the first encrypted index data and the second encrypted index data to obtain the required target data from the second data end without leaking the index information. This scheme reduces the amount of data sent by the first data end, and at the same time reduces the amount of data processing by the second data end, thereby improving data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0073] Figure 1is a flow chart of a data processing method provided in an embodiment of the present application;

[0074] Figure 2 is a flow chart of another data processing method provided in an embodiment of the present application;

[0075] Figure 3 is another flow chart of the data processing method provided in an embodiment of the present application;

[0076] Figure 4 is another flow chart of the data processing method provided in the embodiment of the present application;

[0077] Figure 5 is a schematic diagram of a data processing device provided in an embodiment of the present application;

[0078] Figure 6 is a schematic diagram of another data processing device provided in an embodiment of the present application;

[0079] Figure 7 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0081] The embodiments of the present application provide a data processing method, apparatus, computer equipment and computer-readable storage medium. The data processing apparatus can be integrated in a computer equipment, which can be a server or a terminal.

[0082] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.

[0083] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.

[0084] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0085] This embodiment will be described from the perspective of a data processing device. The data processing device may be integrated into a computer device, which may be a server or a terminal.

[0086] A data processing method provided in an embodiment of the present application can be applied to a scenario where data is obtained from the other party under the premise of protecting the data of the interacting parties from being leaked. For example, it can be applied to federated machine learning (Federated Machine Learning / Federated Learning), which can also be called federated learning, joint learning or alliance learning. Federated machine learning is a machine learning framework that can effectively help multiple institutions use data and perform machine learning modeling while meeting the requirements of user privacy protection, data security and government regulations. As a distributed machine learning paradigm, federated learning can effectively solve the problem of data silos, allowing participants to jointly model without sharing data, which can technically break data silos and achieve AI collaboration.

[0087] Specifically, assuming that there are institutions A and B collaborating on federated learning, institution A can obtain k pieces of data from institution B for training without institution B knowing the specific data it has obtained, so as to avoid the leakage of its own data. For example, institution A has data on x for products a, b, and c, and institution B has data on y for products a, b, c, and d. If institution B learns that institution A has obtained data on y for products a, b, and c, then institution B can infer that institution A may market products a, b, and c in the future. When institution B does not know the data obtained by institution A, institution A's own data will not be leaked.

[0088] An embodiment of the present application provides a data processing method, wherein a first data end and a second data end may be different computer devices, for example, the first data end is terminal A, and the second data end is server B; or the first data terminal is terminal A, and the second data end is terminal B. The second data end has a second data set, and the second data set includes n (n≥2) data. The first data end wants to obtain k (k≤2) data from the data set of the second data end, and the first data end does not know the data obtained by the first data end. At the same time, the first data end cannot obtain other data other than the k data from the second data end.

[0089] The AND calculation is a bitwise AND calculation. When the data involved in the calculation is not a binary string, the data can be converted into a binary string before the calculation. The symbol & can represent the AND calculation. For example, a&b represents the AND calculation of a and b. The symbol & can also be omitted, a&b=ab, 101&011=001.

[0090] Or the calculation is a bitwise OR calculation. The symbol & can represent an AND calculation. For example, a 丨 b means performing an OR calculation on a and b, and 101 丨 011 = 111.

[0091] The XOR calculation is a bitwise XOR calculation. The symbol ^ can represent the XOR calculation. For example, a ^ b means performing an XOR calculation on a and b, and 101 ^ 011 = 110.

[0092] The logical negation is processed as a bitwise negation calculation. The symbol - can represent the logical negation processing. For example, a - , which means performing a logical negation processing on a, and 101 - = 010.

[0093] As Figure 1 shown, the specific process of this data processing method can be as follows:

[0094] 101. Obtain the indexes of multiple pieces of data to be received from the second data end at the second data end, as well as the first string for encrypting the multiple pieces of data and the inverted string of the first string.

[0095] Among them, the index can be used to include information for obtaining target data. Each index can correspond to a piece of data. For example, the index can be information such as a number and an ID. According to the number or ID, the corresponding data can be queried, and there is a corresponding relationship between the data and the number or ID. For example, the score (data) of a student with a student number of 12345 (index).

[0096] Among them, the first string can include a string of characters composed of numbers, letters, and underscores. The inverted string is the string A obtained after performing a logical negation processing on the first string A - , for example, if the first string is 1011011, performing a logical negation on the first string means negating each bit of the first string, and the inverted string 0100100 is obtained.

[0097] For example, the second data end has a second data set, and the first data end has indexes for querying all or part of the data in the second data set. The first data end can obtain the indexes according to a preset rule. For example, randomly obtain the index of any data from the indexes existing in the first data end, or in response to a user's selection operation, obtain the index selected by the user, or obtain all the indexes of the first data end, and obtain the first string and the inverted string. The first string can be a preset string or a randomly generated string.

[0098] For example, the first data end and the second data end collaborate in model training. The second data set contains data such as prices, pictures, descriptions, sales, and comments of multiple commodities. The first data end has indexes of all or part of the commodities in the second data set, such as commodity IDs. The first data end can obtain the data of the corresponding commodity from the second data end through the commodity ID to increase the training data for model training, and perform model training based on the obtained commodity data to improve the training speed of the model. In this process, the second data end cannot know the specific data obtained by the first data end.

[0099] Assume that the second data end has n candidate data X=(X1,X2,X3,…,X n-1 ,X n ), and X corresponds to R=(R1,R R ,R3,…,R n-1 ,R n ,), the first data end needs to obtain k data from the second data end, so there are k indexes First string A, take the inverse of string A - The following example can be used to illustrate.

[0100] The index R obtained by the first data end may be sent by the second data end, or may be obtained from the intersection of indices between the first data set of the first data end and the second data set of the second data end. That is, in one embodiment, the step of "obtaining the indexes of the plurality of data pieces to be received from the second data end at the second data end" may specifically include:

[0101] Receive a second encrypted candidate index and set XOR data sent by a second data end based on a second index set;

[0102] Performing data summary mapping on a first candidate index in a first index set of a first data end to obtain first summary data corresponding to the first candidate index;

[0103] Based on the set XOR data, perform data hiding processing on the first summary data to obtain a first encryption candidate index;

[0104] The first encryption candidate index is compared with the second encryption candidate index to determine an index intersection between the first index set and the second index set, and an index is obtained from the index intersection.

[0105] Among them, the first index set can include at least one candidate index, and the second index set can include at least one candidate index. The first candidate index and the second candidate index can both be information such as numbers and IDs, and data with corresponding relationships can be queried based on the numbers or IDs.

[0106] For example, the second data end uses a hash function to perform a second index set The data summary mapping is performed on each second candidate index in the , and the obtained hash value is the second summary data of the second candidate index The hash function is irreversible. Even the hash function used in the data summary mapping and the obtained hash value cannot be restored to obtain the second candidate index, ensuring that the data is not leaked.

[0107] The second summary data corresponding to each second candidate index is XORed to obtain the set XOR data

[0108] The second data end performs data hiding processing based on the set XOR data and the second summary data to obtain a second encryption candidate index E=(E1, E2, E3, ..., E N1 ,). The data hiding process may include performing a logical calculation on the set XOR data and the second summary data, for example, an AND calculation, an OR calculation, an XOR calculation, and a negation calculation.

[0109] The second data end sends the second encryption candidate index E and the set XOR data Xor to the first data end.

[0110] The first data end receives the second encryption candidate index and the set XOR data sent by the second data end.

[0111] A data summary mapping is performed on the first candidate index in the first index set of the first data terminal to obtain the first summary data corresponding to the first candidate index; then, data hiding processing is performed on the first summary data of the first candidate index based on the set XOR data to obtain the first encrypted candidate index. The data hiding processing is performed in the same manner as the data hiding processing is performed by the second data terminal. When the first candidate index and the second candidate index are the same, the first encrypted candidate index and the second encrypted candidate index are the same. Therefore, the index intersection between the first index set and the second index set can be determined by comparing whether the first encrypted candidate index and the second encrypted candidate index are the same.

[0112] All or part of the indexes are obtained from the index intersection, and target data is obtained from the second data end based on the indexes.

[0113] The first data end determines the index intersection by comparing the first encryption candidate index and the second encryption candidate index, and can only know the same index in the second data end, but cannot know other indexes outside the index intersection, thereby ensuring that the data of the second data end is not leaked.

[0114] Since the summary data obtained by performing data summary mapping on the same data is the same, in order to prevent the summary data from being leaked, resulting in the data owned by the first data end and the second data end being known through summary data comparison, in one embodiment, the summary data may be encrypted, that is, the step of "performing data hiding processing on the first summary data based on the set XOR data to obtain the first encryption candidate index" may specifically include:

[0115] Obtaining a first key of a first data terminal;

[0116] Performing key encryption on the first summary data based on the first key to obtain a first initial encryption candidate index;

[0117] Based on the set XOR data and the first initial encryption candidate index, a data encryption calculation is performed on the first summary data to obtain a first encryption candidate index.

[0118] The first key may be a key of the first data terminal, and the first key is a symmetric key.

[0119] The first summary data is encrypted based on the first key to obtain a first initial encryption candidate index, and a logical calculation is performed on the set candidate XOR data and the first initial candidate encryption index to obtain a first encryption candidate index.

[0120] 102. Perform an AND calculation on the index to obtain first index hidden data.

[0121] For example, for the index Perform AND calculation to get the first index hidden data

[0122] If the index includes the index (1111), Index (0011), Index (1011), Index (1110) and index (1001), then for index index index index and index By performing AND calculation, we can get the first index hidden data, that is, 1010 is the first index hidden data obtained by calculation.

[0123] 103. Perform an AND calculation on the negated index to obtain second index hidden data, where the negated index is obtained by performing a logical negation process on the index.

[0124] For example, for index R S Performing logical inversion can get the inverted index By performing AND calculation on the inverted index, we can get the hidden data of the first index.

[0125] If the indexes (1111), Index (0011), Index (1011), Index (1110) and index (1001) is logically negated and we can get (0000), (1100), (0100), (0001) and (0100), perform AND calculation on the inverted index to obtain the second index hidden data, that is, 0000 is the second index hidden data obtained by calculation.

[0126] 104. Encrypt the first index hidden data by using the first character string to obtain first encrypted index data, and encrypt the second index hidden data by using the inverted character string to obtain second encrypted index data.

[0127] Specifically, step 104 may include:

[0128] Performing an OR operation on the first character string and the first index hidden data to obtain first encrypted index data;

[0129] Perform an OR operation on the inverted character string and the second index hidden data to obtain the second encrypted index data.

[0130] For example, the first string A and the first index can be hidden. Perform an OR operation to obtain the first encrypted index data

[0131] Negate string A - and the second index hides the data Perform an OR operation to obtain the second encrypted index data

[0132] 105. Send the first encrypted index data and the second encrypted index data to the second data end, so that the second data end can predict the second character string used to encrypt each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypt each data according to the second character string to obtain the candidate encrypted data.

[0133] The second character string may include a character string predicted by the second data end, and the second character string may be used to encrypt each candidate data in the second data end.

[0134] For example, the first data end sends the first encrypted index data and the second encrypted index data to the second data end.

[0135] The second data end predicts the second character string B corresponding to each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and the second character string B=(B1, B2, B3, ..., B n-1 ,B n ), encrypt each candidate data according to the second character string to obtain candidate encrypted data.

[0136] Predicting the second character string may specifically be to calculate the index corresponding to each candidate data with the second encrypted index data to obtain the second decrypted data N=Ry corresponding to each candidate data. - =(N1,N2,N3,…,N n-1 ,N n ).

[0137] in,

[0138] The inverse index of the index corresponding to each candidate data is calculated with the first encrypted index data to obtain the first decrypted data M=R corresponding to each candidate data. - y=(M1,M2,M3,…,M n-1 ,M n ),in,

[0139] After the first decrypted data and the second decrypted data are ORed together, they are then combined with the index R of the candidate data. i Perform XOR calculation to obtain the second string B = (M|N)^R = (B1, B2, B3, ..., B n-1 ,B n ). Among them, B i =(M i |N i )^R i ,

[0140] Perform XOR calculation on each candidate data and the corresponding second string to obtain the encrypted candidate data X′=B^X=(B1^X1, B2^X2, B3^X3,…, B n ^X n ).

[0141] The encrypted candidate data is sent to the first data terminal so that the first data terminal can decrypt the encrypted candidate data to obtain the target data.

[0142] When X i When the first data terminal wants to obtain k data, R S Existence With R i The same, that is but and express and Carry out and calculate.

[0143] Then, X i The first decrypted data

[0144] X i The second decrypted data

[0145] X i The second string B i =(M i |N i )^R i =R i ^R i ^A=A, that is, X i The second string is the same as the first string.

[0146] X i The encrypted candidate data X i ′=X i ^A.

[0147] When X i When the data is not among the k pieces of data to be acquired by the first data end, the second character string predicted by the second data end is not equal to the first character string.

[0148] The second data end sends the encrypted candidate data to the first data end.

[0149] In order to prevent other devices from stealing the first encrypted index data and the second encrypted index data, and decrypting to obtain the second string, and maliciously attacking the first data end based on the second string, the first string A can be an encrypted string, for example, encrypted by a symmetric public key, and the second data end can obtain the second string after decryption based on the symmetric public key, while other devices cannot obtain the correct second string due to the lack of the public key. The encrypted first string A can improve the security of the data and further ensure the security of the first data end. That is, in one embodiment, step 101 "obtaining a first string and an inverted string of the first string for encrypting multiple data" can specifically include:

[0150] Obtaining a first initial character string and key data;

[0151] Encrypting the first initial character string using the key data to obtain a first character string;

[0152] Perform logical inversion processing on the first character string to obtain an inverted character string of the first character string.

[0153] The key data may include keys such as symmetric keys and asymmetric keys.

[0154] The first initial character string may be a string of characters including numbers, letters and underscores, and the first character string is a character string obtained by encrypting the first character string using key data.

[0155] For example, the method may specifically obtain a first initial string and key data, encrypt the first initial string using the key data to obtain a first string, and perform logical inversion processing on the first string to obtain an inverted string.

[0156] 106. Receive the encrypted candidate data, decrypt the encrypted candidate data according to the first character string, and obtain target data corresponding to the index.

[0157] For example, the first data terminal receives the encrypted candidate data sent by the second data terminal, and decrypts the encrypted candidate data using the first character string. The decryption can be performed by performing an XOR calculation on the first character string and the confidential candidate data to obtain the decrypted data X A =X′^A=B^X^A, it can be seen that when A=B, the target data X can be decrypted. From the content in step 105, it can be seen that when X i When A is one of the k pieces of data to be acquired by the first data end, A=B. Therefore, the first data end can acquire the desired k pieces of data but cannot acquire other data.

[0158] After obtaining the target data, the target data can be applied according to the application scenario. For example, during model training, the target data can be sample data for model training. The target data is aligned with the data on the first data terminal to obtain more sample data for model training. That is, in one embodiment, the multiple pieces of data to be obtained by the first data terminal are included in the second data set. After the step of "receiving encrypted candidate data, decrypting the encrypted string according to the first string, and obtaining the target data corresponding to the index", the data processing method provided in the embodiment of the present application may further include:

[0159] Acquire a first data set from a first data end;

[0160] Acquire query data from the first data set;

[0161] Sample alignment data between the first data set and the second data set is generated according to the target data and the query data.

[0162] Among them, the first data end can obtain the first data set. For example, the first data end stores the first data set, or the first data end can obtain the first data set from the blockchain, etc. The first data set may include query data corresponding to the index.

[0163] The query data and the target data may be data of the same dimension or data of different dimensions. For example, the query data may include the price, description information and data corresponding to the purchasing user group of the product, and the target data may also include the price, description information and data corresponding to the purchasing user group of the product different from the query data. Optionally, the target data may include sales volume, comments and corresponding data of the product that is the same as the query data.

[0164] For example, the first data set can be obtained from the first data terminal, and the query data can be obtained from the first data set. If the query data and the target data are of the same dimension, the target data can be structured based on the query data so that the data structure of the target data is the same as the query data, and the sample alignment data is obtained. For example, the query data can include the price, description information, and data corresponding to the purchasing user group of commodity A, and the target data can also include it. Then, the data in the target data needs to be structurally changed so that the dimension of the target data is aligned with the dimension of the query data, that is, the obtained target data includes the price, description information, and data corresponding to the purchasing user group of commodity B.

[0165] If the query data and the target data are data of different dimensions, the query data may be obtained from the first data set based on the index, and the query data and the target data are concatenated to obtain data with more dimensions corresponding to the index.

[0166] As can be seen from the above, the embodiment of the present application obtains the index of multiple data that need to be received from the second data end at the second data end, as well as the first string and the inverted string of the first string used to encrypt the multiple data; performs an AND calculation on the index to obtain the first index hidden data; performs an AND calculation on the inverted index to obtain the second index hidden data, and the inverted index is obtained by logically inverting the index; encrypts the first index hidden data through the first string to obtain the first encrypted index data, and encrypts the second index hidden data through the inverted string to obtain the second encrypted index data; sends the first encrypted index data and the second encrypted index data to the second data end, so that the second data end can predict the second string used to encrypt each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypts each data according to the second string to obtain the candidate encrypted data; receives the encrypted candidate data, decrypts the encrypted candidate data according to the first string, and obtains the target data corresponding to the index.

[0167] The embodiment of the present application can hide the index by performing data and calculation on the index, so that the second data end cannot know the index of the first data end. The second data end predicts the second character string for encrypting each candidate data based on the first encrypted index data and the second encrypted index data, and obtains the candidate encrypted data by encrypting the candidate data based on the second character string. When the candidate data is the target data corresponding to the index, the second character string predicted by the second data end is the same as the first character string. The first data end can decrypt the candidate encrypted data sent by the second data end according to the first character string to obtain the target data corresponding to the index. The first data end only needs to send the first encrypted index data and the second encrypted index data to obtain the required target data from the second data end without leaking the index information, thereby reducing the amount of data sent by the first data end, and at the same time reducing the amount of data processing by the second data end, thereby improving data processing efficiency.

[0168] Based on the above embodiments, further detailed description will be given below with examples.

[0169] This embodiment will be described from the perspective of a data processing device. The data processing device may be integrated into a computer device, which may be a server or a terminal.

[0170] The present application provides a data processing method, such as Figure 2 As shown, the specific process of the data processing method can be as follows:

[0171] 201. Receive first encrypted index data and second encrypted index data sent by a first data terminal.

[0172] The first encrypted index data and the second encrypted index data may be obtained based on the above steps 101 - 106 .

[0173] For example, first encrypted index data and second encrypted index data sent by a first data end are received.

[0174] Optionally, the first encrypted index data and the second encrypted index data sent by the first data end may be sent based on the index intersection between the first index set of the first data end and the second index set of the second data end. The second data end may encrypt the second candidate index in the second index set and send it to the first data end, so that the first data end determines the index intersection between the first index set and the second index set according to the second encrypted candidate index. That is, in one embodiment, the step of “receiving the first encrypted index data and the second encrypted index data sent by the first data end” may specifically include:

[0175] Obtaining a second index set about candidate data;

[0176] Performing data summary mapping on the second candidate index in the second index set to obtain second summary data corresponding to the second candidate index;

[0177] Performing an XOR calculation on the second summary data corresponding to the second candidate index to obtain set XOR data of the second index set;

[0178] Based on the set XOR data, perform data hiding processing on each second summary data to obtain a second encryption candidate index;

[0179] Sending the second encrypted candidate index and the set XOR data to the first data end, so that the first data end performs index encryption on the first candidate index in the first index set to obtain the first encrypted candidate index, and determining the index intersection between the first index set and the second index set by comparing the first encrypted candidate index and the second encrypted candidate index;

[0180] The first data receiving end obtains an index from the index intersection, and performs index hiding processing on the index to send the first encrypted index data and the second encrypted index data.

[0181] The second index set may be an index set corresponding to the candidate data, and the second index set may include multiple second candidate indexes. The corresponding candidate data may be queried according to the first candidate index.

[0182] For example, the second data end uses a hash function to perform a second index set The data summary mapping is performed on each second candidate index in the , and the obtained hash value is the second summary data of the second candidate index The hash function is irreversible. Even the hash function used in the data summary mapping and the obtained hash value cannot be restored to obtain the second candidate index, ensuring that the data is not leaked.

[0183] The second summary data corresponding to each second candidate index is XORed to obtain the set XOR data

[0184] The second data end performs data hiding processing based on the set XOR data and the second summary data to obtain a second encryption candidate index E=(E1, E2, E3, ..., E N1 ,). The data hiding process may include performing a logical calculation on the set XOR data and the second summary data, for example, an AND calculation, an OR calculation, an XOR calculation, and a negation calculation.

[0185] The second data end sends the second encryption candidate index E and the set XOR data Xor to the first data end.

[0186] After the first data terminal receives the second encrypted candidate index and the set XOR data sent by the second data terminal, it performs data summary mapping on the first candidate index in the first index set of the first data terminal to obtain the first summary data corresponding to the first candidate index; then, data hiding processing is performed on the first candidate index based on the set XOR to encrypt the first candidate index to obtain the first encrypted candidate index. The way in which the first data terminal performs data hiding processing is the same as the way in which the second data terminal performs data hiding processing. When the first candidate index and the second candidate index are the same, the first encrypted candidate index and the second encrypted candidate index are the same. Therefore, the index intersection between the first index set and the second index set can be determined by comparing whether the first encrypted candidate index and the second encrypted candidate index are the same.

[0187] Since the summary data obtained by performing data summary mapping on the same data is the same, in order to prevent the summary data from being leaked, resulting in the data owned by the first data end and the second data end being known by comparing the summary data, in one embodiment, the summary data can be encrypted, that is, the step of "based on the set XOR data, performing data hiding processing on each second summary data and obtaining a second encryption candidate index" can specifically include:

[0188] Obtaining a second key from a second data terminal;

[0189] Performing key encryption on the second summary data based on the second key to obtain a second initial encryption candidate index;

[0190] A data encryption calculation is performed on the second initial encryption candidate index data based on the set XOR data to obtain a second encryption candidate index.

[0191] Among them, the second key can be a key of the second data end, the second key is a symmetric key, the first key exists in the first data end, and the first key and the second key are symmetric keys.

[0192] The second summary data is encrypted based on the second key to obtain a second initial encryption candidate index, and a logical calculation is performed on the set candidate XOR data and the first initial candidate encryption index to obtain a second encryption candidate index.

[0193] 202. Perform AND calculations on the inverted index corresponding to each candidate data in the second data end and the first encrypted index data to obtain first decrypted data corresponding to the candidate data. The inverted index is obtained by performing logical inversion processing on the index.

[0194] For example, the second data end has n candidate data X = 9X1, X2, X3, ..., X n-1 ,X n ), and X corresponds to R=(R1, R2, R3, …, R n-1 ,R n ,(, negate the index

[0195] The index corresponding to each candidate data is calculated with the second encrypted index data to obtain the second decrypted data N=Ry corresponding to each candidate data. - =(N1,N2,N3,…,N n-1 ,N n ).

[0196] in,

[0197] 203. Perform AND calculation on the index corresponding to each candidate data and the second encrypted index data respectively to obtain the second decrypted data corresponding to each candidate data.

[0198] For example, the inverse index of the index corresponding to each candidate data is calculated with the first encrypted index data to obtain the first decrypted data M=R corresponding to each candidate data. - y=(M1,M2,M3,…,M n-1 ,M n ),in,

[0199] 204. Perform data calculation on the first decrypted data and the second decrypted data corresponding to each piece of candidate data to obtain a second character string used for encrypting each piece of candidate data.

[0200] For example, the first decrypted data and the second decrypted data are OR-calculated and then added to the index R of the candidate data. iPerform XOR calculation to obtain a second string B=M|N=(B1, B2, B3, ..., B n-1 ,B n ). Among them, B i =(M i |N i )^R i ,

[0201] In one embodiment, the first character string of the first data end may be a character string encrypted by key data, and the second data end needs to be decrypted based on the key data corresponding to the first data end to obtain a correct second character string, that is, the step of "calculating the first decrypted data and the second decrypted data corresponding to each candidate data to obtain a second character string for encrypting each candidate data" may specifically include:

[0202] Perform OR calculation on the first decrypted data and the second decrypted data to obtain target decrypted data of the candidate data;

[0203] Perform XOR calculation on the index of the candidate data and the target decrypted data to obtain the encrypted second string;

[0204] The encrypted second character string is decrypted based on the key data of the second data end to obtain the second character string.

[0205] The key data may be a symmetric key or an asymmetric key. For example, the key data of the second data end may be a private key, and the key data of the first data end may be a public key.

[0206] For example, the first decrypted data and the second decrypted data may be subjected to OR calculation to obtain the target decrypted data M of the candidate data. i |N i ; XOR the index of the candidate data with the target decrypted data to obtain the encrypted second string B i =(M i |N i )^R i , the encrypted second character string can be decrypted by the key data to obtain the second character string.

[0207] 205. Perform an XOR calculation on each candidate data and the corresponding second character string to obtain encrypted candidate data of each candidate data.

[0208] For example, each candidate data is XORed with the corresponding second string to obtain the encrypted candidate data X′=B^X=(B1^X1, B2^X2, B3^X3,…, B n^X n ).

[0209] 206. Send the encrypted candidate data to the first data terminal, so that the first data terminal decrypts the encrypted candidate data to obtain target data.

[0210] For example, the encrypted candidate data is sent to the first data end, so that the first data end decrypts the encrypted candidate data based on the first character string to obtain the target data.

[0211] As can be seen from the above, the embodiment of the present application receives the first encrypted index data and the second encrypted index data sent by the first data end; respectively performs AND calculation on the inverted index corresponding to each candidate data in the second data end and the first encrypted index data to obtain the first decrypted data corresponding to the candidate data, and the inverted index is obtained by logically inverting the index; respectively performs AND calculation on the index corresponding to each candidate data and the second encrypted index data to obtain the second decrypted data corresponding to each candidate data; performs data calculation on the first decrypted data and the second decrypted data corresponding to each candidate data to obtain a second character string for encrypting each candidate data; performs XOR calculation on each candidate data and the corresponding second character string to obtain the encrypted candidate data of each candidate data; sends the encrypted candidate data to the first data end, so that the first data end decrypts the encrypted candidate data based on the first character string to obtain the target data.

[0212] The embodiment of the present application predicts a second string for encrypting each candidate data based on the first encrypted index data and the second encrypted index data, and encrypts the candidate data based on the second string to obtain the candidate encrypted data. When the candidate data is the target data corresponding to the index, the second string predicted by the second data end is the same as the first string. The first data end can decrypt the candidate encrypted data sent by the second data end based on the first string to obtain the target data corresponding to the index. The first data end sends the first encrypted index data and the second encrypted index data, and the second data end only needs to process the first encrypted index data and the second encrypted index data to obtain the required target data from the second data end without leaking the index information, thereby reducing the amount of data sent by the first data end, and at the same time reducing the amount of data processing by the second data end, thereby improving data processing efficiency.

[0213] Based on the above embodiments, further detailed description will be given below with examples.

[0214] This embodiment will be described from the perspective of a data processing system, which may specifically include a first data terminal and a second data terminal, wherein the second data terminal has a second data set, the second data set includes n (n≥2) data items, the first data terminal wants to obtain k (k≤2) data items from the data set of the second data terminal, and the first data terminal does not know the data obtained by the first data terminal. At the same time, the first data terminal cannot obtain data other than the k data items from the second data terminal.

[0215] The present application provides a data processing method, such as Figure 3 As shown, the specific process of the data processing method can be as follows:

[0216] 301. A first data end obtains indexes of a plurality of data pieces to be received from a second data end at the second data end, as well as a first character string used to encrypt the plurality of data pieces and a negated character string of the first character string.

[0217] For example, get the index The first string A, the inverted string A obtained by performing logical inversion processing on the first string A - , the first character string A is a character string obtained by encrypting the first initial character string a according to the public key of the second data end.

[0218] 302. The first data end performs an AND calculation on the index to obtain first index hidden data, and performs an AND calculation on the inverted index to obtain second index hidden data.

[0219] For example, for the index Perform AND calculation to get the first index hidden data

[0220] 303. The first data end performs an OR operation on the first string and the first index hidden data to obtain first encrypted index data, and performs an OR operation on the inverted string and the second index hidden data to obtain second encrypted index data.

[0221] For example, for index R S Performing logical inversion can get the inverted index By performing AND calculation on the inverted index, we can get the hidden data of the first index.

[0222] 304. The first data end sends the first encrypted index data and the second encrypted index data to the second data end.

[0223] 305. The second data end receives the first encrypted index data and the second encrypted index data sent by the first data end.

[0224] 306. The second data end performs AND calculation on the inverted index corresponding to each candidate data and the first encrypted index data to obtain the first decrypted data corresponding to the candidate data.

[0225] For example, the second data set of the second data terminal corresponds to the second index set R=(R1, R2, R3, ..., R n-1 ,R n ,), the second index set contains a second candidate index corresponding to each candidate data. The second candidate index in the second index set is inverted to obtain

[0226] The second data end calculates the inverse index of the index corresponding to each candidate data with the first encrypted index data to obtain the first decrypted data M=R corresponding to each candidate data. - y=(M1,M2,M3,…,M n-1 ,M n ),in,

[0227] 307. The second data end respectively calculates the index corresponding to each candidate data with the second encrypted index data to obtain the second decrypted data corresponding to each candidate data.

[0228] For example, the second data end calculates the index corresponding to each candidate data with the second encrypted index data to obtain the second decrypted data N=Ry corresponding to each candidate data. - =(N1,N2,N3,…,N n-1 ,N n ).in,

[0229] 308. The second data terminal performs OR calculation on the first decrypted data and the second decrypted data to obtain target decrypted data of the candidate data.

[0230] For example, the second data end performs OR calculation on the first decrypted data and the second decrypted data to obtain target decrypted data M|N.

[0231] 309. The second data end performs an XOR operation on the index of the candidate data and the target decrypted data to obtain an encrypted second character string.

[0232] For example, the second data end combines the target decrypted data M|N with the index R of the candidate data i Perform XOR calculation to obtain the encrypted second string B = (M|N)^R = (B1, B2, B3, ..., B n-1 ,B n ). Among them, B i =(M i |Ni )^R i .

[0233] 310. The second data end decrypts the encrypted second character string based on the key data of the second data end to obtain a second character string.

[0234] The second data end decrypts the encrypted second string based on the key data of the second data end to obtain a second string B 0 .

[0235] 311. The second data end performs an XOR calculation on each candidate data and the corresponding second character string to obtain encrypted candidate data of each candidate data.

[0236] For example, the second data end may perform an XOR calculation on each candidate data and the corresponding second string to obtain the encrypted candidate data X′=B for each candidate data. 0 ^X.

[0237] When X i When the first data terminal wants to obtain k data, R S Existence With R i The same, that is but Then, X i The first decrypted data M i =(R i &A - )|=(R i &A - )|0=(R i &A - );X i The second decrypted data B i =R i ^A^R i =A; B 0 =a;X i ′=a^X i .

[0238] 312. The second data end sends the encrypted candidate data to the first data end.

[0239] 313. The first data terminal receives the encrypted candidate data, performs an XOR operation on the first initial character string and the encrypted candidate data, and obtains target data corresponding to the index.

[0240] For example, the second data end may perform an XOR calculation on each candidate data and the corresponding second string to obtain the encrypted candidate data X′=a^B of each candidate data. 0 ^X.

[0241] Because, when X i When X is the data in the k data to be obtained by the first data end, i ′=a^X i The first data end performs XOR calculation on the first string and the encryption candidate data to obtain the target data X i .

[0242] When X i If the data is not among the k data to be obtained by the first data end, B 0 ≠a, the first data end performs an XOR calculation on the first character string and the encryption candidate data, and cannot obtain the target data.

[0243] As can be seen from the above, the first data end obtains the index of the multiple data that need to be received from the second data end at the second data end, as well as the first string and the inverted string of the first string used to encrypt the multiple data; performs an AND calculation on the index to obtain the first index hidden data, and performs an AND calculation on the inverted index to obtain the second index hidden data; performs an OR calculation on the first string and the first index hidden data to obtain the first encrypted index data, and performs an OR calculation on the inverted string and the second index hidden data to obtain the second encrypted index data; and sends the first encrypted index data and the second encrypted index data to the second data end.

[0244] The second data end receives the first encrypted index data and the second encrypted index data sent by the first data end; respectively perform AND calculations on the inverted index corresponding to each candidate data and the first encrypted index data to obtain the first decrypted data corresponding to the candidate data; respectively perform AND calculations on the index corresponding to each candidate data and the second encrypted index data to obtain the second decrypted data corresponding to each candidate data; perform OR calculations on the first decrypted data and the second decrypted data to obtain the target decrypted data of the candidate data; perform XOR calculations on the index of the candidate data and the target decrypted data to obtain the encrypted second character string; decrypt the encrypted second character string based on the key data of the second data end to obtain the second character string; perform XOR calculations on each candidate data and the corresponding second character string to obtain the encrypted candidate data of each candidate data; and send the encrypted candidate data to the first data end.

[0245] The first data end receives the encrypted candidate data, performs an XOR calculation on the first initial character string and the encrypted candidate data, and obtains the target data corresponding to the index.

[0246] The embodiment of the present application can hide the index by performing data and calculation on the index, so that the second data end cannot know the index of the first data end. The second data end predicts the second character string for encrypting each candidate data based on the first encrypted index data and the second encrypted index data, and encrypts the candidate data based on the second character string to obtain the candidate encrypted data. When the candidate data is the target data corresponding to the index, the second character string predicted by the second data end is the same as the first character string. The first data end can decrypt the candidate encrypted data sent by the second data end according to the first character string to obtain the target data corresponding to the index. The first data end only needs to send the first encrypted index data and the second encrypted index data to obtain the required target data from the second data end without leaking the index information. This scheme reduces the amount of data sent by the first data end, and at the same time reduces the amount of data processing by the second data end, thereby improving data processing efficiency.

[0247] Based on the above embodiments, further detailed description will be given below with examples.

[0248] This embodiment will be described from the perspective of a data processing system, which may specifically include a first data terminal and a second data terminal, the first data terminal corresponding to a first data set, and the second data terminal corresponding to a second data set. The first index set may include an index corresponding to each piece of data in the first data set; the second index set may include an index corresponding to each piece of data in the second data set, such as a number or ID of each piece of data.

[0249] The data processing method provided in the embodiment of the present application can be applied to federated learning. Specifically, assuming that there are institutions A and B, institutions A and B collaborate in federated learning and use common data to train the model, wherein institution A has a first data set and institution B has a second data set. Institution A and institution B only exchange relevant data of the intersection part (for example, indexes or complete data). For example, institution A has data on goods a, b and c about x, and institution B has data on goods a, b, c and d about y. Then, institution A and institution B only exchange data on goods a, b and c, but not on goods d, to avoid data leakage. Institution A and institution B perform model training based on the data obtained through interaction, thereby improving the model training speed and training effect.

[0250] like Figure 4 As shown, the specific process of the data processing method in the embodiment of the present application is as follows:

[0251] 401. The second data end performs data summary mapping on a second candidate index in a second index set to obtain second summary data corresponding to the second candidate index.

[0252] For example, the index can be the number or ID of each data in the data set. For example, the first data set and the second data set can contain students' grades. Then, the index can be the student's student ID. Each student has a corresponding student ID. The grades of students included in both the first data set and the second data set can be determined based on the student ID.

[0253] For example, the second data end uses a hash function to perform a second index set The data summary mapping is performed on each second candidate index in the , and the obtained hash value is the second summary data of the second candidate index The hash function is irreversible. Even the hash function used in the data summary mapping and the obtained hash value cannot be restored to obtain the second candidate index, ensuring that the data is not leaked.

[0254] 402. The second data end performs an XOR calculation on the second summary data to obtain set XOR data of a second index set.

[0255] The second data end performs XOR calculation on the second summary data corresponding to each second candidate index to obtain the set XOR data.

[0256] 403. The second data end performs data hiding processing on each second summary data based on the set XOR data to obtain a second encryption candidate index.

[0257] For example, the second data end performs key encryption on the second summary data based on the second key to obtain a second initial encryption candidate index, performs OR calculation on the set candidate XOR data and the first initial candidate encryption index to obtain a second encryption candidate index E = (E1, E2, E3, ..., E N1 ).

[0258] 404. The second data end sends the second encryption candidate index and the set XOR data to the first data end.

[0259] 405. The first data end performs data summary mapping on the first candidate index in the first index set to obtain first summary data corresponding to the first candidate index.

[0260] For example, the first data end has a first index set The first candidate index is mapped to the data summary to obtain the first summary data corresponding to the first candidate index

[0261] 406. The first data end performs data hiding processing on the first summary data based on the set XOR data to obtain a first encryption candidate index.

[0262] For example, the first data end performs data hiding processing on the set XOR data and the first candidate index to obtain the first encrypted candidate index F=(F1, F2, F3, ..., F N2 ).

[0263] 407. The first data end compares the first encryption candidate index with the second encryption candidate index to determine an index intersection between the first index set and the second index set, and obtains an index from the index intersection.

[0264] Since the first data terminal performs data hiding processing in the same manner as the second data terminal, when the first candidate index and the second candidate index are the same, the first encrypted candidate index and the second encrypted candidate index are the same. Therefore, by comparing whether the first encrypted candidate index and the second encrypted candidate index are the same, the index intersection J between the first index set and the second index set can be determined as (J1, J2, J3, ..., J N3 ), the first data end obtains the index from the index intersection, and obtains the target data from the second data end based on the index, so that the first data end can only obtain the data corresponding to the index intersection from the second data end, but cannot obtain other data, thereby ensuring the data security of the second data end. At the same time, the second data end cannot obtain the data obtained by the first data end, thereby ensuring the privacy security of the first data end.

[0265] In one embodiment, there is a first data set corresponding to a first index in the first data end, and the data in the first data set corresponding to the intersection of the indexes can be sent to the second data end, so that the second data end obtains the data of the intersection with the first data end, and trains the model in combination with the data in the second data set. Increasing the training data for model training can improve the training speed and training effect of the model.

[0266] As can be seen from the above, the embodiment of the present application performs data summary mapping on the second candidate index in the second index set through the second data end to obtain the second summary data corresponding to the second candidate index; performs XOR calculation on the second summary data corresponding to the second candidate index to obtain the set XOR data of the second index set; based on the set XOR data, performs data hiding processing on each second summary data to obtain the second encrypted candidate index; and sends the second encrypted candidate index and the set XOR data to the first data end.

[0267] The first data end performs data summary mapping on the first candidate index in the first index set to obtain first summary data corresponding to the first candidate index; the first data end performs data hiding processing on the first summary data based on the set XOR data to obtain a first encrypted candidate index; the first data end compares the first encrypted candidate index with the second encrypted candidate index to determine the index intersection between the first index set and the second index set, and obtains the index from the index intersection.

[0268] In the embodiment of the present application, the first data end can only obtain data corresponding to the intersection of the indexes from the second data end, but cannot obtain other data, thereby ensuring the data security of the second data end. At the same time, the second data end cannot obtain the data obtained by the first data end, thereby ensuring the privacy security of the first data end.

[0269] In order to better implement the data processing method provided in the embodiment of the present application, a data processing device is also provided in one embodiment. The meanings of the terms are the same as those in the above data processing method, and the specific implementation details can refer to the description in the method embodiment.

[0270] The data processing device may be integrated into a computer device, such as Figure 5 As shown, the data processing device may include: an acquisition unit 501, a first calculation unit 502, a second calculation unit 503, an encryption unit 504, a sending unit 505 and a decryption unit 506, as follows:

[0271] (1) Acquisition unit 501: used to acquire indexes of multiple pieces of data to be received from the second data end at the second data end, as well as a first character string used to encrypt the multiple pieces of data and a negated character string of the first character string.

[0272] In one embodiment, the acquisition unit 501 may include a first data acquisition subunit, an encryption processing subunit and a logic negation subunit, specifically:

[0273] A first data acquisition subunit: used to acquire a first initial character string and key data;

[0274] The encryption processing subunit is used to encrypt the first initial character string by using the key data to obtain a first character string;

[0275] Logical negation subunit: used for performing logical negation processing on the first character string to obtain a negated character string of the first character string.

[0276] In one embodiment, the acquisition unit 501 may include a second data acquisition subunit, a first summary mapping subunit, a first hiding subunit and a comparison subunit. Specifically:

[0277] The second data acquisition subunit is used to receive the second encrypted candidate index and the set XOR data sent by the second data end based on the second index set;

[0278] A first summary mapping subunit: configured to perform data summary mapping on a first candidate index in a first index set of a first data end to obtain first summary data corresponding to the first candidate index;

[0279] A first hiding subunit: configured to perform data hiding processing on the first summary data based on the set XOR data to obtain a first encryption candidate index;

[0280] Comparison subunit: used to compare the first encryption candidate index with the second encryption candidate index to determine the index intersection between the first index set and the second index set, and obtain the index from the index intersection.

[0281] In one embodiment, the first hiding subunit may include a first key acquisition module, a first key encryption module and a first data encryption module, specifically:

[0282] A first key acquisition module: used to acquire a first key of a first data terminal;

[0283] A first key encryption module: used to perform key encryption on the first summary data based on the first key to obtain a first initial encryption candidate index;

[0284] The first data encryption module is used to perform data encryption calculation on the first summary data based on the set XOR data and the first initial encryption candidate index to obtain the first encryption candidate index.

[0285] (2) A first calculation unit 502: used to perform AND calculation on the index to obtain first index hidden data.

[0286] (3) A second calculation unit 503 is used to perform AND calculation on the inverted index to obtain second index hidden data, where the inverted index is obtained by performing logical inversion processing on the index.

[0287] (4) Encryption unit 504: used to encrypt the first index hidden data by using the first character string to obtain the first encrypted index data, and to encrypt the second index hidden data by taking the inverse character string to obtain the second encrypted index data.

[0288] In one embodiment, the encryption unit 504 may include a first or computing subunit and a second or computing subunit, specifically:

[0289] A first OR calculation subunit is used to perform an OR calculation on the first character string and the first index hidden data to obtain first encrypted index data;

[0290] The second OR calculation subunit is used to perform an OR calculation on the inverted character string and the second index hidden data to obtain the second encrypted index data.

[0291] (5) A sending unit 505 is used to send the first encrypted index data and the second encrypted index data to the second data end, so that the second data end can predict the second character string used to encrypt each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypt each data according to the second character string to obtain the candidate encrypted data.

[0292] (6) Decryption unit 506: used to receive the encrypted candidate data, decrypt the encrypted candidate data according to the first character string, and obtain the target data corresponding to the index.

[0293] In one embodiment, the plurality of data are included in the second data set, and the data processing device may further include a set acquisition unit, a data acquisition unit, and a data generation unit, specifically:

[0294] A set acquisition unit: used for acquiring a first data set from a first data end;

[0295] Data acquisition unit: used to acquire query data from the first data set;

[0296] Data generation unit: used to generate sample alignment data between the first data set and the second data set according to the target data and the query data.

[0297] In the embodiment of the present application, the data processing device of the embodiment of the present application obtains the index of the multiple data to be received from the second data end through the acquisition unit 501 and the first string and the inverse string of the first string used to encrypt the multiple data; the first calculation unit 502 performs an AND calculation on the index to obtain the first index hidden data; the second calculation unit 503 performs an AND calculation on the inverse index to obtain the second index hidden data, and the inverse index is obtained by logically inverting the index; the encryption unit 504 encrypts the first index hidden data through the first string to obtain the first encrypted index data, and encrypts the second index hidden data through the inverse string to obtain the second encrypted index data; the sending unit 505 sends the first encrypted index data and the second encrypted index data to the second data end, so that the second data end predicts the second string used to encrypt each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypts each data according to the second string to obtain the candidate encrypted data; the encrypted candidate data is received by the decryption unit 506, and the encrypted candidate data is decrypted according to the first string to obtain the target data corresponding to the index.

[0298] The implementation of the present application reduces the amount of data sent by the first data end, while reducing the amount of data processed by the second data end, thereby improving data processing efficiency.

[0299] In order to better implement the data processing method provided in the embodiment of the present application, a data processing device is also provided in one embodiment. The meanings of the terms are the same as those in the above data processing method, and the specific implementation details can refer to the description in the method embodiment.

[0300] The data processing device may be integrated into a computer device, such as Figure 6 As shown, the data processing device may include: a receiving unit 601, a third computing unit 602, a fourth computing unit 603, a data computing unit 604, an XOR computing unit 605 and a second sending unit 606, as follows:

[0301] (1) Receiving unit 601: used to receive first encrypted index data and second encrypted index data sent by a first data end.

[0302] In one embodiment, the receiving unit 601 may include a set acquisition subunit, a second summary mapping subunit, a set XOR calculation subunit, a second hiding subunit, a data sending subunit and an index acquisition subunit, specifically:

[0303] A set acquisition subunit: used for acquiring a second index set about candidate data;

[0304] The second summary mapping subunit is used to perform data summary mapping on the second candidate index in the second index set to obtain second summary data corresponding to the second candidate index;

[0305] A set XOR calculation subunit: used for performing XOR calculation on the second summary data corresponding to the second candidate index to obtain set XOR data of the second index set;

[0306] The second hiding subunit is used to perform data hiding processing on each second summary data based on the set XOR data to obtain a second encryption candidate index;

[0307] A data sending subunit is used to send the second encryption candidate index and the set XOR data to the first data end, so that the first data performs index encryption on the first candidate index in the first index set to obtain the first encryption candidate index, and determine the index intersection between the first index set and the second index set by comparing the first encryption candidate index and the second encryption candidate index;

[0308] Index acquisition subunit: used for receiving the first encrypted index data and the second encrypted index data sent by the first data end after acquiring the index from the index intersection, and performing index hiding processing on the index.

[0309] In one embodiment, the second hiding subunit may include a second key acquisition module, a second key encryption module and a second data encryption module, specifically:

[0310] A second key acquisition module: used to acquire a second key of a second data terminal;

[0311] A second key encryption module: used to perform key encryption on the second summary data based on the second key to obtain a second initial encryption candidate index;

[0312] The second data encryption module is used to perform data encryption calculation on the second initial encryption candidate index based on the set XOR data to obtain the second encryption candidate index.

[0313] (2) A third calculation unit 602: used to respectively perform AND calculations on the inverted index corresponding to each candidate data in the second data end and the first encrypted index data to obtain the first decrypted data corresponding to the candidate data, wherein the inverted index is obtained by performing a logical inversion process on the index.

[0314] (3) Fourth calculation unit 603: used to respectively calculate the index corresponding to each candidate data and the second encrypted index data to obtain the second decrypted data corresponding to each candidate data.

[0315] (4) Data calculation unit 604: used to perform data calculation on the first decrypted data and the second decrypted data corresponding to each candidate data to obtain a second character string used for encrypting each candidate data.

[0316] In one embodiment, the data calculation unit 604 may include a data decryption subunit, an encryption string subunit and a string decryption subunit, specifically:

[0317] Data decryption subunit: used for performing OR calculation on the first decrypted data and the second decrypted data to obtain target decrypted data of the candidate data;

[0318] Encryption string subunit: used to perform XOR calculation on the index of the candidate data and the target decryption data to obtain the encrypted second string;

[0319] The character string decryption subunit is used to decrypt the encrypted second character string based on the key data of the second data end to obtain the second character string.

[0320] (5) XOR calculation unit 605: used to perform XOR calculation on each candidate data and the corresponding second character string to obtain encrypted candidate data of each candidate data.

[0321] (6) A second sending unit 606: configured to send the encrypted candidate data to the first data terminal, so that the first data terminal can decrypt the encrypted candidate data based on the first character string to obtain the target data.

[0322] As can be seen from the above, the data processing device of the embodiment of the present application receives the first encrypted index data and the second encrypted index data sent by the first data end through the receiving unit 601; the third calculation unit 602 respectively performs AND calculation on the inverted index corresponding to each candidate data in the second data end and the first encrypted index data to obtain the first decrypted data corresponding to the candidate data, and the inverted index is obtained by logically inverting the index; the fourth calculation unit 603 respectively performs AND calculation on the index corresponding to each candidate data and the second encrypted index data to obtain the second decrypted data corresponding to each candidate data; the data calculation unit 604 performs data calculation on the first decrypted data and the second decrypted data corresponding to each candidate data to obtain the second character string for encrypting each candidate data; the XOR calculation unit 605 performs XOR calculation on each candidate data and the corresponding second character string to obtain the encrypted candidate data of each candidate data; the second sending unit 606 sends the encrypted candidate data to the first data end, so that the first data end decrypts the encrypted candidate data based on the first character string to obtain the target data.

[0323] The embodiment of the present application reduces the amount of data sent by the first data end, while reducing the amount of data processed by the second data end, thereby improving data processing efficiency.

[0324] The present application also provides a computer device, which may be a terminal or a server. Figure 7 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:

[0325] The computer device may include components such as a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, a power supply 1003, and an input unit 1004. Those skilled in the art will appreciate that Figure 7 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0326] The processor 1001 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 1002 and calling data stored in the memory 1002, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, computer program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1001.

[0327] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.

[0328] The computer device also includes a power supply 1003 for supplying power to various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1003 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0329] The computer device may further include an input unit 1004, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0330] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically, in this embodiment, the processor 1001 in the computer device will load the executable files corresponding to the processes of one or more computer programs into the memory 1002 according to the following instructions, and the processor 1001 will run the computer programs stored in the memory 1002, thereby realizing various functions, as follows:

[0331] Obtaining indexes of the plurality of pieces of data to be received from the second data end at the second data end, as well as a first character string used to encrypt the plurality of pieces of data and a negated character string of the first character string;

[0332] Perform an AND calculation on the index to obtain the first index hidden data; perform an AND calculation on the inverted index to obtain the second index hidden data, where the inverted index is obtained by performing a logical inversion process on the index;

[0333] Encrypt the first index hidden data by using the first character string to obtain first encrypted index data, and encrypt the second index hidden data by taking the inverse character string to obtain second encrypted index data;

[0334] Sending the first encrypted index data and the second encrypted index data to the second data end, so that the second data end predicts a second string used to encrypt each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypts each data according to the second string to obtain the candidate encrypted data;

[0335] Encrypted candidate data is received, and the encrypted candidate data is decrypted according to the first character string to obtain target data corresponding to the index.

[0336] as well as

[0337] Receiving first encrypted index data and second encrypted index data sent by the first data end;

[0338] Performing AND calculation on the inverted index corresponding to each candidate data in the second data end and the first encrypted index data respectively to obtain the first decrypted data corresponding to the candidate data, wherein the inverted index is obtained by performing logical inversion processing on the index;

[0339] The index corresponding to each candidate data is respectively ANDed with the second encrypted index data to obtain the second decrypted data corresponding to each candidate data; the first decrypted data and the second decrypted data corresponding to each candidate data are calculated to obtain a second character string used for encrypting each candidate data;

[0340] Performing an XOR calculation on each candidate data and the corresponding second character string to obtain encrypted candidate data of each candidate data;

[0341] The encrypted candidate data is sent to the first data terminal, so that the first data terminal decrypts the encrypted candidate data based on the first character string to obtain the target data.

[0342] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.

[0343] It can be seen from the above that the computer device of the embodiment of the present application can reduce the amount of data sent by the first data end, while reducing the amount of data processed by the second data end, thereby improving data processing efficiency.

[0344] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations in the above-mentioned embodiments.

[0345] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0346] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute any data processing method provided in the embodiment of the present application.

[0347] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0348] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0349] Since the computer program stored in the computer-readable storage medium can execute any data processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any data processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0350] The above is a detailed introduction to a data processing method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data processing method, characterized in that: Applied to the first data terminal, including: Obtaining indexes of a plurality of pieces of data to be received from a second data end at the second data end, as well as a first character string used to encrypt the plurality of pieces of data and a negated character string of the first character string; Performing AND calculation on the index to obtain first index hidden data; Performing AND calculation on the inverted index to obtain second index hidden data, wherein the inverted index is obtained by performing logical inversion processing on the index; Encrypt the first index hidden data using the first character string to obtain first encrypted index data, and encrypt the second index hidden data using the inverted character string to obtain second encrypted index data; Sending the first encrypted index data and the second encrypted index data to a second data end, so that the second data end predicts a second string used to encrypt each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypts each data according to the second string to obtain encrypted candidate data; The encrypted candidate data is received, and the encrypted candidate data is decrypted according to the first character string to obtain target data corresponding to the index.

2. The method according to claim 1, characterized in that The plurality of data are included in the second data set, the encrypted candidate data is received, the encrypted string is decrypted according to the first string, and after obtaining the target data corresponding to the index, the method further includes: Acquire a first data set of the first data end; Acquire query data from the first data set; Sample alignment data between the first data set and the second data set is generated according to the target data and the query data.

3. The method according to claim 1, characterized in that The step of encrypting the first index hidden data by using the first character string to obtain first encrypted index data, and encrypting the second index hidden data by using the inverted character string to obtain second encrypted index data includes: Performing OR calculation on the first character string and the first index hidden data to obtain first encrypted index data; The inverted character string and the second index hidden data are OR-calculated to obtain second encrypted index data.

4. The method according to any one of claim 1, characterized in that: The obtaining of a first character string used for encrypting the plurality of pieces of data and a negated character string of the first character string comprises: Obtaining a first initial character string and key data; Encrypting the first initial character string using the key data to obtain the first character string; Perform logical inversion processing on the first character string to obtain an inverted character string of the first character string.

5. The method according to any one of claims 1 to 4, characterized in that: The obtaining the index of the plurality of pieces of data to be received from the second data end on the second data end includes: Receive a second encrypted candidate index and set XOR data sent by the second data end based on a second index set; Performing data summary mapping on a first candidate index in a first index set of the first data end to obtain first summary data corresponding to the first candidate index; Based on the set XOR data, performing data hiding processing on the first summary data to obtain a first encryption candidate index; The first encryption candidate index and the second encryption candidate index are compared to determine an index intersection between the first index set and the second index set, and the index is obtained from the index intersection.

6. The method according to claim 5, characterized in that The step of performing data hiding processing on the first summary data based on the set XOR data to obtain a first encryption candidate index includes: Obtaining a first key of the first data terminal; Performing key encryption on the first summary data based on the first key to obtain a first initial encryption candidate index; Based on the set XOR data and the first initial encryption candidate index, data encryption calculation is performed on the first summary data to obtain a first encryption candidate index.

7. A data processing method, characterized in that: Applied to the second data terminal, including: Receiving first encrypted index data and second encrypted index data sent by the first data end; respectively performing AND calculation on the inverted index corresponding to each candidate data in the second data end and the first encrypted index data to obtain first decrypted data corresponding to the candidate data, wherein the inverted index is obtained by performing logical inversion processing on the index; Respectively performing AND calculation on the index corresponding to each candidate data and the second encrypted index data to obtain the second decrypted data corresponding to each candidate data; Performing data calculation on the first decrypted data and the second decrypted data corresponding to each piece of the candidate data to obtain a second character string used for encrypting each piece of the candidate data; Performing an XOR calculation on each piece of the candidate data and the corresponding second character string to obtain encrypted candidate data of each piece of the candidate data; The encrypted candidate data is sent to the first data end, so that the first data end decrypts the encrypted candidate data based on the first character string to obtain the target data.

8. The method according to claim 7, characterized in that The receiving the first encrypted index data and the second encrypted index data sent by the first data terminal includes: Acquire a second index set related to the candidate data; Performing data summary mapping on a second candidate index in the second index set to obtain second summary data corresponding to the second candidate index; Performing an XOR calculation on the second summary data corresponding to the second candidate index to obtain set XOR data of the second index set; Based on the set XOR data, perform data hiding processing on each piece of the second summary data to obtain a second encryption candidate index; Sending the second encrypted candidate index and the set XOR data to the first data end, so that the first data end performs index encryption on the first candidate index in the first index set to obtain the first encrypted candidate index, and determining the index intersection between the first index set and the second index set by comparing the first encrypted candidate index with the second encrypted candidate index; Receive first encrypted index data and second encrypted index data sent by the first data end, where the first encrypted index data and the second encrypted index data are obtained by the first data end obtaining indexes from the index intersection and performing index hiding processing on the indexes.

9. The method according to claim 8, characterized in that The step of performing data hiding processing on each piece of the second summary data based on the set XOR data to obtain a second encryption candidate index includes: Obtaining a second key of the second data terminal; Performing key encryption on the second summary data based on the second key to obtain a second initial encryption candidate index; A data encryption calculation is performed on the second initial encryption candidate index based on the set XOR data to obtain a second encryption candidate index.

10. The method according to any one of claims 7 to 9, characterized in that: The step of performing data calculation on the first decrypted data and the second decrypted data corresponding to each piece of the candidate data to obtain a second character string used for encrypting each piece of the candidate data comprises: Perform OR calculation on the first decrypted data and the second decrypted data to obtain target decrypted data of the candidate data; Performing an XOR calculation on the index of the candidate data and the target decrypted data to obtain an encrypted second character string; The encrypted second character string is decrypted based on the key data of the second data end to obtain the second character string.

11. A data processing device, characterized in that: include: An acquisition unit, used for acquiring indexes of a plurality of pieces of data to be received from a second data end at the second data end, and a first character string used for encrypting the plurality of pieces of data and a negated character string of the first character string; A first calculation unit, configured to perform an AND calculation on the index to obtain first index hidden data; A second calculation unit is used to perform an AND calculation on the inverted index to obtain second index hidden data, wherein the inverted index is obtained by performing a logical inversion process on the index; an encryption unit, configured to encrypt the first index hidden data by using the first character string to obtain first encrypted index data, and to encrypt the second index hidden data by using the inverted character string to obtain second encrypted index data; A first sending unit, configured to send the first encrypted index data and the second encrypted index data to a second data end, so that the second data end predicts a second character string used for encrypting each candidate data in the second data end according to the first encrypted index data and the second encrypted index data, and encrypts each data according to the second character string to obtain encrypted candidate data; A decryption unit is used to receive the encrypted candidate data, decrypt the encrypted candidate data according to the first character string, and obtain the target data corresponding to the index.

12. A data processing device, characterized in that: Applied to the second data terminal, including: A receiving unit, configured to receive first encrypted index data and second encrypted index data sent by a first data terminal; a third calculation unit, configured to respectively perform AND calculation on the inverted index corresponding to each candidate data in the second data end and the first encrypted index data to obtain first decrypted data corresponding to the candidate data, wherein the inverted index is obtained by performing a logical inversion process on the index; a fourth calculation unit, configured to respectively calculate an index corresponding to each piece of candidate data and the second encrypted index data to obtain second decrypted data corresponding to each piece of candidate data; A data calculation unit, used for performing data calculation on the first decrypted data and the second decrypted data corresponding to each piece of the candidate data, to obtain a second character string used for encrypting each piece of the candidate data; an XOR calculation unit, used for performing an XOR calculation on each of the candidate data and the corresponding second character string to obtain encrypted candidate data of each of the candidate data; The second sending unit is used to send the encrypted candidate data to the first data end, so that the first data end decrypts the encrypted candidate data based on the first character string to obtain target data.

13. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the data processing method according to any one of claims 1 to 6 or 7 to 10.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the data processing method according to any one of claims 1 to 6 or 7 to 10.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 6 or 7 to 10 is implemented.

Citation Information

Patent Citations

  • Encryption method and device, decryption method and device, electronic equipment and medium

    CN110737908A

  • Encryption method, decryption method, communication method, system and device

    CN112994875A