Data transmission method for confidential computing, computing system and related equipment
By encrypting data in the shared memory of the computing host and migrating it to the memory of the deep computing unit using a secure transmission channel and decrypting it, the encryption problem of data transmission between the computing host and the deep computing unit is solved, and the security of data transmission is achieved.
Patent Information
- Application Number
- CN202510815541.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-23
AI Technical Summary
How to meet the country's requirements for data encryption when realizing data transmission between the computing host and the deep computing unit, especially the encryption requirements when data is transferred from the confidential memory of the computing host to the confidential memory of the deep computing unit.
A trusted execution environment is used to allocate storage space for data in the shared memory of the computing host. After encrypting the data using the national secret algorithm, the encrypted data is migrated to the shared and confidential memory of the deep computing unit using a secure transmission channel and decrypted by the processor of the deep computing unit to ensure the security of the data during transmission.
The encryption requirements for data transmission between the computing host and the deep computing unit are realized, ensuring the security of data during transmission and meeting national standards.
Smart Images

Figure CN120688077A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and specifically to a data transmission method, computing system, and related equipment for confidential computing. Background Art
[0002] In order to reduce the data processing burden of the host processor of the computing host, a deep computing unit for data calculation can be introduced into the computer system, so that the host processor can distribute tasks to the deep computing unit, and the deep computing unit performs data calculations on the tasks. The host processor and the deep computing unit can be connected through the system link of the computer system. For example, when the system link is a Peripheral Component Interconnect Express (PCIE) link, the host processor and the deep computing unit can be connected through the PCIE link.
[0003] With the rapid increase in the number of internal computing units, the computing performance of deep computing units has increased rapidly. How to make the data transmission between the computing host and the deep computing unit meet the national requirements for data encryption has become a technical problem that technical personnel in this field urgently need to solve. Summary of the Invention
[0004] In view of this, the embodiments of the present application provide a data transmission method, a computing system and related equipment for confidential computing, which can enable the data transmission between the computing host and the deep computing unit to meet the national requirements for data encryption.
[0005] To achieve the above objectives, the present invention provides the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a data transmission method for confidential computing, which is applied to a computing host. When a trusted execution environment needs to transfer first data located in a confidential memory of the computing host to a confidential memory of a deep computing unit, the method includes:
[0007] Allocating corresponding storage space for the first data in the shared memory of the computing host using the trusted execution environment as a first shared storage space;
[0008] Using the trusted execution environment to send a first data encryption migration instruction to the host processor or the first security processor;
[0009] Using the host processor or the first security processor to encrypt the first data according to the first data encryption migration instruction using a preset national secret algorithm to obtain corresponding first ciphertext data, and writing the first ciphertext data into the first shared storage space;
[0010] Using the trusted execution environment to send a first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as the second shared storage space;
[0011] Using the trusted execution environment to send a first data migration instruction to a direct memory access module of the depth computing unit, so that the direct memory access module of the depth computing unit migrates the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction;
[0012] Using the trusted execution environment to send a first confidential memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction as a first confidential storage space;
[0013] The trusted execution environment is used to send a first data decryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit obtains the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, uses the national secret algorithm to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and writes the first plaintext data into the first confidential storage space.
[0014] Optionally, when the trusted execution environment needs to read second data located in the confidential memory of the deep computing unit into the confidential memory of the computing host, the data transmission method for confidential computing further includes:
[0015] Allocating corresponding storage space for the second data in the confidential memory of the computing host using the trusted execution environment as a second confidential storage space;
[0016] Using the trusted execution environment to send a second shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the second data in the shared memory of the deep computing unit according to the second shared memory allocation instruction as a third shared memory space;
[0017] Using the trusted execution environment to send a second data encryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit uses the national secret algorithm to encrypt the second data located in the confidential memory of the deep computing unit according to the second data encryption migration instruction to obtain corresponding second ciphertext data, and write the second ciphertext data into the third shared storage space;
[0018] Allocating corresponding storage space for the second ciphertext data in the shared memory of the computing host using the trusted execution environment as a fourth shared storage space;
[0019] Using the trusted execution environment to send a second data migration instruction to the direct memory access module of the depth computing unit, so that the direct memory access module of the depth computing unit migrates the second ciphertext data located in the third shared memory space to the fourth shared memory space according to the second data migration instruction;
[0020] Using the trusted execution environment to send a second data decryption migration instruction to the host processor or the first security processor;
[0021] The host processor or the first security processor uses the second data decryption migration instruction, and uses the national secret algorithm to decrypt the second ciphertext data located in the fourth shared storage space to obtain the corresponding second plaintext data, and migrate the second plaintext data to the second confidential storage space.
[0022] Optionally, the first data is data to be confidentially calculated by the deep calculation unit, and the second data is data obtained by confidential calculation by the deep calculation unit.
[0023] Optionally, before performing confidential computing, the data transmission method for confidential computing further includes:
[0024] Initializing the deep computing unit using a deep computing unit driver in the trusted execution environment to allocate corresponding storage space for a deep computing unit page table in a confidential memory of the deep computing unit, and sending a first register configuration instruction to a second security processor of the deep computing unit via the secure transmission channel, so that the second security processor of the deep computing unit configures a corresponding page table register for the deep computing unit page table according to the first register configuration instruction;
[0025] During the confidential computing process, the data transmission method for confidential computing also includes: using the trusted execution environment to send a page table update instruction to the second security processor of the deep computing unit through the secure transmission channel, so that the second security processor of the deep computing unit updates the page table of the deep computing unit according to the page table update instruction.
[0026] Optionally, before performing confidential computing, the data transmission method for confidential computing further includes:
[0027] Initializing the deep computing unit using a deep computing unit driver in the trusted execution environment to allocate corresponding storage space for a deep computing unit command queue in a confidential memory of the deep computing unit, and sending a second register configuration instruction to a second security processor of the deep computing unit via the secure transmission channel, so that the second security processor of the deep computing unit configures a corresponding command queue register for a deep computing unit page table according to the second register configuration instruction;
[0028] During the confidential computing process, the method further includes: using the trusted execution environment to send a command queue add instruction to the second security processor of the deep computing unit through the secure transmission channel, so that the second security processor of the deep computing unit adds a command to the command queue of the deep computing unit according to the command queue add instruction.
[0029] Optionally, the national secret algorithm includes the SM4 algorithm.
[0030] In a second aspect, an embodiment of the present application provides a computing host, including:
[0031] A trusted execution environment is used to allocate corresponding storage space for the first data in the shared memory of the computing host as a first shared storage space when it is necessary to transfer the first data located in the confidential memory of the computing host to the confidential memory of the deep computing unit; send a first data encryption migration instruction to the host processor or the first security processor; and send a first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as a second shared storage space; send a first data migration instruction to the direct memory access module of the deep computing unit, so that the direct memory access module of the deep computing unit transfers the first ciphertext data to the shared memory of the deep computing unit according to the first data migration instruction. Data is migrated from the first shared storage space to the second shared storage space; a first confidential memory allocation instruction is sent to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction, as the first confidential storage space; a first data decryption migration instruction is sent to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit obtains the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, decrypts the first ciphertext data using a preset national secret algorithm to obtain the corresponding first plaintext data, and writes the first plaintext data into the first confidential storage space;
[0032] The host processor or the first security processor is used to encrypt the first data according to the first data encryption migration instruction using a preset national secret algorithm to obtain corresponding first ciphertext data, and write the first ciphertext data into the first shared storage space.
[0033] Optionally, the trusted execution environment is further used to allocate corresponding storage space for the second data in the confidential memory of the computing host as a second confidential storage space when it is necessary to read the second data located in the confidential memory of the deep computing unit to the confidential memory of the computing host; send a second shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the second data in the shared memory of the deep computing unit according to the second shared memory allocation instruction, as a third shared storage space; and send a second data encryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the second data The computing engine or the second security processor of the deep computing unit encrypts the second data located in the confidential memory of the deep computing unit using the national secret algorithm according to the second data encryption migration instruction to obtain corresponding second ciphertext data, and writes the second ciphertext data into the third shared storage space; is also used to allocate corresponding storage space for the second ciphertext data in the shared memory of the computing host as a fourth shared storage space; sends a second data migration instruction to the direct memory access module of the deep computing unit, so that the direct memory access module of the deep computing unit migrates the second ciphertext data from the third shared storage space to the fourth shared storage space according to the second data migration instruction; is also used to send a second data decryption migration instruction to the host processor or the first security processor;
[0034] The host processor or the first security processor is also used to decrypt the second ciphertext data located in the fourth shared storage space according to the second data decryption migration instruction, using the national secret algorithm to obtain the corresponding second plaintext data, and migrate the second plaintext data to the second confidential storage space.
[0035] Optionally, the trusted execution environment is also used to initialize the deep computing unit using a deep computing unit driver before performing confidential computing, so as to allocate corresponding storage space for the deep computing unit page table in the confidential memory of the deep computing unit, and send a first register configuration instruction to the second security processor of the deep computing unit through the secure transmission channel, so that the second security processor of the deep computing unit configures the corresponding page table register for the deep computing unit page table according to the first register configuration instruction; and is also used to send a page table update instruction to the second security processor of the deep computing unit through the secure transmission channel during confidential computing, so that the second security processor of the deep computing unit updates the page table of the deep computing unit according to the page table update instruction.
[0036] Optionally, the trusted execution environment is also used to initialize the deep computing unit using a deep computing unit driver before performing confidential computing, so as to allocate corresponding storage space for the deep computing unit command queue in the confidential memory of the deep computing unit, and send a second register configuration instruction to the second security processor of the deep computing unit through the secure transmission channel, so that the second security processor of the deep computing unit configures the corresponding command queue register for the deep computing unit command queue according to the second register configuration instruction; and is also used to send a command queue add instruction to the second security processor of the deep computing unit through the secure transmission channel during the confidential computing process, so that the second security processor of the deep computing unit adds commands to the command queue of the deep computing unit according to the command queue add instruction.
[0037] Optionally, the national secret algorithm includes the SM4 algorithm.
[0038] In a third aspect, an embodiment of the present application provides a data transmission method for confidential computing, which is applied to a deep computing unit, including:
[0039] When the trusted execution environment needs to transfer the first data located in the confidential memory of the computing host to the confidential memory of the deep computing unit, the computing engine or the second security processor of the deep computing unit receives the first shared memory allocation instruction of the trusted execution environment through a preset secure transmission channel, and allocates corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as the second shared storage space;
[0040] Using the direct memory access module of the deep computing unit to receive a first data migration instruction sent by the trusted execution environment, and migrating the first ciphertext data in the first shared storage space of the shared memory of the computing host to the second shared storage space according to the first data migration instruction;
[0041] Using the computing engine or the second security processor of the deep computing unit to receive the first confidential memory allocation instruction sent by the trusted execution environment through the secure transmission channel, and allocating corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction as the first confidential storage space;
[0042] The computing engine or the second security processor of the deep computing unit receives the first data decryption migration instruction sent by the trusted execution environment through the secure transmission channel, and obtains the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, uses the preset national secret algorithm to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and writes the first plaintext data into the first confidential storage space.
[0043] Optionally, when the trusted execution environment needs to read second data located in the confidential memory of the deep computing unit into the confidential memory of the computing host, the data transmission method for confidential computing further includes:
[0044] Adopting the computing engine or the second security processor of the deep computing unit to receive the second shared memory allocation instruction sent by the trusted execution environment through the secure transmission channel, and allocating corresponding storage space in the shared memory of the deep computing unit for the second data according to the second shared memory allocation instruction as the third shared storage space;
[0045] The computing engine or the second security processor of the deep computing unit receives the second data encryption migration instruction sent by the trusted execution environment through the secure transmission channel, and encrypts the second data located in the confidential memory of the deep computing unit using the national secret algorithm according to the second data encryption migration instruction to obtain corresponding second ciphertext data, and writes the second ciphertext data into the third shared storage space;
[0046] The direct memory access module of the deep computing unit is used to receive a second data migration instruction sent by the trusted execution environment of the computing host, and according to the second data migration instruction, the second ciphertext data in the third shared storage space in the shared memory of the deep computing unit is migrated to the fourth shared storage space in the shared memory of the computing host.
[0047] Optionally, before performing confidential computing, the data transmission method for confidential computing further includes:
[0048] Using the second security processor of the deep computing unit to receive the first register configuration instruction sent by the trusted execution environment through the secure transmission channel, and configuring the corresponding page table register for the deep computing unit page table according to the first register configuration instruction;
[0049] During the confidential computing process, the data transmission method for confidential computing also includes: using the second security processor of the deep computing unit to receive the page table update instruction sent by the trusted execution environment through the secure transmission channel, and updating the page table of the deep computing unit according to the page table update instruction.
[0050] Optionally, before performing confidential computing, the data transmission method for confidential computing further includes:
[0051] Using the second security processor of the deep computing unit to receive the second register configuration instruction sent by the trusted execution environment through the secure transmission channel, and configuring the corresponding command queue register for the deep computing unit command queue according to the second register configuration instruction;
[0052] During the confidential computing process, the method further includes: using the second security processor of the deep computing unit to receive the command queue addition instruction sent by the trusted execution environment through the secure transmission channel, and adding commands to the command queue of the deep computing unit according to the command queue addition instruction.
[0053] Optionally, the national secret algorithm includes the SM4 algorithm.
[0054] In a fourth aspect, an embodiment of the present application provides a depth calculation unit, including:
[0055] A computing engine or a second security processor, configured to receive a first shared memory allocation instruction of the trusted execution environment through a preset secure transmission channel when the trusted execution environment needs to transfer the first data located in the confidential memory of the computing host to the confidential memory of the deep computing unit, and allocate corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as the second shared storage space; further configured to receive a first confidential memory allocation instruction of the trusted execution environment through the secure transmission channel, and allocate corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction as the first confidential storage space; further configured to receive a first data decryption migration instruction of the trusted execution environment through the secure transmission channel, and obtain the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, decrypt the first ciphertext data using a preset national secret algorithm to obtain corresponding first plaintext data, and write the first plaintext data into the first confidential storage space;
[0056] A direct memory access module is used to receive a first data migration instruction sent by the trusted execution environment, and migrate the first encrypted data in the first shared storage space of the shared memory of the computing host to the second shared storage space according to the first data migration instruction.
[0057] Optionally, the computing engine or the second security processor is further configured to receive a second shared memory allocation instruction of the trusted execution environment through the secure transmission channel when the trusted execution environment needs to read the second data located in the confidential memory of the deep computing unit to the confidential memory of the computing host, and allocate corresponding storage space for the second data in the shared memory of the deep computing unit according to the second shared memory allocation instruction as a third shared storage space; and is further configured to receive a second data encryption migration instruction of the trusted execution environment through the secure transmission channel, and encrypt the second data located in the confidential memory of the deep computing unit according to the second data encryption migration instruction using the national secret algorithm to obtain corresponding second ciphertext data, and write the second ciphertext data into the third shared storage space;
[0058] The direct memory access module is also used to receive a second data migration instruction sent by the trusted execution environment of the computing host, and migrate the second encrypted data in the third shared storage space in the shared memory of the deep computing unit to the fourth shared storage space in the shared memory of the computing host according to the second data migration instruction.
[0059] Optionally, the second security processor is further used to receive a first register configuration instruction sent by the trusted execution environment through the secure transmission channel before performing confidential computing, and configure a corresponding page table register for the deep computing unit page table according to the first register configuration instruction; and is also used to receive a page table update instruction sent by the trusted execution environment through the secure transmission channel during confidential computing, and update the page table of the deep computing unit according to the page table update instruction.
[0060] Optionally, the second security processor is further used to receive a second register configuration instruction sent by the trusted execution environment through the secure transmission channel before performing confidential computing, and configure the corresponding command queue register for the deep computing unit page table according to the second register configuration instruction; and is also used to receive a command queue addition instruction sent by the trusted execution environment through the secure transmission channel during confidential computing, and add commands to the command queue of the deep computing unit according to the command queue addition instruction.
[0061] Optionally, the national secret algorithm includes the SM4 algorithm.
[0062] In a fifth aspect, an embodiment of the present application provides a confidential computing system, comprising a computing host and a deep computing unit, wherein the computing host is configured to execute any of the above-mentioned data transmission methods for confidential computing, and the deep computing unit is configured to execute any of the above-mentioned data transmission methods for confidential computing.
[0063] In a sixth aspect, an embodiment of the present application provides a storage medium, which stores one or more computer-executable instructions, and the one or more computer-executable instructions are used to execute the data transmission method for confidential computing as described in any one of the above items.
[0064] In the seventh aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, it is used to implement the data transmission method for confidential computing as described in any one of the above items.
[0065] Compared with the prior art, the technical solution of the embodiment of the present application has the following advantages:
[0066] The data transmission method for confidential computing provided by an embodiment of the present invention, when the trusted execution environment of a computing host needs to transmit the first data located in the confidential memory of the computing host to the confidential memory of a deep computing unit, first uses the host processor or the first security processor of the computing host to encrypt the first data using a national secret algorithm, and writes the encrypted first ciphertext data into the first shared storage space in the shared memory of the computing host, and the direct memory access module of the deep computing unit migrates the first ciphertext data located in the first shared storage space to the second shared storage space in the shared memory of the deep computing unit, and then the computing engine or the second security processor of the deep computing unit obtains the first ciphertext data from the second shared storage space, and writes the first plaintext data obtained by decrypting the first ciphertext data using the national secret algorithm into the first confidential storage space located in the confidential memory of the deep computing unit, so that the first data can meet the national requirements for data encryption when transmitted between the computing host and the deep computing unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0068] Figure 1This is a schematic diagram of an optional structure of a computer system according to an embodiment of the present invention;
[0069] Figure 2 Schematic diagram of an optional flow chart of a data transmission method for confidential computing in an embodiment of the present invention;
[0070] Figure 3 This is a schematic diagram of an optional flow chart of another data transmission method for confidential computing in an embodiment of the present invention. DETAILED DESCRIPTION
[0071] As mentioned in the background technology, during the process of confidential computing, the data transmission between the existing deep computing unit and the host cannot meet the country's requirements for data encryption.
[0072] To solve the above problems, the technical solution of the present invention provides a method for confidential computing, including: using the trusted execution environment to allocate corresponding storage space for the first data in the shared memory of the computing host as a first shared storage space; using the trusted execution environment to send a first data encryption migration instruction to the host processor or the first security processor; using the host processor or the first security processor to encrypt the first data according to the first data encryption migration instruction using a preset national secret algorithm to obtain corresponding first ciphertext data, and write the first ciphertext data into the first shared storage space; using the trusted execution environment to send a first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel; using the computing engine or the second security processor of the deep computing unit to allocate corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as a second shared storage space; using the trusted execution environment to send a first shared memory allocation instruction to the direct memory access module of the deep computing unit Data migration instruction; using the direct memory access module of the deep computing unit to migrate the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction; using the trusted execution environment to send a first confidential memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel; using the computing engine or the second security processor of the deep computing unit to allocate corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction, as a first confidential storage space; using the trusted execution environment to send a first data decryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel; using the computing engine or the second security processor of the deep computing unit to obtain the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, and using the national secret algorithm to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and write the first plaintext data into the first confidential storage space.
[0073] The data transmission method for confidential computing provided by an embodiment of the present invention, when the trusted execution environment of a computing host needs to transmit the first data located in the confidential memory of the computing host to the confidential memory of a deep computing unit, first uses the host processor or the first security processor of the computing host to encrypt the first data using a national secret algorithm, and writes the encrypted first ciphertext data into the first shared storage space in the shared memory of the computing host, and the direct memory access module of the deep computing unit migrates the first ciphertext data located in the first shared storage space to the second shared storage space in the shared memory of the deep computing unit, and then the computing engine or the second security processor of the deep computing unit obtains the first ciphertext data from the second shared storage space, and writes the first plaintext data obtained by decrypting the first ciphertext data using the national secret algorithm into the first confidential storage space located in the confidential memory of the deep computing unit, so that the first data can meet the national requirements for data encryption when transmitted between the computing host and the deep computing unit.
[0074] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0075] Figure 1 A schematic diagram of an embodiment of a system for confidential computing provided by the technical solution of the present invention is shown. Figure 1 The system 00 for confidential computing includes a computing host 100 and a deep computing unit 200. The computing host 100 and the deep computing unit 200 are coupled to each other.
[0076] The computing host 100 includes a trusted execution environment (TEE) 110, a host processor 120, a first security processor 130, and a computing host memory 140.
[0077] The Trusted Execution Environment (TEE) 110 is a secure area within the computing host 100. It is a hardware-isolated memory area that can only be accessed under secure conditions. Software and data within the TEE 110 are inaccessible to the operating system or virtual machine monitor (VMM) to ensure security.
[0078] The host processor 120 is an important component of the computing host 100 and serves as the computing and processing center of the computing host 100 , and is used to perform operations such as data calculation, receiving and storing commands, and processing data.
[0079] The first security processor 130, also known as the platform security processor (PSP), is a coprocessor integrated into the computing host 100. It has independent processor resources and higher system access rights, such as configuring the registers of the computing host 100 or the deep computing unit 200, accessing the system memory and input and output (I / O) interfaces, and is inaccessible to the outside, so it has higher security.
[0080] The computing host's memory 140 can be divided into a confidential memory for confidential computing and a shared memory other than the confidential memory. The confidential memory of the computing host is used to store confidential code and data, while the shared memory of the computing host is used to store common code and data.
[0081] The depth calculation unit 200 includes a computing engine (Compute Engine) 210 , a second security processor 220 and a video random access memory (VRAM) 230 .
[0082] in:
[0083] The computing engine 210 is an important component of the depth computing unit 200 and a core component of the depth computing unit 200 for executing data computing tasks.
[0084] The second security processor 220 is a coprocessor integrated into the depth calculation unit 200. It has independent processor resources and higher system access rights and is inaccessible to the outside, thus having higher security.
[0085] The video random access memory 230 is a memory unit in the depth computing unit 200 that is independent of the computing host and can be further divided into confidential memory for confidential computing and shared memory outside of the confidential memory. The confidential memory of the depth computing unit cannot be accessed through the PCIE memory-mapped input and output (MMIO) space, and the direct memory access module of the depth computing unit 200 cannot access the confidential memory.
[0086] The above description only describes the components of the computing host 100 and the depth calculation unit 200 that are relevant to the present invention. It is understandable that the computing host 100 and the depth calculation unit 200 may also include more other components, which are not limited here.
[0087] The following will be combined Figure 2 The working principle of the system for confidential computing in an embodiment of the present invention is described.
[0088] Figure 2 A flow chart of an embodiment of a data transmission method for confidential computing provided by the technical solution of the invention is shown.
[0089] First, it should be noted that before executing the data transmission method for confidential computing in this embodiment, the trusted execution environment 110 in the computing host 100 is first started. After the trusted execution environment 110 is started, the trusted execution environment 110 authenticates the deep computing unit 200. After the trusted execution environment 110 authenticates the deep computing unit 200, the trusted execution environment 110 negotiates the secret key for data encryption and decryption between the deep computing unit 200, thereby establishing a secure transmission channel between the trusted execution environment 110 and the deep computing unit 200.
[0090] like Figure 2 As shown, when the trusted execution environment needs to transfer first data located in the confidential memory of the computing host to the confidential memory of the deep computing unit, the data transmission method for confidential computing includes:
[0091] Step S201: using the trusted execution environment to allocate corresponding storage space for the first data in the shared memory of the computing host as a first shared storage space;
[0092] Step S202: using the trusted execution environment to send a first data encryption migration instruction to the host processor or the first security processor;
[0093] Step S203: using the host processor or the first security processor to encrypt the first data according to the first data encryption migration instruction using a preset national secret algorithm to obtain corresponding first ciphertext data, and writing the first ciphertext data into the first shared storage space;
[0094] Step S204: using the trusted execution environment to send a first shared memory allocation instruction to the computing engine of the deep computing unit or the second security processor via a preset secure transmission channel;
[0095] Step S205: using the computing engine of the deep computing unit or the second security processor to allocate corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as the second shared storage space;
[0096] Step S206: using the trusted execution environment to send a first data migration instruction to the direct memory access module of the deep computing unit;
[0097] Step S207: using the direct memory access module of the depth computing unit to migrate the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction;
[0098] Executing step S208, using the trusted execution environment to send a first confidential memory allocation instruction to the computing engine of the deep computing unit or the second security processor through the secure transmission channel;
[0099] Step S209: using the computing engine of the deep computing unit or the second security processor to allocate corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction as a first confidential storage space;
[0100] Step S210: Using the trusted execution environment to send a first data decryption migration instruction to the computing engine of the deep computing unit or the second security processor via the secure transmission channel;
[0101] Step S211: Use the computing engine of the deep computing unit or the second security processor to obtain the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, and use the national secret algorithm to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and write the first plaintext data into the first confidential storage space.
[0102] Please continue to refer to Figure 2 , execute step S201, use the trusted execution environment to allocate corresponding storage space for the first data in the shared memory of the computing host as the first shared storage space.
[0103] The trusted execution environment is used to allocate corresponding storage space for the first data in the shared memory of the computing host as the first shared storage space, providing a basis for subsequently encrypting the first data using a preset national secret algorithm by the host processor or the first security processor to obtain corresponding first ciphertext data, and writing the first ciphertext data into the first shared storage space.
[0104] The trusted execution environment is an independent processing environment that can provide security and integrity protection for data computing and storage.
[0105] In an exemplary embodiment, the trusted execution environment is created using a virtual machine. The virtual machine is created by a host using virtualization technology. Accordingly, the virtual machine runs the feasible execution environment to allocate corresponding storage space for the first data in the shared memory of the computing host as the first shared storage space.
[0106] The trusted execution environment allocates corresponding storage space for the first data in the shared memory of the computing host, that is, the first shared storage space is adapted to the size of the first data to be transmitted to the confidential memory of the deep computing unit.
[0107] In an exemplary embodiment, the first data is located in the confidential memory of the computing host. Since the confidential memory of the computing host is a portion of the storage space in the memory of the computing host that uses security isolation technology, the first data is plaintext data.
[0108] Please continue to refer to Figure 2 , execute step S202, use the trusted execution environment to send a first data encryption migration instruction to the host processor or the first security processor.
[0109] The trusted execution environment is used to send a first data encryption migration instruction to the host processor or the first security processor, providing a basis for subsequently using the host processor or the first security processor to encrypt the first data using a preset national secret algorithm, obtain corresponding first ciphertext data, and write the first ciphertext data into the first shared storage space.
[0110] In an exemplary embodiment, the first data encryption migration instruction carries information about the storage address of the first data in the confidential memory of the computing host, so that the subsequent host processor or the first security processor can obtain the information about the storage address of the first data in the confidential memory of the computing host by executing the first data encryption migration instruction.
[0111] In addition, the first data encryption migration instruction also carries information about the storage address of the first data in the shared memory of the computing host, so that the subsequent host processor or the first security processor can obtain information about the storage address of the first data in the shared memory of the computing host by executing the first data encryption migration instruction.
[0112] In an exemplary embodiment, the first data encryption migration instruction includes a source address field and a destination address field. The source address field of the first data encryption migration instruction is used to indicate information about a storage address of the first data in a confidential storage of the host processor, and the destination address field of the first data migration instruction indicates address information of the first shared storage space.
[0113] Please continue to refer to Figure 2, execute step S203, use the host processor or the first security processor to encrypt the first data according to the first data encryption migration instruction, use the preset national secret algorithm to obtain the corresponding first ciphertext data, and write the first ciphertext data into the first shared storage space.
[0114] The host processor or the first security processor uses a preset national secret algorithm to encrypt the first data according to the first data encryption migration instruction to obtain corresponding first ciphertext data, and writes the first ciphertext data into the first shared storage space, providing a basis for the subsequent use of the trusted execution environment to send the first shared memory allocation instruction to the computing engine of the deep computing unit or the second security processor through a preset secure transmission channel.
[0115] The confidential memory of the computing host is a portion of storage space in the memory of the host processor that uses security isolation technology. Except for authorized interfaces, other hardware in the host cannot access the data in the confidential memory of the computing host.
[0116] The host processor is an important component of the computing host. It has higher permissions, can access the data in the confidential memory of the computing host, and supports the use of national secret algorithms.
[0117] Accordingly, in an exemplary embodiment, the processor core of the host processor uses a preset national encryption algorithm to encrypt the first data to obtain corresponding first ciphertext data, and writes the first ciphertext data into the first shared storage space.
[0118] The first security processor of the computing host is a coprocessor of the host processor. Similar to the host processor, the first security processor has a higher system privilege and can access data in the confidential memory of the computing host.
[0119] Correspondingly, in another exemplary embodiment, the first security processor of the computing host uses a preset national encryption algorithm to encrypt the first data to obtain corresponding first ciphertext data, and writes the first ciphertext data into the first shared storage space.
[0120] In an exemplary embodiment, the host processor or the first security processor may parse the first data encryption migration instruction to obtain information about the storage address of the first data in the confidential storage of the computing host and the address of the first shared storage space.
[0121] The first data is located in the confidential memory of the computing host and is plaintext data, i.e., unencrypted data. Accordingly, the first data is first encrypted using the preset national secret algorithm to obtain corresponding first ciphertext data, and then the first ciphertext data is written to the first shared storage space, thereby ensuring the transmission security of the first data.
[0122] In one exemplary embodiment, the national secret algorithm is the SM4 block cipher algorithm. The SM4 block cipher algorithm, also known as the SM4 algorithm, is a block cipher standard adopted by the national government. Accordingly, encrypting the first data using the preset national secret algorithm to obtain the corresponding first ciphertext data can meet national data encryption requirements.
[0123] It is understandable that those skilled in the art may also select other national encryption algorithms to encrypt the first data according to actual needs, as long as the national encryption algorithm adopted meets the national requirements for data encryption. The present invention does not impose any restrictions here.
[0124] Please continue to refer to Figure 2 , execute step S204, use the trusted execution environment to send a first shared memory allocation instruction to the computing engine of the deep computing unit or the second security processor through a preset secure transmission channel.
[0125] The trusted execution environment is used to send a first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel, so as to provide a basis for the subsequent use of the computing engine or the second security processor of the deep computing unit to allocate corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction, thereby providing a basis for serving as the second shared storage space.
[0126] In an exemplary embodiment, the steps of using the trusted execution environment to send a first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel are: generating the first shared memory instruction; encrypting the first shared memory allocation instruction using a corresponding encryption key to obtain the encrypted first shared memory allocation instruction; and transmitting the encrypted first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the communication interface between the computing host and the deep computing unit.
[0127] In an exemplary embodiment, the computing host and the depth computing unit are communicatively connected via a PCIE link. Accordingly, the communication interfaces between the computing host and the depth computing unit are respectively PCIE interfaces.
[0128] Using the trusted execution environment to send the first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel helps to improve the security of the transmission of the first shared memory instruction.
[0129] In an exemplary embodiment, the first shared memory allocation instruction carries information about the size of the first ciphertext data, so that the computing engine or the second security processor of the subsequent depth computing unit can obtain the information about the size of the first ciphertext data through the first shared memory allocation instruction, and then allocate corresponding storage space for the first ciphertext data in the shared memory of the depth computing unit as the second shared storage space based on the information about the size of the first ciphertext data.
[0130] Please continue to refer to Figure 2 , execute step S205, use the computing engine of the deep computing unit or the second security processor to allocate corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction, as the second shared storage space.
[0131] The computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction, as the second shared storage space, to provide a basis for subsequently using the trusted execution environment to send a first data migration instruction to the direct memory access module (DMA) of the deep computing unit, and then using the direct memory access module of the deep computing unit to migrate the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction.
[0132] In an exemplary embodiment, the computing engine or the second security processor of the deep computing unit first receives the encrypted first shared memory allocation instruction, decrypts the encrypted first shared memory allocation instruction, obtains the first shared memory allocation instruction, and then parses the first shared memory allocation instruction to obtain the size information of the first ciphertext data, thereby allocating corresponding storage space for the first ciphertext data in the confidential memory of the deep computing unit according to the size information of the first ciphertext data as the second shared storage space.
[0133] In an exemplary embodiment, the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit as the second shared storage space according to the first shared memory allocation instruction, and then returns the address information of the second shared storage space to the trusted execution environment through the secure transmission channel, so that the trusted execution environment can obtain the address information of the second shared storage space.
[0134] Please continue to refer to Figure 2 , execute step S206, use the trusted execution environment to send a first data migration instruction to the direct memory access module of the deep computing unit.
[0135] The trusted execution environment is used to send a first data migration instruction to the direct memory access module of the deep computing unit, providing a basis for the subsequent direct memory access module of the deep computing unit to receive the first data migration instruction and migrate the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction.
[0136] In an exemplary embodiment, the first data migration instruction carries information about the address of the first data in the shared memory of the computing host, that is, information about the first shared storage space, so that the direct memory access module of the depth computing unit can obtain the address information of the first shared storage space, thereby enabling the subsequent direct memory access module of the depth computing unit to obtain the first ciphertext data from the first shared storage space.
[0137] At the same time, the first data migration instruction also carries information about the address of the first ciphertext data in the confidential memory of the depth computing unit, that is, information about the second shared storage space, so that the direct memory access module of the depth computing unit can write the first ciphertext data obtained from the first shared storage space into the second shared storage space.
[0138] In an exemplary embodiment, the first data migration instruction includes a source address field and a destination address field, wherein the source address field of the first data migration instruction is used to indicate address information of the first shared storage space, and the destination address field of the first data migration instruction indicates address information of the second shared storage space.
[0139] The first data migration instruction is used to enable the direct memory access module of the depth calculation unit to migrate the first ciphertext data from the first shared storage space to the second shared storage space of the depth calculation unit. Accordingly, the first data migration instruction is a direct memory access instruction.
[0140] Please continue to refer to Figure 2 , execute step S207, use the direct memory access module of the depth calculation unit to migrate the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction.
[0141] The direct memory access module of the deep computing unit is used to migrate the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction, providing a basis for subsequently using the trusted execution environment to send the first data decryption migration instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel, and the computing engine or the second security processor of the deep computing unit is used to obtain the first ciphertext data from the second shared storage space according to the first data decryption migration instruction using the national secret algorithm and decrypt it to obtain the corresponding first plaintext data, and write the first plaintext data into the first confidential storage space.
[0142] In an exemplary embodiment, when the direct memory access module of the depth computing unit receives the first data migration instruction, it first parses the first data migration instruction to obtain the address information of the first shared storage space and the address information of the second shared storage space, and then obtains the first ciphertext data from the first shared storage space and writes it into the second shared storage space based on the parsed address information of the first shared storage space and the address information of the second shared storage space.
[0143] The direct memory access module of the depth computing unit is similar to the direct memory access module of the computing host, which can transfer data between the memory of the depth computing unit and the peripheral device without the participation of the computing engine of the depth computing unit.
[0144] Correspondingly, the direct memory access module of the depth computing unit is used to migrate the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction, which is conducive to improving the efficiency of data transmission.
[0145] The first ciphertext data is encrypted data. Accordingly, migrating the first ciphertext data from the first shared storage space in the shared memory of the computing host to the second shared storage space in the shared memory of the deep computing unit can ensure the transmission security of the first data.
[0146] Please continue to refer to Figure 2, execute step S208, use the trusted execution environment to send a first confidential memory allocation instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel.
[0147] The trusted execution environment is used to send a first confidential memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, providing a basis for subsequently using the trusted execution environment to send a first data decryption migration instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel, and the computing engine or the second security processor of the deep computing unit uses the national secret algorithm to obtain the first ciphertext data from the second shared storage space according to the first data decryption migration instruction and decrypt it to obtain the corresponding first plaintext data, and write the first plaintext data into the first confidential storage space.
[0148] For the process of using the trusted execution environment to send the first confidential memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, please refer to the aforementioned content about using the trusted execution environment to send the first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the preset secure transmission channel, and no further details will be given.
[0149] In an exemplary embodiment, the first confidential memory allocation instruction includes information about the size of the first ciphertext data, so that the subsequent computing engine or the second security processor of the deep computing unit can obtain information about the size of the first ciphertext data through the first confidential memory allocation instruction, thereby allocating corresponding storage space for the first data in the confidential memory of the deep computing unit as the first confidential storage space.
[0150] Please continue to refer to Figure 2 , execute step S209, use the computing engine of the deep computing unit or the second security processor to allocate corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction, as the first confidential storage space.
[0151] The computing engine or second security processor of the deep computing unit allocates corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction, as the first confidential storage space, to provide a basis for subsequently using the trusted execution environment to send the first data decryption migration instruction to the computing engine or second security processor of the deep computing unit through a preset secure transmission channel, and then using the computing engine or second security processor of the deep computing unit to obtain the first ciphertext data from the second shared storage space and decrypt it to obtain the corresponding first plaintext data according to the first data decryption migration instruction using the national secret algorithm, and write the first plaintext data into the first confidential storage space.
[0152] In an exemplary embodiment, the computing engine or the second security processor of the deep computing unit first receives the encrypted first confidential memory allocation instruction, decrypts the encrypted first confidential memory allocation instruction, obtains the first confidential memory allocation instruction, and then parses the first confidential memory allocation instruction to obtain the size information of the first data, thereby allocating corresponding storage space for the first data in the confidential memory of the deep computing unit according to the size information of the first data as the first confidential storage space.
[0153] In an exemplary embodiment, the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first data in the shared memory of the deep computing unit as the first confidential storage space according to the first confidential memory allocation instruction, and then returns the address information of the first confidential storage space to the trusted execution environment through the secure transmission channel, so that the trusted execution environment can obtain the address information of the first confidential storage space.
[0154] Please continue to refer to Figure 2 , execute step S210, use the trusted execution environment to send a first data decryption migration instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel.
[0155] In an exemplary embodiment, the trusted execution environment sends a first data decryption migration instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel, which means that the trusted execution environment uses the encryption key previously negotiated during the establishment of the secure transmission channel to encrypt the first data decryption migration instruction, and transmits it to the computing engine or the second security processor of the deep computing unit through the communication interface between the host processor and the deep computing unit.
[0156] Accordingly, the trusted execution environment sends the first data decryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, which is conducive to improving the security of the transmission of the first decryption migration instruction.
[0157] In an exemplary embodiment, the first data decryption migration instruction carries the address of the first ciphertext data in the shared memory of the depth computing unit, that is, the address information of the second shared storage space, so that the computing engine of the depth computing unit or the second security processor can obtain the address information of the second shared storage space, thereby enabling the computing engine or the second security processor of the depth computing unit to subsequently obtain the first ciphertext data from the second shared storage space and decrypt it.
[0158] At the same time, the first data decryption migration instruction also carries information about the address of the first plaintext data obtained after decrypting the first ciphertext data in the confidential memory of the deep computing unit, that is, information about the first confidential storage space, so that the computing engine of the deep computing unit or the second security processor can decrypt the first ciphertext data obtained from the second shared storage space and write it into the first confidential storage space.
[0159] In an exemplary embodiment, the first data decryption migration instruction includes a source address field and a destination address field. The source address field of the first data decryption migration instruction is used to indicate address information of the second shared storage space, and the destination address field of the first data decryption migration instruction indicates address information of the first confidential storage space.
[0160] Please continue to refer to Figure 2 , execute step S211, use the computing engine of the deep computing unit or the second security processor to obtain the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, and use the national secret algorithm to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and write the first plaintext data into the first confidential storage space.
[0161] The computing engine or the second security processor of the deep computing unit obtains the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, and uses the national secret algorithm to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and writes the first plaintext data into the first confidential storage space. At this point, the first data is securely migrated from the confidential memory of the computing host to the confidential memory of the deep computing unit.
[0162] It should be noted that the first plaintext data, i.e., the first data, is securely migrated from the confidential memory of the computing host to the confidential memory of the deep computing unit after the computing engine or the second security processor of the deep computing unit decrypts the first ciphertext data located in the shared memory of the deep computing unit using the national secret algorithm according to the first data decryption migration instruction to obtain the corresponding first plaintext data and writes the first plaintext data into the confidential memory of the deep computing unit.
[0163] The computing engine of the deep computing unit, similar to the host processor, is the core component of the deep computing unit. It has higher system access rights, including access rights to the shared memory and confidential memory of the deep computing unit, and supports the use of national secret algorithms.
[0164] Accordingly, in an exemplary embodiment, the computing engine of the deep computing unit is used to obtain the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, and the national secret algorithm is used to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and the first plaintext data is written into the first confidential storage space.
[0165] Similar to the first security processor of the host processor, the second security processor of the deep computing unit is a coprocessor of the computing engine of the deep computing unit, and has higher system access rights to the deep computing unit, including access rights to the shared memory and confidential memory of the deep computing unit, and supports the use of national secret algorithms.
[0166] Correspondingly, in another exemplary embodiment, the second security processor of the deep computing unit is used to obtain the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, and uses the national secret algorithm to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and writes the first plaintext data into the first confidential storage space.
[0167] The decryption key used to decrypt the first ciphertext data located in the second shared storage space using the national secret algorithm, and the encryption key used to encrypt the first data located in the confidential memory of the computing host using the national secret algorithm, are a pair of symmetric key pairs, which are negotiated and determined by the trusted execution environment and the deep computing unit during the previous process of establishing a secure transmission channel.
[0168] Accordingly, in conjunction with reference Figure 3When the trusted execution environment needs to read second data located in the confidential memory of the deep computing unit into the confidential memory of the computing host, the data processing method for confidential computing further includes:
[0169] Step S301: using the trusted execution environment to allocate corresponding storage space for the second data in the confidential memory of the computing host as a second confidential storage space;
[0170] Step S302: Using the trusted execution environment to send a second shared memory allocation instruction to the computing engine of the deep computing unit or the second security processor via the secure transmission channel;
[0171] Step S303: using the computing engine of the depth computing unit or the second security processor to allocate corresponding storage space in the shared memory of the depth computing unit for the second data according to the second shared memory allocation instruction as a third shared storage space;
[0172] Step S304: Using the trusted execution environment through the secure transmission channel, sending a second data encryption migration instruction to the computing engine of the deep computing unit or the second security processor;
[0173] Step S305: Using the computing engine or the second security processor of the deep computing unit to encrypt the second data in the confidential memory of the deep computing unit using the national secret algorithm according to the second data encryption migration instruction to obtain corresponding second ciphertext data, and writing the second ciphertext data into the third shared storage space;
[0174] Step S306: using the trusted execution environment to allocate corresponding storage space for the second ciphertext data in the shared memory of the computing host as a fourth shared storage space;
[0175] Step S307: using the trusted execution environment to send a second data migration instruction to the direct memory access module of the deep computing unit;
[0176] Step S308: using the direct memory access module of the depth calculation unit to migrate the second ciphertext data from the third shared storage space to the fourth shared storage space according to the second data migration instruction;
[0177] Step S309: using the trusted execution environment to send a second data decryption migration instruction to the host processor or the first security processor;
[0178] Step S310: Using the host processor or the first security processor to decrypt the second ciphertext data located in the fourth shared storage space according to the second data decryption migration instruction, using the national secret algorithm to obtain the corresponding second plaintext data, and migrating the second plaintext data to the second confidential storage space.
[0179] Please continue to refer to Figure 3 , execute step S301, use the trusted execution environment to allocate corresponding storage space for the second data in the confidential memory of the computing host as a second confidential storage space.
[0180] The trusted execution environment is used to allocate corresponding storage space for the second data in the confidential memory of the computing host as the second confidential storage space, providing a basis for subsequently reading the second data into the second confidential storage space.
[0181] In an exemplary embodiment, the trusted execution environment is created using a virtual machine. Accordingly, the virtual machine runs the feasible execution environment, and corresponding storage space is allocated in the confidential memory of the computing host for the second data, serving as the second confidential storage space. The second confidential storage space can be configured based on the second data, without limitation.
[0182] The second data is located in the confidential memory of the depth computing unit. The confidential memory of the depth computing unit is a partial storage area in the VRAM of the depth computing unit that uses security isolation technology. Therefore, the second data is plaintext data, that is, unencrypted data, which can also ensure the storage security of the second data.
[0183] Please continue to refer to Figure 3 , execute step S302, use the trusted execution environment to send a second shared memory allocation instruction to the computing engine of the deep computing unit or the second security processor through the secure transmission channel.
[0184] The trusted execution environment is used to send a second shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so as to provide a basis for the subsequent use of the computing engine or the second security processor of the deep computing unit to allocate corresponding storage space for the second data in the shared memory of the deep computing unit according to the second shared memory allocation instruction, thereby providing a basis for serving as a third shared storage space.
[0185] In an exemplary embodiment, using the trusted execution environment to send a second shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel means that the trusted execution environment first encrypts the second shared memory allocation instruction using an encryption key agreed in advance with the deep computing unit, and then transmits the encrypted second shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the communication interface between the host processor and the deep computing unit.
[0186] Therefore, using the trusted execution environment to send the second shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel is conducive to ensuring the secure transmission of the second shared memory allocation instruction.
[0187] Regarding the trusted execution environment sending a memory allocation instruction to the computing engine of the deep computing unit or the second security processor through the secure transmission channel, please refer to the aforementioned content of using the trusted execution environment to send a first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the preset secure transmission channel, and no further details will be given here.
[0188] In an exemplary embodiment, the second shared memory allocation instruction carries information of the storage address of the second data in the confidential memory of the deep computing unit, so that the computing engine or the second security processor of the deep computing unit can obtain information of the storage address of the second data in the confidential memory of the deep computing unit according to the second shared memory allocation instruction.
[0189] Please continue to refer to Figure 3 , execute step S303, use the computing engine of the depth computing unit or the second security processor to allocate corresponding storage space for the second data in the shared memory of the depth computing unit according to the second shared memory allocation instruction, as the third shared storage space.
[0190] The computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the second data in the shared memory of the deep computing unit according to the second shared memory allocation instruction, as the third shared storage space, providing a basis for subsequently migrating the second ciphertext data to the third shared storage space.
[0191] In one exemplary embodiment, upon receiving the second shared memory allocation instruction via the secure transmission channel, the computing engine or the second security processor of the deep computing unit first decrypts the second shared memory allocation instruction using a decryption key pre-agreed between the trusted execution environment and the deep computing unit. The decrypted second shared memory allocation instruction is then parsed to obtain information about the size of the second data.
[0192] After obtaining information about the size of the second data, the computing engine or the second security processor of the depth computing unit allocates corresponding storage space for the second data in the shared memory of the depth computing unit as a third shared storage space according to the size of the second data.
[0193] Please continue to refer to Figure 3 , execute step S304, use the trusted execution environment to send a second data encryption migration instruction to the computing engine of the deep computing unit or the second security processor through the secure transmission channel.
[0194] The trusted execution environment is used to send a second data encryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, providing a basis for the computing engine or the second security processor of the deep computing unit to use the national secret algorithm to encrypt the second data located in the confidential memory of the deep computing unit according to the second data encryption migration instruction to obtain corresponding second ciphertext data, and write the second ciphertext data into the third shared storage space.
[0195] Regarding the use of the trusted execution environment to send the second data encryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, please refer to the aforementioned use of the trusted execution environment to send the memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, and no further details will be given.
[0196] In an exemplary embodiment, the second data encryption migration instruction carries information about the storage address of the second data in the confidential memory of the deep computing unit, so that the subsequent computing engine or second security processor of the deep computing unit can obtain information about the storage address of the second data in the confidential memory of the deep computing unit.
[0197] Please continue to refer to Figure 3, execute step S305, use the computing engine or the second security processor of the deep computing unit to encrypt the second data located in the confidential memory of the deep computing unit according to the second data encryption migration instruction, use the national secret algorithm to obtain corresponding second ciphertext data, and write the second ciphertext data into the third shared storage space.
[0198] The computing engine or the second security processor of the deep computing unit uses the national secret algorithm to encrypt the second data located in the confidential memory of the deep computing unit according to the second data encryption migration instruction to obtain corresponding second ciphertext data, and writes the second ciphertext data into the third shared storage space, providing a basis for subsequently writing the second ciphertext data into the fourth shared storage space.
[0199] The third shared storage space is located in the shared memory of the deep computing unit, and the shared memory of the deep computing unit is the portion of storage space in the deep computing unit that does not adopt security isolation technology. Accordingly, the computing engine or second security processor of the deep computing unit first uses the national secret algorithm to encrypt the second data located in the confidential memory of the deep computing unit to obtain corresponding second ciphertext data, and then writes the second ciphertext data into the third shared storage space, which is conducive to ensuring the security of the second data.
[0200] The computing engine or second security processor of the deep computing unit first encrypts the second data in the confidential memory of the deep computing unit using the national secret algorithm to obtain corresponding second ciphertext data, which can meet the national data encryption requirements. Regarding the national secret algorithm, please refer to the above content regarding the national secret algorithm and will not be repeated here.
[0201] Please continue to refer to Figure 3 , execute step S306, and use the trusted execution environment to allocate corresponding storage space for the second ciphertext data in the shared memory of the computing host as a fourth shared storage space.
[0202] The trusted execution environment is used to allocate corresponding storage space for the second ciphertext data in the shared memory of the computing host as the fourth shared storage space, providing a basis for the subsequent direct memory access module of the deep computing unit to migrate the second ciphertext data from the third shared storage space to the fourth shared storage space according to the second data migration instruction.
[0203] In an exemplary embodiment, the step of using the trusted execution environment to allocate corresponding storage space for the second ciphertext data in the shared memory of the computing host as the fourth shared storage space includes: using a virtual machine running the trusted execution environment to send a corresponding shared memory allocation instruction to the memory controller of the computing host through the root component (Root Complex), so that the memory controller of the computing host allocates the corresponding storage space in the shared memory of the computing host as the fourth shared storage space according to the shared memory allocation instruction.
[0204] Please continue to refer to Figure 3 , execute step S307, use the trusted execution environment to send a second data migration instruction to the direct memory access module of the deep computing unit.
[0205] The trusted execution environment is used to send a second data migration instruction to the direct memory access module of the deep computing unit, providing a basis for subsequently using the direct memory access module of the deep computing unit to migrate the second ciphertext data from the third shared storage space to the fourth shared storage space according to the second data migration instruction.
[0206] In an exemplary embodiment, the second data migration instruction carries information about the address of the second ciphertext data in the shared memory of the depth computing unit, that is, information about the third shared storage space, so that the direct memory access module of the depth computing unit can obtain the address information of the third shared storage space, thereby enabling the subsequent direct memory access module of the depth computing unit to obtain the second ciphertext data from the third shared storage space.
[0207] In addition, the second data migration instruction also carries the storage address information of the second ciphertext data in the shared memory of the computing host, that is, the information of the fourth shared storage space, so that the direct memory access module of the depth computing unit obtains the address information of the fourth shared storage space, thereby enabling the subsequent direct memory access module of the depth computing unit to migrate the second ciphertext data from the third shared storage space to the fourth shared storage space.
[0208] In an exemplary embodiment, the second data migration instruction includes a source address field and a destination address field, wherein the source address field of the second data migration instruction is used to indicate address information of the third shared storage space, and the destination address field of the second data migration instruction indicates address information of the fourth shared storage space.
[0209] The second data migration instruction is used to enable the direct memory access module of the depth calculation unit to migrate the second ciphertext data from the third shared storage space to the fourth shared storage space of the depth calculation unit. Accordingly, the second data migration instruction is a direct memory access instruction.
[0210] The direct memory access module of the depth computing unit migrates the second ciphertext data from the third shared storage space to the fourth shared storage space according to the second data migration instruction without the participation of the computing engine of the depth computing unit, thereby improving the migration efficiency of the second ciphertext data.
[0211] Please continue to refer to Figure 3 , execute step S308, use the direct memory access module of the depth calculation unit to migrate the second ciphertext data from the third shared storage space to the fourth shared storage space according to the second data migration instruction.
[0212] The direct memory access module of the deep computing unit is used to migrate the second ciphertext data from the third shared storage space to the fourth shared storage space according to the second data migration instruction, providing a basis for subsequently obtaining the second ciphertext data from the fourth shared storage space for decryption, and writing the second plaintext data obtained after decryption into the second confidential memory space.
[0213] In an exemplary embodiment, the step of using the direct memory access module of the depth computing unit to migrate the second ciphertext data from the third shared storage space to the fourth shared storage space according to the second data migration instruction includes: using the direct memory access module of the depth computing unit to parse the first data migration instruction to obtain the address information of the third shared storage space and the address information of the fourth shared storage space; according to the address information of the third shared storage space and the address information of the fourth shared storage space obtained by parsing, obtaining the second ciphertext data from the third shared storage space and writing it into the fourth shared storage space.
[0214] The direct memory access module of the deep computing unit is used to directly migrate the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction without the participation of the computing engine of the deep computing unit, thereby helping to improve the efficiency of data transmission.
[0215] The second ciphertext data is the encrypted second data. Accordingly, migrating the second ciphertext data from the third shared storage space to the fourth shared storage space is beneficial to improving the transmission security of the second data.
[0216] Please continue to refer to Figure 3 , executing step S309, using the trusted execution environment to send a second data decryption migration instruction to the host processor or the first security processor.
[0217] The trusted execution environment is used to send a second data decryption migration instruction to the host processor or the first security processor, providing a basis for subsequently using the host processor or the first security processor to decrypt the second ciphertext data located in the fourth shared storage space according to the second data decryption migration instruction, using the national secret algorithm to obtain corresponding second plaintext data, and migrating the second plaintext data to the second confidential storage space.
[0218] In an exemplary embodiment, the second data decryption migration instruction carries information about the address of the second ciphertext data in the shared memory of the computing host, that is, information about the address of the fourth shared storage space, so that the host processor or the first security processor can obtain the address information of the fourth shared storage space, thereby enabling the host processor or the first security processor to subsequently obtain and decrypt the second ciphertext data from the fourth shared storage space.
[0219] In addition, the second data decryption migration instruction also carries information about the address of the second plaintext data obtained after decrypting the second ciphertext data in the confidential memory of the computing host, that is, information about the second confidential storage space, so that the host processor or the first security processor can decrypt the second ciphertext data obtained from the fourth shared storage space and write it into the second confidential storage space.
[0220] In an exemplary embodiment, the second data decryption migration instruction includes a source address field and a destination address field. The source address field of the second data decryption migration instruction is used to indicate address information of the fourth shared storage space, and the destination address field of the second data decryption migration instruction indicates address information of the second confidential storage space.
[0221] Please continue to refer to Figure 2 , execute step S310, use the host processor or the first security processor to decrypt the second ciphertext data located in the fourth shared storage space according to the second data decryption migration instruction, use the national secret algorithm to decrypt the second ciphertext data to obtain corresponding second plaintext data, and migrate the second plaintext data to the second confidential storage space.
[0222] The second plaintext data, i.e., the second data, is decrypted by the host processor or the first security processor using the national secret algorithm to obtain the corresponding second plaintext data located in the fourth shared memory space, and the second plaintext data is written into the second confidential memory space, thereby achieving the secure migration of the second data from the confidential memory of the deep computing unit to the confidential memory of the computing host.
[0223] The decryption key used to decrypt the second ciphertext data located in the shared memory of the computing host using the national secret algorithm, and the encryption key used to encrypt the second data located in the confidential memory of the deep computing unit using the national secret algorithm, are a pair of symmetric key pairs, which are negotiated and determined by the trusted execution environment and the deep computing unit in the process of establishing a secure transmission channel.
[0224] In an exemplary embodiment, the first data is data to be confidentially calculated by the deep calculation unit, and the second data is data obtained by confidentially calculating by the deep calculation unit.
[0225] In an exemplary embodiment, before performing confidential computing, the data transmission method for confidential computing also includes: using the deep computing unit driver in the trusted execution environment to initialize the deep computing unit to allocate corresponding storage space for the deep computing unit page table in the confidential memory in the deep computing unit, and sending a first register configuration instruction to the second security processor of the deep computing unit through the secure transmission channel; using the second security processor of the deep computing unit to configure the corresponding page table register for the deep computing unit page table according to the first register configuration instruction.
[0226] Accordingly, during the confidential computing process, the data transmission method for confidential computing also includes: using the trusted execution environment to send a page table update instruction to the second security processor of the deep computing unit through the secure transmission channel; the second security processor of the deep computing unit updates the page table of the deep computing unit according to the page table update instruction.
[0227] By setting the deep computing unit command queue in the confidential memory of the deep computing unit, it is possible to prevent illegal commands from being injected into the deep computing unit command queue from the outside, which is beneficial to further improve the operational security of the deep computing unit.
[0228] In an exemplary embodiment, before performing confidential computing, the data transmission method for confidential computing also includes: using the deep computing unit driver in the trusted execution environment to initialize the deep computing unit to allocate corresponding storage space for the deep computing unit command queue in the confidential memory in the deep computing unit, and sending a second register configuration instruction to the second security processor of the deep computing unit through the secure transmission channel; using the second security processor of the deep computing unit to configure the corresponding command queue register for the deep computing unit command queue according to the second register configuration instruction.
[0229] Accordingly, during the process of confidential computing, the data transmission method for confidential computing also includes: using the trusted execution environment to send a command queue addition instruction to the second security processor of the deep computing unit through the secure transmission channel; the second security processor of the deep computing unit adds a command to the command queue of the deep computing unit according to the command queue addition instruction.
[0230] By setting the deep computing unit page table in the deep computing unit's confidential memory, it is possible to prevent the virtual machine monitor (Hypervisor) from tampering with the deep computing unit's command queue, which is beneficial to further improve the operational security of the deep computing unit.
[0231] An embodiment of the present application also provides a computer device, which may include: at least one memory and at least one processor; the memory stores one or more computer-executable instructions, and the processor calls the one or more computer-executable instructions to execute the data transmission method for confidential computing applied to a computing host or the data transmission method for confidential computing applied to a deep computing unit provided in an embodiment of the present application.
[0232] Accordingly, an embodiment of the present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, is used to implement the data transmission method for confidential computing described in an embodiment of the present invention.
[0233] An embodiment of the present invention also provides a storage medium, which stores one or more computer instructions, and the one or more computer instructions are used to implement the data transmission method for confidential computing provided in the above embodiment.
[0234] The embodiments of the present invention described above are combinations of elements and features of the present invention. Unless otherwise mentioned, elements or features may be considered as optional. Each element or feature may be put into practice without being combined with other elements or features. In addition, embodiments of the present invention may be constructed by combining some elements and / or features. The order of operations described in the embodiments of the present invention may be rearranged. Some configurations of any one embodiment may be included in another embodiment and may be replaced by the corresponding configuration of another embodiment. It is obvious to those skilled in the art that claims that do not have a clear reference relationship to each other in the appended claims may be combined into embodiments of the present invention, or may be included as new claims in amendments after submitting this application.
[0235] The embodiments of the present invention may be implemented by various means such as hardware, firmware, software, or a combination thereof. In a hardware configuration, the method according to the exemplary embodiment of the present invention may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, etc.
[0236] In a firmware or software configuration, the embodiments of the present invention may be implemented in the form of modules, procedures, functions, and the like. Software codes may be stored in a memory unit and executed by a processor. The memory unit may be located inside or outside the processor and may send and receive data to and from the processor via various known means.
[0237] The above description of the disclosed embodiments will enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein, but is to be construed in the widest possible manner consistent with the principles and novel features disclosed herein.
[0238] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention should be based on the scope defined by the claims.
Claims
1. A data transmission method for confidential computing, applied to a computing host, when a trusted execution environment of the computing host needs to transfer first data located in a confidential memory of the computing host to a confidential memory of a deep computing unit, characterized in that: include: Allocating corresponding storage space for the first data in the shared memory of the computing host using the trusted execution environment as a first shared storage space; Using the trusted execution environment to send a first data encryption migration instruction to a host processor or a first security processor; Using the host processor or the first security processor to encrypt the first data according to the first data encryption migration instruction using a preset national secret algorithm to obtain corresponding first ciphertext data, and writing the first ciphertext data into the first shared storage space; Using the trusted execution environment to send a first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as the second shared storage space; Using the trusted execution environment to send a first data migration instruction to a direct memory access module of the depth computing unit, so that the direct memory access module of the depth computing unit migrates the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction; Using the trusted execution environment to send a first confidential memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction as a first confidential storage space; The trusted execution environment is used to send a first data decryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit obtains the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, uses the national secret algorithm to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and writes the first plaintext data into the first confidential storage space.
2. The data transmission method for confidential computing according to claim 1, characterized in that: When the trusted execution environment needs to read the second data in the confidential memory of the deep computing unit into the confidential memory of the computing host, the method further includes: Allocating corresponding storage space for the second data in the confidential memory of the computing host using the trusted execution environment as a second confidential storage space; Using the trusted execution environment to send a second shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the second data in the shared memory of the deep computing unit according to the second shared memory allocation instruction as a third shared memory space; Using the trusted execution environment to send a second data encryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit uses the national secret algorithm to encrypt the second data located in the confidential memory of the deep computing unit according to the second data encryption migration instruction to obtain corresponding second ciphertext data, and write the second ciphertext data into the third shared storage space; Allocating corresponding storage space for the second ciphertext data in the shared memory of the computing host using the trusted execution environment as a fourth shared storage space; Using the trusted execution environment to send a second data migration instruction to the direct memory access module of the depth computing unit, so that the direct memory access module of the depth computing unit migrates the second ciphertext data located in the third shared memory space to the fourth shared memory space according to the second data migration instruction; Using the trusted execution environment to send a second data decryption migration instruction to the host processor or the first security processor; The host processor or the first security processor uses the national secret algorithm to decrypt the second ciphertext data located in the fourth shared storage space according to the second data decryption migration instruction to obtain the corresponding second plaintext data, and migrate the second plaintext data to the second confidential storage space.
3. The data transmission method for confidential computing according to claim 2, characterized in that: The first data is data to be confidentially calculated by the deep calculation unit, and the second data is data obtained through confidential calculation by the deep calculation unit.
4. The data transmission method for confidential computing according to claim 3, characterized in that: Before confidential computing, it also includes: Initializing the deep computing unit using a deep computing unit driver in the trusted execution environment to allocate corresponding storage space for a deep computing unit page table in a confidential memory of the deep computing unit, and sending a first register configuration instruction to a second security processor of the deep computing unit via the secure transmission channel, so that the second security processor of the deep computing unit configures a corresponding page table register for the deep computing unit page table according to the first register configuration instruction; During the confidential computing process, the method further includes: using the trusted execution environment to send a page table update instruction to the second security processor of the deep computing unit through the secure transmission channel, so that the second security processor of the deep computing unit updates the page table of the deep computing unit according to the page table update instruction.
5. The data transmission method for confidential computing according to claim 3, characterized in that: Before confidential computing, it also includes: Initializing the deep computing unit using a deep computing unit driver in the trusted execution environment to allocate corresponding storage space for a deep computing unit command queue in a confidential memory of the deep computing unit, and sending a second register configuration instruction to a second security processor of the deep computing unit via the secure transmission channel, so that the second security processor of the deep computing unit configures a corresponding command queue register for a deep computing unit page table according to the second register configuration instruction; During the confidential computing process, the method further includes: using the trusted execution environment to send a command queue add instruction to the second security processor of the deep computing unit through the secure transmission channel, so that the second security processor of the deep computing unit adds a command to the command queue of the deep computing unit according to the command queue add instruction.
6. The data transmission method for confidential computing according to claim 1 or 2, characterized in that: The national secret algorithm includes the SM4 algorithm.
7. A computing host, characterized in that: include: A trusted execution environment, configured to allocate corresponding storage space for first data in a shared memory of a computing host as a first shared storage space when first data located in a confidential memory of a computing host needs to be transferred to a confidential memory of a deep computing unit; Sending a first data encryption migration instruction to the host processor or the first security processor; It is also used to send a first shared memory allocation instruction to the computing engine or the second security processor of the deep computing unit through a preset secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as the second shared storage space; send a first data migration instruction to the direct memory access module of the deep computing unit, so that the direct memory access module of the deep computing unit migrates the first ciphertext data from the first shared storage space to the second shared storage space according to the first data migration instruction; Sending a first confidential memory allocation instruction to a computing engine or a second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit allocates corresponding storage space for the first data in the confidential memory of the deep computing unit as a first confidential storage space according to the first confidential memory allocation instruction; Sending a first data decryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit obtains the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, decrypts the first ciphertext data using a preset national secret algorithm to obtain corresponding first plaintext data, and writes the first plaintext data into the first confidential storage space; The host processor or the first security processor is used to encrypt the first data according to the first data encryption migration instruction using a preset national secret algorithm to obtain corresponding first ciphertext data, and write the first ciphertext data into the first shared storage space.
8. The computing host according to claim 7, wherein: The trusted execution environment is further configured to allocate corresponding storage space for the second data in the confidential memory of the computing host as a second confidential storage space when it is necessary to read the second data in the confidential memory of the deep computing unit into the confidential memory of the computing host; Sending a second shared memory allocation instruction to the computing engine or the second security processor of the depth computing unit through the secure transmission channel, so that the computing engine or the second security processor of the depth computing unit allocates corresponding storage space for the second data in the shared memory of the depth computing unit according to the second shared memory allocation instruction as a third shared storage space; Also configured to send a second data encryption migration instruction to the computing engine or the second security processor of the deep computing unit through the secure transmission channel, so that the computing engine or the second security processor of the deep computing unit encrypts the second data located in the confidential memory of the deep computing unit using the national secret algorithm according to the second data encryption migration instruction to obtain corresponding second ciphertext data, and writes the second ciphertext data into the third shared storage space; further configured to allocate corresponding storage space for the second ciphertext data in the shared memory of the computing host as a fourth shared storage space; and send a second data migration instruction to the direct memory access module of the depth computing unit, so that the direct memory access module of the depth computing unit migrates the second ciphertext data from the third shared storage space to the fourth shared storage space according to the second data migration instruction; further configured to send a second data decryption migration instruction to the host processor or the first security processor; The host processor or the first security processor is also used to decrypt the second ciphertext data located in the fourth shared storage space according to the second data decryption migration instruction, using the national secret algorithm to obtain corresponding second plaintext data, and migrate the second plaintext data to the second confidential storage space.
9. The computing host according to claim 7 or 8, characterized in that: The trusted execution environment is also used to initialize the deep computing unit using a deep computing unit driver before performing confidential computing, so as to allocate corresponding storage space for the deep computing unit page table in the confidential memory of the deep computing unit, and send a first register configuration instruction to the second security processor of the deep computing unit through the secure transmission channel, so that the second security processor of the deep computing unit configures the corresponding page table register for the deep computing unit page table according to the first register configuration instruction; and is also used to send a page table update instruction to the second security processor of the deep computing unit through the secure transmission channel during the confidential computing process, so that the second security processor of the deep computing unit updates the page table of the deep computing unit according to the page table update instruction.
10. The computing host according to claim 7 or 8, characterized in that: The trusted execution environment is also used to initialize the deep computing unit using a deep computing unit driver before performing confidential computing, so as to allocate corresponding storage space for the deep computing unit command queue in the confidential memory of the deep computing unit, and send a second register configuration instruction to the second security processor of the deep computing unit through the secure transmission channel, so that the second security processor of the deep computing unit configures the corresponding command queue register for the deep computing unit command queue according to the second register configuration instruction; and is also used to send a command queue add instruction to the second security processor of the deep computing unit through the secure transmission channel during the confidential computing process, so that the second security processor of the deep computing unit adds commands to the command queue of the deep computing unit according to the command queue add instruction.
11. The computing host according to claim 7 or 8, characterized in that: The national secret algorithm includes the SM4 algorithm.
12. A data transmission method for confidential computing, applied to a deep computing unit, characterized in that: include: When the trusted execution environment of the computing host needs to transfer the first data located in the confidential memory of the computing host to the confidential memory of the deep computing unit, the computing engine or the second security processor of the deep computing unit receives the first shared memory allocation instruction sent by the trusted execution environment through a preset secure transmission channel, and allocates corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as the second shared storage space; Using the direct memory access module of the deep computing unit to receive a first data migration instruction sent by the trusted execution environment, and migrating the first ciphertext data in the first shared storage space of the shared memory of the computing host to the second shared storage space according to the first data migration instruction; Using the computing engine or the second security processor of the deep computing unit to receive the first confidential memory allocation instruction sent by the trusted execution environment through the secure transmission channel, and allocating corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction as the first confidential storage space; The computing engine or the second security processor of the deep computing unit receives the first data decryption migration instruction sent by the trusted execution environment through the secure transmission channel, and obtains the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, uses the preset national secret algorithm to decrypt the first ciphertext data to obtain the corresponding first plaintext data, and writes the first plaintext data into the first confidential storage space.
13. The data transmission method for confidential computing according to claim 12, characterized in that: When the trusted execution environment needs to read the second data in the confidential memory of the deep computing unit into the confidential memory of the computing host, the method further includes: Adopting the computing engine or the second security processor of the deep computing unit to receive the second shared memory allocation instruction sent by the trusted execution environment through the secure transmission channel, and allocating corresponding storage space in the shared memory of the deep computing unit for the second data according to the second shared memory allocation instruction as the third shared storage space; The computing engine or the second security processor of the deep computing unit receives the second data encryption migration instruction sent by the trusted execution environment through the secure transmission channel, and encrypts the second data located in the confidential memory of the deep computing unit using the national secret algorithm according to the second data encryption migration instruction to obtain corresponding second ciphertext data, and writes the second ciphertext data into the third shared storage space; The direct memory access module of the deep computing unit is used to receive a second data migration instruction sent by the trusted execution environment of the computing host, and according to the second data migration instruction, the second ciphertext data in the third shared storage space in the shared memory of the deep computing unit is migrated to the fourth shared storage space in the shared memory of the computing host.
14. The data transmission method for confidential computing according to claim 12 or 13, characterized in that: Before confidential computing, it also includes: Using the second security processor of the deep computing unit to receive the first register configuration instruction sent by the trusted execution environment through the secure transmission channel, and configuring the corresponding page table register for the deep computing unit page table according to the first register configuration instruction; During the confidential computing process, the method further includes: using the second security processor of the deep computing unit to receive the page table update instruction sent by the trusted execution environment through the secure transmission channel, and updating the page table of the deep computing unit according to the page table update instruction.
15. The data transmission method for confidential computing according to claim 12 or 13, characterized in that: Before confidential computing, it also includes: Using the second security processor of the deep computing unit to receive the second register configuration instruction sent by the trusted execution environment through the secure transmission channel, and configuring the corresponding command queue register for the deep computing unit command queue according to the second register configuration instruction; During the confidential computing process, the method further includes: using the second security processor of the deep computing unit to receive the command queue addition instruction sent by the trusted execution environment through the secure transmission channel, and adding commands to the command queue of the deep computing unit according to the command queue addition instruction.
16. A depth calculation unit, characterized in that: include: A computing engine or a second security processor, configured to receive a first shared memory allocation instruction from the trusted execution environment through a preset secure transmission channel when the trusted execution environment of the computing host needs to transfer first data located in the confidential memory of the computing host to the confidential memory of the deep computing unit, and allocate corresponding storage space for the first ciphertext data in the shared memory of the deep computing unit according to the first shared memory allocation instruction as the second shared storage space; further configured to receive a first confidential memory allocation instruction from the trusted execution environment through the secure transmission channel, and allocate corresponding storage space for the first data in the confidential memory of the deep computing unit according to the first confidential memory allocation instruction as a first confidential storage space; further configured to receive a first data decryption migration instruction from the trusted execution environment via the secure transmission channel, obtain the first ciphertext data from the second shared storage space according to the first data decryption migration instruction, decrypt the first ciphertext data using a preset national secret algorithm to obtain corresponding first plaintext data, and write the first plaintext data into the first confidential storage space; A direct memory access module is used to receive a first data migration instruction sent by the trusted execution environment, and migrate the first encrypted data in the first shared storage space of the shared memory of the computing host to the second shared storage space according to the first data migration instruction.
17. The depth calculation unit according to claim 16, wherein: The computing engine or the second security processor is further configured to receive a second shared memory allocation instruction from the trusted execution environment through the secure transmission channel when the trusted execution environment needs to read the second data located in the confidential memory of the deep computing unit into the confidential memory of the computing host, and allocate corresponding storage space in the shared memory of the deep computing unit for the second data according to the second shared memory allocation instruction as a third shared storage space; further configured to receive a second data encryption migration instruction from the trusted execution environment via the secure transmission channel, and, based on the second data encryption migration instruction, encrypt the second data located in the confidential memory of the deep computing unit using the national secret algorithm to obtain corresponding second ciphertext data, and write the second ciphertext data into the third shared storage space; The direct memory access module is also used to receive a second data migration instruction sent by the trusted execution environment of the computing host, and migrate the second encrypted data in the third shared storage space in the shared memory of the deep computing unit to the fourth shared storage space in the shared memory of the computing host according to the second data migration instruction.
18. The depth calculation unit according to claim 16 or 17, characterized in that The second security processor is also used to receive the first register configuration instruction sent by the trusted execution environment through the secure transmission channel before performing confidential computing, and configure the corresponding page table register for the deep computing unit page table according to the first register configuration instruction; and is also used to receive the page table update instruction sent by the trusted execution environment through the secure transmission channel during the confidential computing process, and update the page table of the deep computing unit according to the page table update instruction.
19. The depth calculation unit according to claim 16 or 17, characterized in that The second security processor is also used to receive a second register configuration instruction sent by the trusted execution environment through the secure transmission channel before performing confidential computing, and configure the corresponding command queue register for the deep computing unit page table according to the second register configuration instruction; and is also used to receive a command queue addition instruction sent by the trusted execution environment through the secure transmission channel during confidential computing, and add commands to the command queue of the deep computing unit according to the command queue addition instruction.
20. A confidential computing system, characterized in that: It includes a computing host and a deep computing unit, the computing host is configured to execute the data transmission method for confidential computing described in any one of claims 1 to 6, and the deep computing unit is configured to execute the data transmission method for confidential computing described in any one of claims 12 to 15.
21. A storage medium, characterized in that The storage medium stores one or more computer-executable instructions, and the one or more computer-executable instructions are used to execute the data transmission method for confidential computing according to any one of claims 1 to 6 or 12 to 15.
22. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, they are used to implement the data transmission method for confidential computing as described in any one of claims 1 to 6 or 12 to 15.