Data processing method and apparatus, and storage medium

By using a combination of Trusted Execution Environment (TEE) and linear computing devices in terminal devices, the efficiency and security issues of terminal devices when processing large-scale data are solved, and efficient and safe processing of data in TEE is achieved.

WO2024179167A1PCT designated stage expired Publication Date: 2024-09-06HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Application Number
PCT/CN2023/143171
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-24
Filing Date
2023-12-29
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Terminal devices have low computing efficiency when processing large-scale data, and there are data leakage and security issues, especially when the data is sent to the cloud platform for processing.

Method used

Using a Trusted Execution Environment (TEE) combined with a linear computing device, the data is obfuscated in the TEE and sent to the linear computing device for linear computing to ensure the security and efficiency of the data in the TEE.

Benefits of technology

It improves the computing efficiency and security of data processing, prevents data leakage, and efficiently performs linear operations in TEE to enhance data protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023143171_06092024_PF_FP
    Figure CN2023143171_06092024_PF_FP
Patent Text Reader

Abstract

The present application belongs to the field of communications. Disclosed are a data processing method and apparatus, and a storage medium. The method comprises: receiving first data to be processed and second data to be processed, which are sent by a terminal device; inputting the first data and the second data into a TEE; sending a linear operation request to a linear operation device, wherein the linear operation request comprises third data corresponding to the first data and fourth data corresponding to the second data, the third data and the fourth data being in the TEE; receiving a linear operation response sent by the linear operation device, wherein the linear operation response comprises a first operation result, and the first operation result is a linear operation result between the third data and the fourth data; inputting the first operation result into the TEE; and sending, to the terminal device, a second operation result corresponding to the first operation result, wherein the second operation result is a linear operation result between the first data and the second data. The present application can improve the operation efficiency and security of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing method, device and storage medium

[0001] This application claims priority to Chinese Patent Application No. 202310181818.7, filed on February 28, 2023, entitled “Secure Neural Network Training Method,” the entire contents of which are hereby incorporated by reference into this application. Furthermore, this application claims priority to Chinese Patent Application No. 202310594205.6, filed on May 24, 2023, entitled “Data Processing Method, Apparatus, and Storage Medium,” the entire contents of which are hereby incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communications, and in particular to a method, device, and storage medium for processing data. Background Art

[0003] With the development of terminal technology, terminal devices have become widely used. For example, mobile phones, tablets, and / or IoT devices are now used in all aspects of people's lives. However, terminal devices have limited computing resources, and when they need to calculate large amounts of data, their computing efficiency is very low. For example, the data that a terminal device needs to calculate is a matrix, which may contain tens of thousands or hundreds of thousands of data elements. This results in low efficiency for terminal devices to perform matrix operations.

[0004] To address this issue, existing technologies have allowed terminal devices to send data to a cloud platform, which then processes the data and returns the results to the terminal device. However, with the increasing number of data leaks and big data price gouging incidents in recent years, handing off terminal device data to a cloud platform for processing can lead to data and privacy breaches.

[0005] Therefore, how to improve the computational efficiency of data processing and the security of data processing is an urgent problem that needs to be solved in related technologies.

[0006] Summary of the Invention

[0007] This application provides a method, device, and storage medium for processing data to improve the computational efficiency and security of data processing. The technical solution is as follows:

[0008] In a first aspect, the present application provides a method for processing data, which is applied to a secure processing device included in a cloud service system, the secure processing device including a trusted execution environment TEE, and the cloud service system also including a linear operation device. In the method, a data processing request sent by a terminal device is received, and the data processing request includes first data and second data to be processed. The first data and the second data are input into the TEE. A linear operation request is sent to the linear operation device, and the linear operation request includes third data corresponding to the first data and fourth data corresponding to the second data in the TEE. A linear operation response is received from the linear operation device, and the linear operation response includes a first operation result, and the first operation result is a linear operation result between the third data and the fourth data. The first operation result is input into the TEE. A data processing response is sent to the terminal device, and the processing response includes a second operation result corresponding to the first operation result in the TEE, and the second operation result is a linear operation result between the first data and the second data.

[0009] A TEE is a trusted execution environment. Data within the TEE cannot be leaked or accessed by attackers, and linear arithmetic devices perform linear operations on data very efficiently. Therefore, first and second data are input into the TEE. Within the TEE, the first and second data are processed into third and fourth data corresponding to the first and second data, respectively. The third and fourth data are then sent to the linear arithmetic device. When the linear arithmetic device performs linear operations on the third and fourth data, leakage of the first and second data is avoided. The result of the first operation is input into the TEE. Within the TEE, the first operation result is processed into the second operation result, which is then sent to the terminal device. Because the trusted execution environment provided by the TEE prevents leakage of the first and second data, and the result of the first operation, the first and second data are processed into third and fourth data, respectively, within the TEE. The linear arithmetic device performs linear operations on the third and fourth data. This prevents leakage of the first and second data, while also improving the efficiency of linear operations. This improves both the efficiency and security of data processing.

[0010] In one possible implementation, the first data is training data for an artificial intelligence (AI) model, and the second data is the parameters of the AI ​​model; alternatively, the first data is data that needs to be inferred by the AI ​​model, and the second data is the parameters of the AI ​​model. This allows both training the AI ​​model and using the AI ​​model to infer data.

[0011] In another possible implementation, the first data includes a first matrix, the second data includes a second matrix, and in the TEE, based on multiple obfuscation vectors, data elements included in the first matrix are obfuscated to obtain a third matrix, and data elements included in the second matrix are obfuscated to obtain a fourth matrix, wherein the obfuscation vectors include multiple random numbers, the third data includes a third matrix, and the fourth data includes a fourth matrix.

[0012] Because the confusion vectors include multiple random numbers, they vary irregularly. Based on these multiple confusion vectors, the data elements of the first matrix are obfuscated to obtain a third matrix, and the data elements of the second matrix are obfuscated to obtain a fourth matrix. Therefore, the first and second matrices cannot be inferred from the third and fourth matrices. Therefore, when the linear operation device performs linear operations on the third and fourth matrices, leakage of the first and second matrices is avoided, ensuring data security. Since the linear operation device is dedicated to performing linear operations, it can quickly obtain the first operation result by performing linear operations on the third and fourth matrices, thereby improving the efficiency of the linear operations.

[0013] In another possible implementation, the first operation result is the product of the third matrix and the fourth matrix, or the first operation result is the product of the third matrix and the fourth matrix. In the TEE, the efficiency of matrix multiplication or division operations is low, so a linear operation device is used to perform matrix multiplication or division operations, thereby improving operation efficiency.

[0014] In another possible implementation, multiple obfuscation vectors are obtained based on the first and second matrices. This ensures that different obfuscation vectors are used for linear operations on different matrices, significantly increasing the difficulty for attackers to infer the first and second matrices from the third and fourth matrices, thereby improving data security.

[0015] In another possible implementation, the first matrix has m rows and n columns, the second matrix has n rows and s columns, m, n, and s are all integers greater than 1, the multiple obfuscation vectors include a first obfuscation vector, a second obfuscation vector, and a third obfuscation vector, the first obfuscation vector includes m random numbers, the second obfuscation vector includes n random numbers, and the third obfuscation vector includes s random numbers. A real number range is obtained based on the first matrix and the second matrix, the real number range including multiple non-zero real numbers. The m random numbers included in the first obfuscation vector, the n random numbers included in the second obfuscation vector, and the s random numbers included in the third obfuscation vector are randomly selected from the real number range.

[0016] Since the real number range is obtained based on the first matrix and the second matrix and does not include 0, and the multiple confusion vectors are randomly selected from the real number range, this expands the difference between the first matrix and the third matrix, and expands the difference between the second matrix and the fourth matrix, greatly increasing the difficulty for an attacker to infer the first matrix and the second matrix from the third matrix and the fourth matrix, thereby improving data security.

[0017] In another possible implementation, the maximum absolute value is selected from the absolute value of each data element included in the first matrix and the absolute value of each data element included in the second matrix. A real number range is obtained based on the maximum absolute value, wherein the lower limit of the real number range is -2 L / 2 , the upper limit of this real number range is 2 L / 2 ,exist When it is an even number, MAX is the maximum absolute value, For the rounding operation, When is an odd number, In this way, the real number range is obtained based on the first matrix and the second matrix.

[0018] In another possible implementation, the first matrix is ​​confounded based on the first and second confounding vectors to obtain a third matrix. Since the first confounding vector includes m random numbers and the second confounding vector includes n random numbers, and the first matrix is ​​a matrix with m rows and n columns, the first matrix can be successfully confounded based on the first and second confounding vectors.

[0019] In another possible implementation, the second matrix is ​​obfuscated based on the second and third obfuscation vectors to obtain a fourth matrix. Since the second obfuscation vector includes n random numbers and the third obfuscation vector includes s random numbers, and the second matrix is ​​a matrix with n rows and s columns, the second matrix can be successfully obfuscated based on the second and third obfuscation vectors.

[0020] In another possible implementation, multiple permutation vectors are obtained. Based on the multiple permutation vectors, positions of data elements included in the first matrix are transformed to obtain a fifth matrix, and positions of data elements included in the second matrix are transformed to obtain a sixth matrix. Based on the multiple confusion vectors, data elements included in the fifth matrix are obfuscated to obtain a third matrix, and data elements included in the sixth matrix are obfuscated to obtain a fourth matrix.

[0021] Since the positions of the data elements included in the first matrix and the positions of the data elements included in the second matrix are transformed based on the multiple permutation vectors, it is greatly difficult for an attacker to infer the first matrix and the second matrix from the third matrix and the fourth matrix, thereby improving data security.

[0022] In another possible implementation, the multiple permutation vectors include a first permutation vector, a second permutation vector, and a third permutation vector, the first permutation vector includes m different data elements, each data element in the first permutation vector is an integer greater than or equal to 1 and less than or equal to m, the second permutation vector includes n different data elements, each data element in the second permutation vector is an integer greater than or equal to 1 and less than or equal to n, and the third permutation vector includes s different data elements, each data element in the third permutation vector is an integer greater than or equal to 1 and less than or equal to s.

[0023] The positions of the data elements included in the first matrix are transformed based on the first permutation vector and the second permutation vector to obtain a fifth matrix. Since the first permutation vector includes m data elements and the second permutation vector includes n data elements, and the first matrix is ​​a matrix with m rows and n columns, the positions of the data elements included in the first matrix can be successfully transformed based on the first permutation vector and the second permutation vector.

[0024] The positions of the data elements included in the second matrix are transformed based on the second permutation vector and the third permutation vector to obtain a sixth matrix. Since the second permutation vector includes n data elements and the third permutation vector includes s data elements, and the second matrix is ​​a matrix with n rows and s columns, the positions of the data elements included in the second matrix can be successfully transformed based on the second permutation vector and the third permutation vector.

[0025] In another possible implementation, data elements with a value of 0 included in the first matrix and data elements with a value of 0 included in the second matrix are replaced with a first real number, which is not equal to 0. This can prevent leakage of zero values ​​and improve data security.

[0026] In a second aspect, the present application provides a device for processing data, configured to execute the method in the first aspect or any possible implementation of the first aspect. Specifically, the device includes a unit for executing the method in the first aspect or any possible implementation of the first aspect.

[0027] In a third aspect, the present application provides a cluster for processing data, the cluster comprising at least one computing device, each of the at least one computing device comprising at least one processor and at least one memory, the at least one memory storing computer-readable instructions; the at least one processor executes the computer-readable instructions so that the cluster implements the method in the first aspect or any possible implementation of the first aspect.

[0028] In a fourth aspect, the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the method of the above-mentioned first aspect or any possible implementation method of the first aspect.

[0029] In a fifth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program is loaded by a processor to execute the method of the above-mentioned first aspect or any possible implementation of the first aspect.

[0030] In a sixth aspect, the present application provides a chip comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and run the computer instructions from the memory to execute the method of the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] FIG1 is a schematic diagram of the structure of a cloud service system provided in an embodiment of the present application;

[0032] FIG2 is a schematic diagram of a network architecture provided in an embodiment of the present application;

[0033] FIG3 is a flow chart of a method for processing data provided in an embodiment of the present application;

[0034] FIG4 is a flow chart of another method for processing data provided by an embodiment of the present application;

[0035] FIG5 is a flowchart of a method for a confusion matrix provided in an embodiment of the present application;

[0036] FIG6 is a flowchart of another method for confusion matrix provided in an embodiment of the present application;

[0037] FIG7 is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0038] FIG8 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0039] FIG9 is a schematic diagram of the structure of a data processing cluster provided in an embodiment of the present application;

[0040] FIG10 is a schematic diagram of the structure of another data processing cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The embodiments of the present application will be described in further detail below with reference to the accompanying drawings.

[0042] In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance. In the description of this application, it should be noted that, unless otherwise expressly specified and limited, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to the specific circumstances. In addition, in the description of this application, unless otherwise specified, "multiple" refers to two or more. "and / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0043] A TEE is a hardware-supported secure isolation environment that allows applications to run in an isolated environment. This prevents sensitive data in the application from being accessed by other applications or even the operating system. When sensitive data is entered into a TEE, it allows for both plaintext computations on the sensitive data and prevents attackers from accessing it, effectively protecting privacy. Optionally, a TEE can be based on software guard extension (SGX) technology, TrustZone technology (a trusted environment technology), and Sanctum technology (a trusted environment technology).

[0044] The computational operations for processing data include linear operations. In TEE, the efficiency of linear operations on certain data is not high, while the computational efficiency of linear processing devices is very high. In this case, linear operations can be performed on these data through linear processing devices.

[0045] For example, the data to be processed in a TEE may be two matrices. The linear operations on the two matrices include one or more of the following: multiplication or division of the two matrices. The computational complexity of the multiplication or division of the two matrices is very high. Performing the multiplication or division of the two matrices in the TEE seriously reduces the efficiency of linear operations.

[0046] To improve the efficiency of linear operations, the two matrices in the TEE can be sent to a linear operation device for performing linear operations. The linear operation device performs linear operations on the two matrices to obtain linear operation results. The linear operation device is very efficient in performing linear operations and can very efficiently perform linear operations on the two matrices, that is, very efficiently perform multiplication or division operations on the two matrices, and then return the linear operation results to the TEE.

[0047] If these two matrices are sent to a linear operation device, which has low security, the two matrices can easily be leaked or accessed by attackers in the linear operation device, thus reducing data security. To this end, the present application can implement linear operations between matrices through any of the following embodiments, thereby improving both data security and the efficiency of linear operations.

[0048] 1 , an embodiment of the present application provides a cloud service system 100 , which includes a secure processing device 101 and a linear computing device 102 . The secure processing device 101 includes a TEE, and the secure processing device 101 communicates with the linear computing device 102 .

[0049] In some embodiments, the TEE is located on a processor in the secure processing device 101. Optionally, the processor may be a central processing unit (CPU), a network processing unit (NPU), or a field programmable gate array (FPDA).

[0050] In some embodiments, the secure processing device 101 may be a computing device such as a server, which includes a TEE. The computing device may input data to be processed into the TEE and process the data in the secure environment provided by the TEE, thereby improving the security of the processed data.

[0051] The computing operation for processing the data includes linear computing and / or nonlinear computing. For example, a linear computing may be performed on the first data and the second data in the TEE.

[0052] In some embodiments, the linear operation efficiency of the linear operation device 102 is high, and the first data and the second data that need to be linearly operated in the TEE can be outsourced to the linear operation device 102. Optionally, during implementation:

[0053] The security processing device 101 is used to perform obfuscation processing on the first data in the TEE to obtain third data, perform obfuscation processing on the second data to obtain fourth data, and send a linear operation request to the linear operation device 102, where the linear operation request includes the third data and the fourth data.

[0054] The linear operation device 102 is configured to receive the linear operation request, perform a linear operation on the third data and the fourth data included in the linear operation request to obtain a first operation result; and send a linear operation response to the security processing device 101, where the linear operation response includes the first operation result.

[0055] The secure processing device 101 is configured to receive the linear operation response, input the first operation result into the TEE, and obtain a second operation result corresponding to the first operation result in the TEE, where the second operation result is a linear operation result between the first data and the second data.

[0056] In some embodiments, the first data requiring linear operation in the TEE may include a first matrix, the second data requiring linear operation in the TEE may include a second matrix, and the linear operation may be performed on the first matrix and the second matrix in the TEE.

[0057] In some embodiments, the linear operation performed on the two matrices (the first matrix and the second matrix) includes one or more of the following operations: addition of the two matrices, subtraction of the two matrices, multiplication of the two matrices, or division of the two matrices. For ease of description, X is used to represent the first matrix and Y is used to represent the second matrix.

[0058] The addition operation between the first matrix and the second matrix can be expressed as X+Y. The subtraction operation between the first matrix and the second matrix can be expressed as XY. The multiplication operation of the first matrix by the second matrix can be expressed as X*Y, where * represents the multiplication operation. The division operation of the first matrix by the second matrix can be converted into the multiplication of the first matrix by the inverse matrix of the second matrix, that is, the division operation of the first matrix by the second matrix can be expressed as X / Y=X*Y -1 , / represents division operation, Y -1 is the inverse matrix of the second matrix.

[0059] The linear operation performed on the first matrix and the second matrix in the TEE is a multiplication or division operation, which is very inefficient. To improve the efficiency of the linear operation on the first matrix and the second matrix, the linear operation can be outsourced to the linear operation device 102, and the linear operation device 102 can be requested to perform the linear operation.

[0060] During implementation, the security processing device 101 is used to confuse the data elements included in the first matrix to obtain a third matrix, and to confuse the data elements included in the second matrix to obtain a fourth matrix based on multiple confusion vectors in the TEE, where the confusion vector includes multiple random numbers; and to send a linear operation request to the linear operation device 102, where the linear operation request includes the third matrix and the fourth matrix.

[0061] The linear operation device 102 is used to receive the linear operation request, perform a linear operation on the third matrix and the fourth matrix included in the linear operation request to obtain a first operation result, where the linear operation includes one or more of the following: a multiplication operation between the third matrix and the fourth matrix, or a division operation between the third matrix and the fourth matrix; and send a linear operation response to the security processing device 101, where the linear operation response includes the first operation result.

[0062] The security processing device 101 is used to receive the linear operation response, and obtain a second operation result in the TEE based on the multiple confusion vectors and the first operation result, where the second operation result is a linear operation result between the first matrix and the second matrix.

[0063] Sending the obfuscated third and fourth matrices to the linear operation device 102 can prevent the leakage of the first and second matrices, or prevent attackers from accessing the first and second matrices, thereby improving data security. The linear operation device 102 performs linear operations on the third and fourth matrices very efficiently, quickly obtaining the first operation result. The security processing device 101 quickly receives the first operation result and obtains the second operation result based on the multiple obfuscated vectors and the first operation result, thereby improving the efficiency of obtaining the second operation result, that is, improving the efficiency of the linear operation.

[0064] 2 , the present application provides a network architecture 200, which includes a cloud service system 100 and a terminal device 103. The security processing device 101 can communicate with the terminal device 103. Optionally, the network architecture 200 includes one or more terminal devices 103.

[0065] The terminal device 103 is configured to send a data processing request to the security processing device 101 , where the data processing request includes first data and second data (eg, a first matrix and a second matrix).

[0066] The secure processing device 101 is further configured to receive the data processing request, and input the first data and the second data included in the data processing request into the TEE.

[0067] In some embodiments, the above-mentioned first matrix (or second matrix) may be a picture or a parameter of an artificial intelligence (AI) model, etc. When the first matrix is ​​a picture, each data element in the first matrix (or second matrix) may be a pixel value in the picture, etc. When the first matrix (or second matrix) is a parameter of an AI model, each data element in the first matrix (or second matrix) may be a different parameter of the AI ​​model.

[0068] In some embodiments, the network architecture 200 can be applied to scenarios for AI model training.

[0069] In the AI ​​model training scenario, the first matrix is ​​the training data used to train the AI ​​model, and the second matrix is ​​the parameters of the AI ​​model. The data processing request sent by the terminal device 103 to the security processing device 101 can be a model training request. The model training request includes at least one training sample, each of which includes training data and label information. That is, each training sample includes the first matrix and label information. The second matrix is ​​the parameters of the AI ​​model. During the training process of the AI ​​model, the parameters of the AI ​​model are continuously optimized and adjusted. Therefore, the second matrix is ​​not fixed but is constantly changing data.

[0070] In some embodiments, the network architecture 200 can be applied to scenarios where data reasoning is performed.

[0071] In a data inference scenario, an AI model has been trained. The first matrix represents the data that the AI ​​model needs to infer, and the second matrix represents the parameters of the AI ​​model. The data processing request sent by the terminal device 103 to the secure processing device 101 can be a data inference request that includes the first matrix. The second matrix represents the parameters of the AI ​​model, and the second matrix is ​​fixed data.

[0072] In some embodiments, the linear operation device 102 includes at least one graphics processing unit (GPU) and other components. The GPU is very efficient in performing multiplication and division operations between two matrices, so the linear operation device 102 is very efficient in performing linear operations on matrices.

[0073] In some embodiments, the secure processing device 101 and the linear computing device 102 are two different devices in the cloud service system 100, or the secure processing device 101 and the linear computing device 102 are integrated on the same device and are two different components of the same device. For example, the secure processing device 101 is a processor including a TEE on the device, and the linear computing device 102 is at least one GPU on the device.

[0074] 3 , the present application provides a method 300 for processing data, which is applied to the network architecture 200 shown in FIG2 . The method 300 includes the following process.

[0075] Step 301: The terminal device sends a data processing request to a security processing device. The data processing request includes first data and second data to be processed.

[0076] In some embodiments, the first data may be training data for training an AI model, and the second data is a parameter of the AI ​​model; or, the first data is data that requires AI model inference, and the second data is a parameter of the AI ​​model.

[0077] Step 302: The secure processing device receives a data processing request sent by the terminal device, and inputs the first data and the second data included in the data processing request into the TEE.

[0078] After the first data and the second data are input into the TEE, the first data can be obfuscated in the TEE based on multiple obfuscation vectors to obtain third data corresponding to the first data, and the second data can be obfuscated to obtain fourth data corresponding to the second data, where each obfuscation vector includes multiple random numbers.

[0079] Step 303: The security processing device sends a linear operation request to the linear operation device, where the linear operation request includes third data corresponding to the first data and fourth data corresponding to the second data.

[0080] Since the third data and the fourth data are obtained by obfuscating the first data and the second data respectively, an attacker cannot obtain the first data and the second data from the third data and the fourth data included in the linear operation request, thereby improving data security.

[0081] Step 304: The linear operation device receives the linear operation request, performs a linear operation on the first data and the second data included in the linear operation request, and obtains a first operation result.

[0082] Step 305: The linear operation device sends a linear operation response to the security processing device, where the linear operation response includes a first operation result.

[0083] Step 306: The secure processing device receives the linear operation response, and inputs the first operation result included in the linear operation response into the TEE.

[0084] In the TEE, a second operation result corresponding to the first operation result is obtained based on the first operation result and the multiple confusion vectors, where the second operation result is a linear operation result between the first data and the second data.

[0085] Step 307: The security processing device sends a data processing response to the terminal device, where the data processing response includes a second operation result corresponding to the first operation result.

[0086] Step 308: The terminal device receives the data processing response and obtains a second operation result from the data processing response.

[0087] In an embodiment of the present application, since the TEE is a trusted execution environment, the data in the TEE will not be leaked or accessed by attackers, and the linear operation device performs linear operations on the data very efficiently. Therefore, the security processing device inputs the first data and the second data sent by the terminal device into the TEE, processes the first data and the second data into third data corresponding to the first data and fourth data corresponding to the second data, respectively, in the TEE, and sends the third data and the fourth data to the linear operation device. When the linear operation device performs linear operations on the third data and the fourth data, it avoids leaking the first data and the second data, and sends the first operation result obtained by the linear operation to the security processing device. The security processing device inputs the first operation result into the TEE, processes the first operation result into the second operation result in the TEE, and sends the second operation result to the terminal device. Because the trusted execution environment provided by the TEE can prevent the leakage of the first data, the second data, and the first operation result, the first data and the second data are processed into the third data and the fourth data, respectively, in the TEE, and the linear operation device performs linear operations on the third data and the fourth data. This can prevent the leakage of the first data and the second data, and can also improve the efficiency of the linear operation, thereby improving the efficiency of data processing and the security of data processing.

[0088] Referring to FIG4 , the present application provides a method 400 for processing data, which is applied to the cloud service system 100 shown in FIG1 or the network architecture 200 shown in FIG2 . Method 400 is executed in a TEE and is described using an example in which the first data includes a first matrix and the second data includes a second matrix. Method 400 includes the following process.

[0089] Step 401: Obtain a first matrix and a second matrix, where the first matrix and the second matrix are data that require linear operations in the TEE.

[0090] In some embodiments, the first matrix has m rows and n columns, the second matrix has n rows and s columns, and m, n, and s are all integers greater than 1, that is, the first matrix is ​​a matrix with m rows and n columns, and the second matrix is ​​a matrix with n rows and s columns.

[0091] The linear operation performed on the first matrix and the second matrix may be a multiplication operation between the first matrix and the second matrix or a division operation between the first matrix and the second matrix.

[0092] In some embodiments, the first matrix and / or the second matrix may be data in a secure processing device, which inputs the first matrix and the second matrix into the TEE. Alternatively, the first matrix and / or the second matrix may be data received by the secure processing device from a terminal device, which inputs the received first matrix and / or second matrix into the TEE.

[0093] For example, in the scenario of AI model training, the first matrix is ​​the training data for training the AI ​​model, and the second matrix is ​​the parameters of the AI ​​model. The terminal device sends a model training request to the security processing device. The model training request includes the first matrix and the second matrix. The first matrix is ​​the training data, and the second matrix is ​​the parameters of the AI ​​model. Optionally, the model training request also includes label information. The security processing device receives the model training request and inputs the first matrix and the second matrix included in the model training request into the TEE. Or,

[0094] The TEE includes the AI ​​model, that is, the TEE includes the second matrix. The terminal device sends a model training request to the secure processing device. The model training request includes the first matrix, which is training data. Optionally, the model training request also includes label information. The secure processing device receives the model training request and inputs the first matrix included in the model training request into the TEE.

[0095] For another example, in a data inference scenario, an AI model has been trained, the first matrix is ​​the data that needs to be inferred by the AI ​​model, and the second matrix is ​​the parameter of the AI ​​model. The terminal device sends a data inference request to the security processing device, and the data inference request includes the first matrix and the second matrix. The security processing device receives the data inference request and inputs the first matrix and the second matrix included in the data inference request into the TEE. Or,

[0096] The TEE includes the trained AI model, that is, the TEE includes the second matrix. The terminal device sends a data inference request to the secure processing device, where the data inference request includes the first matrix. The secure processing device receives the data inference request and inputs the first matrix included in the data inference request into the TEE.

[0097] In some embodiments, before a terminal device sends the first matrix and / or the second matrix to the secure processing device, the terminal device and the secure processing device negotiate a shared key. The terminal device then encrypts the first matrix and / or the second matrix using a symmetric encryption algorithm based on the shared key to obtain ciphertext, and sends a data processing request including the ciphertext to the secure processing device. The secure processing device receives the data processing request and decrypts the ciphertext using a symmetric decryption algorithm based on the shared key to obtain the first matrix and / or the second matrix.

[0098] In some embodiments, the shared key includes a first part and a second part. The secure processing device starts the TEE, and the terminal device uses remote authentication to request authentication from the secure processing device. After the secure processing device authenticates the terminal device in the TEE, the terminal device negotiates a shared key with the secure processing device. The process of negotiating the shared key can be:

[0099] The terminal device generates the first part and sends it to the secure processing device. The secure processing device generates the second part in the TEE, receives the first part from the terminal device, inputs the first part into the TEE, combines the first and second parts into a shared key, and sends the second part to the terminal device. The terminal device receives the second part and combines the first and second parts into a shared key.

[0100] In some embodiments, after obtaining the first matrix and the second matrix, the data elements with a value of 0 included in the first matrix and the data elements with a value of 0 included in the second matrix may be replaced with a first real number that is not equal to 0.

[0101] The first and second matrices may contain a large number of zeros. If these zeros are not replaced with the first real number, an attacker can easily infer that the first and second matrices contain a large number of zeros, posing a risk to data security. Replacing both the data elements with a value of zero in the first matrix and the data elements with a value of zero in the second matrix with the first real number eliminates this risk and improves data security.

[0102] In some embodiments, the first real number is greater than or equal to -2 -R and less than or equal to 2 -R Any non-zero real number in the range of , R is a system parameter greater than 0.

[0103] Step 402: Based on a plurality of confusion vectors, obfuscate the data elements of the first matrix to obtain a third matrix, and obfuscate the data elements of the second matrix to obtain a fourth matrix, wherein the confusion vectors include a plurality of random numbers.

[0104] The multiple obfuscation vectors include a first obfuscation vector, a second obfuscation vector, and a third obfuscation vector. The first obfuscation vector includes m data elements, the second obfuscation vector includes n data elements, and the third obfuscation vector includes s data elements. The m data elements included in the first obfuscation vector, the n data elements included in the second obfuscation vector, and the s data elements included in the third obfuscation vector are all random numbers. A random number is a randomly selected value.

[0105] In some embodiments, the m random numbers included in the first obfuscation vector are all random real numbers, the n random numbers included in the second obfuscation vector are all random real numbers, and the s random numbers included in the third obfuscation vector are also all random real numbers. Alternatively, the m random numbers included in the first obfuscation vector are all random non-zero real numbers, the n random numbers included in the second obfuscation vector are all random non-zero real numbers, and the s random numbers included in the third obfuscation vector are also all random non-zero real numbers. In this way, using these multiple obfuscation vectors can better obfuscate and hide the data elements in the first matrix and the second matrix, thereby improving data security.

[0106] Before executing step 402, it is necessary to obtain multiple confusion vectors.

[0107] In some embodiments, the multiple obfuscation vectors stored in the TEE of the secure processing device may be obtained, where the multiple obfuscation vectors stored in the TEE are the obfuscation vectors generated last time.

[0108] In some embodiments, a plurality of confusion vectors are generated based on the first matrix and the second matrix.

[0109] Since the multiple confusion vectors are generated based on the first matrix and the second matrix, different confusion vectors are used for linear operations on different matrices, making it difficult for an attacker to infer the multiple confusion vectors, the first matrix, and the second matrix from the obfuscated matrices, thereby improving data security.

[0110] The multiple confusion vectors may be generated through the following operations 4021-4022.

[0111] 4021: Obtain a real number range based on the first matrix and the second matrix, where the real number range includes multiple non-zero real numbers.

[0112] In 4021 , a maximum absolute value is selected from the absolute value of each data element included in the first matrix and the absolute value of each data element included in the second matrix.

[0113] Then, a real number range is obtained based on the maximum absolute value, where the lower limit of the real number range is -2. L / 2 , the upper limit of this real number range is 2 L / 2 ,exist When it is an even number, MAX is the maximum absolute value, For the rounding operation, When is an odd number,

[0114] In some embodiments, a value greater than or equal to -2 may be obtained. L / 2 and less than or equal to 2 L / 2The range of , the intersection of this range and each real number not equal to zero, is obtained, which does not include 0 and is greater than or equal to -2 L / 2 and less than or equal to 2 L / 2 The real number range, each value included in the real number range is a non-zero real number.

[0115] 4022: Randomly select from the real number range m random numbers included in the first obfuscation vector, n random numbers included in the second obfuscation vector, and s random numbers included in the third obfuscation vector.

[0116] In step 402, the following two methods may be used to confuse the data elements included in the first matrix and the data elements included in the second matrix based on the multiple confusion vectors.

[0117] 5 , in the first approach, multiple confusion vectors are used to confuse the specific values ​​of the data elements in the first matrix with the specific values ​​of the data elements in the second matrix. This can be achieved through the following operations 11 to 12.

[0118] 11: Based on the first confusion vector and the second confusion vector, confuse the first matrix to obtain a third matrix.

[0119] Among them, X is used to represent the first matrix, Y is used to represent the second matrix, and X is used to represent the 1 Denote the third matrix, use O to denote the first confusion vector, use P to denote the second confusion vector, and use Q to denote the third confusion vector.

[0120] The third matrix X 1 The data element in row i and column j is X 1 i,j =X i , j +O i *P j . i=1, 2, 3, ..., m, j=1, 2, 3, ..., n, X i , j is the data element in the i-th row and j-th column of the first matrix X, O i is the i-th data element of the first confusion vector O, P j is the j-th data element of the second confusion vector P.

[0121] 12: Based on the second confusion vector and the third confusion vector, confuse the second matrix to obtain a fourth matrix.

[0122] Among them, use Y 1 Represents the fourth matrix, the fourth matrix Y 1 The data element in row i and column j is Y 1 i,j =Y i,j +Pi *Q j . i=1, 2, 3, ..., n, j=1, 2, 3, ..., s, Y i , j is the data element in the i-th row and j-th column of the second matrix Y, P i is the i-th data element of the second confusion vector P, Q j is the j-th data element of the third confusion vector Q.

[0123] Referring to FIG6 , in a second method, multiple permutation vectors are used to transform the positions of the data elements in the first matrix to obtain a fifth matrix, and the positions of the data elements in the second matrix are transformed to obtain a sixth matrix. Subsequently, multiple obfuscation vectors are used to obfuscate the specific values ​​of the data elements in the fifth matrix with the specific values ​​of the data elements in the sixth matrix. This can be achieved through the following operations 21 to 23.

[0124] 21: Get multiple permutation vectors based on m, n and s.

[0125] The plurality of permutation vectors include a first permutation vector, a second permutation vector, and a third permutation vector.

[0126] The first permutation vector includes m different data elements, where each data element is an integer greater than or equal to 1 and less than or equal to m. In other words, the first permutation vector is generated by shuffling the positions of the m integers from 1 to m. For example, if m = 8, the first permutation vector is generated by shuffling the positions 1, 2, 3, 4, 5, 6, 7, and 8. For example, the first permutation vector is [1, 3, 4, 8, 2, 5, 7, 6].

[0127] The second permutation vector includes n different data elements, where each data element in the second permutation vector is an integer greater than or equal to 1 and less than or equal to n. In other words, the second permutation vector is generated by shuffling the positions of n integers from 1 to n. For example, if n = 6, the second permutation vector is generated by shuffling the positions 1, 2, 3, 4, 5, and 6. For example, the second permutation vector is [6, 2, 5, 1, 3, 4].

[0128] The third permutation vector includes s different data elements, each of which is an integer greater than or equal to 1 and less than or equal to s. That is, the third permutation vector is generated by shuffling the positions of the s integers from 1 to s. For example, if s = 10, the third permutation vector is generated by shuffling the positions of 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10. For example, the second permutation vector is [7, 9, 4, 1, 3, 2, 5, 8, 10, 6].

[0129] 22: Transform the positions of the data elements included in the first matrix based on the multiple permutation vectors to obtain a fifth matrix, and transform the positions of the data elements included in the second matrix to obtain a sixth matrix.

[0130] In some embodiments, the positions of the data elements included in the first matrix are transformed based on the first permutation vector and the second permutation vector to obtain a fifth matrix.

[0131] Use A to represent the first permutation vector, use B to represent the permutation vector, and use X 2 Represents the fifth matrix. The fifth matrix X 2 The data element X in row i and column j 2 i,j =X A(i),B(j) , i = 1, 2, 3, ..., m, j = 1, 2, 3, ..., n, A(i) represents the i-th data element in the first permutation vector A, and B(j) represents the j-th data element in the second permutation vector B.

[0132] For example, if i=2, j=3, A(2) is the second data element 3 in the first permutation vector A, and B(3) is the third data element 5 in the second permutation vector B. In other words, the fifth matrix X 2 The data element in the 2nd row and 3rd column of is the data element in the 3rd row and 5th column of the first matrix X, that is, X 2 2,3 =X 3,5 , thereby changing the positions of the data elements in the first matrix X.

[0133] In some embodiments, the sixth matrix is ​​obtained by transforming positions of data elements included in the second matrix based on the second permutation vector and the third permutation vector.

[0134] Use C to represent the third permutation vector and Y 2 Represents the sixth matrix. The sixth matrix Y 2 The data element Y in row i and column j 2 i,j =X B(i),C(j) , i = 1, 2, 3, ..., n, j = 1, 2, 3, ..., s, B(i) represents the i-th data element in the second permutation vector B, and C(j) represents the j-th data element in the third permutation vector C.

[0135] For example, if i=3, j=5, B(3) is the third data element 5 in the second permutation vector B, and C(5) is the fifth data element 3 in the third permutation vector C. That is, the sixth matrix Y 2 The data element of the 3rd row and 5th column of is the data element of the 5th row and 3rd column of the second matrix Y, that is, Y2 3,2 =Y 5,3 , thereby changing the positions of the data elements in the second matrix Y.

[0136] 23: Based on the multiple confusion vectors, confuse the data elements included in the fifth matrix to obtain a third matrix, and confuse the data elements included in the sixth matrix to obtain a fourth matrix.

[0137] In some embodiments, the fifth matrix is ​​obfuscated based on the first obfuscation vector and the second obfuscation vector to obtain a third matrix.

[0138] The third matrix X 1 The data element in row i and column j is X 1 i,j =X 2 i , j +O i *P j =X A(i),B(j) +O i *P j . i=1, 2, 3, ..., m, j=1, 2, 3, ..., n, O i is the i-th data element of the first confusion vector O, P j is the j-th data element of the second confusion vector P.

[0139] In some embodiments, based on the second confusion vector and the third confusion vector, the sixth matrix is ​​obfuscated to obtain a fourth matrix.

[0140] The fourth matrix Y 1 The data element in row i and column j is Y 1 i,j =Y 2 i,j +P i *Q j =Y B(i),C(j) +P i *Q j . i=1, 2, 3, ..., n, j=1, 2, 3, ..., s, P i is the i-th data element of the second confusion vector P, Q j is the j-th data element of the third confusion vector Q.

[0141] Before obfuscating the first and second matrices, the data elements in the first and second matrices are shuffled to obtain the fifth and sixth matrices. Multiple obfuscation vectors are then used to obfuscate the fifth and sixth matrices to obtain the third and fourth matrices. This makes it even more difficult for an attacker to infer the first and second matrices from the third and fourth matrices, making the first and second matrices more secure.

[0142] Step 403: Request a linear operation device to perform a linear operation on the third matrix and the fourth matrix to obtain a first operation result.

[0143] The linear operation includes one or more of the following: a multiplication operation between the third matrix and the fourth matrix, or a division operation between the third matrix and the fourth matrix.

[0144] In step 403, the security processing device sends a linear operation request to the linear operation device. The linear operation request includes identification information of the linear operation, the third matrix, and the fourth matrix.

[0145] The linear security device receives the linear operation request, determines the linear operation based on the identification information, performs the linear operation on the third matrix and the fourth matrix to obtain a first operation result, and sends a linear operation response to the security processing device, where the linear operation response includes the first operation result.

[0146] The secure processing device receives the linear operation response, and inputs the first operation result included in the linear operation response into the TEE.

[0147] In some embodiments, the linear operation device includes at least one GPU, and the linear operation device uses the at least one GPU to perform the linear operation on the third matrix and the fourth matrix.

[0148] If the linear operation is a multiplication operation between the third matrix and the fourth matrix, the third matrix is ​​multiplied by the fourth matrix to obtain a first operation result.

[0149] If the linear operation is a division operation between the third matrix and the fourth matrix, the inverse matrix of the fourth matrix is ​​calculated, and the third matrix is ​​multiplied by the inverse matrix of the fourth matrix to obtain the first operation result.

[0150] Step 404: Obtain a second operation result based on the multiple confusion vectors and the first operation result, where the second operation result is a linear operation result between the first matrix and the second matrix.

[0151] The first operation result and the second operation result are also matrices.

[0152] In the case where the third matrix and the fourth matrix are obtained by confusion using the above method, the second operation result Z=Z 1 -S, S=(X+O T *P)*P T *Q+O T *(P*Y), Z 1 is the first operation result, O T is the transposed vector of the first confusion vector, P T is the transposed vector of the second confusion vector.

[0153] In the case where the third matrix and the fourth matrix are obtained by confusion using the above-mentioned method 2, the positions of the data elements in the first operation result are transformed based on the multiple permutation vectors to obtain the third operation result, and the second operation result is obtained based on the multiple confusion vectors and the third operation result.

[0154] Using Z 2 Indicates the result of the third operation. The data element in the i-th row and j-th column of the third operation result is Z 2 i,j =Z 1 A -1 (i),C -1 (i) , A -1 (i) is the i-th data element in the inverse vector of the first permutation vector A, C -1 (j) is the jth data element in the inverse vector of the third permutation vector C, and the second operation result Z=Z 2 -S=Z 2 -(X+O T *P)*P T *Q+O T *(P*Y).

[0155] Among them, S is the multiplication of a matrix and a vector. The computational complexity of the multiplication of a matrix and a vector is low. S can be calculated quickly in the TEE of the security processing device, that is, the second operation result Z can be calculated quickly, thereby improving the efficiency of linear operations.

[0156] In some embodiments, the method 400 may be a linear operation step in the model training process. After obtaining the second operation result, the security processing device continues to execute the remaining steps in the model training process based on the second operation result.

[0157] In some embodiments, the method 400 may be a linear operation step in the data reasoning process. After obtaining the second operation result, the security processing device continues to execute the remaining steps in the data reasoning process based on the second operation result.

[0158] Next, let's take an example where the secure processing device is a server, the terminal device is a client, and the TEE in the server is an SGX environment. This example may include the following steps S1-S3.

[0159] S1: Authentication and shared key establishment in the SGX environment. Optionally, the server enables the SGX environment; the client uses remote authentication to authenticate the server's SGX environment through the server software and establish a shared key with the server's SGX environment.

[0160] During implementation, step S1 can be implemented through the following operations S11-S18.

[0161] S11: The client generates a pair of public and private keys, which include a public key Pk and a private key Sk. The format of the public key Pk is the 256-bit elliptic curve public key format (sgx_ec256_public_t) defined by SGX, applies for a service provider identity (SPID) from the attestation service for SGX (AS), and then sends a request to the server, requesting the public key Pk.

[0162] S12: The server receives the client's request, saves the public key Pk included in the request, calls the sgx_get_extended_epid_group_id function in the SGX application programming interface (API), obtains the group ID (ExGID) of the server's enhanced privacy ID (EPID), and the format of the ExGID is unsigned 32 bits; and returns Msg_0 (message 0) containing the ExGID to the client.

[0163] S13: The client software receives Msg_0 from the server and extracts the ExGID from Msg_0. When the ExGID is 0, it indicates that the server supports EPID authentication and key establishment. The client executes S14 as follows.

[0164] When the ExGID is not 0, the client exits the connection and ends the operation.

[0165] S14: The server calls the sgx_ra_init function in the SGX API with the saved public key Pk as input to create a context for the SGX environment authentication and key establishment process, and returns the context content in the format of the SGX context type (sgx_ra_context_t). The sgx_ra_get_msg1 function in the SGX API provided by Intel is called with the content as input, and returns Msg_1 (message 1), where Msg1 contains G_a and GID; G_a is the server's elliptic curve Diffie–Hellman key exchange (ECDH) public key named P-256 defined by the National Institute of Standards and Technology (NIST), and GID is the group identity assigned by the server for the EPID authentication method; the server sends Msg_1 to the client, and Msg_1 includes G_a||GID to the client, where the "||" symbol indicates bit string concatenation.

[0166] S15: The client receives Msg_1 sent by the server, extracts G_a and GID, and sends GID to AS; enables AS to query the signature revocation list (SigRL) based on GID and returns SigRL to the client; the client generates a temporary ECDH public key G_b and private key priv_key based on the NIST P-256 elliptic curve, calculates the negotiated key dh_key = priv_key * G_a; then uses the AES-128CMAC algorithm, uses dh_key as the key, and uses "0x01||'SMK'||0x00||0x80||0x00" as the message to calculate the derived key SMK; sets the quote type to quote_type = 0x1, indicating that the client can verify from the server's two signatures whether they are from the same server's TEE environment; sets the key derivation function ID (KDF_ID) to 0x1, indicating that the AES-128CMAC algorithm is used; the client software uses the private key Sk to use the elliptic curve digital signature algorithm (elliptic The message "G_b||SPID||quote_type|(|KDF_ID|)|Sig_(Ga_Gb)" is signed using the ECDSA (Electronic Curve Digital Signature Algorithm) to obtain the signature value Sig_(Ga_Gb). The derived key SMK is used to calculate the check value MAC for the message "G_b||SPID||quote_type|(|KDF_ID|)|Sig_(Ga_Gb)" using the AES-128CMAC algorithm. The message Msg_2 is constructed. Msg_2 is G_b||SPID||quote_type|(|KDF_ID|)|Sig_(Ga_Gb)|(|MAC|)|SigRL_size||SigRL, where SigRL_size is the size of the signature revocation list. Finally, the message Msg_2 is sent to the server.

[0167] S16: The server receives Msg_2 and uses it as a parameter to call the sgx_ra_proc_msg2 function in the SGX API to process Msg_2; this function mainly completes the following tasks: 1. Verify the client's signature using Pk; 2. Check SigRL; 3. Generate Msg_3. Message Msg_3 contains a quote used to prove the SGX security environment. The quote includes the measurement value of the current SGX enclave, the signature value obtained by signing the enclave with the platform's EPID private key, information about the platform service enclave (PSE), and a checksum of the negotiated key. In addition to the quote, Msg_3 also includes a message checksum MAC, which is calculated by using the SMK key to perform an AES-128 CMAC algorithm on the message "G_a||ps_sec_prop||quote", where ps_sec_prop is a security property of the SGX platform service. Msg_3 is constructed, and Msg_3 is mac||G_a||ps_sec_prop||quote. Msg_3 is sent to the client.

[0168] S17: The client receives Msg_3 and performs the following operations: 1. Compares G_a with G_a in Msg_1 to see if they are the same; 2. Verifies the MAC field in Msg_3 using the SMK; 3. Verifies the checksum associated with the negotiated key of the referenced content in Msg_3; 4. The client submits the referenced content to the IAS; the IAS verifies the validity of the referenced content using the signature of the reference and returns a signed report to the client; the client verifies the validity of this report using the IAS's public key and obtains the report content; 5. Verifies the validity of the report on the enclave status in the report content; 6. Verifies the measurement values ​​in the referenced content to confirm that the code and data in the enclave are consistent; 7. Generates the shared key SK in a similar manner to the SMK. The internal message is now "0x01||'SK'||0x00||0x80||0x00", and the algorithm is still the AES-128 CMAC algorithm; 8. Generates Msg_4 as a response and returns it to the server.

[0169] S18: The server receives Msg_4 and continues the subsequent process.

[0170] S2: Data injection. The client encrypts the training data using the shared key SK and the AES-128GCM symmetric encryption algorithm to obtain ciphertext, which is then transmitted to the server. The server inputs the ciphertext into the SGX environment, where it is decrypted to obtain the user-injected training data.

[0171] S3: Model training: The server receives user-injected training data in the SGX environment. This training data is then used to train the AI ​​model. During training, two matrices requiring linear operations are outsourced to the GPU. The server's SGX environment collects the GPU's computational results and completes the training.

[0172] Among them, the linear operation operations in the model training in the SGX environment may include the following S31-S34 operations.

[0173] The AI ​​model is a convolutional neural network. When calculating convolution, the data and the convolution kernel are formed into a matrix for outsourced calculation. Suppose that in one calculation, the data forms a matrix of 500*600 dimensions, while the matrix formed by the convolution kernel is of 600*700 dimensions.

[0174] S31: Outsource the first matrix X (a 500×600 matrix) and the second matrix Y (a 600×700 matrix) in the SGX environment.

[0175] First, set R=7, and randomly select a value greater than or equal to -2. -7 and less than or equal to 2 -7 Randomly select a real number not equal to 0 in the interval as the first real number, replace the value 0 in the first matrix X and the second matrix Y with the first real number. Then select the maximum absolute value MAX from the absolute values ​​of the data elements in the first matrix X and the absolute values ​​of the data elements in the second matrix Y. Assume that the maximum absolute value MAX = 6. In this way,

[0176] Then, a real number range including non-zero real numbers is obtained based on the value 4, and the real number range is greater than or equal to -2 L / 2 and less than or equal to 2 L / 2 The range is , that is, the real number range is a non-zero real number range greater than or equal to -4 and less than or equal to 4. Three sets of random obfuscation vectors are randomly selected from the real number range, namely, a first obfuscation vector O, a second obfuscation vector P, and a third obfuscation vector Q. A first permutation vector A with a dimension of 500, a second permutation vector B with a dimension of 600, and a third permutation vector C with a dimension of 700 are randomly generated, thereby obtaining a one-time key of (O, P, Q, A, B, C).

[0177] An example of three random permutation vectors is as follows:

[0178] A=(430, 468, 390, 452, 247, 479, 278, 352, 388, 343, ..., 84, 183, 87, 48, 53, 108, 60, 221, 219, 42),

[0179] B=(340, 286, 260, 451, 512, 365, 415, 354, 325, 16,..., 29, 240, 8, 227, 22, 44, 239, 145, 235, 59),

[0180] C=(364, 374, 302, 501, 353, 60, 324, 382, ​​279, 676, ..., 692, 63, 5, 215, 25, 93, 177, 11, 143, 247).

[0181] S32: Compute the third matrix X using a one-time key in an SGX environment 1 , where the third matrix X 1 The data element X in row i and column j 1 i,j =X A(i),B(j) +O i *P j , X is the first matrix. Similarly calculate the fourth matrix Y 1 , where the fourth matrix Y 1 The data element Y in row i and column j 1 i,j =Y B(i),C(j) +P i *Q j , Y is the second matrix. The third matrix X 1 and the fourth Y 1 Outsource to GPU computing.

[0182] S33: GPU calculates the first operation result Z 1 =X 1 *Y 1 , and the first operation result Z 1 Return to the SGX environment.

[0183] S34: Calculate the second operation result Z in the SGX environment, where the data element Z in the i-th row and j-th column of the second operation result Z is (i,j) =Z 2 i,j -S=Z 1 A -1 (i),C -1 (i) -S=Z 1 A -1 (i),C -1 (i) -(X+O T *P)*P T *Q+O T *(P*Y).

[0184] In an embodiment of the present application, for the first matrix and the second matrix that require linear operations in the TEE, multiple confusion vectors are obtained based on the first matrix and the second matrix. This ensures that linear operations are performed on different matrices to obtain different confusion vectors. The confusion vectors are used to confuse the first matrix and the second matrix, making the obtained third matrix and fourth matrix more secure and reliable. The third matrix and the fourth matrix are sent to a linear operation device, which is dedicated to linear operations and can perform linear operations on the third matrix and the fourth matrix to obtain a first operation result. The first operation result returned by the linear operation device is received, and the first operation result is obtained based on the multiple confusion vectors and the first operation result, thereby improving the efficiency of the linear operation.

[0185] Referring to Figure 7, the present application provides a device 700 for processing data, which is deployed on the secure processing device 101 of the cloud service system 100 shown in Figure 1 or Figure 2, and the device 700 is deployed on the secure processing device of the method 300 shown in Figure 3 or the method 400 shown in Figure 4.

[0186] The apparatus 600 is applied to a secure processing device included in the cloud service system 100, the secure processing device including a trusted execution environment TEE, and the cloud service system 100 also including a linear computing device. The apparatus 600 includes:

[0187] A receiving unit 701 is configured to receive a data processing request sent by a terminal device, where the data processing request includes first data and second data to be processed;

[0188] A processing unit 702 is configured to input the first data and the second data into the TEE;

[0189] A sending unit 703 is configured to send a linear operation request to a linear operation device, where the linear operation request includes third data corresponding to the first data and fourth data corresponding to the second data in the TEE;

[0190] The receiving unit 701 is further configured to receive a linear operation response sent by the linear operation device, where the linear operation response includes a first operation result, where the first operation result is a linear operation result between the third data and the fourth data;

[0191] The processing unit 702 is further configured to input the first operation result into the TEE;

[0192] The sending unit 703 is further used to send a data processing response to the terminal device, where the processing response includes a second operation result in the TEE corresponding to the first operation result, where the second operation result is a linear operation result between the first data and the second data.

[0193] Optionally, the detailed implementation process of the receiving unit 701 receiving the data processing request sent by the terminal device can be found in the relevant content of step 302 of the method 300 shown in FIG3 , which will not be described in detail here.

[0194] Optionally, the detailed implementation process of the processing unit 702 inputting the first data and the second data into the TEE refers to the relevant content in step 302 of the method 300 shown in Figure 3, which is not described in detail here.

[0195] Optionally, the detailed implementation process of the sending unit 703 sending the linear operation request to the linear operation device refers to the relevant content in step 303 of the method 300 shown in FIG3 , which will not be described in detail here.

[0196] Optionally, the detailed implementation process of the receiving unit 701 receiving the linear operation response can be found in the relevant content of step 306 of the method 300 shown in FIG3 , and will not be described in detail here.

[0197] Optionally, the detailed implementation process of the processing unit 702 inputting the first operation result into the TEE refers to the relevant content in step 306 of the method 300 shown in Figure 3, which is not described in detail here.

[0198] Optionally, the detailed implementation process of the sending unit 703 sending the data processing response to the terminal device refers to the relevant content in step 307 of the method 300 shown in Figure 3, and will not be described in detail here.

[0199] Optionally, the first data is training data for training an artificial intelligence (AI) model, and the second data is a parameter of the AI ​​model; or, the first data is data that requires AI model inference, and the second data is a parameter of the AI ​​model.

[0200] Optionally, the first data includes a first matrix, the second data includes a second matrix, and the processing unit 702 is further configured to:

[0201] In the TEE, based on multiple confusion vectors, data elements included in the first matrix are obfuscated to obtain a third matrix, and data elements included in the second matrix are obfuscated to obtain a fourth matrix. The confusion vectors include multiple random numbers, the third data include the third matrix, and the fourth data include the fourth matrix.

[0202] Optionally, the detailed implementation process of the processing unit 702 confusing the data elements included in the first matrix to obtain the third matrix, and confusing the data elements included in the second matrix to obtain the fourth matrix, can be found in the relevant content of step 402 of the method 400 shown in FIG4 , and will not be described in detail here.

[0203] Optionally, the first operation result is a result obtained by multiplying the third matrix and the fourth matrix, or the first operation result is a result obtained by dividing the third matrix and the fourth matrix.

[0204] Optionally, the processing unit 702 is further configured to:

[0205] The plurality of confusion vectors are obtained based on the first matrix and the second matrix.

[0206] Optionally, the detailed implementation process of the processing unit 702 obtaining the multiple confusion vectors based on the first matrix and the second matrix refers to the relevant content in step 402 of the method 400 shown in Figure 4, which is not described in detail here.

[0207] Optionally, the number of rows of the first matrix is ​​m, the number of columns is n, the number of rows of the second matrix is ​​n, the number of columns is s, m, n and s are all integers greater than 1, the multiple confusion vectors include a first confusion vector, a second confusion vector and a third confusion vector, the first confusion vector includes m random numbers, the second confusion vector includes n random numbers, and the third confusion vector includes s random numbers.

[0208] The processing unit 702 is configured to:

[0209] acquiring a real number range based on the first matrix and the second matrix, where the real number range includes a plurality of non-zero real numbers;

[0210] M random numbers included in the first obfuscation vector, n random numbers included in the second obfuscation vector, and s random numbers included in the third obfuscation vector are randomly selected from the real number range.

[0211] Optionally, the detailed implementation process of the processing unit 7025 obtaining the real number range based on the first matrix and the second matrix can be found in the relevant content of step 4021 of the method 400 shown in FIG4 , and will not be described in detail here.

[0212] Optionally, the processing unit 702 randomly selects m random numbers from the real number range to obtain the first obfuscation vector, n random numbers included in the second obfuscation vector, and s random numbers included in the third obfuscation vector. For a detailed implementation process, please refer to the relevant content in step 4022 of the method 400 shown in Figure 4, and will not be described in detail here.

[0213] Optionally, the processing unit 702 is configured to:

[0214] Selecting a maximum absolute value from the absolute value of each data element included in the first matrix and the absolute value of each data element included in the second matrix;

[0215] The real number range is obtained based on the maximum absolute value, wherein the lower limit of the real number range is -2 L / 2 , the upper limit of this real number range is 2 L / 2 ,exist When it is an even number, MAX is the maximum absolute value, For the rounding operation, When is an odd number,

[0216] Optionally, the detailed implementation process of the processing unit 702 selecting the maximum absolute value can be found in the relevant content of step 4021 of the method 400 shown in FIG4 , which will not be described in detail here.

[0217] Optionally, the detailed implementation process of the processing unit 702 obtaining the real number range based on the maximum absolute value can be found in the relevant content of step 4021 of the method 400 shown in FIG4 , which will not be described in detail here.

[0218] Optionally, the processing unit 702 is configured to:

[0219] Based on the first confusion vector and the second confusion vector, the first matrix is ​​confused to obtain a third matrix;

[0220] Based on the second confusion vector and the third confusion vector, the second matrix is ​​confused to obtain a fourth matrix.

[0221] Optionally, the detailed implementation process of the processing unit 702 confusing the first matrix to obtain the third matrix can be found in the relevant content of step 402 of the method 400 shown in FIG4 , and will not be described in detail here.

[0222] Optionally, the detailed implementation process of the processing unit 702 confusing the second matrix to obtain the fourth matrix can be found in the relevant content of step 402 of the method 400 shown in FIG4 , and will not be described in detail here.

[0223] Optionally, the processing unit 702 is further configured to:

[0224] Get multiple permutation vectors;

[0225] Transforming positions of data elements included in the first matrix based on the multiple permutation vectors to obtain a fifth matrix, and transforming positions of data elements included in the second matrix to obtain a sixth matrix;

[0226] Based on the multiple confusion vectors, data elements included in the fifth matrix are confused to obtain a third matrix, and data elements included in the sixth matrix are confused to obtain a fourth matrix.

[0227] Optionally, the detailed implementation process of the processing unit 702 acquiring multiple replacement vectors can be found in the relevant content of step 402 of the method 400 shown in FIG4 , and will not be described in detail here.

[0228] Optionally, the processing unit 702 transforms the positions of the data elements included in the first matrix based on the multiple permutation vectors to obtain a fifth matrix, and transforms the positions of the data elements included in the second matrix to obtain a sixth matrix. For the detailed implementation process, please refer to the relevant content in step 402 of the method 400 shown in Figure 4, and will not be described in detail here.

[0229] Optionally, the processing unit 702 confuses the data elements included in the fifth matrix to obtain a third matrix based on the multiple confusion vectors, and confuses the data elements included in the sixth matrix to obtain a fourth matrix. For the detailed implementation process, please refer to the relevant content in step 402 of the method 400 shown in Figure 4, which will not be described in detail here.

[0230] Optionally, the multiple permutation vectors include a first permutation vector, a second permutation vector, and a third permutation vector, the first permutation vector includes m different data elements, each data element in the first permutation vector is an integer greater than or equal to 1 and less than or equal to m, the second permutation vector includes n different data elements, each data element in the second permutation vector is an integer greater than or equal to 1 and less than or equal to n, and the third permutation vector includes s different data elements, each data element in the third permutation vector is an integer greater than or equal to 1 and less than or equal to s. The processing unit 601 is configured to:

[0231] Transforming positions of data elements included in the first matrix based on the first permutation vector and the second permutation vector to obtain a fifth matrix;

[0232] The positions of the data elements included in the second matrix are transformed based on the second permutation vector and the third permutation vector to obtain a sixth matrix.

[0233] Optionally, the detailed implementation process of the processing unit 702 transforming the positions of the data elements included in the first matrix based on the first permutation vector and the second permutation vector to obtain the fifth matrix can be found in the relevant content of step 402 of the method 400 shown in Figure 4, which will not be described in detail here.

[0234] Optionally, the detailed implementation process of the processing unit 702 transforming the positions of the data elements included in the second matrix based on the second permutation vector and the third permutation vector to obtain the sixth matrix can be found in the relevant content of step 4302 of the method 400 shown in Figure 4, which will not be described in detail here.

[0235] Optionally, the processing unit 702 is further configured to:

[0236] The data elements of the first matrix with a value of 0 and the data elements of the second matrix with a value of 0 are replaced with a first real number, where the first real number is not equal to 0.

[0237] Optionally, the processing unit 702 replaces the data elements with a value of 0 included in the first matrix and the data elements with a value of 0 included in the second matrix with the first real number. For the detailed implementation process, please refer to the relevant content in step 401 of the method 400 shown in Figure 4, which will not be described in detail here.

[0238] The receiving unit 701, the processing unit 702, and the sending unit 703 can all be implemented by software or hardware. For example, the implementation of the processing unit 702 will be described below using the processing unit 702 as an example. Similarly, the implementation of the receiving unit 701 and the sending unit 703 can refer to the implementation of the processing unit 702.

[0239] As an example of a software functional unit, the processing unit 702 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the processing unit 702 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0240] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0241] As an example of a hardware functional unit, processing unit 702 may include at least one computing device, such as a server. Alternatively, processing unit 702 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0242] The multiple computing devices included in processing unit 702 can be distributed in the same region or in different regions. The multiple computing devices included in processing unit 702 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in processing unit 702 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0243] It should be noted that, in other embodiments, the receiving unit 701 can be used to perform any receiving step in the method provided in any of the above embodiments, the sending unit 703 can be used to perform any sending step in the method provided in any of the above embodiments, and the processing unit 702 can be used to perform any step in the method provided in any of the above embodiments except the receiving step and the sending step. The steps that the receiving unit 701, the processing unit 702, and the sending unit 703 are responsible for implementing can be specified as needed. The full functionality of the data processing device 700 is achieved by having the receiving unit 701, the processing unit 702, and the sending unit 703 respectively implement different steps in the method provided in any of the above embodiments.

[0244] In an embodiment of the present application, TEE is a trusted execution environment. The data in the TEE will not be leaked or accessed by attackers, and the linear operation device is very efficient in performing linear operations on the data. Therefore, the processing unit inputs the first data and the second data into the TEE, and the sending unit sends the third data corresponding to the first data and the fourth data corresponding to the second data to the linear operation device, so that when the linear operation device performs linear operations on the third data and the fourth data, the first data and the second data are avoided from leaking. The processing unit inputs the first operation result into the TEE, and the sending unit sends the second operation result to the terminal device. Since the trusted execution environment provided by the TEE can prevent the leakage of the first data, the second data and the first operation result, the first data and the second data are processed into the third data and the fourth data respectively in the TEE, and the linear operation device performs linear operations on the third data and the fourth data, which can prevent the leakage of the first data and the second data and improve the efficiency of the linear operation, thereby improving the efficiency of the data processing and the security of the data processing. In the case where the first data includes a first matrix and the second data includes a second matrix, since the confusion vector includes multiple random numbers, the confusion vector does not change regularly. Based on the multiple confusion vectors, the processing unit confuses the data elements included in the first matrix to obtain a third matrix, and confuses the data elements included in the second matrix to obtain a fourth matrix. Therefore, it is impossible to infer the first matrix and the second matrix from the third and fourth matrices. Therefore, when requesting the linear operation device to perform a linear operation on the third and fourth matrices, the leakage of the first and second matrices is avoided, thereby ensuring data security. Since the linear operation device is a device dedicated to performing linear operations, the linear operation device can quickly obtain the first operation result by performing a linear operation on the third and fourth matrices. The processing unit quickly obtains the second operation result based on the multiple confusion vectors and the first operation result, thereby improving the efficiency of the linear operation.

[0245] 8 , an embodiment of the present application provides a computing device 800. For example, the computing device 800 may be the secure processing device in the embodiment shown in FIG1 or FIG2 , or the secure processing device in the method 300 shown in FIG3 or the method 400 shown in FIG4 .

[0246] As shown in Figure 8, computing device 800 includes a bus 802, a processor 804, a memory 806, and a communication interface 808. Processor 804, memory 806, and communication interface 808 communicate with each other via bus 802. Computing device 800 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 800.

[0247] Bus 802 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG8 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 802 may include a path for transmitting information between various components of computing device 800 (e.g., processor 804, memory 806, and communication interface 808).

[0248] The processor 804 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0249] The memory 806 may include volatile memory, such as random access memory (RAM). The memory 806 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0250] Referring to FIG8 , the memory 806 stores executable program code, and the processor 804 executes the executable program code to respectively implement the functions of the receiving unit 701, the processing unit 702, and the sending unit 703 in the apparatus 700 shown in FIG7 , thereby implementing the method provided by any of the above embodiments. In other words, the memory 806 stores instructions for executing the method provided by any of the above embodiments. Alternatively,

[0251] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 800 and other devices or a communication network.

[0252] Embodiments of the present application also provide a data processing cluster. The data processing cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0253] As shown in Figure 9, the data processing cluster includes at least one computing device 800. The memory 806 in one or more computing devices 800 in the data processing cluster may store the same instructions for executing the method provided in any of the above embodiments.

[0254] In some possible implementations, the memory 806 of one or more computing devices 800 in the data processing cluster may also store partial instructions for executing the above-described data management method. In other words, a combination of one or more computing devices 800 can jointly execute instructions for executing the method provided in any of the above-described embodiments.

[0255] In some possible implementations, one or more computing devices in a data processing cluster can be connected via a network. The network can be a wide area network (WAN), a local area network (LAN), or the like. FIG10 illustrates one possible implementation. As shown in FIG10 , two computing devices 800A and 800B are connected via a network. Specifically, each computing device is connected to the network via a communication interface within the computing device.

[0256] In this type of possible implementation, the memory 806 in the computing device 800A stores instructions for executing the functions of the processing unit 702 in the embodiment shown in FIG7 . Simultaneously, the memory 806 in the computing device 800B stores instructions for executing the functions of the receiving unit 701 and the sending unit 703 in the embodiment shown in FIG7 .

[0257] It should be understood that the functionality of the computing device 800A shown in FIG10 may also be implemented by multiple computing devices 800. Similarly, the functionality of the computing device 800B may also be implemented by multiple computing devices 800.

[0258] The present application also provides another data processing cluster. The connection relationship between the computing devices in the data processing cluster can be similar to the connection method of the data processing cluster described in Figure 10. The difference is that the memory 806 of one or more computing devices 800 in the data processing cluster can store the same instructions for executing the method provided in any of the above embodiments.

[0259] In some possible implementations, the memory 806 of one or more computing devices 800 in the data processing cluster may also store partial instructions for executing the method provided in any of the above embodiments. In other words, a combination of one or more computing devices 800 can jointly execute instructions for executing the method provided in any of the above embodiments.

[0260] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored on any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the method provided in any of the above embodiments.

[0261] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the method provided in any of the above embodiments.

[0262] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0263] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method of processing data, It is characterized in that The method is applied to a secure processing device included in a cloud service system, the secure processing device includes a trusted execution environment TEE, and the cloud service system also includes a linear computing device, and the method includes: Receiving a data processing request sent by a terminal device, wherein the data processing request includes first data and second data to be processed; Inputting the first data and the second data into the TEE; Sending a linear operation request to the linear operation device, wherein the linear operation request includes third data corresponding to the first data and fourth data corresponding to the second data in the TEE; receiving a linear operation response sent by the linear operation device, wherein the linear operation response includes a first operation result, and the first operation result is a linear operation result between the third data and the fourth data; Inputting the first operation result into the TEE; A data processing response is sent to the terminal device, wherein the processing response includes a second operation result in the TEE corresponding to the first operation result, and the second operation result is a linear operation result between the first data and the second data.

2. The method according to claim 1, It is characterized in that The first data is training data for training an artificial intelligence (AI) model, and the second data is a parameter of the AI ​​model; or, The first data is data that needs to be inferred by the AI ​​model, and the second data is parameters of the AI ​​model.

3. The method according to claim 1 or 2, It is characterized in that The first data includes a first matrix, the second data includes a second matrix, and the method further includes: In the TEE, based on multiple confusion vectors, the data elements included in the first matrix are confused to obtain a third matrix, and the data elements included in the second matrix are confused to obtain a fourth matrix, the confusion vectors include multiple random numbers, the third data include the third matrix, and the fourth data include the fourth matrix.

4. The method according to claim 3, It is characterized in that The first operation result is a result obtained by multiplying the third matrix and the fourth matrix, or the first operation result is a result obtained by dividing the third matrix and the fourth matrix.

5. The method according to claim 3 or 4, It is characterized in that The method further comprises: The plurality of confusion vectors are obtained based on the first matrix and the second matrix.

6. The method according to any one of claims 3 to 5, It is characterized in that The method further comprises: Get multiple permutation vectors; The method of confusing the data elements of the first matrix to obtain a third matrix and confusing the data elements of the second matrix to obtain a fourth matrix based on the multiple confusion vectors comprises: Transforming the positions of the data elements included in the first matrix based on the multiple permutation vectors to obtain a fifth matrix, and transforming the positions of the data elements included in the second matrix to obtain a sixth matrix; Based on the multiple confusion vectors, the data elements included in the fifth matrix are confused to obtain the third matrix, and the data elements included in the sixth matrix are confused to obtain the fourth matrix.

7. The method according to any one of claims 3 to 6, It is characterized in that Before confusing the data elements included in the first matrix to obtain a third matrix based on the multiple confusion vectors and confusing the data elements included in the second matrix to obtain a fourth matrix, the method further includes: The data elements whose values ​​are 0 and included in the first matrix and the data elements whose values ​​are 0 and included in the second matrix are all replaced with a first real number, where the first real number is not equal to 0.

8. A device for processing data, It is characterized in that The device is applied to a secure processing device included in a cloud service system, the secure processing device includes a trusted execution environment TEE, the cloud service system also includes a linear computing device, and the device includes: A receiving unit is used to receive a data processing request sent by a terminal device, wherein the data processing request includes first data to be processed and second data to be processed. data; a processing unit, configured to input the first data and the second data into the TEE; a sending unit, configured to send a linear operation request to the linear operation device, wherein the linear operation request includes third data corresponding to the first data and fourth data corresponding to the second data in the TEE; The receiving unit is further configured to receive a linear operation response sent by the linear operation device, wherein the linear operation response includes a first operation result, and the first operation result is a linear operation result between the third data and the fourth data; The processing unit is further configured to input the first operation result into the TEE; The sending unit is further used to send a data processing response to the terminal device, wherein the processing response includes a second operation result in the TEE corresponding to the first operation result, and the second operation result is a linear operation result between the first data and the second data.

9. The device as claimed in claim 8, It is characterized in that The first data is training data for training an artificial intelligence (AI) model, and the second data is a parameter of the AI ​​model; or, The first data is data that needs to be inferred by the AI ​​model, and the second data is parameters of the AI ​​model.

10. The device according to claim 8 or 9, It is characterized in that The first data includes a first matrix, the second data includes a second matrix, and the processing unit is further used for: In the TEE, based on multiple confusion vectors, the data elements included in the first matrix are confused to obtain a third matrix, and the data elements included in the second matrix are confused to obtain a fourth matrix, the confusion vectors include multiple random numbers, the third data include the third matrix, and the fourth data include the fourth matrix.

11. The device according to claim 10, It is characterized in that The first operation result is a result obtained by multiplying the third matrix and the fourth matrix, or the first operation result is a result obtained by dividing the third matrix and the fourth matrix.

12. The device according to claim 11, It is characterized in that The processing unit is further used for: The plurality of confusion vectors are obtained based on the first matrix and the second matrix.

13. The device according to any one of claims 10 to 12, It is characterized in that The processing unit is used for: Get multiple permutation vectors; Transforming the positions of the data elements included in the first matrix based on the multiple permutation vectors to obtain a fifth matrix, and transforming the positions of the data elements included in the second matrix to obtain a sixth matrix; Based on the multiple confusion vectors, the data elements included in the fifth matrix are confused to obtain the third matrix, and the data elements included in the sixth matrix are confused to obtain the fourth matrix.

14. The device according to any one of claims 10 to 13, It is characterized in that The processing unit is further used for: The data elements whose values ​​are 0 and included in the first matrix and the data elements whose values ​​are 0 and included in the second matrix are all replaced with a first real number, where the first real number is not equal to 0.

15. A cluster for processing data, It is characterized in that The cluster includes at least one computing device, each of the at least one computing device includes at least one processor and at least one memory, and the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the cluster executes the method according to any one of claims 1 to 7.

16. A computer storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

17. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Operation method and device of artificial intelligence AI model

    CN110704850A

  • Data processing method, device and system

    CN115248927A

  • Data processing method and device and storage medium

    CN116701831A

  • Methods and system for on-device ai model parameter run-time protection

    US20220114014A1

Cited By

  • Privacy enhancement semantic communication method based on trusted execution environment security reasoning

    CN120456003A