Data processing method, electronic device and computer readable storage medium
By obfuscating and encrypting the original data, and using the trusted execution environment to perform matrix multiplication operations, the problems of low data processing efficiency and insufficient security in the existing technology are solved, and efficient and secure data processing is achieved.
Patent Information
- Application Number
- CN202210806382.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-08
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-07-08
AI Technical Summary
The existing secure matrix multiplication algorithm is inefficient in data processing and the encrypted ciphertext is at risk of being deciphered. There is an urgent need for a data processing method with higher efficiency and security.
By obfuscating and encrypting the original data participating in multi-party security calculations, sending it to the trusted execution environment for decryption and matrix multiplication operations, the encrypted product data is generated and fed back, and finally the original product data is extracted after decryption to ensure the safety of data transmission. Safety and efficiency.
It improves the efficiency and security of data processing, avoids the risk of data leakage, and ensures the security of data transmission. Even if the transmitted data is intercepted, it cannot be deciphered.
Smart Images

Figure CN117411652B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of secure matrix multiplication algorithms, and in particular to a data processing method, an electronic device and a computer-readable storage medium. Background Art
[0002] The current secure matrix multiplication algorithm can generally be implemented based on multi-party secure computing technology and homomorphic encryption technology. In the absence of a trusted third party, the existing secure matrix multiplication algorithm can use complex encryption methods to perform collaborative data calculations according to public calculation logic and ultimately output the calculation results.
[0003] However, the existing secure matrix multiplication algorithm has low data processing efficiency because most of the processes need to calculate the encrypted ciphertext. In addition, if the encrypted ciphertext is intercepted, there is a risk of being deciphered.
[0004] In view of this, there is an urgent need for a more efficient and secure data processing method. Summary of the invention
[0005] In view of this, one or more embodiments of the present disclosure provide a data processing method, an electronic device, and a computer-readable storage medium to improve the efficiency and security of data processing.
[0006] On the one hand, the present disclosure provides a data processing method, which is applied to a first electronic device, and the method includes: performing obfuscation processing on first original data participating in a multi-party secure computing, encrypting the first obfuscated data after the obfuscation processing into first encrypted obfuscated data, and sending the first encrypted obfuscated data to a working node device, so as to decrypt the first encrypted obfuscated data into the first obfuscated data through the working node device in a trusted execution environment; receiving encrypted obfuscated product data fed back by the working node device, the obfuscated product data being generated by the working node device in the trusted execution environment according to the first obfuscated data and second obfuscated data of a second electronic device; wherein the second obfuscated data is obtained by the second electronic device performing obfuscation processing on the second original data participating in the multi-party secure computing; decrypting the encrypted obfuscated product data into obfuscated product data, and extracting original product data from the obfuscated product data, the original product data being generated based on the first original data and the second original data.
[0007] On the other hand, the present disclosure also provides an electronic device, which includes: a data sending unit, which is used to perform obfuscation processing on first original data participating in a multi-party secure computing, and encrypt the first obfuscated data after the obfuscation processing into first encrypted obfuscated data, and send the first encrypted obfuscated data to a working node device, so that the first encrypted obfuscated data can be decrypted into the first obfuscated data by the working node device in a trusted execution environment; a data receiving unit, which is used to receive the encrypted obfuscated product data fed back by the working node device, the obfuscated product data is generated by the working node device in the trusted execution environment according to the first obfuscated data and second obfuscated data of a second electronic device; wherein the second obfuscated data is obtained by the second electronic device performing obfuscation processing on the second original data participating in the multi-party secure computing; a data extraction unit, which is used to decrypt the encrypted obfuscated product data into obfuscated product data, and extract original product data from the obfuscated product data, wherein the original product data is generated based on the first original data and the second original data.
[0008] On the other hand, the present disclosure further provides an electronic device, which includes a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the above-mentioned data processing method is implemented.
[0009] On the other hand, the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the above-mentioned data processing method is implemented.
[0010] The technical solution provided by one or more embodiments of the present disclosure is that after the first electronic device sends the first encrypted obfuscated data to the working node device, the working node device can decrypt the first encrypted obfuscated data into the first obfuscated data in plain text. When the working node device performs matrix multiplication operations, the first obfuscated data and the second obfuscated data in plain text can be directly processed in a trusted execution environment. After the obfuscated product data is obtained through processing, the working node device can encrypt the obfuscated product data and feed it back to the first electronic device. Finally, the first electronic device can extract the required original product data from the decrypted obfuscated product data.
[0011] In this process, the working node device always processes data in plain text, which greatly improves the data processing efficiency. In addition, the data transmitted between the electronic device and the working node device are encrypted and obfuscated. The working node device processes the plain text in a trusted execution environment. Even if the transmitted data is intercepted, data leakage can be avoided, thereby ensuring the security of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0013] Figure 1 A schematic diagram of the system architecture of a secure matrix multiplication operation in one embodiment of the present invention is shown;
[0014] Figure 2 A schematic diagram showing the steps of a data processing method in one embodiment of the present invention is shown;
[0015] Figure 3 An interactive schematic diagram of a data processing method in one embodiment of the present invention is shown;
[0016] Figure 4 An interactive schematic diagram of an authentication process in one embodiment of the present invention is shown;
[0017] Figure 5 A schematic diagram of the steps for verifying an encrypted public key in one embodiment of the present invention is shown;
[0018] Figure 6 A schematic diagram of the transmission interaction of obfuscated data in one embodiment of the present invention is shown;
[0019] Figure 7 A schematic diagram of transmission of interactive data in one embodiment of the present invention is shown;
[0020] Figure 8 A schematic diagram of functional modules of an electronic device in one embodiment of the present invention is shown;
[0021] Fig. 9 A schematic structural diagram of an electronic device in one embodiment of the present invention is shown. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0023] The data processing method provided in one embodiment of the present disclosure can be applied to Figure 1 The system architecture shown. Figure 1The system architecture shown may include an authentication node device, a working node device, and multiple electronic devices. Each electronic device has its own original data. After each electronic device authenticates the authentication node device, the working node device may perform a secure matrix multiplication operation on the original data. After generating the result data of the secure matrix multiplication operation, the working node device may feed back the result data to the corresponding electronic device.
[0024] In practical applications, the original data of each electronic device may be data participating in secure multi-party computing (Secure Multi-Party Computation), where the original data of each electronic device is usually confidential data. In the process of participating in secure multi-party computing, on the premise of ensuring that each electronic device can receive the calculation results, it is also necessary to ensure that the original data of each electronic device is not leaked, that is, in the whole process, the electronic device can only know its own original data, but cannot decipher the original data of other electronic devices.
[0025] In the embodiments of the present disclosure, two electronic devices (a first electronic device and a second electronic device) are used as an example to illustrate the technical solution. However, those skilled in the art should know that in practical applications, the number of electronic devices in the security matrix multiplication algorithm can be more than two, wherein the security matrix multiplication operation performed on the original data of any two electronic devices can refer to the data processing process between the first electronic device and the second electronic device in the present disclosure.
[0026] For different application scenarios, raw data can have different forms of expression. For example, in the field of machine learning, raw data can be image training samples, or feature data extracted from image training samples. For another example, in the field of blockchain, raw data can be user transaction records.
[0027] See also Figure 2 The data processing method provided in one embodiment of the present disclosure can be executed by any electronic device in the secure matrix multiplication algorithm. Figure 2 As shown, taking the first electronic device as an example, the data processing method may include the following steps.
[0028] S1: Perform obfuscation processing on first original data participating in multi-party secure computing to generate first obfuscated data, perform encryption processing on the first obfuscated data to generate first encrypted obfuscated data, and send the first encrypted obfuscated data to a working node device so that the first encrypted obfuscated data can be decrypted into the first obfuscated data in a trusted execution environment by the working node device.
[0029] In this embodiment, the first original data of the first electronic device may have different forms of expression in different application scenarios. For example, in the field of machine learning, the first original data may be data obtained after feature extraction of a training sample. Generally speaking, the first original data may be expressed in a matrix form. For example, the data obtained after feature extraction of a training sample may be represented by a feature vector, and a feature matrix composed of feature vectors of a large number of training samples may be used as the above-mentioned first original data.
[0030] In this embodiment, the first electronic device may use a first obfuscation parameter to perform obfuscation processing on the first original data. The first obfuscation parameter may be a matrix initialized by a random number, and the number of rows and columns of the matrix correspond to the number of rows and columns of the first original data. After the first original data is obfuscated, the obfuscated data may be further encrypted to obtain first encrypted obfuscated data. The encryption algorithm may flexibly adopt a conventional encryption algorithm according to the actual application scenario and data processing requirements. For example, encryption algorithms such as DES (Data Encryption Standard) or AES (Advanced Encryption Standard) may be used to encrypt the obfuscated data.
[0031] See also Figure 3 In this embodiment, after generating the first encrypted obfuscated data, the first electronic device can send the first encrypted obfuscated data to the working node device. In this way, the working node device can decrypt the first encrypted obfuscated data to restore the plaintext of the first obfuscated data.
[0032] It should be noted that the second electronic device can use a similar method to confuse and encrypt the second original data and obtain the second encrypted obfuscated data. The second encrypted obfuscated data can also be sent by the second electronic device to the working node device. In this way, the working node device can decrypt the first encrypted obfuscated data and the second encrypted obfuscated data respectively, thereby restoring the plaintext of the first obfuscated data and the plaintext of the second obfuscated data.
[0033] S3: Receive the encrypted obfuscated product data fed back by the working node device, wherein the obfuscated product data is generated by the working node device in the trusted execution environment according to the first obfuscated data and the second obfuscated data corresponding to the second electronic device; wherein the second obfuscated data is obtained by the second electronic device performing obfuscation processing on the second original data participating in the multi-party secure computing.
[0034] like Figure 3As shown, in this embodiment, after the working node device decrypts and obtains the plaintext of the first obfuscated data and the second obfuscated data, it can calculate the obfuscated product data between the first obfuscated data and the second obfuscated data. Specifically, assuming that the first obfuscated data x'1 and the second obfuscated data x'2 can be respectively expressed as:
[0035] x'1=x1+C
[0036] x'2=x2+D
[0037] Wherein, x1 represents the first original data, C represents the first obfuscation parameter, x2 represents the second original data, and D represents the second obfuscation parameter for obfuscating the second original data.
[0038] In this embodiment, the working node device may multiply the first obfuscated data and the second obfuscated data to obtain obfuscated product data. Specifically, when the first obfuscated data and the second obfuscated data are multiplied, the rule of matrix multiplication may be followed. The working node device may encrypt the obfuscated product data and feed back the encrypted obfuscated product data to the first electronic device. In this way, after the first electronic device sends the first encrypted obfuscated data to the working node device, it can receive the encrypted obfuscated product data fed back by the working node device.
[0039] S5: decrypting the encrypted obfuscated product data into obfuscated product data, and extracting original product data from the obfuscated product data, wherein the original product data is generated based on the first original data and the second original data.
[0040] In this embodiment, the first electronic device can decrypt the encrypted obfuscated product data into obfuscated product data. Generally speaking, the obfuscated product data will include the original product data generated by the first original data and the second original data. At the same time, since the first obfuscated parameter in the first obfuscated data and the second obfuscated parameter in the second obfuscated data are introduced into the obfuscated product data, some unnecessary redundant data will also exist in the obfuscated product data. In this case, the redundant data related to the first obfuscated parameter and the second obfuscated parameter in the obfuscated product data can be removed, and the original product data can be extracted, and the original product data can be used as the result of the security matrix multiplication operation on the first original data and the second original data.
[0041] For example, after performing a matrix product operation on the first obfuscated data x'1 and the second obfuscated data x'2, the following obfuscated product data can be obtained:
[0042] x'1*x'2=(x1+C)*(x2+D)=x1*x2+x1*D+x2*C+C*D
[0043] =x1*x2+x1*D+(x2+D)*C=x1*x2+x1*D+x'2*C
[0044] It can be seen that, in addition to the original product data x1*x2, the obfuscated product data also includes two other redundant data x1*D+x'2*C related to the first obfuscated parameter and the second obfuscated parameter. By removing these two redundant data from the obfuscated product data, the original product data can be extracted.
[0045] Among them, when removing the above-mentioned redundant data, the first electronic device can send the encrypted first obfuscation parameter to the second electronic device, and the first electronic device can receive the encrypted second obfuscation parameter sent by the second electronic device. Subsequently, after the first electronic device decrypts and obtains the second obfuscation parameter D, it can calculate x1*D. At the same time, the second electronic device can decrypt and obtain the first obfuscation parameter C, and calculate x'2*C. In this way, the second electronic device can encrypt x'2*C and send it to the first electronic device. After decrypting the data, the first electronic device can obtain x'2*C. In this way, the first electronic device can remove x1*D+x'2*C from the obfuscated product data, and the remaining data can be used as the extracted original product data.
[0046] In this embodiment, the first electronic device and the second electronic device perform data transmission in a process involving data encryption and decryption. In order to ensure the normal progress of the encryption and decryption process, the two electronic devices can negotiate a key in advance, and then each store the negotiated key. Subsequently, the negotiated key can be used to encrypt or decrypt the data.
[0047] Similarly, in this embodiment, when the first electronic device and the second electronic device perform the above-mentioned data transmission with the working node device, a process of encrypting and decrypting data is usually involved. For example, the first electronic device sends the first encrypted obfuscated data to the working node device, and the working node device decrypts the first encrypted obfuscated data into the first obfuscated data. For another example, the working node device feeds back the encrypted obfuscated product data to the first electronic device, and the first electronic device decrypts the encrypted obfuscated product data. In order to ensure the normal progress of the encryption and decryption process, the electronic device and the working node device can negotiate a key in advance, and then each will store the negotiated key. Subsequently, the negotiated key can be used to encrypt or decrypt the data.
[0048] It should be noted that in order to improve the security of data processing, the above-mentioned authentication node devices and working node devices can all be devices with a trusted execution environment (TEE). The process of processing data by the above-mentioned authentication node devices and working node devices can be completed in their respective TEEs. Therefore, although the data is processed in plain text in the working node device, the security of the original data can also be guaranteed due to the high reliability of TEE itself and the randomness of the obfuscated data.
[0049] As can be seen from the above, the technical solution provided by one or more embodiments of the present disclosure is that after the first electronic device sends the first encrypted obfuscated data to the working node device, the working node device can decrypt the first encrypted obfuscated data into the first obfuscated data in plain text. When performing matrix multiplication operations, the working node device can directly process the first obfuscated data and the second obfuscated data in plain text. After processing to obtain the obfuscated product data, the working node device can encrypt the obfuscated product data and feed it back to the first electronic device. Finally, the first electronic device can extract the required original product data from the decrypted obfuscated product data.
[0050] In this process, the working node device always processes the data in plain text, which greatly improves the data processing efficiency. In addition, the data transmitted between the electronic device and the working node device are encrypted and obfuscated. Even if the transmitted data is intercepted, data leakage can be avoided, thus ensuring the security of data transmission.
[0051] See also Figure 1 and Figure 4 In one embodiment, before executing the security matrix multiplication algorithm, each electronic device may first verify and negotiate with the authentication node device to obtain the encryption public key and encryption private key required for subsequent data encryption and decryption.
[0052] Specifically, Figure 4 As shown, taking the first electronic device as an example, the first electronic device sends an authentication request to the authentication node device, and the authentication request usually includes a randomly generated random information. For example, the random information can be a one-time string nonce of 32 bytes.
[0053] After receiving the authentication request, the authentication node device can generate two pairs of public and private keys, which are used for encryption and signature respectively. One pair of public and private keys is a matching encryption public key PK1 and encryption private key SK1, and the other pair of public and private keys is a matching signature public key PK2 and signature key SK2. Among them, these two pairs of public and private keys can use conventional encryption algorithms, such as RSA encryption algorithms or other encryption algorithms selected according to actual application scenarios.
[0054] After generating two pairs of public and private keys, the authentication node device can use the signature key SK2 to sign the random information in the authentication request, generate signature information, and feedback the return data containing the signature information to the first electronic device. In practical applications, the return data also includes the above-mentioned encryption public key PK1 and signature public key PK2, as well as remote proof information, wherein the remote proof information can also include a hash string generated based on the encryption public key PK1 and signature public key PK2.
[0055] In one embodiment, the same hash algorithm can be used to calculate the hash string hash(PK1) of the encryption public key PK1, and the hash string hash(PK2) of the signature public key PK2, and then the two hash strings can be concatenated to obtain a hash string generated based on the encryption public key PK1 and the signature public key PK2.
[0056] In a specific application example, the TEE in the electronic device and the authentication node device can be implemented through Intel SGX (Software Guard eXtensions). The feedback data fed back by the authentication node device to the first electronic device may include the above-mentioned signature information, encryption public key PK1, signature public key PK2 and remote proof information, and the remote proof information can be implemented through the quote structure in Intel SGX. In the designated field of the remote proof information, the hash string generated based on the encryption public key PK1 and the signature public key PK2 can be stored. For example, in the report_body field of the quote structure, the concatenated hash string can be stored.
[0057] In this embodiment, after receiving the feedback data fed back by the authentication node device in response to the authentication request, the first electronic device can verify the encryption public key and signature public key carried in the feedback data. After the encryption public key and signature public key carried in the feedback data are verified, the first electronic device can store the encryption public key. Subsequently, the first electronic device can encrypt and transmit data using the encryption public key.
[0058] See also Figure 5In one embodiment, the first electronic device may verify the correctness of the encryption public key PK1 and the signature public key PK2 in the returned data according to the following steps.
[0059] S21: After confirming the legitimacy of the hash string contained in the remote certification information, respectively calculate the hash strings corresponding to the encryption public key and the signature public key carried in the returned data.
[0060] S22: Determine whether the calculated hash string of the signature public key is consistent with the hash string of the signature public key in the remote certification information, and determine whether the calculated hash string of the encryption public key is consistent with the hash string of the encryption public key in the remote certification information.
[0061] S23: Decrypt the signature information in the returned data using the signature public key, and compare the decrypted data with the random information in the authentication request.
[0062] In this embodiment, the verification process of the first electronic device for the encrypted public key PK1 in the returned data can be divided into three steps. First, the first electronic device will verify the correctness of the remote attestation information in the returned data. Generally speaking, the remote attestation information is generated in a fixed format. The first electronic device can determine whether the authentication node device that sends the remote attestation information has a trusted identity by identifying the certificate and other information contained in the remote attestation information. After confirming that the authentication node device has a trusted identity, the first electronic device can further determine the correctness of the encrypted public key PK1 and the signature public key PK2 carried in the returned data.
[0063] Specifically, the first electronic device can extract the carried hash string and the encryption public key PK1 and the signature public key PK2 from the returned data. The first electronic device can calculate the hash strings hash(PK1) and hash(PK2) corresponding to the encryption public key PK1 and the signature public key PK2 respectively. The first electronic device can compare the calculated hash(PK1) and hash(PK2) with the hash string carried in the returned data, respectively, to determine whether the calculated hash string of the signature public key is consistent with the hash string of the signature public key in the returned data, and to determine whether the calculated hash string of the encryption public key is consistent with the hash string of the encryption public key in the returned data. When both are consistent, it indicates that the encryption public key and the signature public key carried in the returned data are correct.
[0064] When it is determined that the encryption public key and signature public key carried in the returned data are correct, the first electronic device can finally decrypt the signature information in the returned data through the signature public key, and compare the decrypted data with the random information in the authentication request to determine whether the decrypted data is consistent with the random information. If they are consistent, it means that the signature verification has passed. At this time, the first electronic device can determine that the encryption public key and signature public key in the returned data have been verified. The first electronic device can store the encryption public key PK1 locally to encrypt and decrypt the subsequently transmitted data.
[0065] It should be noted that other electronic devices (such as the second electronic device) can also use a similar method to send an authentication request to the authentication node device, and finally store the verified encrypted public key PK1. The specific implementation process can refer to the execution steps of the first electronic device, which will not be repeated here.
[0066] In one embodiment, the authentication node device can start multiple working node devices. After completing two-way authentication and mutual identity verification with these working node devices, the authentication node device can synchronize the generated encryption public key PK1 and encryption private key SK1 to each working node device.
[0067] In this way, after completing the above verification process, the encrypted public key PK1 can be stored in each electronic device, and the encrypted public key PK1 and the encrypted private key SK1 can be stored in each working node device.
[0068] Through the above-mentioned authentication process, it can be ensured that the encryption public key in the electronic device and the working node device is consistent, thereby providing a basis for data encryption and decryption for the subsequent data transmission process, and ensuring the security and correctness of data transmission.
[0069] After the electronic device and the working node device have synchronized the encryption public key, the data transmission process can be carried out based on the encryption public key.
[0070] Specifically, see Figure 6In one embodiment, the first electronic device uses the first obfuscation parameter to perform obfuscation processing on the first original data. After obtaining the first obfuscated data, it can randomly select an unused first symmetric key, and then use the first symmetric key to encrypt the first obfuscated data, thereby obtaining the first encrypted obfuscated data, which can be sent to the working node device. At the same time, in order to enable the working node device to decrypt the first encrypted obfuscated data normally, the first electronic device also needs to use the encryption public key PK1 obtained from the authentication node device to encrypt the above-mentioned randomly generated first symmetric key, and send the encrypted first symmetric key to the working node device. In this way, the working node device can first use the encryption private key SK1 to decrypt the encrypted first symmetric key to obtain the first symmetric key. Then use the first symmetric key to decrypt the first encrypted obfuscated data into the plaintext of the first obfuscated data.
[0071] Similarly, the working node device can decrypt the second encrypted obfuscated data sent by the second electronic device in a similar manner. However, in this process, the second electronic device uses a random second symmetric key to encrypt the second obfuscated data to generate the second encrypted obfuscated data. Then, while sending the second encrypted obfuscated data to the working node device, the second symmetric key is encrypted using the encryption public key PK1, and the encrypted second symmetric key is sent to the working node device.
[0072] In the above manner, when each electronic device sends encrypted obfuscated data to the working node device, it can encrypt the obfuscated data with a randomly selected symmetric key, and at the same time encrypt the symmetric key with the encryption public key PK1 issued by the authentication node device. In a data transmission process, encryption is performed using both the symmetric key and the encryption public key PK1, which can further improve the security of data transmission while ensuring that the working node device can decrypt the encrypted data normally.
[0073] In this embodiment, after decrypting and obtaining the plaintext of the first obfuscated data and the second obfuscated data, the working node device can calculate the product x'1*x'2 of the first obfuscated data and the second obfuscated data, and use the product x'1*x'2 as the obfuscated product data. After obtaining the obfuscated product data, the working node device can encrypt the obfuscated product data using the first symmetric key to obtain the encrypted obfuscated product data. The encrypted obfuscated product data can be sent by the working node device to the first electronic device, and the first electronic device can decrypt and obtain the obfuscated product data using the first symmetric key.
[0074] See also Figure 7In one embodiment, in order to finally extract the original product data from the obfuscated product data, data may also need to be transmitted between the first electronic device and the second electronic device. Figure 7 As shown, in order to ensure the security of data transmission, the first electronic device and the second electronic device can pre-negotiate a shared symmetric key, which can be stored in the two electronic devices. Then, the first electronic device can use the shared symmetric key to encrypt the first obfuscation parameter, and send the obtained first encrypted obfuscation parameter to the second electronic device, so that the second electronic device decrypts the first encrypted obfuscation parameter into the first obfuscation parameter according to the shared symmetric key.
[0075] After decrypting and obtaining the first obfuscation parameter, the second electronic device can calculate the product x'2*C of the second obfuscated data and the first obfuscation parameter, and use the product as the first interaction data. After generating the first interaction data, the second electronic device can use the above-mentioned shared symmetric key to encrypt the first interaction data into first encrypted interaction data, and send the first encrypted interaction data to the first electronic device. After receiving the first encrypted interaction data, the first electronic device can use the shared symmetric key to decrypt the first encrypted interaction data into the first interaction data x'2*C.
[0076] In one embodiment, the second electronic device may encrypt the second obfuscation parameter into a second encrypted obfuscation parameter using the above-mentioned shared symmetric key, and then send the second encrypted obfuscation parameter to the first electronic device. After the first electronic device receives the second encrypted obfuscation parameter sent by the second electronic device, it may decrypt the second encrypted obfuscation parameter into a second obfuscation parameter using the shared symmetric key. Then, the second interactive data may be generated according to the second obfuscation parameter and the first original data. The second interactive data may be the product x1*D of the second obfuscation parameter and the first original data.
[0077] At this point, the first electronic device may have the obfuscated product data x'1*x'2:
[0078] x'1*x'2=x1*x2+x1*D+x'2*C
[0079] There may also be first interaction data x'2*C and second interaction data x1*D, so that the first electronic device can remove the first interaction data and the second interaction data from the obfuscated product data and use the remaining data as the extracted original product data x1*x2.
[0080] Through the technical solutions of the above-mentioned embodiments, the original product data after the security matrix multiplication operation is performed on the first original data and the second original data can be finally obtained by the first electronic device. Similarly, the second electronic device can also obtain the original product data in a similar manner, which will not be repeated here.
[0081] It should be noted that according to the above-mentioned execution steps, the first electronic device can obtain the second obfuscation parameter D and the first interaction data x'2*C of the second electronic device. The first interaction data will include the second obfuscation data x'2 of the second electronic device. The first electronic device itself knows its own first obfuscation parameter C. If the first electronic device can obtain the inverse matrix of the first obfuscation parameter, then by multiplying the first interaction data with the inverse matrix, the second obfuscation data can be deciphered. Then, by subtracting the second obfuscation parameter from the second obfuscated data, the second original data of the second electronic device can be restored. In other words, under the premise that the inverse matrix of the first obfuscation parameter C exists, the first electronic device can directly decipher the second original data of the second electronic device, which obviously poses a risk of original data leakage for the second electronic device.
[0082] However, in practical applications, the above-mentioned "prerequisite that the first confusion parameter C has an inverse matrix" is usually not met. The reason is that when the number of rows of the first confusion parameter C is greater than twice the number of columns, the first confusion parameter C does not have an inverse matrix. In practical applications, assuming that the first original data can be represented as a matrix with l rows and m columns, the number of rows can represent the number of training samples, and the number of columns can represent the dimension of the feature vector. Since the number of training samples is usually quite large, and the dimension of the feature vector is often limited, the number of rows of the first original data will be much larger than the number of columns. In this way, the first confusion parameter C with the same matrix dimension as the first original data will also have a situation where the number of rows is much larger than the number of columns, thereby ensuring that the number of rows is greater than twice the number of columns. At this time, the first confusion parameter C does not have an inverse matrix, which can prevent the first electronic device from directly deciphering the second original data of the second electronic device, thereby ensuring the security of the second original data.
[0083] It can be seen that in the data dimension of the first original data, the numerical relationship between the number of rows and the number of columns satisfies the specified irreversible condition, and the specified irreversible condition can be that the number of columns is greater than twice the number of rows. In this case, the first obfuscation parameter used to obfuscate the first original data does not have an inverse matrix, thereby avoiding the risk of the second original data being directly deciphered by the first electronic device.
[0084] Similarly, when the final original product data is acquired by the second electronic device, the risk of the first original data being directly deciphered by the second electronic device can also be avoided.
[0085] It should be noted that, in practical applications, considering that the memory of the TEE space in the electronic device and the working node device is usually limited, it is not suitable for processing a large amount of data. When the amount of data of the overall data matrix to be processed is large, the overall data matrix can be split into several local data matrices, and each local data matrix can be processed separately. Specifically, when the amount of data of the above-mentioned first original data and the second original data is greater than or equal to the specified data amount threshold, the first original data can be divided into a plurality of first local data matrices, and the second original data can be divided into a plurality of second local data matrices. The amount of data of the first local data matrix and the second local data matrix obtained by division can be less than the above-mentioned specified data amount threshold. Among them, the specified data amount threshold can be the amount of data that the TEE space can support. Considering that the first local data matrix and the second local data matrix need to be multiplied later, when dividing the local data matrix, it is necessary to ensure that the first local data matrix and the second local data matrix obtained by division meet the conditions that can be multiplied.
[0086] Subsequently, for the first local data matrix and the second local data matrix, the local product data generated by the first local data matrix and the second local data matrix can be calculated according to the processing process of steps S1 to S5. The original product data can be obtained by re-merging the local product data.
[0087] It should be noted that, in order to ensure that matrix multiplication can be performed normally, the confusion parameters for confusing the local data matrix may also be a local confusion matrix obtained by splitting an overall confusion matrix.
[0088] For example, the first original data can be a matrix of 128*2, and the second original data can be a matrix of 2*128. Then when performing matrix splitting, the first original data can be split into several first local data matrices of 8*2, and the second original matrix can be split into several second local data matrices of 2*8. According to the order of splitting, the first local data matrix and the second local data matrix can be paired. The first local data matrix and the second local data matrix of the same pair can be processed according to the process in steps S1 to S5, so as to obtain the local product data generated by the first local data matrix and the second local data matrix. For each pair of the first local data matrix and the second local data matrix, corresponding local product data can be generated. Finally, according to the order of matrix splitting, the local product data can be merged to obtain the original product data composed of each local product data.
[0089] The technical solutions provided by the above-mentioned various embodiments of the present disclosure can be applied to different practical scenarios. In different practical scenarios, the original data, obfuscation parameters, obfuscated product data, original product data, etc. of the above-mentioned electronic devices will have actual forms of expression. The following two different algorithm scenarios are used to explain the technical solutions of the above-mentioned various embodiments of the present disclosure in more detail.
[0090] In the specific application example of the federated logistic regression algorithm, assume that the electronic devices are A1 and A2, where A1 has data A2 owns the data The technical solution provided by the present disclosure can be implemented according to the following steps:
[0091] 1. Participants A1 and A2 each initialize the model weights And negotiate a shared symmetric key k.
[0092] 2.A1 generates random numbers to initialize the confusion matrix C = [c i ] l×1 .
[0093] 3.A2 generates random numbers to initialize the confusion matrix
[0094] 4.A2 will make its data into a large matrix Split into multiple small matrices Where l′<<l and l′>2m2.
[0095] 5.A2 also splits D into multiple small matrices Send data E encrypted by k to A1 k (D i ).
[0096] 6.A1 Similarly, split C into multiple small matrices C i ∈R l′×1 , send the k-encrypted data E to A2 k (C i ).
[0097] 7. The matrix after A2 confusion is x' 2,i =x 2,i +D i , and randomly select a symmetric key k2, and encrypt the obfuscated matrix with the symmetric key And encrypt the symmetric key E with PK1 PK1 (k2), then Sent to the working node device.
[0098] 8. For each sample feature, repeat steps 1) to 14):
[0099] 1) For the first sample feature in the first original data, weighting is performed on the first sample feature to generate a first weighted feature. Similarly, the second electronic device can generate a second weighted feature. Specifically, for a set of sample features x 1i and x 2i , A1, A2 are calculated independently, where x 1i represents the i-th sample feature in x1, x 2i Represents the i-th sample feature in x2:
[0100]
[0101] 2) A2 sends to A1 In this way, the first electronic device can receive the second weighted feature sent by the second electronic device, where the second weighted feature is obtained by weighting the second sample feature in the second original data by the second electronic device.
[0102] 3) Generate a linear predictor consisting of the first weighted feature and the second weighted feature, A1 calculates the linear predictor
[0103]
[0104] 4) Generate the current prediction value according to the linear predictor, and A1 calculates the current prediction value of the model
[0105]
[0106] 5) Subsequently, a residual vector may be generated according to the first weighted feature and the second weighted feature, and a first gradient vector may be generated according to the first original data and the residual vector. Specifically, A1 calculates the current residual of the model
[0107]
[0108] 6) The difference between the current prediction value and the standard prediction value is used as the sample residual, and each sample residual is used as a vector element to generate a residual vector: each set of sample features can correspond to a current residual, and A1 combines these residuals into a residual vector Y = [r1, ..., r l ] T , and then split this vector into multiple small vectors Y i ∈R l′×1 .
[0109] 7) A1 for each Y i and C i , calculate the noisy residual vector:
[0110] I i =Ci +Y i
[0111] 8) A1 randomly selects a symmetric key k1 and encrypts the noisy residual vector with the symmetric key And encrypt the symmetric key E with PK1 PK1 (k1), then E PK1 (k1) is sent to the working node device.
[0112] 9) The working node device first decrypts SK1 to obtain k1 and k2, and then decrypts to obtain x' 2,i and I i , and finally calculate F i =x' 2,i T I i , and encrypt the result Send to A2.
[0113] 10) A1 calculates D i T Y i , and the encrypted result E k (D i T Y i ) is sent to A2.
[0114] 11) A1 calculates the gradient vector:
[0115]
[0116] 12) A2 decrypts to get F i and D i T Y i , and calculate the gradient vector:
[0117]
[0118] Although A2 obtains D i T Y i and D i , but since l′>2m2, it still cannot get Y i , so the residuals are not deciphered by A2.
[0119] 13) Finally, the first electronic device can update the weighting coefficient for generating the first weighted feature according to the first gradient vector, and A1 updates the model
[0120] w1←w1-ηG1 T
[0121] 14) A2 Update Model
[0122] w2←w2-ηG2 T
[0123] Where η represents the preset learning rate.
[0124] It can be seen that after the residual vector is obfuscated to generate a confused residual vector, the confused residual vector is sent to the working node device, so that the working node device sends the product data between the confused residual vector and the second confused data to the second electronic device, and enables the second electronic device to extract the second gradient vector from the received product data, and update the weighting coefficient for generating the second weighted feature according to the second gradient vector.
[0125] In this application scenario, both A1 and A2 can eventually update the model, and the residual calculated by A1 will not be directly deciphered by A2.
[0126] In the application scenario of the federated XGBoost algorithm, assume that the electronic devices are A1 and A2, where A1 has data A2 owns the data The technical solution provided by the present disclosure can be implemented according to the following steps:
[0127] 1. Participant A1 initializes the predicted label value And negotiate a shared symmetric key k with participant A2.
[0128] 2. Participants A1 and A2 sort their data by id, then bin each dimension of the data and generate a splitting matrix
[0129] Among them, the binning operation can be performed in the following way: if there is a one-dimensional feature data of [1, 11, 8, 4, 2, 12, 17, 13, 5], and the interval of each box is (-∞, 6] (6, 11] (11, 12] (12, +∞), then the data in the first box contains [1, 4, 2, 5], the second box contains [8, 11], the third box contains
[12] , and the fourth box contains [13, 17].
[0130] Based on the binning results, a splitting matrix can be generated. Each value in the feature data will generate a corresponding n-1-dimensional vector, where n is the number of bins. Each element in the vector can be assigned a value according to the following rules:
[0131] For the i-th element in the vector, generate a value q (usually i-1) less than or equal to i, and determine whether the current value in the feature data is in the 1st to qth bins. If it is in one of the bins, set the value of the i-th element to 1; if it is outside the 1st to qth bins, set the value of the i-th element to 0. In this way, the splitting matrix generated by the above one-dimensional feature data is:
[0132] [[1,1,1],[0,1,1],[0,1,1],[1,1,1],[1,1,1],[0,0,1],[0,0,0],[0,0,0],[1,1,1]], which is l*(n-1) dimensional.
[0133] 3.A1 generates random numbers to initialize the confusion matrix C = [c i ] l×2 .
[0134] 4.A2 generates random numbers to initialize the confusion matrix Where n max is the maximum number of bins.
[0135] 5.A1,A2 will split each dimension of their features into a matrix M 1i ,M 2i After sorting by id, split into multiple Small matrix, where l′<<l and l′>4.
[0136] 6. A1 and A2 also split C and D into multiple small matrices C t ∈R l′×2 , A2 sends E to A1 k (D t ), A1 sends E to A2 k (C t ).
[0137] 7.A2 confuses the small matrix of the splitting matrix corresponding to each dimension of the feature to obtain the matrix And randomly select a symmetric key k2 and encrypt the matrix with the key And encrypt the symmetric key E with PK1 PK1 (k2), then E PK1 (k2) is sent to the working node device.
[0138] 8. For each sample, repeat steps 1) to 3) below:
[0139] 1) Breadth traverse each tree, for each node of a tree, repeat a) to k):
[0140] a) Generate the first-order derivative and the second-order derivative of the loss function of the first original data, and generate a derivative matrix composed of the first-order derivative and the second-order derivative: A1 calculates the first-order derivative and the second-order derivative of the loss function of each sample, here taking the logistic loss as an example,
[0141]
[0142] These values form the matrix GH = [[g1,…,g l ],[h1,…,h l ]]∈R 2×l , and split it into multiple small matrices GH t ∈R 2×l′ .
[0143] b) A1 calculates all g i The sum and all h i Of, remember Then calculate your own local optimal split through the following process:
[0144] i) Calculate the data for each dimension
[0145] ii) Calculate afterwards
[0146] iii) Calculate the Gain value of each splitting case for each dimension of data, that is,
[0147]
[0148] Find the maximum Gain value And record the corresponding values of i,j.
[0149] c) A1 to matrix GH t Obfuscate to get GH t’ =GH t +C t , randomly select a symmetric key k1, and encrypt the noisy residual vector with the symmetric key And encrypt the symmetric key E with PK1 PK1 (k1), then E PK1 (k1) is sent to the working node device.
[0150] d) The working node device first decrypts SK1 to obtain k1 and k2, and then decrypts GH t’ and Final calculation And encrypt the result Send to A1.
[0151] e) A2 calculation And encrypt the result Send to A1.
[0152] f) A1 calculation
[0153] g) Calculation after A1
[0154] h) A1 calculates the Gain value of each splitting case for each dimension of data, that is,
[0155]
[0156] Find the maximum Gain value And record the corresponding values of i′, j′.
[0157] i) A1 comparison and like If the node is large, the feature of the node is the feature corresponding to i′, and the split value is the right boundary of the interval corresponding to j′; The feature of the node is the feature corresponding to i, and the split value j is the right boundary of the corresponding interval.
[0158] j) A1 updates the node information and synchronizes the node information to A2. If the feature of the node is the data feature on the A1 side, A1 determines and records whether each sample is assigned to the left child node (left child node) or the right child node (right child node); if the feature of the node is the data feature on the A2 side, A2 determines and records whether each sample is assigned to the left child node or the right child node, and synchronizes it to A1.
[0159] k) A1 calculates the weight of each child node x as Among them I x is the sample space assigned to node x.
[0160] 2) A1 updates the predicted label value Right now where f t (x 1i ) is the weight of the leaf node to which sample i belongs in this tree.
[0161] 3) A1, A2 add this tree to the forest.
[0162] It can be seen that through the technical solution provided by the present disclosure, both A1 and A2 can eventually add trees to the forest, and the splitting matrix of A2 will not be directly deciphered by A1.
[0163] Through the above-mentioned method, the first electronic device can perform confusion processing on the derivative matrix, generate a confused derivative matrix, and send the confused derivative matrix to the working node device, so that the working node device generates the left confusion matrix product between the confused derivative matrix and the second confused splitting matrix; the second confused splitting matrix is obtained by the second electronic device performing confusion processing on the second splitting matrix, and the second splitting matrix is obtained by the second electronic device performing binning processing on the second original data.
[0164] The first electronic device may receive the left confusion matrix product sent by the working node device, and extract a left matrix product from the left confusion matrix product, wherein the left matrix product is generated based on the derivative matrix and the second splitting matrix.
[0165] The first electronic device calculates a right-side matrix product according to the left-side matrix product, and calculates a splitting gain value based on the left-side matrix product and the right-side matrix product.
[0166] Finally, the first electronic device updates the predicted label value according to the splitting gain value, and adds the tree corresponding to the updated predicted label value to the forest.
[0167] In this process, the derivative matrix is also used to generate a local optimal split value; the step of updating the predicted label value according to the split gain value specifically includes:
[0168] Comparing the local optimal splitting value with the splitting gain value, and updating the characteristics and splitting value of the node based on the comparison result;
[0169] The weight of the node is calculated according to the updated features and split value of the node, and the predicted label value is updated according to the weight.
[0170] Based on the comparison result, the step of updating the node feature and split value includes:
[0171] The larger one between the optimal splitting value and the splitting gain value is determined from the comparison result, and the characteristics and splitting value of the node are updated according to the larger one.
[0172] See also Figure 8 The present application also provides an electronic device, the electronic device comprising:
[0173] The data sending unit 100 is used to perform obfuscation processing on first original data participating in multi-party secure computing to generate first obfuscated data, perform encryption processing on the first obfuscated data to generate first encrypted obfuscated data, and send the first encrypted obfuscated data to a working node device, so that the working node device decrypts the first encrypted obfuscated data into the first obfuscated data in a trusted execution environment;
[0174] A data receiving unit 200 is used to receive the encrypted obfuscated product data fed back by the working node device, wherein the obfuscated product data is generated by the working node device in the trusted execution environment according to the first obfuscated data and the second obfuscated data of the second electronic device; wherein the second obfuscated data is obtained by the second electronic device performing obfuscating processing on the second original data participating in the multi-party secure computation;
[0175] The data extraction unit 300 is used to decrypt the encrypted obfuscated product data into obfuscated product data, and extract original product data from the obfuscated product data, where the original product data is generated based on the first original data and the second original data.
[0176] Each unit described in the above embodiments may be implemented by a computer chip or a product having a certain function. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0177] For the convenience of description, the above devices are described in terms of functions and are described separately in various units. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0178] In one embodiment, the electronic device further includes:
[0179] A request sending unit, used to send an authentication request to the authentication node device;
[0180] A feedback data receiving unit, configured to receive feedback data fed back by the authentication node device in response to the authentication request;
[0181] A public key storage unit is used to store the encrypted public key that has passed the verification after the encrypted public key and the signature public key carried in the returned data are verified; wherein the encrypted public key and the corresponding encrypted private key are also sent by the authentication node device to the working node device.
[0182] In one embodiment, the returned data also includes remote attestation information, and the remote attestation information includes a hash string generated based on the signature public key and the encryption public key;
[0183] The public key storage unit is further used to calculate the hash strings corresponding to the encrypted public key and the signed public key carried in the returned data respectively after confirming the legitimacy of the hash string contained in the remote certification information; determine whether the calculated hash string of the signed public key is consistent with the hash string of the signed public key in the remote certification information, and determine whether the calculated hash string of the encrypted public key is consistent with the hash string of the encrypted public key in the remote certification information.
[0184] In one embodiment, the authentication request includes at least random information, and the returned data also includes signature information, wherein the signature information is obtained by the authentication node device signing the random information using a signature private key;
[0185] The public key storage unit is further used to decrypt the signature information using the signature public key, and compare the decrypted data with the random information to determine whether the decrypted data is consistent with the random information.
[0186] In one embodiment, the data sending unit 100 is also used to use a first obfuscation parameter to perform obfuscation processing on the first original data, and use a first symmetric key to encrypt the first obfuscated data obtained by the obfuscation processing to obtain first encrypted obfuscated data; use the encryption public key obtained from the authentication node device to encrypt the first symmetric key, and send the encrypted first symmetric key to the working node device, so that the working node device uses the first symmetric key to decrypt the first encrypted obfuscated data into the first obfuscated data.
[0187] In one embodiment, the data sending unit 100 is also used to encrypt the first obfuscation parameter using a shared symmetric key negotiated with the second electronic device, and send the obtained first encrypted obfuscation parameter to the second electronic device, so that the second electronic device decrypts the first encrypted obfuscation parameter into the first obfuscation parameter according to the shared symmetric key.
[0188] In one embodiment, the data receiving unit 200 is also used to receive first encrypted interaction data sent by the second electronic device, and use the shared symmetric key to decrypt the first encrypted interaction data into first interaction data; wherein the first interaction data is generated by the second electronic device based on the second obfuscation data and the first obfuscation parameter.
[0189] In one embodiment, the data receiving unit 200 is also used to receive a second encrypted obfuscation parameter sent by the second electronic device, and use the shared symmetric key to decrypt the second encrypted obfuscation parameter into a second obfuscation parameter, where the second obfuscation parameter is an obfuscation parameter used by the second electronic device when performing obfuscation processing on the second original data; and generate second interaction data based on the second obfuscation parameter and the first original data.
[0190] In one embodiment, the data extraction unit 300 is further configured to remove the first interaction data and the second interaction data from the obfuscated product data, and use the remaining data as the extracted original product data.
[0191] In one embodiment, when the data amounts of the first original data and the second original data are both greater than or equal to a specified data amount threshold, the first original data is divided into multiple first local data matrices, and the second original data is divided into multiple second local data matrices; wherein the data amounts of the first local data matrix and the second local data matrix are both less than the specified data amount threshold; the data extraction unit 300 is further used to merge each of the local product data into the original product data after obtaining the local product data generated by the first local data matrix and the second local data matrix.
[0192] In one embodiment, in the data dimension of the first original data, the numerical relationship between the number of rows and the number of columns is such that the first obfuscation parameter for performing obfuscation processing on the first original data does not have an inverse matrix.
[0193] See also Fig. 9 The present application also provides an electronic device, which includes a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the above-mentioned data processing method is implemented.
[0194] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the above-mentioned data processing method is implemented.
[0195] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0196] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiment.
[0197] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0198] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0199] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device and the storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0200] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
[0201] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data processing method, characterized in that: The method comprises: Performing obfuscation processing on first original data participating in multi-party secure computing to generate first obfuscated data, performing encryption processing on the first obfuscated data to generate first encrypted obfuscated data, and sending the first encrypted obfuscated data to a working node device, so that the working node device decrypts the first encrypted obfuscated data into the first obfuscated data in a trusted execution environment; Receive the encrypted obfuscated product data fed back by the working node device, where the obfuscated product data is generated by the working node device in the trusted execution environment according to the first obfuscated data and second obfuscated data of the second electronic device; wherein the second obfuscated data is obtained by the second electronic device performing obfuscated processing on the second original data participating in the multi-party secure computation; decrypting the encrypted obfuscated product data into obfuscated product data, and extracting original product data from the obfuscated product data, wherein the original product data is generated based on the first original data and the second original data; The obfuscated product data includes first interactive data and second interactive data, wherein the first interactive data is generated based on the second obfuscated data and a first obfuscation parameter, and the first obfuscation parameter is an obfuscation parameter used by the first electronic device when performing obfuscation processing on the first original data; the second interactive data is generated based on the first original data and the second obfuscation parameter, and the second obfuscation parameter is an obfuscation parameter used by the second electronic device when performing obfuscation processing on the second original data; The step of extracting original product data from the obfuscated product data specifically includes: Eliminate the first interaction data and the second interaction data from the obfuscated product data, and use the remaining data as the extracted original product data; Wherein, when extracting the original product data from the obfuscated product data, the first electronic device sends the encrypted first obfuscation parameter to the second electronic device, and the first electronic device receives the encrypted second obfuscation parameter sent by the second electronic device; after the first electronic device decrypts to obtain the second obfuscation parameter, it calculates to obtain the second interactive data representing the product of the second obfuscation parameter and the first original data; the second electronic device decrypts to obtain the first obfuscation parameter, and calculates the first interactive data representing the product of the second obfuscation data and the first obfuscation parameter; the second electronic device encrypts the first interactive data and sends it to the first electronic device, and after the first electronic device decrypts the data, it obtains the second interactive data, and removes the first interactive data and the second interactive data from the obfuscated product data, and the remaining data is used as the extracted original product data.
2. The method according to claim 1, characterized in that The first encrypted obfuscated data is generated in the following manner: Using a first obfuscation parameter to perform obfuscation processing on the first original data, and using a first symmetric key to encrypt the first obfuscated data obtained by the obfuscation processing to obtain first encrypted obfuscated data; When sending the first encrypted obfuscated data to the working node device, the method further includes: The first symmetric key is encrypted using the encryption public key obtained from the authentication node device, and the encrypted first symmetric key is sent to the working node device, so that the working node device uses the first symmetric key to decrypt the first encrypted obfuscated data into the first obfuscated data.
3. The method according to claim 2, characterized in that The encrypted public key is obtained from the authentication node device in the following manner: Sending an authentication request to the authentication node device; Receive the feedback data from the authentication node device in response to the authentication request, and after verifying the encrypted public key and signature public key carried in the feedback data, store the verified encrypted public key; wherein the encrypted public key and the corresponding encrypted private key are also sent by the authentication node device to the working node device.
4. The method according to claim 3, characterized in that The returned data also includes remote attestation information, and the remote attestation information includes a hash string generated based on the signature public key and the encryption public key; Verifying the encryption public key and signature public key carried in the returned data includes: After confirming the legitimacy of the hash string contained in the remote attestation information, respectively calculating the hash strings corresponding to the encryption public key and the signature public key carried in the returned data; Determine whether the calculated hash string of the signature public key is consistent with the hash string of the signature public key in the remote certification information, and determine whether the calculated hash string of the encryption public key is consistent with the hash string of the encryption public key in the remote certification information.
5. The method according to claim 3 or 4, characterized in that: The authentication request at least includes random information, and the returned data also includes signature information, wherein the signature information is obtained by the authentication node device signing the random information using a signature private key; Verifying the signature public key carried in the returned data also includes: The signature information is decrypted using the signature public key, and the decrypted data is compared with the random information to determine whether the decrypted data is consistent with the random information.
6. The method according to claim 1, characterized in that The first interaction data is obtained in the following manner: Encrypting the first obfuscation parameter using the shared symmetric key obtained through negotiation with the second electronic device, and sending the obtained first encrypted obfuscation parameter to the second electronic device, so that the second electronic device decrypts the first encrypted obfuscation parameter into the first obfuscation parameter according to the shared symmetric key; Receive first encrypted interaction data sent by the second electronic device, and use the shared symmetric key to decrypt the first encrypted interaction data into first interaction data; wherein the first interaction data is generated by the second electronic device according to the second obfuscation data and the first obfuscation parameter.
7. The method according to claim 1, characterized in that When the data amounts of the first original data and the second original data are both greater than or equal to a specified data amount threshold, the first original data is divided into a plurality of first local data matrices, and the second original data is divided into a plurality of second local data matrices; wherein the data amounts of the first local data matrices and the second local data matrices are both less than the specified data amount threshold; After obtaining the local product data generated by the first local data matrix and the second local data matrix, each of the local product data is merged into the original product data.
8. The method according to claim 1, characterized in that After sending the first encrypted obfuscated data to the working node device, the method further includes: For the first sample feature in the first original data, weighting the first sample feature to generate a first weighted feature; receiving a second weighted feature sent by the second electronic device, where the second weighted feature is obtained by weighting a second sample feature in the second original data by the second electronic device; Generate a residual vector according to the first weighted feature and the second weighted feature, and generate a first gradient vector according to the first original data and the residual vector; The weighting coefficient for generating the first weighted feature is updated according to the first gradient vector.
9. The method according to claim 1, characterized in that: After extracting the original product data from the obfuscated product data, the method further includes: Generate a first-order derivative and a second-order derivative of a loss function of the first original data, and generate a derivative matrix consisting of the first-order derivative and the second-order derivative; Performing obfuscation processing on the derivative matrix to generate an obfuscated derivative matrix, and sending the obfuscated derivative matrix to the working node device, so that the working node device generates a left-side obfuscation matrix product between the obfuscated derivative matrix and a second obfuscated splitting matrix; the second obfuscated splitting matrix is obtained by the second electronic device performing obfuscation processing on the second splitting matrix, and the second splitting matrix is obtained by the second electronic device performing binning processing on the second original data; Receiving the left confusion matrix product sent by the working node device, and extracting a left matrix product from the left confusion matrix product, wherein the left matrix product is generated based on the derivative matrix and the second splitting matrix; Calculating a right-side matrix product according to the left-side matrix product, and calculating a splitting gain value based on the left-side matrix product and the right-side matrix product; According to the split gain value, the predicted label value is updated, and the tree corresponding to the updated predicted label value is added to the forest.
10. An electronic device, characterized in that: The electronic device comprises: a data sending unit, configured to perform obfuscation processing on first original data participating in multi-party secure computing to generate first obfuscated data, perform encryption processing on the first obfuscated data to generate first encrypted obfuscated data, and send the first encrypted obfuscated data to a working node device, so that the working node device decrypts the first encrypted obfuscated data into the first obfuscated data in a trusted execution environment; a data receiving unit, configured to receive the encrypted obfuscated product data fed back by the working node device, wherein the obfuscated product data is generated by the working node device in the trusted execution environment according to the first obfuscated data and second obfuscated data of the second electronic device; wherein the second obfuscated data is obtained by the second electronic device performing obfuscated processing on the second original data participating in the multi-party secure computation; a data extraction unit, configured to decrypt the encrypted obfuscated product data into obfuscated product data, and extract original product data from the obfuscated product data, wherein the original product data is generated based on the first original data and the second original data; the obfuscated product data includes first interaction data and second interaction data, wherein the first interaction data is generated based on the second obfuscated data and a first obfuscated parameter, and the first obfuscated parameter is an obfuscated parameter used by the first electronic device when performing obfuscation processing on the first original data; the second interaction data is generated based on the first original data and the second obfuscation parameter, and the second obfuscation parameter is an obfuscation parameter used by the second electronic device when performing obfuscation processing on the second original data; extracting the original product data from the obfuscated product data specifically comprises: removing the first interaction data and the second interaction data from the obfuscated product data, and using the remaining data as the extracted original product data; Wherein, when extracting the original product data from the obfuscated product data, the first electronic device sends the encrypted first obfuscation parameter to the second electronic device, and the first electronic device receives the encrypted second obfuscation parameter sent by the second electronic device; after the first electronic device decrypts to obtain the second obfuscation parameter, it calculates to obtain the second interactive data representing the product of the second obfuscation parameter and the first original data; the second electronic device decrypts to obtain the first obfuscation parameter, and calculates the first interactive data representing the product of the second obfuscation data and the first obfuscation parameter; the second electronic device encrypts the first interactive data and sends it to the first electronic device, and after the first electronic device decrypts the data, it obtains the second interactive data, and removes the first interactive data and the second interactive data from the obfuscated product data, and the remaining data is used as the extracted original product data.
11. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Privacy protection multi-side diagnostic model fusion method and system, and cloud server
CN109194523A
Cross-domain secure multi-party computing method and device based on trusted execution environment
CN111082934A
Method and device for jointly training service prediction model by two parties for protecting data privacy
CN111177791A
Model parameter training method and device of federal learning model and electronic equipment
CN113807534A
System and method for providing a collective decentralized authority for sharing sensitive data
WO2018099577A1
