Data processing method, device and equipment
The second model is constructed through homomorphic encryption processing and the processing layer determined in the preset search space, which solves the security problem of user privacy data in the business processing process, and achieves a balance between data security and processing accuracy.
Patent Information
- Application Number
- CN202210762960.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-06-30
AI Technical Summary
During the business process, the user's privacy data is low and is easily broken by attackers, and there is a risk of privacy data leakage.
By acquiring multiple data processing layers of the first model, performing homomorphic encryption processing, the third and fourth processing layers are determined in the preset search space, and a second model is constructed to perform data processing in the ciphertext domain to ensure data security and processing accuracy.
It improves the security of user privacy data, while ensuring the accuracy of data processing, and reducing the complexity and efficiency of model structure search.
Smart Images

Figure CN115186278B_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of data processing technology, and in particular to a data processing method, device and equipment. Background Art
[0002] With the rapid development of computer technology, biometric recognition technology has been widely used in business scenarios such as identity authentication. For example, clients such as access control devices and face-scanning payment devices can authenticate users based on the biometric data (such as fingerprints, facial images, etc.) entered by the users.
[0003] The terminal device can encrypt the user's private data (such as biometrics), and then the server decrypts the received processed private data to obtain the user's private data, and then performs business processing based on the obtained private data.
[0004] However, during the above-mentioned business processing, the server needs to perform business processing based on the private data obtained by decryption, which will result in low security of the user's private data, making it easy for attackers to break through and posing a risk of private data leakage. Therefore, a solution is needed that can improve the security of user private data during business processing. Summary of the Invention
[0005] The purpose of the embodiments of this specification is to provide a solution that can improve the security of user privacy data during business processing.
[0006] In order to implement the above technical solution, the embodiments of this specification are implemented as follows:
[0007] In a first aspect, an embodiment of the present specification provides a data processing method, the method comprising: obtaining a first model for processing first sample data in a plaintext domain; determining a first processing layer and a second processing layer among multiple data processing layers of the first model based on a model structure of the first model, the second processing layer being used to process output data of the first processing layer; performing homomorphic encryption on the first sample data to obtain encrypted first sample data, and determining a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, the first processing layer being used to process the first sample data; determining a fourth processing layer in the preset search space based on the preset encryption network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer being used to process output data of the third processing layer; and determining the second model based on the third processing layer and the fourth processing layer, the second model being used to process the encrypted sample data obtained by homomorphic encryption in a ciphertext domain.
[0008] In a second aspect, an embodiment of the present specification provides a data processing device, comprising: a data acquisition module for acquiring a first model for processing first sample data in a plaintext domain; a data determination module for determining, based on the model structure of the first model, a first processing layer and a second processing layer among multiple data processing layers of the first model, the second processing layer being used to process output data of the first processing layer; a first processing module for performing homomorphic encryption processing on the first sample data to obtain encrypted first sample data, and determining in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data and the first processing layer. A third processing layer for processing the encrypted first sample data, wherein the first processing layer is used to process the first sample data; a second processing module for determining a fourth processing layer in the preset search space based on the preset encryption network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer and the third processing layer, wherein the fourth processing layer is used to process the output data of the third processing layer; a model determination module for determining the second model based on the third processing layer and the fourth processing layer, wherein the second model is used to process the encrypted sample data obtained by homomorphic encryption in the ciphertext domain.
[0009] In a third aspect, an embodiment of the present specification provides a data processing device, the data processing device comprising: a processor; and a memory arranged to store computer-executable instructions, wherein the executable instructions, when executed, cause the processor to: obtain a first model for processing first sample data in a plaintext domain; based on the model structure of the first model, determine a first processing layer and a second processing layer among multiple data processing layers of the first model, the second processing layer being used to process the output data of the first processing layer; perform homomorphic encryption on the first sample data to obtain encrypted first sample data, and search the model, the first sample data, the encrypted first sample data based on a preset encryption network structure. Based on this data and the first processing layer, a third processing layer for processing the encrypted first sample data is determined in a preset search space, and the first processing layer is used to process the first sample data; based on the preset encryption network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer and the third processing layer, a fourth processing layer is determined in the preset search space, and the fourth processing layer is used to process the output data of the third processing layer; based on the third processing layer and the fourth processing layer, the second model is determined, and the second model is used to process the encrypted sample data obtained by homomorphic encryption in the ciphertext domain.
[0010] In a fourth aspect, an embodiment of the present specification provides a storage medium for storing computer-executable instructions, which implement the following process when executed: obtaining a first model for processing first sample data in a plaintext domain; based on the model structure of the first model, determining a first processing layer and a second processing layer among multiple data processing layers of the first model, the second processing layer being used to process the output data of the first processing layer; performing homomorphic encryption on the first sample data to obtain encrypted first sample data, and searching the model, the first sample data, the encrypted first sample data and the first processing layer based on a preset encryption network structure. , determining a third processing layer for processing the encrypted first sample data in a preset search space, the first processing layer being used to process the first sample data; based on the preset encryption network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer and the third processing layer, determining a fourth processing layer in the preset search space, the fourth processing layer being used to process the output data of the third processing layer; based on the third processing layer and the fourth processing layer, determining the second model, the second model being used to process the encrypted sample data obtained by homomorphic encryption in the ciphertext domain. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0012] Figure 1A This is a flow chart of an embodiment of a data processing method of this specification;
[0013] Figure 1B This is a schematic diagram of the processing process of a data processing method in this specification;
[0014] Figure 2 This is a schematic diagram of a data processing method in this specification;
[0015] Figure 3 This is a schematic diagram of the processing process of another data processing method of this specification;
[0016] Figure 4 This is a schematic diagram of a method for determining a first candidate processing layer in this specification;
[0017] Figure 5 is a schematic diagram of another method for determining a first candidate processing layer in this specification;
[0018] Figure 6 This is a schematic diagram of a process for determining a third processing result of this specification;
[0019] Figure 7 This is a schematic diagram of a second model determination process of this specification;
[0020] Figure 8 This is a schematic structural diagram of an embodiment of a data processing device of this specification;
[0021] Figure 9 This is a structural diagram of a data processing device in this specification. DETAILED DESCRIPTION
[0022] The embodiments of this specification provide a data processing method, apparatus, and device.
[0023] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative work should fall within the scope of protection of this specification.
[0024] Example 1
[0025] like Figure 1A and 1B As shown, the embodiments of this specification provide a data processing method. The execution subject of this method can be a terminal device or a server, wherein the terminal device can be a mobile terminal device such as a mobile phone or a tablet computer, and the server can be an independent server or a server cluster composed of multiple servers. The method can specifically include the following steps:
[0026] In S102 , a first model for processing first sample data in a plaintext domain is obtained.
[0027] Among them, the first sample data may be data required to trigger a certain service. For example, the first sample data may be user data (such as user's biometric data, etc.) required to trigger identity authentication services, resource transfer services and other services. The first model may be a model that can process the first sample data. For example, the first model may be a risk identification model, identity identification model, etc. constructed based on a machine learning algorithm. In addition, the first sample data may be user data obtained after user authorization, such as the first sample data may be user data collected by the terminal device after receiving the user's authorization instruction, or the first sample data may also be data obtained after desensitizing the user data, that is, the first sample data does not contain the user's privacy information, or the first sample data may also be synthetic sample data generated based on a preset generation model and user data, etc.
[0028] In practice, with the rapid development of computer technology, biometric recognition technology has been widely used in business scenarios such as identity authentication. For example, clients such as access control devices and face-swiping payment devices can authenticate users based on biometric data (such as fingerprints, facial images, etc.) input by users. The terminal device can encrypt the user's private data (such as biometrics), and then the server decrypts the received processed private data to obtain the user's private data, and then performs business processing based on the obtained private data. However, during the above-mentioned business processing, the server needs to perform business processing based on the decrypted private data, which will result in low security of the user's private data, which is easy to be broken through by attackers, and there is a risk of privacy data leakage. Therefore, a solution is needed to improve the security of user privacy data during business processing. To this end, the embodiments of this specification provide a technical solution that can solve the above-mentioned problems. Please refer to the following content for details.
[0029] Taking the first model as an example of a risk identification model built based on a machine learning algorithm, the server or terminal device can obtain the data required for the user to trigger a certain service (such as a resource transfer service, etc.) within a preset data update cycle (such as the user's biometric data, the time of triggering the resource transfer service, the amount of resource transfer, etc.). In order to ensure the security of the user's privacy data, synthetic sample data corresponding to the above-mentioned acquired data can be generated based on a generative adversarial network, and the synthetic sample data can be used as the first sample data, that is, the first model can determine whether there is a risk in triggering the resource transfer service through the first sample data in the plaintext domain.
[0030] In addition, if Figure 1B As shown, the terminal device or server (i.e., the receiving device) can also receive the first sample data sent by the sending device. The first sample data can be the data obtained by the sending device after desensitizing the collected user data based on a preset desensitization algorithm.
[0031] In S104 , based on the model structure of the first model, a first processing layer and a second processing layer among a plurality of data processing layers of the first model are determined.
[0032] The second processing layer can be used to process the output data of the first processing layer.
[0033] In implementation, the first processing layer and the second processing layer among the multiple data processing layers of the first model may be determined based on a preset selection rule and with respect to the model structure of the first model.
[0034] For example, assuming that the preset selection rule is to select the middle layer of multiple data processing layers as the first processing layer and the last layer as the second processing layer, if the model structure of the first model is a convolutional neural network structure constructed by 3 convolutional layers, the second convolutional layer can be used as the first processing layer, and the third convolutional layer can be used as the second processing layer, or, if the model structure of the first model is a convolutional neural network structure constructed by 5 convolutional layers, the third convolutional layer can be used as the first processing layer, and the fifth convolutional layer can be used as the second processing layer, or, if the model structure of the first model is a convolutional neural network structure constructed by 5 convolutional layers, the second convolutional layer can be used as the first processing layer 1, the fourth convolutional layer can be used as the first processing layer 2, and the fifth convolutional layer can be used as the second processing layer, that is, there can be multiple first processing layers, and similarly, there can be multiple second processing layers.
[0035] The above-mentioned determination method of the first processing layer and the second processing layer is an optional and feasible determination method. In actual application scenarios, there can also be multiple different determination methods. Different determination methods can be selected according to different actual application scenarios. The embodiments of this specification do not make specific limitations on this.
[0036] In S106, the first sample data is homomorphically encrypted to obtain encrypted first sample data, and based on the preset encryption network structure search model, the first sample data, the encrypted first sample data and the first processing layer, a third processing layer for processing the encrypted first sample data is determined in the preset search space.
[0037] Among them, the first processing layer can be used to process the first sample data, and the preset encrypted network structure search model can be a model constructed based on the neural network structure search (Neural Architecture Search, NAS) algorithm, which is used to search for a model structure whose performance meets the requirements in a predefined search space.
[0038] In practice, homomorphic encryption processing refers to processing data obtained by homomorphic encryption processing using a preset processing method to obtain an output, and decrypting this output, the result of which is the same as the output result obtained by processing the unencrypted original data using the same preset processing method.
[0039] There are many methods for performing homomorphic encryption processing on the first sample data. For example, the first sample data can be homomorphically encrypted based on a preset homomorphic encryption algorithm (such as the RSA algorithm that can achieve multiplicative homomorphism, the Paillier algorithm that achieves additive homomorphism, or the Gentry algorithm that achieves full homomorphism, etc.). In addition, there can be many different homomorphic encryption processing methods. Different homomorphic encryption processing methods can be selected according to different actual application scenarios. The embodiments of this specification do not make specific limitations on this.
[0040] After obtaining the encrypted first sample data, a search can be performed in the preset search space based on the preset encryption network structure search model, the first sample data, the encrypted first sample data and the first processing layer, and the first candidate processing layer obtained by the search can be evaluated to obtain a third processing layer for processing the encrypted first sample data.
[0041] In S108 , based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, a fourth processing layer is determined in the preset search space.
[0042] The fourth processing layer can be used to process the output data of the third processing layer.
[0043] In implementation, a search can be performed in a preset search space based on a preset encrypted network structure search model, first sample data, encrypted first sample data, first processing layer, second processing layer and third processing layer, and the second candidate processing layer obtained by the search can be evaluated to obtain a fourth processing layer for processing the output data of the third processing layer.
[0044] After determining the third processing layer, the fourth processing layer can be determined based on the third processing layer. That is, the degree of fit of the intermediate layer features can be evaluated instead of evaluating the final output results of the first model, thereby reducing the search complexity of the second model and improving the determination efficiency of the second model.
[0045] In S110 , a second model is determined based on the third processing layer and the fourth processing layer.
[0046] Among them, the second model can be used to process the encrypted sample data obtained through homomorphic encryption in the ciphertext domain.
[0047] In implementation, Figure 2As shown, taking the first model as a convolutional neural network model constructed by three convolutional layers as an example, the second convolutional layer of the first model can be the first processing layer, and the third convolutional layer can be the second processing layer. The first sample data can be homomorphically encrypted to obtain the encrypted first sample data, and based on the preset encryption network structure search model, the first sample data, the encrypted first sample data and the first processing layer, the third processing layer for processing the encrypted first sample data is determined in the preset search space, that is, the first sample data can be input into the first convolutional layer of the first model, and the end of the first convolutional layer is input into the second convolutional layer (that is, the first processing layer), and according to the output result of the first processing layer and the preset encryption network structure search model, the third processing layer for processing the encrypted first sample data is determined in the preset search space. Similarly, when determining the fourth processing layer, the output of the first processing layer (i.e., the second convolutional layer) can be input into the third convolutional layer (i.e., the second processing layer) of the first model. Based on the output of the second processing layer and the preset encrypted network structure search model, a fourth processing layer for processing the output data of the third processing layer is determined in the preset search space. Finally, based on the third and fourth processing layers, the second model can be constructed.
[0048] After obtaining the second model, the sample data can be input into the first model. After being processed by the three convolutional layers of the first model, a structure 1 for the sample data can be obtained. Then, the sample data can be homomorphically encrypted based on a preset homomorphic encryption algorithm to obtain encrypted sample data, and the encrypted sample data can be input into the second model. After being processed by the third and fourth processing layers of the second model, a result 2 for the encrypted sample data can be obtained. After decrypting the result 2, a decrypted output result (i.e., result 3) can be obtained. Since the encrypted sample data is obtained by homomorphically encrypting the sample data, the similarity between the output result obtained by decrypting the second model and the output result of the first model is greater than a preset similarity threshold (i.e., the similarity between result 1 and result 3 is greater than the preset similarity threshold). In other words, by processing the encrypted sample data obtained by homomorphic encryption through the second model, both the security of the sample data and the accuracy of the processing of the sample data can be guaranteed.
[0049] An embodiment of the present specification provides a data processing method, which obtains a first model for processing first sample data in a plaintext domain, determines a first processing layer and a second processing layer among multiple data processing layers of the first model based on the model structure of the first model, the second processing layer is used to process the output data of the first processing layer, performs homomorphic encryption processing on the first sample data to obtain encrypted first sample data, and determines a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, the first processing layer is used to process the first sample data, determines a fourth processing layer in the preset search space based on the preset encryption network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer is used to process the output data of the third processing layer, determines a second model based on the third processing layer and the fourth processing layer, and the second model is used to process the encrypted sample data obtained by homomorphic encryption processing in a ciphertext domain. In this way, the third processing layer of the second model is determined by evaluating the degree of fit of the features of the intermediate layer (i.e., the first processing layer), and then the fourth processing layer of the second model is determined by the determined third processing layer and the second processing layer of the second model. This avoids the problem of high search complexity and low model structure search efficiency caused by evaluating only the final output result of the first model, thereby improving the efficiency of determining the second model. In addition, since the encrypted first sample data is obtained by homomorphically encrypting the first sample data, the similarity between the output result obtained by decrypting the second model and the output result of the first model is greater than the preset similarity threshold, that is, the encrypted sample data obtained by homomorphic encryption is processed by the second model, which can ensure both the security of the sample data and the accuracy of the processing of the sample data.
[0050] Example 2
[0051] like Figure 3 As shown, the embodiments of this specification provide a data processing method. The execution subject of this method can be a terminal device or a server, wherein the terminal device can be a mobile terminal device such as a mobile phone or a tablet computer, and the server can be an independent server or a server cluster composed of multiple servers. The method can specifically include the following steps:
[0052] In S102 , a first model for processing first sample data in a plaintext domain is obtained.
[0053] In S104 , based on the model structure of the first model, a first processing layer and a second processing layer among a plurality of data processing layers of the first model are determined.
[0054] The second processing layer can be used to process the output data of the first processing layer.
[0055] In S302 , based on a preset encrypted network structure search model, a first candidate processing layer is determined in a preset search space.
[0056] In practice, in actual applications, the processing method of the above S302 can be varied. The following provides an optional implementation method. For details, please refer to the following steps 1 to 2:
[0057] Step 1: Based on a preset mapping relationship, determine the number of candidate processing layers corresponding to the first processing layer of the first model.
[0058] In implementation, assuming that the mapping relationship between the candidate processing layers and the first processing layer is 4:1, then the number of candidate processing layers corresponding to the first processing layer of the first model may be 4.
[0059] In addition, the above mapping relationship is an optional and feasible mapping relationship. In actual application scenarios, the preset mapping relationship may vary depending on the model structure of the first model and the application scenario of the second model. The embodiments of this specification do not specifically limit the preset mapping relationship.
[0060] Step 2: Based on the preset encrypted network structure search model and the determined number of candidate processing layers, multiple target candidate processing layers corresponding to the number of candidate processing layers are determined in the preset search space, and a first candidate processing layer is constructed based on the multiple target candidate processing layers.
[0061] In implementation, for example, Figure 4 As shown, assuming that there are 4 target candidate processing layers determined based on the preset mapping relationship, and the target candidate processing layer can be a convolutional layer, then, based on the preset encrypted network structure search model, 4 convolutional layers can be determined in the preset search space, and the first candidate processing layer can be constructed based on the determined 4 convolutional layers.
[0062] There are many methods for constructing the first candidate processing layer. For example, Figure 4 The structure shown in the figure constructs the first candidate processing layer, and can also be based on Figure 5 The structure shown constructs the first candidate processing layer. In addition, there can be a variety of different construction methods. Different construction methods can be selected according to different actual application scenarios. The embodiments of this specification do not make specific limitations on this.
[0063] In S304 , a first processing result is determined based on the first sample data and the first processing layer.
[0064] In implementation, Figure 2As shown, taking the first model as a convolutional neural network model constructed by three convolution layers as an example, the second convolution layer of the first model can be the first processing layer, the third convolution layer can be the second processing layer, the first sample data can be input into the first convolution layer of the first model, and the output data of the first convolution layer can be input into the second convolution layer of the first model (i.e., the first processing layer), and then the output data of the second convolution layer can be determined as the first processing result.
[0065] In S306, the first sample data is homomorphically encrypted to obtain encrypted first sample data, and based on the encrypted first sample data and the first candidate processing layer, a second processing result is determined, and the second processing result is decrypted to obtain a decrypted second processing result.
[0066] In the implementation, the first candidate processing layer is used as the four target candidate layers based on the following Figure 5 Taking the structure shown as an example, the encrypted first sample data can be input into convolution layer 1 and convolution layer 2 respectively, and the output data of convolution layer 1 and convolution layer 2 are used as the input data of convolution layer 3. Finally, the output data of convolution layer 3 is input into convolution layer 4. The output data of convolution layer 4 is the output data of the first candidate processing layer, that is, the output data of convolution layer 4 can be used as the second processing result.
[0067] In S308, based on the preset loss function, the first processing result and the decrypted second processing result, it is determined whether the first candidate processing layer meets the first search requirement. If the first candidate processing layer does not meet the first search requirement, the first candidate processing layer is continued to be searched in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data and the first processing layer until the first candidate processing layer meets the first search requirement, and the first candidate processing layer that meets the first search requirement is determined as the third processing layer.
[0068] In implementation, the loss value of the first candidate processing layer can be determined based on the target loss function, the first processing result and the decrypted second processing result. Based on the loss value of the first candidate processing layer and the first search requirement, it is determined whether the first candidate processing layer meets the first search requirement. For example, if the loss value of the first candidate processing layer is greater than the first loss threshold, it can be determined that the loss value of the first candidate processing layer does not meet the first search requirement. Based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data and the first processing layer, the first candidate processing layer can be continued to be searched in the preset search space until the first candidate processing layer meets the first search requirement, and the first candidate processing layer that meets the first search requirement is determined as the third processing layer.
[0069] The first processing result and the second processing result can be substituted into the following formula:
[0070]
[0071] Get the loss value of the first candidate processing layer, where LOSS1 is the loss value of the first candidate processing layer, x is the first sample data, E(x) is the encrypted first sample data, f(x) is the first processing result, F(E(x) is the second processing result, E -1 (F(E(x)) is the second processing result after decryption.
[0072] In S310 , based on a preset encrypted network structure search model, a second candidate processing layer is determined in a preset search space.
[0073] In implementation, the number of candidate processing layers corresponding to the second processing layer of the first model can be determined based on a preset mapping relationship. Based on the preset encrypted network structure search model and the determined number of candidate processing layers corresponding to the second processing layer, multiple candidate processing layers corresponding to the number of candidate processing layers corresponding to the second processing layer are determined in the preset search space, and a second candidate processing layer is constructed based on the determined multiple candidate processing layers. The method for constructing the second candidate processing layer can refer to the method for constructing the first candidate processing layer and will not be repeated here.
[0074] In S312 , a third processing result is determined based on the first sample data, the first processing layer, and the second processing layer.
[0075] In practice, in actual applications, the processing method of the above S312 can be various. The following provides an optional implementation method. For details, please refer to the following steps 1 to 3:
[0076] Step 1: Input the first sample data into the first processing layer to obtain a first processing result.
[0077] Step 2: Input the first processing result into the fifth processing layer to obtain an intermediate result.
[0078] There may be multiple fifth processing layers.
[0079] Step three: input the intermediate result into the second processing layer to obtain the third processing result.
[0080] In implementation, the model results of the first model are as follows Figure 6 Taking the structure shown in FIG. 1 as an example, the fifth processing layer of the first model can be a plurality of processing layers between the first processing layer and the second processing layer (ie Figure 6 The first sample data can be input into the first processing layer, and the first processing result obtained can be input into the fifth processing layer. Finally, the intermediate result obtained in the fifth processing layer can be input into the second processing layer to obtain the third processing result.
[0081] In addition, the number of the first processing layer, the fifth processing layer, and the second processing layer may vary according to different actual application scenarios, and the embodiments of this specification do not specifically limit this.
[0082] In S314 , a fourth processing result is determined based on the encrypted first sample data, the third processing layer, and the second candidate processing layer, and the fourth processing result is decrypted to obtain a decrypted fourth processing result.
[0083] In implementation, the encrypted first sample data may be input into the third processing layer, and then the output data of the third processing layer may be input into the second candidate processing layer, and the output data of the third processing layer may be determined as the fourth processing result.
[0084] In S316, based on the preset loss function, the third processing result and the decrypted fourth processing result, it is determined whether the second candidate processing layer meets the second search requirement. If the second candidate processing layer does not meet the second search requirement, the second candidate processing layer is continued to be searched in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer and the third processing layer until the second candidate processing layer meets the second search requirement, and the second candidate processing layer that meets the second search requirement is determined as the fourth processing layer.
[0085] In implementation, the loss value of the second candidate processing layer can be determined based on the target loss function, the third processing result and the decrypted fourth processing result. Based on the loss value of the second candidate processing layer and the second search requirement, it is determined whether the second candidate processing layer meets the second search requirement. The method for determining the loss value of the second candidate processing layer can refer to the above-mentioned method for determining the loss value of the first candidate processing layer, and will not be repeated here.
[0086] In S110 , a second model is determined based on the third processing layer and the fourth processing layer.
[0087] Among them, the second model can be used to process the encrypted sample data obtained through homomorphic encryption in the ciphertext domain.
[0088] In implementation, the first model may have multiple first processing layers and multiple second processing layers. According to the structure of the multiple first processing layers and the multiple second processing layers, the third processing layer corresponding to each first processing layer may be determined in sequence, and the fourth processing layer corresponding to the second processing layer may be determined based on the third processing layer. For example, Figure 5As shown, the first model can include two first processing layers and two second processing layers, then the third processing layer 1 can be determined based on the first processing layer 1, and the third processing layer 2 can be determined based on the first processing layer 1, the fifth processing layer 1, the first processing layer 2 and the third processing layer 1, and so on, to obtain the fourth processing layer 1 and the fourth processing layer 2. Finally, according to the model structure of the first model, the third processing layer 1, the third processing layer 2, the fourth processing layer 1 and the fourth processing layer 2, the following can be constructed: Figure 5 The second model is shown.
[0089] In S318 , the encrypted target data obtained through homomorphic encryption processing and sent by the target device is received.
[0090] The target data is the data required to trigger the target service, and the target service may be an identity authentication service, a resource transfer service, or other service involving user privacy data.
[0091] In implementation, taking the target device as an access control device and the target service as a facial recognition service as an example, when the access control device receives a facial recognition instruction, it can collect the user's biometric data through a preset collection device (such as collecting the user's facial image through a camera, or collecting the user's fingerprint data through a fingerprint collection device, etc.), and then perform homomorphic encryption on the collected biometric data to obtain encrypted biometric data. The encrypted biometric data can be the encrypted target data, and the target device can send the encrypted target data to the server, that is, the server can receive the encrypted target data sent by the target device obtained through homomorphic encryption.
[0092] In S320 , the encrypted target data is processed based on the second model to obtain a processing result.
[0093] In implementation, before S320, second sample data may be obtained, and the second model may be trained based on the second sample data to obtain a trained second model. The second sample data may be historical data required to trigger a target service. For example, the target service may be an identity authentication service, and the second sample data may be historical biometric data of historical users.
[0094] In addition, the second model is trained based on the second sample data, and there are many ways to process the trained second model. The following provides an optional implementation method. For details, please refer to the following steps 1 to 3:
[0095] Step 1: Obtain second sample data.
[0096] Step 2: Determine a target processing result of the second sample data based on the first model and the second sample data, and determine label data of the second sample data based on the target processing result.
[0097] In implementation, taking the first model as an identity recognition model as an example, the second sample data can be input into the first model to obtain an identity recognition result of the second sample data, and then the identity recognition result of the second sample data is determined as the label data of the second sample data.
[0098] Step three: obtain label data of the second sample data.
[0099] Step 4: Perform homomorphic encryption on the second sample data to obtain encrypted second sample data.
[0100] In implementation, the process of performing homomorphic encryption processing on the second sample data can refer to the above-mentioned process of performing homomorphic encryption processing on the first sample data, and will not be repeated here.
[0101] Step five: obtaining a fifth processing result based on the encrypted second sample data and the second model, and performing decryption processing on the fifth processing result to obtain a decrypted fifth processing result.
[0102] Step six: obtain a sixth processing result based on the second sample data and the first processing layer of the first model, and obtain a seventh processing result based on the second sample data, the first processing layer and the second processing layer of the first model.
[0103] Step seven: Based on the encrypted second sample data and the third processing layer of the second model, an eighth processing result is obtained, and the eighth processing result is decrypted to obtain a decrypted eighth processing result.
[0104] Step eight, obtaining a ninth processing result based on the encrypted second sample data, the third processing layer and the fourth processing layer of the second model, and decrypting the ninth processing result to obtain a decrypted ninth processing result.
[0105] Step nine, determining the target loss value based on the target loss function, the label data of the second sample data, the decrypted fifth processing result, the sixth processing result, the seventh processing result, the decrypted eighth processing result, and the decrypted ninth processing result.
[0106] In implementation, a first loss value can be determined based on the label data of the second sample data and the decrypted fifth processing result, a first sub-loss value can be determined based on the sixth processing result and the decrypted eighth processing result, a second sub-loss value can be determined based on the seventh processing result and the decrypted ninth processing result, a second loss value can be determined based on the first sub-loss value and the second sub-loss value, and a target loss value can be determined based on the first loss value and the second loss value. There are multiple methods for determining the target loss value, and different determination methods can be selected based on different actual application scenarios. For example, any one of the sum, maximum value, or average value of the first sub-loss value and the second sub-loss value can be determined as the second loss value, and the sum of the first loss value and the second loss value can be determined as the target loss value. The embodiments of this specification do not specifically limit the method for determining the target loss value.
[0107] In addition, the process of determining the first sub-loss value and the second sub-loss value can refer to the process of determining the loss value of the first candidate processing layer in the above S308, which will not be repeated here.
[0108] In this way, the overall loss of the second model and the first model can be controlled by the first loss value, and the local loss of the second model and the first model can be controlled by the second loss value, so that the performance evaluation of the second model is more atomic, that is, the second model is trained by the target loss value, so that the model effect of the trained second model can be good.
[0109] Step 10: Based on the target loss value, determine whether the second model has converged. If it is determined that the second model has not converged, continue to train the second model based on the second sample data and the label data of the second sample data until the second model converges to obtain the trained second model.
[0110] After obtaining the trained second model, the encrypted target data can be processed based on the trained second model to obtain a processing result for the target data.
[0111] In S322 , the processing result is returned to the target device, so that the target device determines whether to trigger execution of the target service based on the processing result.
[0112] In implementation, for example, the target business is an identity recognition business, and the processing results for the target business can be recognition passed and recognition failed. After obtaining the processing result for the target data, the server can return the processing result to the target device, so that the target device can determine whether to trigger the execution of the target business based on the processing result. For example, the access control device can trigger the start of the door opening instruction when the processing result obtained is recognition passed, and may not trigger the start of the door opening instruction when the processing result obtained is recognition failed.
[0113] An embodiment of the present specification provides a data processing method, which obtains a first model for processing first sample data in a plaintext domain, determines a first processing layer and a second processing layer among multiple data processing layers of the first model based on the model structure of the first model, the second processing layer is used to process the output data of the first processing layer, performs homomorphic encryption processing on the first sample data to obtain encrypted first sample data, and determines a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, the first processing layer is used to process the first sample data, determines a fourth processing layer in the preset search space based on the preset encryption network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer is used to process the output data of the third processing layer, determines a second model based on the third processing layer and the fourth processing layer, and the second model is used to process the encrypted sample data obtained by homomorphic encryption processing in a ciphertext domain. In this way, the third processing layer of the second model is determined by evaluating the degree of fit of the features of the intermediate layer (i.e., the first processing layer), and then the fourth processing layer of the second model is determined by the determined third processing layer and the second processing layer of the second model. This avoids the problem of high search complexity and low model structure search efficiency caused by evaluating only the final output result of the first model, thereby improving the efficiency of determining the second model. In addition, since the encrypted first sample data is obtained by homomorphically encrypting the first sample data, the similarity between the output result obtained by decrypting the second model and the output result of the first model is greater than the preset similarity threshold, that is, the encrypted sample data obtained by homomorphic encryption is processed by the second model, which can ensure both the security of the sample data and the accuracy of the processing of the sample data.
[0114] Example 3
[0115] The above is a data processing method provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a data processing device, such as Figure 8 shown.
[0116] The data processing device includes: a data acquisition module 801, a data determination module 802, a first processing module 803, a second processing module 804 and a model determination module 808, wherein:
[0117] The data acquisition module 801 is used to acquire a first model for processing first sample data in a plaintext domain;
[0118] A data determination module 802 is configured to determine, based on the model structure of the first model, a first processing layer and a second processing layer among a plurality of data processing layers of the first model, wherein the second processing layer is configured to process output data of the first processing layer;
[0119] A first processing module 803 is configured to perform homomorphic encryption on the first sample data to obtain encrypted first sample data, and determine, based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, a third processing layer in a preset search space for processing the encrypted first sample data, wherein the first processing layer is configured to process the first sample data;
[0120] A second processing module 804 is configured to determine a fourth processing layer in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, wherein the fourth processing layer is configured to process output data of the third processing layer;
[0121] The model determination module 808 is used to determine the second model based on the third processing layer and the fourth processing layer, and the second model is used to process the encrypted sample data obtained through homomorphic encryption in the ciphertext domain.
[0122] In the embodiment of this specification, the first processing module 803 is used to:
[0123] Determining a first candidate processing layer in the preset search space based on the preset encrypted network structure search model;
[0124] determining a first processing result based on the first sample data and the first processing layer;
[0125] Determining a second processing result based on the encrypted first sample data and the first candidate processing layer, and decrypting the second processing result to obtain a decrypted second processing result;
[0126] Based on a preset loss function, the first processing result and the decrypted second processing result, determine whether the first candidate processing layer meets the first search requirement; if the first candidate processing layer does not meet the first search requirement, then based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data and the first processing layer, continue to search for the first candidate processing layer in the preset search space until the first candidate processing layer meets the first search requirement, and determine the first candidate processing layer that meets the first search requirement as the third processing layer.
[0127] In the embodiment of this specification, the first processing module 803 is used to:
[0128] Determining, based on a preset mapping relationship, the number of candidate processing layers corresponding to the first processing layer of the first model;
[0129] Based on the preset encrypted network structure search model and the determined number of candidate processing layers, multiple target candidate processing layers corresponding to the number of candidate processing layers are determined in the preset search space, and the first candidate processing layer is constructed based on the multiple target candidate processing layers.
[0130] In the embodiment of this specification, the second processing module 804 is used to:
[0131] Determining a second candidate processing layer in the preset search space based on the preset encrypted network structure search model;
[0132] determining a third processing result based on the first sample data, the first processing layer, and the second processing layer;
[0133] determining a fourth processing result based on the encrypted first sample data, the third processing layer, and the second candidate processing layer, and performing decryption processing on the fourth processing result to obtain a decrypted fourth processing result;
[0134] Based on the preset loss function, the third processing result and the decrypted fourth processing result, determine whether the second candidate processing layer meets the second search requirement; if the second candidate processing layer does not meet the second search requirement, then based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer and the third processing layer, continue to search for the second candidate processing layer in the preset search space until the second candidate processing layer meets the second search requirement, and determine the second candidate processing layer that meets the second search requirement as the fourth processing layer.
[0135] In the embodiment of this specification, the second processing module 804 is used to:
[0136] Inputting the first sample data into the first processing layer to obtain the first processing result;
[0137] Inputting the first processing result into the fifth processing layer to obtain an intermediate result;
[0138] The intermediate result is input into the second processing layer to obtain the third processing result.
[0139] In the embodiment of this specification, the device further includes:
[0140] A data receiving module is used to receive encrypted target data sent by a target device, obtained through homomorphic encryption processing, wherein the target data is the data required to trigger the target service;
[0141] A result determination module, configured to process the encrypted target data based on the second model to obtain a processing result;
[0142] The data sending module is used to return the processing result to the target device, so that the target device determines whether to trigger the execution of the target service based on the processing result.
[0143] In the embodiment of this specification, the device further includes:
[0144] a sample acquisition module, configured to acquire second sample data, and train the second model based on the second sample data to obtain a trained second model;
[0145] The result determination module is used to process the encrypted target data based on the trained second model to obtain the processing result.
[0146] In the embodiment of this specification, the sample acquisition module is used to:
[0147] Obtaining second sample data and label data of the second sample data, and performing homomorphic encryption on the second sample data to obtain encrypted second sample data;
[0148] Obtaining a fifth processing result based on the encrypted second sample data and the second model, and decrypting the fifth processing result to obtain a decrypted fifth processing result;
[0149] obtaining a sixth processing result based on the second sample data and the first processing layer of the first model, and obtaining a seventh processing result based on the second sample data, the first processing layer and the second processing layer of the first model;
[0150] Obtaining an eighth processing result based on the encrypted second sample data and the third processing layer of the second model, and decrypting the eighth processing result to obtain a decrypted eighth processing result;
[0151] Obtaining a ninth processing result based on the encrypted second sample data, the third processing layer, and the fourth processing layer of the second model, and performing decryption processing on the ninth processing result to obtain a decrypted ninth processing result;
[0152] Determining a target loss value based on a target loss function, label data of the second sample data, the decrypted fifth processing result, the sixth processing result, the seventh processing result, the decrypted eighth processing result, and the decrypted ninth processing result;
[0153] Based on the target loss value, determine whether the second model converges. If it is determined that the second model has not converged, continue to train the second model based on the second sample data and the label data of the second sample data until the second model converges to obtain the trained second model.
[0154] In the embodiment of this specification, the sample acquisition module is used to:
[0155] determining a first loss value based on the label data of the second sample data and the decrypted fifth processing result;
[0156] determining a first sub-loss value based on the sixth processing result and the decrypted eighth processing result, and determining a second sub-loss value based on the seventh processing result and the decrypted ninth processing result;
[0157] A second loss value is determined based on the first sub-loss value and the second sub-loss value, and the target loss value is determined based on the first loss value and the second loss value.
[0158] In the embodiment of this specification, the device further includes:
[0159] The label acquisition module is used to determine a target processing result of the second sample data based on the first model and the second sample data, and determine label data of the second sample data based on the target processing result.
[0160] An embodiment of the present specification provides a data processing device, which obtains a first model for processing first sample data in a plaintext domain, determines a first processing layer and a second processing layer among multiple data processing layers of the first model based on the model structure of the first model, the second processing layer is used to process the output data of the first processing layer, performs homomorphic encryption on the first sample data to obtain encrypted first sample data, and determines a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, the first processing layer is used to process the first sample data, determines a fourth processing layer in the preset search space based on the preset encryption network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer is used to process the output data of the third processing layer, determines a second model based on the third processing layer and the fourth processing layer, and the second model is used to process the encrypted sample data obtained by homomorphic encryption in a ciphertext domain. In this way, the third processing layer of the second model is determined by evaluating the degree of fit of the features of the intermediate layer (i.e., the first processing layer), and then the fourth processing layer of the second model is determined by the determined third processing layer and the second processing layer of the second model. This avoids the problem of high search complexity and low model structure search efficiency caused by evaluating only the final output result of the first model, thereby improving the efficiency of determining the second model. In addition, since the encrypted first sample data is obtained by homomorphically encrypting the first sample data, the similarity between the output result obtained by decrypting the second model and the output result of the first model is greater than the preset similarity threshold, that is, the encrypted sample data obtained by homomorphic encryption is processed by the second model, which can ensure both the security of the sample data and the accuracy of the processing of the sample data.
[0161] Example 4
[0162] Based on the same idea, the embodiment of this specification also provides a data processing device, such as Figure 9 shown.
[0163] The data processing device may vary greatly due to different configurations or performances, and may include one or more processors 901 and memory 902, and the memory 902 may store one or more storage applications or data. The memory 902 may be a temporary storage or a persistent storage. The application stored in the memory 902 may include one or more modules (not shown in the figure), each of which may include a series of computer-executable instructions for the data processing device. Furthermore, the processor 901 may be configured to communicate with the memory 902 to execute a series of computer-executable instructions in the memory 902 on the data processing device. The data processing device may also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input and output interfaces 905, and one or more keyboards 906.
[0164] Specifically, in this embodiment, the data processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the data processing device, and the one or more programs are configured to be executed by one or more processors, including computer-executable instructions for performing the following:
[0165] Obtaining a first model for processing first sample data in a plaintext domain;
[0166] Determining, based on the model structure of the first model, a first processing layer and a second processing layer among a plurality of data processing layers of the first model, wherein the second processing layer is used to process output data of the first processing layer;
[0167] performing homomorphic encryption on the first sample data to obtain encrypted first sample data, and determining a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, wherein the first processing layer is used to process the first sample data;
[0168] Determining a fourth processing layer in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer being configured to process output data of the third processing layer;
[0169] Based on the third processing layer and the fourth processing layer, the second model is determined, and the second model is used to process the encrypted sample data obtained through homomorphic encryption in the ciphertext domain.
[0170] Optionally, the determining, in a preset search space, a third processing layer for processing the encrypted first sample data based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer includes:
[0171] Determining a first candidate processing layer in the preset search space based on the preset encrypted network structure search model;
[0172] determining a first processing result based on the first sample data and the first processing layer;
[0173] Determining a second processing result based on the encrypted first sample data and the first candidate processing layer, and decrypting the second processing result to obtain a decrypted second processing result;
[0174] Based on a preset loss function, the first processing result and the decrypted second processing result, determine whether the first candidate processing layer meets the first search requirement; if the first candidate processing layer does not meet the first search requirement, then based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data and the first processing layer, continue to search for the first candidate processing layer in the preset search space until the first candidate processing layer meets the first search requirement, and determine the first candidate processing layer that meets the first search requirement as the third processing layer.
[0175] Optionally, determining the first candidate processing layer in the preset search space based on the preset encrypted network structure search model includes:
[0176] Determining, based on a preset mapping relationship, the number of candidate processing layers corresponding to the first processing layer of the first model;
[0177] Based on the preset encrypted network structure search model and the determined number of candidate processing layers, multiple target candidate processing layers corresponding to the number of candidate processing layers are determined in the preset search space, and the first candidate processing layer is constructed based on the multiple target candidate processing layers.
[0178] Optionally, the determining the fourth processing layer in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer includes:
[0179] Determining a second candidate processing layer in the preset search space based on the preset encrypted network structure search model;
[0180] determining a third processing result based on the first sample data, the first processing layer, and the second processing layer;
[0181] determining a fourth processing result based on the encrypted first sample data, the third processing layer, and the second candidate processing layer, and performing decryption processing on the fourth processing result to obtain a decrypted fourth processing result;
[0182] Based on the preset loss function, the third processing result and the decrypted fourth processing result, determine whether the second candidate processing layer meets the second search requirement; if the second candidate processing layer does not meet the second search requirement, then based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer and the third processing layer, continue to search for the second candidate processing layer in the preset search space until the second candidate processing layer meets the second search requirement, and determine the second candidate processing layer that meets the second search requirement as the fourth processing layer.
[0183] Optionally, the first model further includes a fifth processing layer, input data of the fifth processing layer is output data of the first processing layer, and output data of the fifth processing layer is input data of the second processing layer, and determining a third processing result based on the first sample data, the first processing layer, and the second processing layer includes:
[0184] Inputting the first sample data into the first processing layer to obtain the first processing result;
[0185] Inputting the first processing result into the fifth processing layer to obtain an intermediate result;
[0186] The intermediate result is input into the second processing layer to obtain the third processing result.
[0187] Optionally, the method further includes:
[0188] Receive encrypted target data obtained through homomorphic encryption sent by the target device, where the target data is data required to trigger the target service;
[0189] Processing the encrypted target data based on the second model to obtain a processing result;
[0190] The processing result is returned to the target device, so that the target device determines whether to trigger execution of the target service based on the processing result.
[0191] Optionally, before processing the encrypted target data based on the second model to obtain a processing result, the method further includes:
[0192] Acquire second sample data, and train the second model based on the second sample data to obtain a trained second model;
[0193] The processing of the encrypted target data based on the second model to obtain a processing result includes:
[0194] The encrypted target data is processed based on the trained second model to obtain the processing result.
[0195] Optionally, the acquiring the second sample data and training the second model based on the second sample data to obtain the trained second model includes:
[0196] Obtaining second sample data and label data of the second sample data, and performing homomorphic encryption on the second sample data to obtain encrypted second sample data;
[0197] Obtaining a fifth processing result based on the encrypted second sample data and the second model, and decrypting the fifth processing result to obtain a decrypted fifth processing result;
[0198] obtaining a sixth processing result based on the second sample data and the first processing layer of the first model, and obtaining a seventh processing result based on the second sample data, the first processing layer and the second processing layer of the first model;
[0199] Obtaining an eighth processing result based on the encrypted second sample data and the third processing layer of the second model, and decrypting the eighth processing result to obtain a decrypted eighth processing result;
[0200] Obtaining a ninth processing result based on the encrypted second sample data, the third processing layer, and the fourth processing layer of the second model, and performing decryption processing on the ninth processing result to obtain a decrypted ninth processing result;
[0201] Determining a target loss value based on a target loss function, label data of the second sample data, the decrypted fifth processing result, the sixth processing result, the seventh processing result, the decrypted eighth processing result, and the decrypted ninth processing result;
[0202] Based on the target loss value, determine whether the second model converges. If it is determined that the second model has not converged, continue to train the second model based on the second sample data and the label data of the second sample data until the second model converges to obtain the trained second model.
[0203] Optionally, determining the target loss value based on the target loss function, the label data of the second sample data, the decrypted fifth processing result, the sixth processing result, the seventh processing result, the decrypted eighth processing result, and the decrypted ninth processing result includes:
[0204] determining a first loss value based on the label data of the second sample data and the decrypted fifth processing result;
[0205] determining a first sub-loss value based on the sixth processing result and the decrypted eighth processing result, and determining a second sub-loss value based on the seventh processing result and the decrypted ninth processing result;
[0206] A second loss value is determined based on the first sub-loss value and the second sub-loss value, and the target loss value is determined based on the first loss value and the second loss value.
[0207] Optionally, before obtaining the label data of the second sample data, the method further includes:
[0208] Based on the first model and the second sample data, a target processing result of the second sample data is determined, and based on the target processing result, label data of the second sample data is determined.
[0209] An embodiment of the present specification provides a data processing device, which obtains a first model for processing first sample data in a plaintext domain, determines a first processing layer and a second processing layer among multiple data processing layers of the first model based on the model structure of the first model, the second processing layer is used to process the output data of the first processing layer, performs homomorphic encryption processing on the first sample data to obtain encrypted first sample data, and determines a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, the first processing layer is used to process the first sample data, determines a fourth processing layer in the preset search space based on the preset encryption network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer is used to process the output data of the third processing layer, determines a second model based on the third processing layer and the fourth processing layer, and the second model is used to process the encrypted sample data obtained by homomorphic encryption processing in a ciphertext domain. In this way, the third processing layer of the second model is determined by evaluating the degree of fit of the features of the intermediate layer (i.e., the first processing layer), and then the fourth processing layer of the second model is determined by the determined third processing layer and the second processing layer of the second model. This avoids the problem of high search complexity and low model structure search efficiency caused by evaluating only the final output result of the first model, thereby improving the efficiency of determining the second model. In addition, since the encrypted first sample data is obtained by homomorphically encrypting the first sample data, the similarity between the output result obtained by decrypting the second model and the output result of the first model is greater than the preset similarity threshold, that is, the encrypted sample data obtained by homomorphic encryption is processed by the second model, which can ensure both the security of the sample data and the accuracy of the processing of the sample data.
[0210] Example 5
[0211] The embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the various processes of the above-mentioned data processing method embodiments are implemented, and the same technical effects are achieved. To avoid repetition, the details are not described here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0212] An embodiment of the present specification provides a computer-readable storage medium, which obtains a first model for processing first sample data in a plaintext domain, determines a first processing layer and a second processing layer among multiple data processing layers of the first model based on the model structure of the first model, the second processing layer is used to process the output data of the first processing layer, performs homomorphic encryption on the first sample data to obtain encrypted first sample data, and determines a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, the first processing layer is used to process the first sample data, determines a fourth processing layer in the preset search space based on the preset encryption network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer is used to process the output data of the third processing layer, determines a second model based on the third processing layer and the fourth processing layer, and the second model is used to process the encrypted sample data obtained by homomorphic encryption in a ciphertext domain. In this way, the third processing layer of the second model is determined by evaluating the degree of fit of the features of the intermediate layer (i.e., the first processing layer), and then the fourth processing layer of the second model is determined by the determined third processing layer and the second processing layer of the second model. This avoids the problem of high search complexity and low model structure search efficiency caused by evaluating only the final output result of the first model, thereby improving the efficiency of determining the second model. In addition, since the encrypted first sample data is obtained by homomorphically encrypting the first sample data, the similarity between the output result obtained by decrypting the second model and the output result of the first model is greater than the preset similarity threshold, that is, the encrypted sample data obtained by homomorphic encryption is processed by the second model, which can ensure both the security of the sample data and the accuracy of the processing of the sample data.
[0213] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0214] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures such as diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to hire a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.
[0215] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the means for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as both a software module implementing the method and a structure within the hardware component.
[0216] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. 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 smartphone, 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.
[0217] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0218] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0219] The embodiments of this specification are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0220] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0221] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0222] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0223] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0224] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0225] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0226] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Thus, one or more embodiments of this specification may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0227] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0228] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0229] The foregoing is merely an example of the present invention and is not intended to limit the present invention. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.
Claims
1. A data processing method, the method comprising: Obtaining a first model for processing first sample data in a plaintext domain; Determining, based on the model structure of the first model, a first processing layer and a second processing layer among a plurality of data processing layers of the first model, wherein the second processing layer is used to process output data of the first processing layer; performing homomorphic encryption on the first sample data to obtain encrypted first sample data, and determining a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, wherein the first processing layer is used to process the first sample data; Determining a fourth processing layer in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer being configured to process output data of the third processing layer; Based on the third processing layer and the fourth processing layer, a second model is determined, where the second model is used to process the encrypted sample data obtained through homomorphic encryption in the ciphertext domain.
2. The method according to claim 1, wherein determining, in a preset search space, a third processing layer for processing the encrypted first sample data based on a preset encrypted network structure search model, the first sample data, the encrypted first sample data, and the first processing layer comprises: Determining a first candidate processing layer in the preset search space based on the preset encrypted network structure search model; determining a first processing result based on the first sample data and the first processing layer; Determining a second processing result based on the encrypted first sample data and the first candidate processing layer, and decrypting the second processing result to obtain a decrypted second processing result; Based on a preset loss function, the first processing result and the decrypted second processing result, determine whether the first candidate processing layer meets the first search requirement; if the first candidate processing layer does not meet the first search requirement, then based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data and the first processing layer, continue to search for the first candidate processing layer in the preset search space until the first candidate processing layer meets the first search requirement, and determine the first candidate processing layer that meets the first search requirement as the third processing layer.
3. The method according to claim 2, wherein determining the first candidate processing layer in the preset search space based on the preset encrypted network structure search model comprises: Determining, based on a preset mapping relationship, the number of candidate processing layers corresponding to the first processing layer of the first model; Based on the preset encrypted network structure search model and the determined number of candidate processing layers, multiple target candidate processing layers corresponding to the number of candidate processing layers are determined in the preset search space, and the first candidate processing layer is constructed based on the multiple target candidate processing layers.
4. The method according to claim 3, wherein determining the fourth processing layer in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer comprises: Determining a second candidate processing layer in the preset search space based on the preset encrypted network structure search model; determining a third processing result based on the first sample data, the first processing layer, and the second processing layer; determining a fourth processing result based on the encrypted first sample data, the third processing layer, and the second candidate processing layer, and performing decryption processing on the fourth processing result to obtain a decrypted fourth processing result; Based on the preset loss function, the third processing result and the decrypted fourth processing result, determine whether the second candidate processing layer meets the second search requirement; if the second candidate processing layer does not meet the second search requirement, then based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer and the third processing layer, continue to search for the second candidate processing layer in the preset search space until the second candidate processing layer meets the second search requirement, and determine the second candidate processing layer that meets the second search requirement as the fourth processing layer.
5. The method according to claim 4, wherein the first model further comprises a fifth processing layer, wherein input data of the fifth processing layer is output data of the first processing layer, and output data of the fifth processing layer is input data of the second processing layer, and wherein determining a third processing result based on the first sample data, the first processing layer, and the second processing layer comprises: Inputting the first sample data into the first processing layer to obtain the first processing result; Inputting the first processing result into the fifth processing layer to obtain an intermediate result; The intermediate result is input into the second processing layer to obtain the third processing result.
6. The method according to claim 5, further comprising: Receive encrypted target data obtained through homomorphic encryption sent by the target device, where the target data is data required to trigger the target service; Processing the encrypted target data based on the second model to obtain a processing result; The processing result is returned to the target device, so that the target device determines whether to trigger execution of the target service based on the processing result.
7. The method according to claim 6, before processing the encrypted target data based on the second model to obtain a processing result, further comprising: Acquire second sample data, and train the second model based on the second sample data to obtain a trained second model; The processing of the encrypted target data based on the second model to obtain a processing result includes: The encrypted target data is processed based on the trained second model to obtain the processing result.
8. The method according to claim 7, wherein obtaining the second sample data and training the second model based on the second sample data to obtain the trained second model comprises: Obtaining second sample data and label data of the second sample data, and performing homomorphic encryption on the second sample data to obtain encrypted second sample data; Obtaining a fifth processing result based on the encrypted second sample data and the second model, and decrypting the fifth processing result to obtain a decrypted fifth processing result; obtaining a sixth processing result based on the second sample data and the first processing layer of the first model, and obtaining a seventh processing result based on the second sample data, the first processing layer and the second processing layer of the first model; Obtaining an eighth processing result based on the encrypted second sample data and the third processing layer of the second model, and decrypting the eighth processing result to obtain a decrypted eighth processing result; Obtaining a ninth processing result based on the encrypted second sample data, the third processing layer, and the fourth processing layer of the second model, and performing decryption processing on the ninth processing result to obtain a decrypted ninth processing result; Determining a target loss value based on a target loss function, label data of the second sample data, the decrypted fifth processing result, the sixth processing result, the seventh processing result, the decrypted eighth processing result, and the decrypted ninth processing result; Based on the target loss value, determine whether the second model converges. If it is determined that the second model has not converged, continue to train the second model based on the second sample data and the label data of the second sample data until the second model converges to obtain the trained second model.
9. The method according to claim 8, wherein determining the target loss value based on the target loss function, the label data of the second sample data, the decrypted fifth processing result, the sixth processing result, the seventh processing result, the decrypted eighth processing result, and the decrypted ninth processing result comprises: determining a first loss value based on the label data of the second sample data and the decrypted fifth processing result; determining a first sub-loss value based on the sixth processing result and the decrypted eighth processing result, and determining a second sub-loss value based on the seventh processing result and the decrypted ninth processing result; A second loss value is determined based on the first sub-loss value and the second sub-loss value, and the target loss value is determined based on the first loss value and the second loss value.
10. The method according to claim 9, before obtaining the label data of the second sample data, further comprising: Based on the first model and the second sample data, a target processing result of the second sample data is determined, and based on the target processing result, label data of the second sample data is determined.
11. A data processing device, comprising: A data acquisition module, configured to acquire a first model for processing first sample data in a plaintext domain; a data determination module, configured to determine, based on the model structure of the first model, a first processing layer and a second processing layer among a plurality of data processing layers of the first model, wherein the second processing layer is configured to process output data of the first processing layer; a first processing module, configured to perform homomorphic encryption processing on the first sample data to obtain encrypted first sample data, and determine, based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, a third processing layer for processing the encrypted first sample data in a preset search space, wherein the first processing layer is configured to process the first sample data; a second processing module, configured to determine a fourth processing layer in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, wherein the fourth processing layer is configured to process output data of the third processing layer; A model determination module is used to determine a second model based on the third processing layer and the fourth processing layer, and the second model is used to process the encrypted sample data obtained by homomorphic encryption in the ciphertext domain.
12. A data processing device, comprising: processor; as well as a memory arranged to store computer-executable instructions which, when executed, cause the processor to: Obtaining a first model for processing first sample data in a plaintext domain; Determining, based on the model structure of the first model, a first processing layer and a second processing layer among a plurality of data processing layers of the first model, wherein the second processing layer is used to process output data of the first processing layer; performing homomorphic encryption on the first sample data to obtain encrypted first sample data, and determining a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, wherein the first processing layer is used to process the first sample data; Determining a fourth processing layer in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer being configured to process output data of the third processing layer; Based on the third processing layer and the fourth processing layer, a second model is determined, where the second model is used to process the encrypted sample data obtained through homomorphic encryption in the ciphertext domain.
13. A storage medium for storing computer-executable instructions, wherein the computer-executable instructions, when executed, implement the following process: Obtaining a first model for processing first sample data in a plaintext domain; Determining, based on the model structure of the first model, a first processing layer and a second processing layer among a plurality of data processing layers of the first model, wherein the second processing layer is used to process output data of the first processing layer; performing homomorphic encryption on the first sample data to obtain encrypted first sample data, and determining a third processing layer for processing the encrypted first sample data in a preset search space based on a preset encryption network structure search model, the first sample data, the encrypted first sample data, and the first processing layer, wherein the first processing layer is used to process the first sample data; Determining a fourth processing layer in the preset search space based on the preset encrypted network structure search model, the first sample data, the encrypted first sample data, the first processing layer, the second processing layer, and the third processing layer, the fourth processing layer being configured to process output data of the third processing layer; Based on the third processing layer and the fourth processing layer, a second model is determined, where the second model is used to process the encrypted sample data obtained through homomorphic encryption in the ciphertext domain.
Citation Information
Patent Citations
Privacy operation method based on homomorphic encryption
CN118041505A
Training Method, Apparatus, and Device for Federated Neural Network Model, Computer Program Product, and Computer-Readable Storage Medium
US20230023520A1