Method, system and product for secure collaborative computing between heterogeneous trusted execution environments
Through the secure collaborative computing method of heterogeneous trusted execution environment, the security and performance issues in collaborative inference computing are solved. By separating the layering of the pre-training model and selecting the optimal layering point, the user data and model are realized. Security protection and significantly improved computing efficiency and speed.
Patent Information
- Application Number
- CN202410713506.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-04
AI Technical Summary
Existing collaborative inference computing has challenges in terms of security and performance. In particular, unprotected collaborative computing faces the risk of data leakage and model theft, and a single TEE environment cannot effectively balance computing efficiency and privacy security.
Adopt a secure collaborative computing method between heterogeneous trusted execution environments, obtain the collaborative computing security layering range through multiple attack methods, separate the hierarchical upper and lower bounds of the pre-training model, and select the optimal hierarchical point based on performance parameters. , distribute the model to local device TEE and remote server TEE to ensure security and efficiency.
On the premise of ensuring security, the overall execution efficiency of the system is improved, the speed of DNN inference calculation is significantly improved, and power consumption is reduced. At the same time, only 7.06% of additional performance overhead is introduced, protecting user data and pre-trained models. safety.
Smart Images

Figure CN118277107B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, system and product for secure collaborative computing between heterogeneous trusted execution environments. Background Art
[0002] A Trusted Execution Environment (TEE) is a trusted component that runs in parallel in an untrusted Rich Operating System Execution Environment (REE). It is designed to provide protection for the confidentiality and integrity of programs and data running in it. To achieve this goal, TEE establishes an area on the main processor that is isolated by hardware and software. In addition, additional security components, such as unchangeable private keys or security bits, are included in the chip manufacturing process, which help ensure that the untrusted parts of the platform cannot access the contents of the TEE. In addition to providing strong security guarantees, TEE also provides better computing performance than existing software protection, making it suitable for executing computationally intensive deep learning tasks. Some software-based protection technologies, such as fully homomorphic encryption, allow operators to process encrypted data and models without decrypting the data, but this significantly increases the computing cost. In contrast, TEE only requires additional operations to build a trusted environment and communication between the trusted and untrusted parts, so its performance is comparable to the execution efficiency in an untrusted environment.
[0003] With the increasing popularity of IoT devices, there is a need to find ways to deploy deep learning inference applications on resource-constrained edge devices. There are multiple challenges in running the entire application on edge devices: the limited computing resources of the device may cause significant delays; limited storage capacity makes it difficult to store large DNN (Deep Neural Network) models; limited battery capacity leads to critical energy consumption constraints. Another option is to upload the entire DNN model and inference calculations to the cloud, where the edge device sends input data to the cloud and receives output. While this can solve the limitations of edge device computing performance, it may incur significant communication costs when sending large amounts of input data. In addition, if the cloud is not trusted, there may be privacy issues with inference data and integrity issues with the model.
[0004] Collaborative inference computing can solve security and performance issues between edge devices and cloud computing. The first few simple layers of the DNN model are deployed on the edge device, while the remaining complex layers are uploaded to the cloud. This approach can reduce communication costs because the intermediate output can be designed to be much smaller than the original input. This low data transmission bandwidth can also achieve lower latency. Collaborative inference makes it feasible and efficient to deploy large-scale DNN models on edge platforms. Collaborative inference can also provide better privacy protection because the cloud only receives intermediate values, not raw data. The leakage of raw data can cause serious privacy issues, such as biosensor readings, medical diagnosis and examination data, and facial images.
[0005] However, while collaborative reasoning computing accelerates DNN reasoning computing, it also faces serious security risks. The leakage of network layer weight data deployed on local devices may threaten the security of the entire pre-trained model, and the leakage of intermediate data transmitted over the network will leak the user's input privacy, and dishonest cloud server owners may steal the user's reasoning results.
[0006] Existing research on collaborative reasoning mainly focuses on performance optimization. For example, Collaborative Intelligence between the cloud and mobile edge[J]. ACM SIGARCH Computer Architecture News, 2017, 45(1):615-629 mainly considers the scenario of collaborative computing of machine learning as a service. Users have their own converged pre-trained models. By uploading the models to the cloud server to perform complex network layers, the optimal layering point of collaborative reasoning computing is determined based on the difference in computing speed between the cloud server and mobile devices and the network bandwidth speed. However, since the converged pre-trained models require the use of a large amount of data sets and computing power for training, most users do not have their own converged pre-trained models, but rather use the model reasoning service provided by the cloud server owner. In addition, this method does not solve the security issues of collaborative reasoning computing, nor does it consider the security risks that may be brought about by deploying pre-trained models on mobile devices.
[0007] Some studies on collaborative inference focus on security issues. For example, Model inversion attacks against collaborative inference [C] / / Proceedings of the 35th Annual Computer Security Applications Conference. 2019: 148-162 studied the leakage of input images in collaborative inference calculations. Attackers may reconstruct the input image from the intermediate output of the collaborative computing network transmission, resulting in user privacy leakage. It considers white-box attacks, black-box attacks, and no-query attacks, but does not consider the security issues of pre-trained models.
[0008] Therefore, although collaborative reasoning improves computing performance, unprotected collaborative computing faces the problem of computing data being stolen or the computing process being tampered with. Currently, there are solutions that use TEE to protect the security of pre-trained model reasoning. However, most existing methods only consider a single TEE environment and cannot effectively balance computing efficiency and privacy security. Summary of the invention
[0009] The present invention aims to solve the problem that unprotected collaborative reasoning calculations may face serious risks of data leakage and model theft, and at the same time, unreasonable layering methods will reduce the execution efficiency of the system. To this end, the present invention provides a method, system and product for secure collaborative computing between heterogeneous trusted execution environments, which can provide a secure collaborative computing layer range for a given model with low coupling between network layers, fully protecting the security of user input and output data and the security of pre-trained models; in addition, the performance of local device TEE and remote server TEE is also evaluated, and the layering point with the best performance can be selected within the collaborative computing security layer range according to the characteristics of a given computing task, thereby improving the overall execution efficiency of the system while ensuring the security of collaborative computing.
[0010] The present invention provides a method for secure collaborative computing between heterogeneous trusted execution environments, and the technical solution adopted is as follows:
[0011] Obtaining a computing task, wherein the computing task includes a pre-trained model and raw data;
[0012] Attacking the computing task to obtain a collaborative computing security layering range of the pre-trained model that can resist the attack;
[0013] Deploy the operating environment of the local device TEE and the remote server TEE to obtain performance parameters;
[0014] According to the performance parameters, respectively calculate the predicted execution time of each network layer in the collaborative computing security layering range in the local device TEE and the remote server TEE, and determine the optimal layering point of the local device according to the predicted time;
[0015] The pre-trained model is split according to the optimal layering point of the local device; and the split pre-trained model is sent to the local device TEE and the remote server TEE respectively.
[0016] Furthermore, the pre-trained model is a model that can be divided into multiple independently running parts.
[0017] Furthermore, the process of attacking the computing task and obtaining the collaborative computing security layering range of the pre-trained model capable of resisting the attack is as follows:
[0018] Performing multiple attacks on the pre-trained model to obtain a hierarchical upper bound and a hierarchical lower bound of the pre-trained model that can resist the attacks; the hierarchical upper bound is deployed in the remote server TEE, and the hierarchical lower bound is deployed in the local device TEE;
[0019] The network layers of the pre-trained model between the upper bound and the lower bound are the collaborative computing security layer range.
[0020] Furthermore, a model stealing attack is performed on the pre-trained model to obtain the hierarchical upper bound; and an image reconstruction attack is performed on the pre-trained model using the original data to obtain the hierarchical lower bound.
[0021] Furthermore, the layered upper bound is the last several network layers containing weight data of the pre-trained model except the last network layer;
[0022] The layered lower bound is the first several network layers of the pre-trained model.
[0023] Furthermore, the process of determining the optimal layering point of the local device according to the predicted time is as follows:
[0024] The last network layer of the lower boundary of the layering and each network layer of the collaborative computing security layering range are respectively used as the local device layering points, the sum of the predicted times corresponding to all network layers in the collaborative computing security layering range is calculated, and the network layer with the smallest sum of the predicted times is selected as the optimal layering point of the local device.
[0025] Furthermore, the performance parameters include the time required for initialization of each 1MB of secure memory of the local device TEE and the remote server TEE, the time required for a single calculation, and the time required for a single memory access.
[0026] The calculation formula of the predicted time is:
[0027]
[0028] Where T represents the prediction time, m represents the size of the secure memory required for the computing task, and E per represents the time required to initialize each 1MB of secure memory, n represents the total number of GEMM (General Matrix to Matrix Multiplication) cycles of the pre-trained model, α represents the ratio of the number of calculations to the number of memory accesses, t represents the time required for a single calculation, and M represents the time required for a single memory access;
[0029] The calculation formula for the total number of cycles of the GEMM of the pre-trained model is:
[0030]
[0031] in, represents the filter, represents the convolution kernel size, c represents the number of input image channels, w represents the input image width, and h represents the input image height.
[0032] Further, the pre-trained model is split according to the optimal layering point of the local device; and the split pre-trained model is sent to the local device TEE and the remote server TEE respectively. The process is:
[0033] Divide the network layer from the first network layer of the pre-trained model to the network layer corresponding to the optimal layering point of the local device into a first model block, divide the last network layer of the pre-trained model into a third model block, and divide the remaining network layers of the pre-trained model into a second model block;
[0034] The first model block and the third model block are sent to the local device TEE; and the second model block is sent to the remote server TEE.
[0035] The present invention also provides a system for secure collaborative computing between heterogeneous trusted execution environments, and the technical scheme adopted is as follows: comprising: a computing task acquisition module, a computing task attack module, a TEE operating environment deployment module, a hierarchical point computing module and a model distribution module, wherein the computing task acquisition module is connected to the computing task attack module, and the hierarchical point computing module is respectively connected to the computing task attack module, the TEE operating environment deployment module and the model distribution module,
[0036] The computing task acquisition module is used to acquire a computing task, wherein the computing task includes a pre-trained model and raw data;
[0037] The computing task attack module is used to attack the computing task to obtain a collaborative computing security layer range of the pre-trained model that can resist the attack;
[0038] The TEE operating environment deployment module is used to deploy the operating environment of the local device TEE and the remote server TEE and obtain performance parameters;
[0039] The layering point calculation module is used to calculate the predicted execution time of each network layer of the collaborative computing security layering range in the local device TEE and the remote server TEE according to the performance parameters, and determine the optimal layering point of the local device according to the predicted time;
[0040] The model distribution module is used to split the pre-trained model according to the optimal layering point of the local device; and send the split pre-trained model to the local device TEE and the remote server TEE respectively.
[0041] The present invention also provides a computer program product, including a computer program, which implements the above-mentioned method of secure collaborative computing between heterogeneous trusted execution environments when executed by a processor.
[0042] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects:
[0043] 1. The present invention uses a heterogeneous trusted execution environment to divide the reasoning calculation of the pre-trained model into two parts: local device TEE execution and remote server TEE execution. Based on the heterogeneous trusted execution environment, the present invention uses a variety of advanced attack methods to attack the pre-trained model, obtains a collaborative computing security layer range that can resist all attacks, and selects a layer point within the collaborative computing security layer range, which can simultaneously protect the overall security of the user's original data and the pre-trained model.
[0044] 2. The present invention analyzes the initialization, memory access performance and computing performance in different TEE environments and devices, estimates the prediction time of the network layer executed in the local device TEE and the remote server TEE, and selects the optimal performance layering point within the collaborative computing security layering range for a given pre-trained model.
[0045] 3. Experiments using the Resnet-18 model show that the present invention can increase the speed of DNN reasoning calculation by 3.27 times and reduce power consumption by 71.85% while ensuring the security of the pre-trained model and user input and output data. Compared with collaborative reasoning without TEE protection, it only introduces 7.06% additional performance overhead to achieve protection of the entire computing process.
[0046] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 It is a flow chart of the method provided by the present invention.
[0049] Figure 2 It is a structural block diagram of the system provided by the present invention.
[0050] Reference numerals:
[0051] 1. Computing task acquisition module; 2. Computing task attack module; 3. TEE operating environment deployment module; 4. Hierarchical point calculation module; 5. Model distribution module. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. The following embodiments are used to illustrate the present invention, but cannot be used to limit the scope of the present invention.
[0053] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0054] Existing technologies lack integrity protection for the security of collaborative reasoning computing, and usually only consider the security of input data, but ignore the security of pre-trained models. In addition, existing technologies usually only consider the use of a single TEE environment, but this cannot use TEE to protect the entire collaborative computing process, and lacks evaluation of TEE performance, resulting in the entire collaborative computing failing to fully utilize the computing resources of local devices and cloud servers, and the overall computing efficiency is low.
[0055] Combine the following Figure 1 and Figure 2 The present invention is further described in detail, and a method, system and product for secure collaborative computing between heterogeneous trusted execution environments of the present invention are described:
[0056] In this embodiment, Figure 1 As shown, a method for secure collaborative computing between heterogeneous trusted execution environments is provided, comprising the following steps:
[0057] Step 1: Obtain a computing task, which includes a pre-trained model and original data.
[0058] The pre-trained model is a model with low coupling between network layers and can be divided into multiple independently running parts. For example: DNN, Transformers. Transformers can deploy Encoders and Decoders in blocks on the local device TEE and remote server TEE respectively.
[0059] This embodiment uses the DNN model as an example to illustrate the subsequent steps of the method. It is assumed that the pre-trained model of the computing task adopts the DNN model, which has N network layers in total; and the original data adopts an image.
[0060] Step 2: Attack the computing task to obtain the collaborative computing security layer range of the pre-trained model that can resist the attack. The specific process is: perform multiple attacks on the pre-trained model to obtain the layer upper bound and layer lower bound of the pre-trained model that can resist the attack; the layer upper bound needs to be deployed on the remote server TEE, and the layer lower bound needs to be deployed on the local device TEE; the network layer of the pre-trained model between the layer upper bound and the layer lower bound is the collaborative computing security layer range.
[0061] First, the present invention determines the collaborative reasoning framework protected by TEE. The components of collaborative reasoning are mainly divided into two parts: local device TEE and remote server TEE. Among them, the local device TEE provides the original image for reasoning calculation and completes part of the network layer calculation in the user's local TEE environment. The remote server TEE is responsible for the main network layer calculation tasks. The calculation process is designed as follows: the user first transfers the original image x to its local device TEE to execute the first i layers of the DNN model, and then uses the integrity check module to check the output results of the first i layers. After verification, a verification code is generated and the encrypted verification code and The data is transmitted to the cloud server together. After the integrity check module of the cloud server verifies that the intermediate data has not been tampered with, the TEE of the cloud server performs the calculation of the inference network layer from i+1 to N-1. After the integrity check, the data is transmitted back to the user's local device to perform the last layer of calculation and obtain the final inference result.
[0062] Secondly, on the basis of the collaborative reasoning framework, the present invention considers protecting the security of the pre-trained model. The network layer at the back of the pre-trained model file contains more sensitive information of the original data. Therefore, when the collaborative reasoning calculation is deployed on more network layers of the user's local device, the attacker can build a high-precision alternative model after obtaining enough weight data, which endangers the security of the pre-trained model. In order to determine the upper limit of the secure layering range of the collaborative reasoning calculation, the present invention uses the most advanced model stealing attack. When the layering strategy of collaborative reasoning can resist the model stealing attack, the layering can be considered safe, and the layering upper limit of the pre-trained model is determined. The layering upper limit is the last several network layers containing weight data of the pre-trained model except the last network layer.
[0063] The process of the model stealing attack used in the present invention is as follows: the attacker uses the input image constructed by himself to query the pre-trained model multiple times and obtain the inference results, and then selects the input image with high confidence as the training data set to train the alternative model. Member inference attack often uses this method to obtain the shadow model. After obtaining the shadow model, the attacker splices the shadow model with the network layer deployed on the mobile device, and then trains the spliced model to obtain a high-precision attack model.
[0064] The present invention analyzes the accuracy of the alternative model obtained by the above attack layer by layer through experimental design. The experimental results show that for the DNN model, generally setting the last two layers containing weight data as the layer upper bound can effectively protect the security of the pre-trained model.
[0065] Secondly, based on the collaborative reasoning framework, the present invention also considers protecting the security of the user's original data. In the design of collaborative reasoning, the only data that an attacker may obtain is the intermediate output transmitted through the network. Although the intermediate output is difficult to directly identify the key information of the original image after the calculation of the previous network layer, the latest research results show that it is still possible for an attacker to reconstruct the original image using the intermediate output.
[0066] The present invention uses the most aggressive image reconstruction attack based on white-box attack, and the attacker can obtain the network layer structure deployed on the local device and the intermediate data transmitted through the network. The attacker can construct an input data, and then continuously adjust the constructed input data by comparing the Euclidean distance between the calculation result of the input data through the previous network layer and the intermediate output result intercepted by collaborative reasoning to obtain a constructed image similar to the original data, thereby stealing sensitive information of the user's original data. When the number of network layers deployed on the local device is large enough, the attacker cannot obtain enough a posteriori information and will find it difficult to restore a valid original image.
[0067] The present invention uses the peak signal-to-noise ratio and the structural similarity index to measure the quality of the constructed image, and verifies the quality of the constructed image when different numbers of network layers are deployed on the user's local device through experiments. The experimental results show that only a small number of network layers need to be deployed on the user's local device to effectively protect the security of user input data and resist image reconstruction attacks based on white box attacks. Therefore, the first several network layers of the pre-trained model are set as the hierarchical lower bound of the pre-trained model. For the DNN model, it is usually four layers.
[0068] Finally, after determining the upper and lower bounds of the stratification, the network layers of the pre-trained model between the upper and lower bounds of the stratification are used as the collaborative computing security stratification range.
[0069] In this embodiment, two attack methods, model stealing attack and image reconstruction attack, are used. Other types of attack methods, such as black box attack and no-query attack, can also be used according to actual needs. The number of attack methods is not limited to two. The collaborative computing security layer range needs to be able to resist all types of attacks.
[0070] Assume that in a DNN model with N network layers, N = 10. Obviously, the 10th layer needs to be deployed in the local device TEE.
[0071] By performing a model stealing attack on the DNN model, it is determined that the upper bound of the layers that can resist the model stealing attack is the last two layers containing weight data. Assuming that the 8th and 9th layers of the DNN model both contain weight data, the upper bound of the layers is the 8th and 9th layers of the DNN model.
[0072] By performing an image reconstruction attack based on a white-box attack on the DNN model, it is determined that the layered lower bound that can resist the image reconstruction attack is the first 4 layers of the DNN model, that is, layers 1 to 4 of the DNN model.
[0073] Then, the collaborative computing security layer range is the 5th to 7th layers of the DNN model.
[0074] Step 3: Deploy the operating environment of the local device TEE and the remote server TEE to obtain performance parameters.
[0075] The local device TEE and remote server TEE are not limited to specific devices and have wide applicability. For example, the local device TEE can be a trusted execution environment using ARM TrustZone for ARM architecture chips, or a trusted execution environment using Keystone and Penglai for RISC-V architecture, and the remote server TEE can use a trusted execution environment using SGX for Intel architecture, or a trusted execution environment using SEV for AMD architecture.
[0076] Step 4: Based on the performance parameters, respectively calculate the predicted execution time of each network layer in the collaborative computing security layering range in the local device TEE and the remote server TEE, and determine the optimal layering point of the local device based on the predicted time.
[0077] In order to improve the computing efficiency of the system, the present invention studies how to select the optimal stratification point of the local device based on the collaborative computing security stratification range.
[0078] The present invention evaluates the performance of the local device TEE and the remote server device TEE from three aspects: secure memory initialization performance, memory access performance and computing performance. The present invention proposes a method for evaluating TEE performance, and proposes the following evaluation methods for the above three aspects of performance: 1. In order to evaluate the relationship between secure memory initialization performance and secure memory size, the present invention sets a series of different secure memory sizes on a given TEE environment and device, and records in detail the initialization time corresponding to different secure memory sizes. 2. In order to comprehensively evaluate the memory access performance under different secure memory sizes, the present invention adopts the Stream benchmark program widely recognized by the industry. The Stream benchmark is a mainstream tool for measuring computer memory bandwidth and memory latency in academia and industry, and measures memory bandwidth by executing four typical memory access modes. In order to reduce the impact of computing performance on the results, the present invention uses the Copy mode test to evaluate the memory access performance of TEE. The Copy mode tests the memory-to-memory data copy performance, which reflects the basic speed of memory access. 3. Evaluate the computing performance of TEE according to the computing characteristics of the pre-trained model. In order to deeply evaluate the computing performance of TEE, the present invention uses the most core matrix multiplication calculation in DNN reasoning calculation as the test benchmark. In the DNN reasoning process, convolution calculation is the part with the largest amount of calculation, and the essence of convolution calculation can be regarded as matrix multiplication operation. Therefore, by measuring the performance of matrix multiplication (General Matrix to Matrix Multiplication, GEMM) calculation, the computational efficiency of TEE can be effectively evaluated.
[0079] The experimental results show that the secure memory initialization performance and computing performance of Intel SGX used by the remote server are better than those of ARM TrustZone used by the local device. However, after exceeding the secure memory size, the memory access performance of Intel SGX is significantly lower than that of ARM TrustZone.
[0080] Based on the test results, the present invention provides the prediction time of the initialization and execution time of the network layer of the pre-trained model in TEE. The calculation formula of the prediction time is:
[0081]
[0082] Where T represents the prediction time, m represents the size of the secure memory required for the computing task, and E per represents the time required to initialize each 1MB of secure memory, n represents the total number of GEMM cycles of the pre-trained model, α represents the ratio of the number of calculations to the number of memory accesses, t represents the time required for a single calculation, and M represents the time required for a single memory access.
[0083] The calculation formula for the total number of cycles of the GEMM of the pre-trained model is:
[0084]
[0085] in, represents the filter, represents the convolution kernel size, c represents the number of input image channels, w represents the input image width, and h represents the input image height.
[0086] For a given pre-trained model, , The values of , c, w, h, and m are known before performing the calculation. The value of α can be learned by observing the structure of the pre-trained model. For example, in the DNN model, the matrix multiplication calculation of the general matrix occupies more than 91% of the time in the DNN inference calculation. The main content of the GEMM calculation is the product of two matrices, which is the core calculation unit of the DNN inference calculation. The ratio of the number of memory accesses and the number of calculations in a typical GEMM algorithm is about 1:3. Therefore, it can be roughly considered that the ratio of the number of memory accesses and calculations in the DNN inference calculation is 1:3, that is, the value of α is 3. E per , t, and M are performance parameters of the local device TEE and the remote server TEE, and their values can be obtained by actual measurement using the above-mentioned method for evaluating TEE performance.
[0087] According to the calculation formula of the prediction time, the prediction time of each network layer in the collaborative computing security layering range in the local device TEE and the remote server TEE is calculated respectively. The last network layer of the layering lower boundary and each network layer in the collaborative computing security layering range are respectively used as the local device layering point, and the sum of the prediction times corresponding to all network layers in the collaborative computing security layering range is calculated, and the network layer with the smallest sum of the prediction times is selected as the optimal layering point of the local device. In this way, it is determined that the network layer in the collaborative computing security layering range should be executed in the local device TEE or the remote server TEE.
[0088] In step 2, the collaborative computing security layer range is obtained as layer 5-7 of the DNN model. In this step, the prediction time of layer 5, layer 6, and layer 7 of the DNN model in the local device TEE and remote server TEE is calculated, which are T 5本地 , T 5远程 , T 6本地 , T 6远程 , T 7本地 and T 7远程 .
[0089] Layer 4 is the local device stratification point, and the sum of the prediction time is T 5远程 +T 6远程 +T7远程 ;
[0090] Layer 5 is the local device stratification point, and the sum of the prediction time is T 5本地 +T 6远程 +T 7远程 ;
[0091] The 6th layer is the local device stratification point, and the sum of the prediction time is T 5本地 +T 6本地 +T 7远程 ;
[0092] Layer 7 is the local device stratification point, and the sum of the predicted time is T 5本地 +T 6本地 +T 7本地 .
[0093] Compare the sum of the four prediction times. If T 5本地 +T 6远程 +T 7远程 The minimum value is the 5th layer, which is the optimal layering point for local devices.
[0094] Step 5: Split the pre-trained model according to the optimal layering point of the local device; send the split pre-trained model to the local device TEE and the remote server TEE respectively. The specific process is:
[0095] The network layer from the first network layer of the pre-trained model to the network layer corresponding to the optimal layering point of the local device is divided into the first model block. The 1st to 5th layers of the DNN model are the first model block.
[0096] The last network layer of the pre-trained model is divided into the third model block. The 10th layer of the DNN model is the third model block.
[0097] The remaining network layers of the pre-trained model are divided into a second model block. Layers 6-9 of the DNN model are the second model block.
[0098] The first model block and the third model block are sent to the local device TEE; and the second model block is sent to the remote server TEE.
[0099] In order to comprehensively evaluate the performance of the present invention, the present invention, the DNN reasoning framework DarkneTZ running on the local device TEE, and the traditional collaborative reasoning calculation are deeply compared using the Resnet-18 model. The remote server TEE uses Intel SGX, and the local device TEE uses ARM TrustZone. To ensure the fairness of the comparison, the present invention uses the same local device optimal layering point as the benchmark when performing performance comparison. The test results are summarized in Table 1.
[0100] Table 1 Summary of test results
[0101]
[0102] From Table 1, we can clearly see the significant advantages of the present invention in multiple key indicators. Compared with DarkneTZ, the present invention not only provides protection for the integrity of DNN calculations, ensuring the security of the calculation process and data, but also achieves a 3.27-fold improvement in average computing performance. This significant improvement is mainly due to the optimization of the present invention in the collaborative computing of local device TEE and remote server TEE, which effectively reduces the computing time. In addition, the present design also has a significant reduction in power consumption, which is 71.85% lower than DarkneTZ, which is especially important for resource-constrained scenarios such as mobile devices and IoT devices.
[0103] Compared with collaborative reasoning without TEE protection, the present invention only introduces 7.06% additional performance overhead to achieve protection of the entire computing process. In addition, it should be noted that collaborative reasoning uses the same optimal layering point of local devices as the present invention. If collaborative reasoning uses other layering points, the additional performance overhead of the present invention may be reduced.
[0104] The present invention is based on the premise of protecting the user's original data and the security of the pre-trained model, and improves the overall execution efficiency of the system. The present invention proposes a trusted collaborative reasoning framework, and uses the local device TEE and the remote server TEE to protect the integrity of the collaborative reasoning calculation process and the security of the data. Based on the collaborative reasoning framework, the present invention proposes a method for setting a secure upper bound of the hierarchy, which avoids the problem that the pre-trained model deployed on the local device will threaten the security of the entire pre-trained model; it also proposes a method for setting a secure lower bound of the hierarchy, which avoids the problem that the intermediate output data leaks the privacy of the user's original data. The present invention also proposes a method for calculating the optimal hierarchical point of the local device, which improves the overall computing efficiency of the collaborative reasoning while protecting the security of the reasoning calculation. Compared with the existing collaborative reasoning calculation, the present invention can protect the security of the user's input and output data and the security of the pre-trained model, and can further improve the computing efficiency of the system according to the specific deployment platform while protecting security.
[0105] In this embodiment, Figure 2 As shown, a system for secure collaborative computing between heterogeneous trusted execution environments is also provided, and the technical solution adopted is as follows: it includes: a computing task acquisition module 1, a computing task attack module 2, a TEE operating environment deployment module 3, a hierarchical point calculation module 4 and a model distribution module 5, the computing task acquisition module 1 is connected to the computing task attack module 2, and the hierarchical point calculation module 4 is respectively connected to the computing task attack module 2, the TEE operating environment deployment module 3 and the model distribution module 5.
[0106] The computing task acquisition module 1 is used to acquire a computing task, wherein the computing task includes a pre-trained model and raw data. The pre-trained model is a model in which the coupling between network layers is low and can be divided into multiple independently running parts.
[0107] The computing task attack module 2 is used to attack the computing task to obtain a collaborative computing security layering range of the pre-trained model that can resist the attack.
[0108] The TEE operating environment deployment module 3 is used to deploy the operating environment of the local device TEE and the remote server TEE and obtain performance parameters.
[0109] The layering point calculation module 4 is used to calculate the predicted execution time of each network layer in the collaborative computing security layering range in the local device TEE and the remote server TEE according to the performance parameters, and determine the optimal layering point of the local device according to the predicted time.
[0110] The model distribution module 5 is used to split the pre-trained model according to the optimal layering point of the local device; and send the split pre-trained model to the local device TEE and the remote server TEE respectively.
[0111] The working process of this system is:
[0112] The computing task acquisition module 1 acquires a given computing task, which includes a pre-trained model and original data, and sends the computing task to the computing task attack module 2.
[0113] The computing task attack module 2 performs multiple attacks on the pre-trained model to obtain the hierarchical upper bound and hierarchical lower bound of the pre-trained model that can resist the attack; the hierarchical upper bound is the last several network layers containing weight data of the pre-trained model except the last network layer, and the hierarchical upper bound is deployed on the remote server TEE; the hierarchical lower bound is the first several network layers of the pre-trained model, and the hierarchical lower bound is deployed on the local device TEE; the network layer of the pre-trained model between the hierarchical upper bound and the hierarchical lower bound is the collaborative computing security hierarchical range. Performing multiple attacks can be specifically as follows: performing a model stealing attack on the pre-trained model to obtain the hierarchical upper bound of the pre-trained model that can resist the model stealing attack; performing an image reconstruction attack based on a white box attack on the pre-trained model using the original data to obtain the hierarchical lower bound of the pre-trained model that can resist the image reconstruction attack. The computing task attack module 2 sends the pre-trained model and the collaborative computing security hierarchical range to the hierarchical point calculation module 4.
[0114] The TEE operating environment deployment module 3 deploys the operating environment of the local device TEE and the remote server TEE, and then sends the performance parameters of the local device TEE and the remote server TEE to the hierarchical point calculation module 4. The performance parameters include the time required for initialization of each 1MB of secure memory, the time required for a single calculation, and the time required for a single memory access.
[0115] The hierarchical point calculation module 4 determines the filter, convolution kernel size, number of input image channels, input image width, input image height and the ratio of calculation times to memory access times according to the specific structure of the pre-trained model; and then calculates the predicted time for each network layer in the collaborative computing security hierarchical range to be executed in the local device TEE and the remote server TEE in combination with the performance parameters.
[0116] The calculation formula of the predicted time is:
[0117]
[0118] Where T represents the prediction time, m represents the size of the secure memory required for the computing task, and E per represents the time required to initialize each 1MB of secure memory, n represents the total number of GEMM cycles of the pre-trained model, α represents the ratio of the number of calculations to the number of memory accesses, t represents the time required for a single calculation, and M represents the time required for a single memory access.
[0119] The calculation formula for the total number of cycles of the GEMM of the pre-trained model is:
[0120]
[0121] in, represents the filter, represents the convolution kernel size, c represents the number of input image channels, w represents the input image width, and h represents the input image height.
[0122] The layer point calculation module 4 uses the last network layer of the layer lower boundary and each network layer of the collaborative computing security layer range as the local device layer point, calculates the sum of the prediction times corresponding to all network layers in the collaborative computing security layer range, and selects the network layer with the smallest sum of the prediction times as the local device optimal layer point. The layer point calculation module 4 sends the pre-trained model and the local device optimal layer point to the model distribution module 5.
[0123] The model distribution module 5 divides the network layer from the first network layer of the pre-trained model to the network layer corresponding to the optimal layering point of the local device into a first model block, divides the last network layer of the pre-trained model into a third model block, and divides the remaining network layers of the pre-trained model into a second model block; sends the first model block and the third model block to the local device TEE; and sends the second model block to the remote server TEE.
[0124] This embodiment also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned method for secure collaborative computing between heterogeneous trusted execution environments.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for secure collaborative computing between heterogeneous trusted execution environments, characterized in that: include: Obtaining a computing task, wherein the computing task includes a pre-trained model and raw data; Attacking the computing task to obtain a collaborative computing security layering range of the pre-trained model that can resist the attack; Deploy the operating environment of the local device TEE and the remote server TEE to obtain performance parameters; According to the performance parameters, respectively calculate the predicted execution time of each network layer in the collaborative computing security layering range in the local device TEE and the remote server TEE, and determine the optimal layering point of the local device according to the predicted time; Calculate the sum of the prediction times corresponding to all network layers in the collaborative computing security layering range, and select the network layer with the smallest sum of the prediction times as the optimal layering point of the local device; The performance parameters include the time required for initialization of each 1MB of secure memory of the local device TEE and the remote server TEE, the time required for a single calculation, and the time required for a single memory access. The calculation formula of the predicted time is: Where T represents the prediction time, m represents the size of the secure memory required for the computing task, and E per represents the time required to initialize each 1MB of secure memory, n represents the total number of cycles of the GEMM of the pre-trained model, α represents the ratio of the number of calculations to the number of memory accesses, t represents the time required for a single calculation, and M represents the time required for a single memory access; The calculation formula for the total number of cycles of the GEMM of the pre-trained model is: in, represents the filter, represents the convolution kernel size, c represents the number of input image channels, w represents the input image width, and h represents the input image height; The pre-trained model is split according to the optimal layering point of the local device; and the split pre-trained model is sent to the local device TEE and the remote server TEE respectively.
2. The method for secure collaborative computing between heterogeneous trusted execution environments as claimed in claim 1, characterized in that: The pre-trained model is a model that can be divided into multiple independently running parts.
3. The method for secure collaborative computing between heterogeneous trusted execution environments according to claim 1 or 2, characterized in that: The process of attacking the computing task and obtaining the collaborative computing security layering range of the pre-trained model capable of resisting the attack is as follows: Performing multiple attacks on the pre-trained model to obtain a hierarchical upper bound and a hierarchical lower bound of the pre-trained model that can resist the attacks; The hierarchical upper bound is deployed on the remote server TEE, and the hierarchical lower bound is deployed on the local device TEE; The network layers of the pre-trained model between the upper bound and the lower bound are the collaborative computing security layer range.
4. The method for secure collaborative computing between heterogeneous trusted execution environments as claimed in claim 3, characterized in that: A model stealing attack is performed on the pre-trained model to obtain the hierarchical upper bound; and an image reconstruction attack is performed on the pre-trained model using the original data to obtain the hierarchical lower bound.
5. The method for secure collaborative computing between heterogeneous trusted execution environments as claimed in claim 3, characterized in that: The layered upper bound is the last several network layers containing weight data of the pre-trained model except the last network layer; The layered lower bound is the first several network layers of the pre-trained model.
6. The method for secure collaborative computing between heterogeneous trusted execution environments as claimed in claim 3, characterized in that: The process of determining the optimal stratification point of the local device according to the predicted time is as follows: The last network layer of the layered lower boundary and each network layer of the collaborative computing security layered range are respectively used as local device layering points.
7. The method for secure collaborative computing between heterogeneous trusted execution environments according to claim 1 or 2, characterized in that: The process of splitting the pre-trained model according to the optimal layering point of the local device and sending the split pre-trained model to the local device TEE and the remote server TEE respectively is: Divide the first network layer of the pre-trained model to the optimal layering point of the local device into a first model block, divide the last network layer of the pre-trained model into a third model block, and divide the remaining network layers of the pre-trained model into a second model block; Sending the first model block and the third model block to the local device TEE; The second model block is sent to the remote server TEE.
8. A system for secure collaborative computing between heterogeneous trusted execution environments, characterized in that: The method for executing secure collaborative computing between heterogeneous trusted execution environments as described in any one of claims 1 to 7 comprises: a computing task acquisition module, a computing task attack module, a TEE operating environment deployment module, a hierarchical point computing module and a model distribution module, wherein the computing task acquisition module is connected to the computing task attack module, and the hierarchical point computing module is respectively connected to the computing task attack module, the TEE operating environment deployment module and the model distribution module. The computing task acquisition module is used to acquire a computing task, wherein the computing task includes a pre-trained model and raw data; The computing task attack module is used to attack the computing task to obtain a collaborative computing security layer range of the pre-trained model that can resist the attack; The TEE operating environment deployment module is used to deploy the operating environment of the local device TEE and the remote server TEE and obtain performance parameters; The layering point calculation module is used to calculate the predicted execution time of each network layer of the collaborative computing security layering range in the local device TEE and the remote server TEE according to the performance parameters, and determine the optimal layering point of the local device according to the predicted time; Calculate the sum of the prediction times corresponding to all network layers in the collaborative computing security layering range, and select the network layer with the smallest sum of the prediction times as the optimal layering point of the local device; The performance parameters include the time required for initialization of each 1MB of secure memory of the local device TEE and the remote server TEE, the time required for a single calculation, and the time required for a single memory access. The calculation formula of the predicted time is: Where T represents the prediction time, m represents the size of the secure memory required for the computing task, and E per represents the time required to initialize each 1MB of secure memory, n represents the total number of cycles of the GEMM of the pre-trained model, α represents the ratio of the number of calculations to the number of memory accesses, t represents the time required for a single calculation, and M represents the time required for a single memory access; The calculation formula for the total number of cycles of the GEMM of the pre-trained model is: in, represents the filter, represents the convolution kernel size, c represents the number of input image channels, w represents the input image width, and h represents the input image height; The model distribution module is used to split the pre-trained model according to the optimal layering point of the local device; and send the split pre-trained model to the local device TEE and the remote server TEE respectively.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for secure collaborative computing between heterogeneous trusted execution environments described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Transform model segmentation method and device in mobile edge environment
CN116033492A
White traffic filtering model training method and system based on multi-party splitting learning
CN116151351A
DNN edge-end collaborative reasoning method for edge intelligence
CN117808049A
Verifiable Deep Learning Training Service
US20200082270A1
