Resource allocation method and device

By obtaining the requests of trusted applications in the rich execution environment and sending resource information to the trusted execution environment, we ensure that the hardware resources used by trusted applications in the trusted execution environment are within the scope of the tenant's application, and the problem of trusted applications being used beyond the resource scope is solved, and the orderly management of hardware resources is achieved.

CN119536976APending Publication Date: 2025-02-28HUAWEI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311125915.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the case where multiple tenants share a rich and trusted execution environment, trusted applications may use hardware resources beyond the scope of the tenant's requested hardware resources, resulting in confusion in hardware resource management.

Method used

By obtaining the request of a trusted application in a rich execution environment, and sending resource information and files of trusted application to the trusted execution environment, ensuring that the hardware resources used by the trusted application runtime are contained within the hardware resource scope indicated by the resource information.

Benefits of technology

It effectively limits the scope of hardware resource use of trusted applications, ensures orderly management of hardware resources in trusted execution environments, and avoids the problems of excessive resource utilization and management chaos.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536976A_ABST
    Figure CN119536976A_ABST
Patent Text Reader

Abstract

A resource allocation method and device are used for limiting hardware resources in a trusted execution environment used by a trusted application in hardware resources applied by tenants corresponding to the trusted application when a plurality of tenants share a rich execution environment and the trusted execution environment. In the application, the method is adapted to a resource allocation device comprising a rich execution environment and a trusted execution environment, and the method comprises the following steps: the rich execution environment obtains a trusted application request in a process of running a client application according to a file of the client application; in response to the trusted application request, the rich execution environment sends resource information and files of the trusted application to the trusted execution environment, the resource information indicating hardware resources in the resource allocation device that can be used by the trusted application. The trusted execution environment runs the trusted application according to the file and resource information of the trusted application, and hardware resources used when the trusted application runs are contained in hardware resources indicated by the resource information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the server field, and in particular to a resource allocation method and device. Background Art

[0002] With the use of servers based on the advanced RISC machines (ARM) architecture, trust zone technology is increasingly being used in data centers. Trust zone technology introduces a monitoring mode, which is divided into a secure world and a normal world. The monitoring mode has the highest security level, and it can be used to switch between the secure world and the normal world. The environment running in the secure world is usually called a trusted execution environment (TEE), and the environment running in the normal world is usually called a rich execution environment (REE). The rich execution environment provides an execution environment for client applications (CA), and the trusted execution environment provides an execution environment for trusted applications (TA). Client applications and trusted applications can implement the functions of the entire application (APP).

[0003] When multiple tenants share the rich execution environment and the trusted execution environment, the rich execution environment can allocate hardware resources within the tenant's application scope to each tenant's virtual machine (VM), so that the client applications running in the virtual machine can only occupy the hardware resources within the tenant's application scope. However, the trusted execution environment cannot provide virtual machine functions, and there is a problem that the trusted application uses the hardware resources in the trusted execution environment beyond the scope of the hardware resources applied by the tenant, resulting in confusion in the management of hardware resources in the trusted execution environment. Summary of the invention

[0004] The present application provides a resource allocation method and device for limiting the hardware resources in a trusted execution environment used by a trusted application to the hardware resources requested by the tenant corresponding to the trusted application when multiple tenants share a rich execution environment and a trusted execution environment.

[0005] In a first aspect, the present application provides a resource allocation method, which is suitable for a resource allocation device including a rich execution environment and a trusted execution environment, wherein the rich execution environment includes a virtual machine, and the virtual machine includes files of a client application and files of a trusted application corresponding to the files of the client application. The method includes: the rich execution environment obtains a trusted application request in the process of running a client application according to the files of the client application. In response to the trusted application request, the rich execution environment sends resource information and files of the trusted application to the trusted execution environment, and the resource information indicates the hardware resources in the resource allocation device that the trusted application can use. The trusted execution environment runs the trusted application according to the files and resource information of the trusted application, wherein the hardware resources used when the trusted application is running are included in the hardware resources indicated by the resource information. Exemplarily, the resource allocation device includes one or more servers, and the architecture of the server is, for example, an ARM architecture. Optionally, the hardware resources used when the trusted application is running are included in the hardware resources indicated by the resource information, and specifically, the hardware resources used when the trusted application is running are limited to the hardware resources indicated by the resource information.

[0006] In the above technical solution, the rich execution environment sends the files and resource information of the trusted application to the trusted execution environment, so that when the trusted execution environment runs the files of the trusted application, it can include the hardware resources used by the trusted application during runtime in the hardware resources indicated by the resource information based on the resource information. That is, the hardware resources used by the trusted application during runtime are included in the hardware resources applied for by the tenant to which the virtual machine belongs, which helps to ensure the orderly management of hardware resources in the trusted execution environment.

[0007] In a possible implementation, when the trusted execution environment runs the trusted application according to the file and resource information of the trusted application, the trusted execution environment may allocate the hardware resources indicated by the resource information to the trusted application, and then run the trusted application according to the file of the trusted application on the hardware resources indicated by the resource information. In the above technical solution, before running the trusted application, the trusted execution environment allocates the hardware resources that the trusted application can use to ensure that the hardware resources used by the trusted application when running are included in the hardware resources indicated by the resource information.

[0008] In a possible implementation, before the rich execution environment sends resource information and files of the trusted application to the trusted execution environment, it also obtains the storage address of the files of the trusted application in the virtual machine, and obtains the files of the trusted application from the virtual machine according to the storage address. In the above technical solution, the files of the client application and the files of the trusted application are deployed to the virtual machine together by the tenant, and the rich execution environment can first determine the storage address of the files of the trusted application in the virtual machine, and then obtain the files of the trusted application from the virtual machine according to the storage address.

[0009] In a possible implementation, before the rich execution environment sends the resource information and the trusted application file to the trusted execution environment, the resource information is also determined based on the virtual machine identifier, the mapping relationship between the virtual machine identifier maintained in the rich execution environment and the resource information. In the above technical solution, the rich execution environment can maintain multiple virtual machine identifiers and the resource information corresponding to each virtual machine identifier, and then the rich execution environment can determine the resource information corresponding to the virtual machine identifier based on the identifier of the virtual machine that currently initiates the trusted application request.

[0010] In a possible implementation, the file of the trusted application includes the running code of the trusted application and the identification of the trusted application. After the rich execution environment sends the resource information and the file of the trusted application to the trusted execution environment, the trusted execution environment can also receive the resource information and the file of the trusted application, and maintain the mapping relationship between the identification of the trusted application and the resource information. In the above technical solution, the trusted execution environment can maintain the identification of multiple trusted applications and the resource information corresponding to the identification of each trusted application, and then allocate hardware resources corresponding to the resource information to each trusted application, and ensure that the hardware resources used by each trusted application at runtime are included in the hardware resources applied for by the tenant of the virtual machine to which it belongs.

[0011] In a possible implementation, the hardware resources include one or more of processor resources and memory resources.

[0012] In one possible implementation, before the rich execution environment obtains the trusted application request, it also obtains a virtual machine request, which includes resource information. In response to the virtual machine request, the rich execution environment creates a virtual machine in the rich execution environment and generates a mapping relationship between the virtual machine's identifier and the resource information. The rich execution environment allocates the hardware resources indicated by the resource information to the virtual machine, and runs the virtual machine on the hardware resources indicated by the resource information, that is, runs the client application on the hardware resources indicated by the resource information according to the files of the client application contained in the virtual machine. In the above technical solution, the rich execution environment can establish a mapping relationship between the virtual machine's identifier and the resource information when creating the virtual machine, so as to be used in the subsequent sending of the files of the trusted application to the trusted execution environment.

[0013] In a possible implementation, the rich execution environment includes a virtual machine simulator and a driver. The virtual machine simulator records the mapping relationship between the virtual machine's identification and resource information. The driver is used for communication between the rich execution environment and the trusted execution environment. When the rich execution environment sends resource information and files of the trusted application to the trusted execution environment, specifically, the virtual machine simulator determines the resource information based on the identification of the virtual machine and the mapping relationship between the identification of the virtual machine maintained in the virtual machine simulator and the resource information, and sends the resource information to the driver. The client application determines the storage address of the file of the trusted application in the virtual machine, sends the storage address to the driver, and the driver obtains the file of the trusted application from the virtual machine based on the storage address. Subsequently, the driver sends the resource information and files of the trusted application to the trusted execution environment.

[0014] In a second aspect, the present application provides a resource allocation device, which includes: a rich execution environment and a trusted execution environment. The rich execution environment includes a virtual machine, and the virtual machine includes files of a client application and files of a trusted application corresponding to the files of the client application. The rich execution environment is used to: in the process of running a client application according to the files of the client application, obtain a trusted application request, and in response to the trusted application request, send resource information and files of the trusted application to the trusted execution environment, wherein the resource information indicates hardware resources in the resource allocation device that the trusted application can use. The trusted execution environment is used to: run a trusted application according to the files and resource information of the trusted application, wherein the hardware resources used by the trusted application during operation are included in the hardware resources indicated by the resource information.

[0015] In one possible implementation, when the trusted execution environment runs a trusted application based on the files and resource information of the trusted application, it is specifically used to: allocate hardware resources indicated by the resource information to the trusted application, and then run the trusted application based on the files of the trusted application on the hardware resources indicated by the resource information.

[0016] In a possible implementation, before the rich execution environment sends resource information and the trusted application file to the trusted execution environment, it is further configured to: obtain the storage address of the trusted application file in the virtual machine, and obtain the trusted application file from the virtual machine according to the storage address.

[0017] In a possible implementation, before the rich execution environment sends the resource information and the trusted application file to the trusted execution environment, it is further configured to: determine the resource information according to the virtual machine identifier, the mapping relationship between the virtual machine identifier maintained in the rich execution environment and the resource information.

[0018] In a possible implementation, the file of the trusted application includes the running code of the trusted application and the identification of the trusted application. The trusted execution environment is also used to: after the rich execution environment sends the resource information and the file of the trusted application to the trusted execution environment, receive the resource information and the file of the trusted application, and maintain the mapping relationship between the identification of the trusted application and the resource information.

[0019] In a possible implementation, the hardware resources include one or more of processor resources and memory resources.

[0020] In a possible implementation, before the rich execution environment obtains the trusted application request, it is further used to: obtain a virtual machine request, the virtual machine request includes resource information. In response to the virtual machine request, a virtual machine is created in the rich execution environment, a mapping relationship between the virtual machine identifier and the resource information is generated, the hardware resources indicated by the resource information are allocated to the virtual machine, and the virtual machine is run on the hardware resources indicated by the resource information.

[0021] In one possible implementation, the rich execution environment includes a virtual machine simulator and a driver. The virtual machine simulator records the mapping relationship between the virtual machine's identification and resource information. The driver is used for communication between the rich execution environment and the trusted execution environment. Specifically, the virtual machine simulator is used to determine resource information based on the identification of the virtual machine, the mapping relationship between the identification of the virtual machine maintained in the virtual machine simulator and resource information, and send the resource information to the driver. Correspondingly, the driver is used to receive resource information from the virtual machine simulator. The client application is used to determine the storage address of the trusted application's file in the virtual machine and send the storage address to the driver. Correspondingly, the driver is used to receive the storage address from the client application and obtain the trusted application's file from the virtual machine based on the storage address. The driver is also used to send resource information and trusted application files to the trusted execution environment.

[0022] In a third aspect, the present application provides a resource allocation device, including a module for executing the method in the above-mentioned first aspect or any possible implementation of the first aspect. Exemplarily, the resource allocation device includes a rich execution environment module and a trusted execution environment module, and further, the rich execution environment module includes a first processing module and a first transceiver module, and the trusted execution environment module includes a second processing module and a second transceiver module. Exemplarily, the first processing module obtains a trusted application request in the process of running a client application according to the file of the client application, and in response to the trusted application request, controls the first transceiver module to send resource information and the file of the trusted application to the second transceiver module, and the resource information indicates the hardware resources in the resource allocation device that the trusted application can use. The second processing module is used to control the second transceiver module to receive the resource information and the file of the trusted application from the first transceiver module, and run the trusted application according to the file and resource information of the trusted application, wherein the hardware resources used by the trusted application when running are included in the hardware resources indicated by the resource information.

[0023] In a fourth aspect, the present application provides a computing device, including a processor, the processor being connected to a memory, the memory being used to store a computer program, and the processor being used to execute the computer program stored in the memory, so that the computing device executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0024] In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a device, the method in the above-mentioned first aspect or any possible implementation method of the first aspect is implemented.

[0025] In a sixth aspect, the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a device, the method in the above-mentioned first aspect or any possible implementation manner of the first aspect is implemented.

[0026] In a seventh aspect, the present application further provides a chip system, the chip system comprising a processor and an interface circuit. The processor and the interface circuit can be interconnected via a line. Exemplarily, the interface circuit can read an instruction stored in a memory and send the instruction to the processor. When the instruction is executed by the processor, the chip system executes the method in the first aspect or any possible implementation of the first aspect.

[0027] The technical effects that can be achieved in any of the second to seventh aspects mentioned above can refer to the description of the beneficial effects in the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1A schematic diagram of a use case of a software provided for this application running at each abnormal level;

[0029] Figure 2 An ARM architecture based on trust zone technology provided for this application;

[0030] Figure 3 A schematic diagram of a time-division multiplexing mechanism provided for this application;

[0031] Figure 4 A schematic diagram of a public cloud scenario provided for this application;

[0032] Figure 5 A flowchart of a resource allocation method provided in this application;

[0033] Figure 6 A flowchart of another resource allocation method provided in this application;

[0034] Figure 7 A schematic diagram of the structure of a resource allocation device provided in this application. DETAILED DESCRIPTION

[0035] The following first explains the relevant technical features involved in the embodiments of the present application. It should be noted that these explanations are intended to make the embodiments of the present application easier to understand and should not be regarded as limiting the scope of protection claimed by the present application.

[0036] 1. Exception level (EL)

[0037] In the ARM architecture, there can be 4 exception levels (referred to as EL0 to EL3), and the software needs to run at one of these 4 exception levels. Among them, the exception level is similar to the privilege level. The larger the exception level, the higher the privilege level. Figure 1It is a use case where software runs at each exception level: EL0: ordinary application (APP); EL1: operating system kernel (such as guest operating system (guest OS)), usually described as a privileged program; EL2: virtual machine manager (hypervisor), where the virtual machine manager can be used to implement computing virtualization, network virtualization and storage virtualization of virtual machines, responsible for managing virtual machines, etc.; EL3: secure monitor. Normally, software only works at a certain exception level. However, this rule does not apply to virtual machine hypervisors. For example, in-kernel hypervisors need to enter EL1 to manage different virtual machine programs, so in-kernel hypervisors can work across EL1 and EL2.

[0038] 2. Virtual Machine (VM)

[0039] Based on virtualization technology, independent virtual computers are created. The created virtual computers can be referred to as virtual machines. One or more applications can run in a virtual machine. Applications running in different virtual machines usually use different hardware resources.

[0040] 3. Trust Zone Technology

[0041] Figure 2 An ARM architecture based on the trust zone technology is shown as an example. The ARM architecture is divided into two worlds, namely, a non-secure world and a secure world. A rich execution environment runs in the non-secure world, and a trusted execution environment runs in the secure world.

[0042] The rich execution environment can also be called a common execution environment, which can run multiple virtual machines, each of which includes one or more application files, and each application file can further include client application files and trusted application files. The virtual machine can run the client application in the virtual machine based on the client application files. The trusted application files need to be sent to the trusted execution environment, and then the trusted execution environment (or the operating system in the trusted execution environment) runs the trusted application in the trusted execution environment according to the trusted application files.

[0043] Furthermore, the virtual machine also includes a client operating system, and client applications can run on the client operating system. The client application is located in EL0, and the client operating system is located in EL1. The rich execution environment also includes a host operating system, and the host operating system includes a virtual machine simulator, a virtual machine hypervisor, and a driver. Furthermore, the virtual machine simulator can be used to receive virtual machine requests from the cloud management platform and deploy virtual machines based on the virtual machine requests. The virtual machine simulator is a user state program and can be located in EL1. The virtual machine hypervisor can be used to manage multiple virtual machines, and the virtual machine hypervisor is located in EL2. The driver can be used to achieve communication between the rich execution environment and the trusted execution environment, and the driver can be located in EL2. The virtual machine hypervisor and the driver are located in the kernel or kernel virtual machine (KVM).

[0044] It should be noted that the rich execution environment does not mean that the operating system or software running in it is malicious, but the security of the rich execution environment is lower than that of the trusted execution environment. Usually, when the central processing unit (CPU) works in the rich execution environment, the resources of the trusted execution environment (such as registers, memory, cache, peripherals, etc.) are prohibited from access.

[0045] A trusted execution environment can also be called a secure execution environment. A trusted execution environment operating system (TEE OS or TOS) can be run in a trusted execution environment. Trusted applications can be run on top of the trusted execution environment operating system. Trusted applications can execute corresponding functions under the call of client applications, such as fingerprint matching services, password verification services, face matching services, etc. Exemplarily, a trusted execution environment can be applied to one or more of the following purposes: 1. Content protection mechanism: To prevent theft of some high-definition movies, music, etc. 2. Mobile financial services: mobile payment, etc. 3. Authentication: fingerprint recognition, facial recognition, etc. 4. Protection of confidential information for enterprises or governments. When the CPU works in a trusted execution environment, it can access both the resources of the rich execution environment and the resources of the trusted execution environment. The trusted execution environment can provide system-level security services.

[0046] As a possible implementation, the secure monitor located in EL3 can act as a gateway for moving between the non-secure world and the secure world, that is, switching between the secure world and the non-secure world can be performed through the secure monitor.

[0047] 4. Time-division multiplexing mechanism

[0048] ARM servers can use a time-sharing multiplexing mechanism to enable the CPU in the ARM server to run in the secure world and the non-secure world respectively. Figure 3 A schematic diagram of a time-sharing multiplexing mechanism is shown as an example, with trusted applications and client applications running on the CPU, and the client application further includes process A and process B. In the 0th to 3rd time slices, the CPU is in the non-secure world, and the CPU can execute process A. In the 4th time slice, the CPU performs process switching, and in the 5th to 8th time slices, it executes process B. It can be understood that the CPU is still in the non-secure world at this time. In the 9th time slice, the CPU switches from the non-secure world to the secure world, and then runs the trusted application in the 10th and 11th time slices.

[0049] like Figure 4 A possible public cloud scenario includes a data center, the Internet, and a client. The data center includes a cloud management platform, an internal network of the data center, and a server cluster (it can be understood that the server cluster may include multiple servers, Figure 4 This is just an example of three servers).

[0050] The cloud management platform exchanges information with servers in the server cluster through the internal network of the data center.

[0051] From a hardware perspective, a server includes a processor, memory, network card, and hard disk. The processor, memory, network card, and hard disk are connected via a bus. Examples of buses include the high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIe) bus and the unified bus (UB).

[0052] Among them, the processor and memory are used to provide computing resources. Specifically, the processor may include one or more of a CPU, a graphics processing unit (GPU), a neural-network processing unit (NPU), and a data processing unit (DPU) (for the convenience of description, the processor may be a CPU as an example below). The processor can be used to process access requests from outside the server (such as a client), and also to process requests generated inside the server. The server may include one or more processors, and a processor has one or more processor cores.

[0053] Memory refers to the internal storage that directly exchanges data with the processor. It can read and write data at any time and at a very fast speed. It serves as a temporary data storage for the operating system or other running programs. Memory includes at least two types of memory. For example, memory can be either random access memory or read-only memory (ROM). For example, random access memory is dynamic random access memory (DRAM) or storage class memory (SCM). Read-only memory is programmable read only memory (PROM), erasable programmable read only memory (EPROM), etc. In addition, memory can also be a dual in-line memory module or a dual-line memory module (DIMM), that is, a module composed of DRAM, or a solid state disk (SSD).

[0054] From the software level, the server can be an ARM architecture, which includes a rich execution environment and a trusted execution environment. For details, see Figure 1 and Figure 2 Described in the relevant embodiments.

[0055] Tenants of the cloud management platform can log in to the cloud management platform through the client and apply for virtual machine resources in the cloud management platform. Accordingly, the cloud management platform can create a virtual machine that the tenant can use for the tenant on the rich execution environment side of the server cluster based on the tenant's application. Furthermore, the tenant can also log in to the cloud management platform through the client, and then log in and operate the created virtual machine, such as deploying applications in the virtual machine. Exemplarily, the client can be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, etc.

[0056] Exemplarily, the server cluster includes servers 1 to 3, wherein server 1 includes CPUs 1 to 4, server 2 includes CPUs 5 to 8, and server 3 includes CPUs 9 to 12. The CPU resources applied for by tenant 1 are CPUs 1 to 5. The cloud management platform can create virtual machine 1 for tenant 1 on the rich execution environment side in the server cluster, and set the application deployed in virtual machine 1 to occupy only CPUs 1 to 5. Furthermore, tenant 1 can deploy the files of application 1 in virtual machine 1, and the files of application 1 include the files of client application 1. Virtual machine 1 can run client application 1. In other words, client application 1 can occupy CPUs 1 to 5.

[0057] The CPU resources applied for by tenant 2 are CPU6 to CPU10. The cloud management platform can create virtual machine 2 for tenant 2 on the rich execution environment side in the server cluster, and set the application deployed in virtual machine 2 to only occupy CPU6 to CPU10. Furthermore, tenant 2 can deploy the files of application 2 and application 3 together in virtual machine 2. The files of application 2 include the files of client application 2, and the files of application 3 include the files of client application 3. Virtual machine 2 can run client application 2 and client application 3. In other words, both client application 2 and client application 3 can occupy CPU6 to CPU10.

[0058] It can be understood that a client application can only occupy the CPU resources corresponding to the virtual machine to which it belongs, and cannot occupy other CPU resources besides the CPU resources corresponding to the virtual machine to which it belongs.

[0059] Furthermore, the rich execution environment can send the file of the trusted application corresponding to the client application to the trusted execution environment. Accordingly, the trusted execution environment can run the trusted application corresponding to the client application, so that the client application can request the security service of the trusted application in the trusted execution environment. However, the trusted execution environment cannot provide virtualization capabilities, that is, it cannot limit the hardware resources used by the trusted application to the range of the hardware resources applied by the tenant through the virtual machine. In combination with the above example, the file of application 1 also includes the file of trusted application 1 corresponding to client application 1. After the rich execution environment sends the file of trusted application 1 to the trusted execution environment, the trusted execution environment can run the trusted application 1. As a part of application 1, the CPU resources occupied by trusted application 1 should be limited to CPU1 to CPU5. However, since the trusted execution environment does not provide virtualization capabilities, trusted application 1 may occupy other CPU resources, such as preempting CPU6 to CPU10. Similarly, the file of application 2 also includes the file of trusted application 2 corresponding to client application 2. After the rich execution environment sends the file of trusted application 2 to the trusted execution environment, the trusted execution environment can run the trusted application 2, but trusted application 2 may occupy other CPU resources except CPU6 to CPU10. Thus, there is a problem of confusion in the use of CPU resources in the trusted execution environment.

[0060] It is understandable that the above is only an example of the problem existing in the public cloud. The application scenario of this application is not limited to the public cloud scenario, but can also be applied to the hybrid cloud scenario, or other possible scenarios where multiple tenants share the rich execution environment and the trusted execution environment.

[0061] To this end, the present application provides a resource allocation method, which can be used to limit the hardware resources in the trusted execution environment used by the trusted application to the application scope of the tenant corresponding to the trusted application when multiple tenants share the rich execution environment and the trusted execution environment.

[0062] Specifically, the resource allocation method is applicable to a resource allocation device, which may be Figure 4 In the relevant embodiments, a cluster consisting of multiple servers or a single server, the architecture of the server is, for example, an ARM architecture. The resource allocation device includes a rich execution environment and a trusted execution environment shared by multiple tenants.

[0063] When a tenant needs to deploy a virtual machine to a rich execution environment, the tenant can first apply for hardware resources that the virtual machine can use from the rich execution environment. Accordingly, the rich execution environment can maintain resource information corresponding to each virtual machine. Exemplarily, the rich execution environment maintains a mapping relationship between the identifiers of multiple virtual machines and multiple resource information. The resource information can be used to indicate the hardware resources of the server that can be used by the application in the corresponding virtual machine.

[0064] Among them, the hardware resources can be one or more of the processor resources and memory resources, wherein the processor resources can specifically be one or more of the CPU resources, GPU resources, NPU resources, and DPU resources. Correspondingly, the resource information corresponding to the processor resources is, for example, the identification of the processor. Taking the processor resource as the CPU resource as an example, the resource information corresponding to the CPU resource is, for example, the identification of the CPU; the resource information corresponding to the memory resource includes, for example, the physical address and length. For the convenience of description, the following explanation is based on the example that the hardware resource is the CPU resource.

[0065] Exemplarily, the rich execution environment receives a virtual machine request, which may include resource information of hardware resources applied for by the tenant for the virtual machine. Accordingly, the rich execution environment can respond to the virtual machine request, create a virtual machine, and generate a mapping relationship between the virtual machine's identifier and the resource information, and store the mapping relationship between the virtual machine's identifier and the resource information in the memory.

[0066] For example, the rich execution environment receives a virtual machine request 1, which is used to deploy a virtual machine 1 in the rich execution environment for a tenant 1. Further, the virtual machine request 1 includes resource information 1. After the rich execution environment deploys the virtual machine 1, the rich execution environment can maintain the mapping relationship between the identifier of the virtual machine 1 and the resource information 1. Exemplarily, the resource information 1 includes the identifiers of CPU1 to CPU5. Similarly, the rich execution environment receives a virtual machine request 2, which is used to deploy a virtual machine 2 in the rich execution environment for a tenant 2. Further, the virtual machine request 2 includes resource information 2. After the rich execution environment deploys the virtual machine 2, the rich execution environment can maintain the mapping relationship between the identifier of the virtual machine 2 and the resource information 2. Exemplarily, the resource information 2 includes the identifiers of CPU6 to CPU10.

[0067] Furthermore, the rich execution environment can also receive an application deployment request, which includes application files. In response to the application deployment request, the rich execution environment deploys the application files in the corresponding virtual machine. The application files may further include client application files and trusted application files corresponding to the client application. Here, the files of an application deployed in a virtual machine may be one or more, or it can be understood that one or more applications can be running in a virtual machine. In conjunction with the above example, the rich execution environment also receives application deployment request 1, which includes application 1 files and the identifier of virtual machine 1. In response to application deployment request 1, the rich execution environment deploys application 1 files in virtual machine 1; the rich execution environment also receives application deployment request 2, which includes application 2 files, application 3 files and the identifier of virtual machine 2. In response to application deployment request 2, the rich execution environment deploys application 2 files and application 3 files in virtual machine 2.

[0068] Optionally, the virtual machine request also includes capability information, and the capability information is used to indicate whether the virtual machine deployed by the virtual machine request has the capability of a trusted execution environment, or in other words, the capability information is used to indicate whether the files of the trusted application can be sent to the trusted execution environment, or in other words, whether the trusted application can run in the trusted execution environment. The trusted application files here are the trusted application files included in the application files deployed when the rich execution environment responds to the application deployment request.

[0069] It is understandable that when a tenant deploys a virtual machine, he or she can choose whether to apply for a trusted execution environment capability for the virtual machine. When a tenant applies for a trusted execution environment capability for a virtual machine, the trusted application corresponding to the client application in the virtual machine can run in the trusted execution environment; when a tenant does not apply for a trusted execution environment capability for a virtual machine, the trusted application corresponding to the client application in the virtual machine cannot run in the trusted execution environment. Accordingly, the rich execution environment also maintains information on whether the virtual machine has the trusted execution environment capability.

[0070] For the convenience of description, a virtual machine (referred to as the first virtual machine) in a rich execution environment may be used as an example. The first virtual machine has files of a first application deployed therein, and the files of the first application may include files of a first client application and files of a first trusted application. The first client application is running in the first virtual machine, and when the first virtual machine has the trusted execution environment capability, the first trusted application is running in the trusted execution environment. The resource information corresponding to the first virtual machine is recorded as the first resource information.

[0071] like Figure 5 A schematic diagram of a resource allocation method provided as an example for this application:

[0072] Step 501: The rich execution environment obtains a trusted application request during the process of running a first client application according to a file of the first client application.

[0073] Specifically, the rich execution environment obtains a trusted application request from the first client application, wherein the first client application may generate the trusted application request based on a trigger of a tenant, a trigger of other applications, or based on its own operating logic.

[0074] For example, in a tenant-based triggering scenario, after receiving an encryption request from the tenant, the first client application determines that a key is needed to process the encryption request, and the key is confidential data that has been stored in the trusted execution environment. That is, the key can be used by the first trusted application but cannot be used by the first client application. The first client application can then generate a trusted application request, which can be used to request the rich execution environment to send the file of the first trusted application to the trusted execution environment, so that the trusted execution environment can run the first trusted application based on the file of the first trusted application, and complete data encryption based on the call of the first client application.

[0075] Exemplarily, after obtaining the trusted application request, the rich execution environment can determine which virtual machine the client application running in initiated the trusted application request, that is, obtain the identifier of the first virtual machine. Subsequently, the rich execution environment determines whether the first virtual machine has the trusted execution environment capability based on the identifier of the first virtual machine. If the rich execution environment determines that the first virtual machine has the trusted execution environment capability, the following step 502 is executed; if the rich execution environment determines that the first virtual machine does not have the trusted execution environment capability, at least one or more of the following is executed: reject the trusted application request, ignore the trusted application request, and prompt the tenant to apply for the trusted execution environment capability for the first virtual machine through the client.

[0076] Step 502: In response to the trusted application request, the rich execution environment sends first resource information and a file of the first trusted application to the trusted execution environment, wherein the first resource information indicates hardware resources in a resource allocation device that can be used by the first trusted application. Accordingly, after identifying the first resource information and the file of the first trusted application, the trusted execution environment maintains a mapping relationship between the identifier of the first trusted application and the first resource information.

[0077] Optionally, before the rich execution environment sends the first resource information and the file of the first trusted application to the trusted execution environment, the following operations (1) and (2) may be performed:

[0078] Operation (1), the rich execution environment determines the first resource information according to the identification of the first virtual machine and the mapping relationship between the identifications of multiple virtual machines and multiple resource information maintained. In combination with the above example, when the rich execution environment determines that the identification of the first virtual machine is virtual machine 1, the first resource information is determined to be resource information 1; or, when the rich execution environment determines that the identification of the first virtual machine is virtual machine 2, the first resource information is determined to be resource information 2.

[0079] In operation (2), the rich execution environment may obtain the storage address (referred to as the first address) of the file of the first trusted application in the first virtual machine, and then obtain the file of the first trusted application from the first virtual machine according to the first address. The file of the first trusted application includes the identifier of the first trusted application, the running code of the first trusted application, etc. The identifier of the first trusted application is, for example, a universally unique identifier (UUID).

[0080] Combination Figure 2 In the ARM architecture in the cloud management platform, the rich execution environment includes not only the first virtual machine, but also a virtual machine simulator and a driver. Among them, the virtual machine simulator can be used to receive a virtual machine request from the cloud management platform, deploy the virtual machine based on the virtual machine request, and maintain the mapping relationship between the virtual machine's identification and resource information after the virtual machine is deployed. It can also be understood that the virtual machine simulator maintains a mapping relationship between the identification of multiple virtual machines and multiple resource information. The virtual machine simulator is, for example, a quick emulator (QEMU). The driver can be used to implement communication between the rich execution environment and the trusted execution environment. For example, after the driver receives a call request from a client application, it forwards the call request to the trusted execution environment through hardware functions. The driver is, for example, a trust zone driver (TZ driver).

[0081] In one possible manner, the rich execution environment sends the first resource information and the file of the first trusted application to the trusted execution environment. Specifically, the virtual machine simulator determines the first resource information based on the identifier of the first virtual machine, the mapping relationship between the identifier of the first virtual machine maintained in the virtual machine simulator and the first resource information, and sends the first resource information to the driver. Correspondingly, the driver receives the first resource information from the virtual machine simulator. The client application determines the storage address (i.e., the first address) of the file of the first trusted application in the virtual machine, sends the first address to the driver, and correspondingly, the driver receives the first address from the client application, and obtains the file of the first trusted application from the virtual machine based on the first address. Subsequently, the driver sends the first resource information and the file of the first trusted application to the trusted execution environment.

[0082] In one possible manner, the rich execution environment sends the first resource information and the file of the first trusted application to the trusted execution environment, which can be specifically divided into two parts: creating a context part and creating a session part:

[0083] Part 1: Creating the context.

[0084] Based on how the virtual machine simulator writes the first resource information to the driver, it can be further divided into the following two implementation methods:

[0085] Implementation method 1: The virtual machine simulator writes the first resource information into a create context request, and sends the context request to the driver.

[0086] The first client application can send a create context request to the driver through the virtual machine simulator. In this process, the virtual machine simulator can identify that the initiator of the create context request is the client application in the first virtual machine, and then determine the first resource information based on the identifier of the first virtual machine and the mapping relationship between the identifiers of multiple virtual machines and multiple resource information maintained in the virtual machine simulator, and then write the first resource information into the create context request. Furthermore, after receiving the create context request, the driver can respond to the create context request, create a context, and store the first resource information and context in the memory.

[0087] Alternatively, it can be understood that the first client application sends a first create context request to the virtual machine simulator. After receiving the first create context request, the virtual machine simulator identifies that the initiator of the first create context request is the client application in the first virtual machine, and then determines the first resource information based on the identifier of the first virtual machine and the mapping relationship between the identifiers of multiple virtual machines and multiple resource information maintained in the virtual machine simulator, writes the first resource information into the first create context request, and obtains a second create context request. The virtual machine simulator sends the second create context request to the driver. After receiving the second create context request, the driver can respond to the second create context request, create a context, and store the first resource information and context in the memory.

[0088] In one possible implementation, the first create context request may include address 1, and address 1 is used to indicate that after the driver successfully generates the context, the context may be stored in the memory corresponding to address 1. The second create context request may include address 1 and address 2, that is, the virtual machine simulator may also write address 2 into the first create context request, and address 2 is used to indicate that after the driver successfully generates the context, the first resource information may be stored in the memory corresponding to address 2.

[0089] The process can also be considered as follows: the driver includes a create context interface, and the first client application calls the create context interface in the driver through the virtual machine simulator, that is, the create context request is a request to call the create context interface. The input of the create context interface includes the first resource information, and the output of the create context interface includes: success or failure of creating the context. Exemplarily, the input of the create context interface also includes address 1 and address 2.

[0090] In one possible implementation, after receiving a create context request from a first client application, the virtual machine simulator can determine whether the create context request is a global platform (GP) call request. If so, it adds the first resource information and address 2 to the extended information of the GP call request, and then sends the GP call request to the driver.

[0091] The context may be considered as a handle, which may be a unique string. Exemplarily, the first client application may create a session associated with the context based on the context, and index the session according to the context, and then send a call command to the first trusted application based on the session.

[0092] Implementation method 2: The virtual machine simulator writes the first resource information into a registration request and sends the registration request to the driver.

[0093] The first client application may send a create context request to the driver through the virtual machine simulator. After receiving the create context request, the driver may respond to the create context request, create a context, and store the context in the memory. In one possible implementation, the create context request includes address 1, and the address 1 is used to instruct the driver to store the context in the memory corresponding to the address 1 after successfully generating the context.

[0094] The process can also be considered as follows: the driver includes a create context interface, and the first client application calls the create context interface in the driver through the virtual machine simulator, that is, the create context request is a request to call the create context interface. Exemplarily, the input of the create context interface includes address 1, and the output of the create context interface includes: success or failure of creating the context.

[0095] In addition, the virtual machine simulator can not only forward the create context request from the first client application to the driver, but also identify that the initiator of the create context request is the client application in the first virtual machine, and then determine the first resource information according to the identifier of the first virtual machine and the mapping relationship between the identifiers of multiple virtual machines and multiple resource information maintained in the virtual machine simulator, write the first resource information into the registration request, send the registration request to the driver, and correspondingly, the driver stores the first resource information in the memory. In a possible implementation, the registration request also includes address 2, and address 2 is used to instruct the driver to store the first resource information in the memory corresponding to address 2.

[0096] The process can also be considered that the driver also includes a registration interface, and the virtual machine simulator calls the driver's registration interface, that is, the registration request is a request to call the registration interface. The input of the registration interface includes the first resource information, and the output of the registration interface includes: write success or failure. In addition, the input of the registration interface also includes address 2.

[0097] Part 2: Creating a session.

[0098] In a specific implementation, the first client application obtains the context from the memory according to address 1, and the first client application determines the storage address (i.e., the first address) of the file of the first trusted application in the first virtual machine, and then generates a create session request according to the context and the first address, wherein the create session request carries the context and the first address. The first client application sends a create session request to the driver through the virtual machine emulator. The driver can respond to the create session request and obtain the first resource information from address 2 of the memory according to the context, and the context can be considered as a credential for the driver to obtain the first resource information. Subsequently, the driver obtains the file of the first trusted application from the first virtual machine according to the first address, and sends the file of the first trusted application and the first resource information to the trusted execution environment together.

[0099] Correspondingly, after identifying the file of the first trusted application and the first resource information, the trusted execution environment (specifically, it can be a trusted execution environment operating system) maintains the mapping relationship between the identifier of the first trusted application and the first resource information. The driver creates a session between the first trusted application and the first client application. Among them, the session is used by the first client application to call the function of the first trusted application. The process can also be considered that the first client application can call the driver's create session interface through the virtual machine simulator, that is, the create session request is a request to call the create session interface. The input of the create session interface includes a context and a first address, and the output of the create context interface includes: a session identifier of successful creation.

[0100] Optionally, the driver may create a mapping relationship between the context and the session identifier, which may be used by the first client application to index the session identifier according to the context, and further determine the session between the first client application and the first trusted application according to the session identifier.

[0101] Step 503: The trusted execution environment runs the first trusted application according to the file of the first trusted application and the first resource information, wherein the hardware resources used by the first trusted application when running are included in the hardware resources indicated by the first resource information.

[0102] In one possible manner, the trusted execution environment allocates the hardware resources indicated by the first resource information to the first trusted application, and then runs the first trusted application according to the file of the first trusted application on the hardware resources indicated by the first resource information. It can be understood that the hardware resources used by the first trusted application when running are limited to the hardware resources indicated by the first resource information, that is, the hardware resources used by the trusted application when running do not exceed the hardware resources indicated by the first resource information.

[0103] It is understandable that the trusted execution environment can not only obtain the mapping relationship between the identifier of the first trusted application deployed from the rich execution environment to the trusted execution environment and the first resource information, but also obtain the mapping relationship between the identifiers of other trusted applications and resource information. That is, multiple mapping relationships are maintained in the trusted execution environment, and each mapping relationship may include the identifier and resource information of the trusted application. Furthermore, when the trusted execution environment runs the first trusted application, it can determine the first resource information corresponding to the identifier of the first trusted application from the multiple mapping relationships maintained by the trusted execution environment based on the identifier of the first trusted application, and then allocate the hardware resources indicated by the first resource information to the first trusted application, and run the first trusted application according to the files of the first trusted application on the hardware resources indicated by the first resource information.

[0104] Exemplarily, the trusted execution environment maintains the identifier and resource information 1 of trusted application 1, and the identifier and resource information 2 of trusted application 2. Resource information 1 includes identifiers of CPU 1 to CPU 5, and resource information 2 includes identifiers of CPU 6 to CPU 20. When the trusted execution environment determines that the identifier of the first trusted application is trusted application 1, the trusted execution environment can determine that the first resource information is resource information 1, that is, it is determined that the CPU resources used by the first trusted application during operation need to be limited to CPU 1 to CPU 5.

[0105] In a specific implementation, the trusted execution environment includes a trusted execution environment operating system, which can be used to run a first trusted application and limit the hardware resources used by the first trusted application during operation to the hardware resources indicated by the first resource information. Specifically, before the trusted execution environment operating system runs the first trusted application, the management service (or management process) in the trusted execution environment operating system can determine the first resource information corresponding to the identifier of the first trusted application from multiple mapping relationships maintained by the trusted execution environment operating system based on the identifier of the first trusted application. The management service configures the hardware resources that can be used during the operation of the first trusted application based on the first resource information, so that the hardware resources used during the operation of the first trusted application are limited to the hardware resources indicated by the first resource information. Exemplarily, when the hardware resources are CPU resources, the management service can limit the CPU resources that can be used during the operation of the first trusted application to the CPU resources indicated by the first resource information through CPU isolation technology (such as control technology (controlgroups, cgroup)).

[0106] In the process of running the first trusted application in the trusted execution environment, the first trusted application can execute related functions based on the call command of the first client application. Exemplarily, the first client application can first apply to the client operating system for address A and address B in the memory, and the first client application writes the data required for this call into the memory according to address A, determines the session between the first client application and the first trusted application according to the context, and then sends a call command to the first trusted application through the session between the first client application and the first trusted application, and the call command includes address A, address B and operation information, and the operation information is used to indicate the operation performed by the first trusted application on the data (such as encryption operation, verification operation, etc.). Accordingly, the first trusted application receives the call command from the first client application through the session between the first client application and the first trusted application, obtains address A, address B and operation information from the call command, reads the data required for this call from the memory according to address A, processes the data according to the operation information to obtain the execution result, and then writes the execution result into the memory according to address B. Subsequently, the first trusted application reads the execution result from the memory according to address B. In conjunction with the above encryption example, the data required for the call here is the data to be encrypted, and the execution result is that the first trusted application encrypts the data according to the key to obtain the ciphertext.

[0107] Exemplarily, the first trusted application includes a communication thread and a working thread, wherein the communication thread is used to communicate with the first client application, that is, to receive a call command through a session, read data from a memory, etc.; the working thread can be used to execute the call command, such as processing data. In this way, when one thread triggers an interrupt, the other thread can continue to work.

[0108] Optionally, the first client application may also send a session closing request to the driver through the virtual machine simulator, and the driver responds to the session closing request to close the session between the first client application and the first trusted application. Accordingly, after determining that the session between the first client application and the first trusted application is closed, the trusted execution environment may end the operation of the first trusted application. Optionally, the first client application may also send a context release request to the driver through the virtual machine simulator, and the driver responds to the context release request to release the context.

[0109] It should be added that the file of the trusted application may include a signature (significant). When the rich execution environment (specifically, it may be a driver) sends the file of the trusted application to the trusted execution environment, the trusted execution environment (specifically, it may be a trusted execution environment operating system) may verify whether the file of the trusted application is safe based on the signature in the file of the trusted application and a preset verification algorithm, and then run the trusted application based on the file of the trusted application after determining that the file of the trusted application is safe. It is understandable that when the trusted execution environment determines that the file of the trusted application is unsafe, it refuses to run the trusted application.

[0110] Combination Figure 2 ARM architecture in, such as Figure 6 A flowchart of another resource allocation method provided as an example for the present application. In this process, the first virtual machine, the first client application, the first trusted application and the first resource information are respectively virtual machine 1, client application 1, trusted application 1 and resource information 1 as an example, wherein resource information 1 includes the identifiers of CPU1 to CPU5. Furthermore, the virtual machine simulator is specifically QEMU, and a mapping relationship between the identifier of virtual machine 1 and resource information 1 is maintained in QEMU. The driver is specifically a trust zone driver.

[0111] Client application 1 sends a first create context request to QEMU, and the first create context request includes address 1, where address 1 is an address in memory for storing context. QEMU determines that the client application that sends the first create context request belongs to virtual machine 1, and then determines resource information 1 (i.e., the identifiers of CPU1 to CPU5) based on the mapping relationship between the identifier of virtual machine 1 and resource information 1. Further, QEMU determines that the first create context request is a GP call request, and adds address 2 and resource information 1 to the extended information of the first create context request to obtain a second create context request, where address 2 is an address in memory for storing resource information 1. Subsequently, QEMU sends the second create context request to the trust zone driver, and the trust zone driver responds to the second create context request, creates a context, stores the context in address 1 of memory, and stores resource information 1 in address 2 of memory.

[0112] The client application 1 obtains the context from the address 1 of the memory, and determines the address (i.e., the first address) of the file of the trusted application 1 in the virtual machine 1, and sends a session creation request to the trust zone driver through QEMU, wherein the session creation request includes the context and the first address. In response to the session creation request, the trust zone driver obtains the resource information 1 from the address 2 according to the context, and obtains the file of the trusted application 1 from the virtual machine 1 according to the first address, and sends the resource information 1 and the file of the trusted application 1 to the trusted execution environment. After determining that the resource information 1 and the file of the trusted application 1 are obtained, the trusted execution environment operating system maintains the mapping relationship between the resource information 1 and the identifier of the trusted application 1. Then, the trust zone driver establishes a session between the client application 1 and the trusted application 1. Accordingly, the management service in the trusted execution environment operating system determines the resource information 1 corresponding to the trusted application 1 according to the identifier of the trusted application 1, and allocates the CPU 1 to the CPU 5 indicated by the resource information 1 to the trusted application 1, that is, the CPU resources used by the trusted application 1 during operation are limited to the CPU 1 to the CPU 5.

[0113] In the above technical solution, the rich execution environment sends the files and resource information of the trusted application to the trusted execution environment, so that when the trusted execution environment runs the files of the trusted application, it can include the hardware resources used by the trusted application during runtime in the hardware resources indicated by the resource information based on the resource information. That is, the hardware resources used by the trusted application during runtime are included in the hardware resources applied for by the tenant to which the virtual machine belongs, which helps to ensure the orderly management of hardware resources in the trusted execution environment.

[0114] Based on the same inventive concept, the present application provides a resource allocation device, including a module for executing each step in the method in the above embodiment. Figure 7A schematic diagram of the structure of a resource allocation device 700 provided in the present application, which includes a rich execution environment module 710 and a trusted execution environment module 720. Further, the rich execution environment module 710 includes a first processing module 711 and a first transceiver module 712, and the trusted execution environment module 720 includes a second processing module 721 and a second transceiver module 722. Exemplarily, the first processing module 711 obtains a trusted application request in the process of running a client application according to the file of the client application, and in response to the trusted application request, controls the first transceiver module 712 to send resource information and the file of the trusted application to the second transceiver module 722, wherein the resource information indicates the hardware resources in the resource allocation device that the trusted application can use. The second processing module 721 is used to control the second transceiver module 722 to receive the resource information and the file of the trusted application from the first transceiver module 712, and run the trusted application according to the file and resource information of the trusted application, wherein the hardware resources used by the trusted application when running are included in the hardware resources indicated by the resource information. A more detailed description of the above-mentioned rich execution environment module 710 and trusted execution environment module 720 can be directly obtained by referring to the relevant description in the above-mentioned method embodiment, and will not be repeated here.

[0115] Based on the same inventive concept, the present application also provides a chip system, which includes a processor and an interface circuit. The processor and the interface circuit can be interconnected through lines. For example, the interface circuit can be used to receive signals from other devices. For another example, the interface circuit can be used to send signals to other devices (such as processors). Exemplarily, the interface circuit can read instructions stored in a memory and send the instructions to the processor. When the instruction is executed by the processor, the device can execute the various steps in the method in the above embodiment. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0116] Based on the same inventive concept, the present application provides a computing device, including a processor, the processor is connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the computing device executes each step of the method in the above embodiment.

[0117] Based on the same inventive concept, the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a device, each step of the method in the above embodiment is implemented.

[0118] Based on the same inventive concept, the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a device, each step of the method in the above embodiment is implemented.

[0119] It is to be understood that the various digital numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of each of the above processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of protection of the present application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these changes and variations.

Claims

1. A resource allocation method, characterized in that: Adapted to a resource allocation device including a rich execution environment and a trusted execution environment, the rich execution environment including a virtual machine, the virtual machine including a client application file and a trusted application file corresponding to the client application file; the method comprising: The rich execution environment obtains a trusted application request during the process of running the client application according to the file of the client application; The rich execution environment sends resource information and a file of the trusted application to the trusted execution environment in response to the trusted application request, wherein the resource information indicates hardware resources in the resource allocation device that can be used by the trusted application; The trusted execution environment runs the trusted application according to the file of the trusted application and the resource information, wherein the hardware resources used by the trusted application when running are included in the hardware resources indicated by the resource information.

2. The method according to claim 1, characterized in that The trusted execution environment runs the trusted application according to the file of the trusted application and the resource information, including: The trusted execution environment allocates the hardware resources indicated by the resource information to the trusted application; The trusted execution environment runs the trusted application on the hardware resources indicated by the resource information according to the file of the trusted application.

3. The method according to claim 1, characterized in that Before the rich execution environment sends the resource information and the file of the trusted application to the trusted execution environment, the method further includes: The rich execution environment obtains a storage address of a file of the trusted application in the virtual machine; The rich execution environment obtains the file of the trusted application from the virtual machine according to the storage address.

4. The method according to claim 1, characterized in that Before the rich execution environment sends the resource information and the file of the trusted application to the trusted execution environment, the method further includes: The rich execution environment determines the resource information according to the identifier of the virtual machine, a mapping relationship between the identifier of the virtual machine maintained in the rich execution environment and the resource information.

5. The method according to claim 1, characterized in that The file of the trusted application includes an identification of the trusted application; After the rich execution environment sends the resource information and the file of the trusted application to the trusted execution environment, the method further includes: The trusted execution environment receives the resource information and the file of the trusted application; The trusted execution environment maintains a mapping relationship between the identifier of the trusted application and the resource information.

6. The method according to claim 1, characterized in that The hardware resources include one or more of processor resources and memory resources.

7. The method according to claim 1, characterized in that Before the rich execution environment obtains a trusted application request, the method further includes: The rich execution environment obtains a virtual machine request, wherein the virtual machine request includes the resource information; The rich execution environment creates the virtual machine in the rich execution environment in response to the virtual machine request, and generates a mapping relationship between the identifier of the virtual machine and the resource information; The rich execution environment allocates the hardware resources indicated by the resource information to the virtual machine; The rich execution environment runs the virtual machine on the hardware resources indicated by the resource information.

8. The method according to any one of claims 1 to 7, characterized in that The rich execution environment includes a virtual machine simulator and a driver, the virtual machine simulator records a mapping relationship between the identifier of the virtual machine and the resource information, and the driver is used for communication between the rich execution environment and the trusted execution environment; The rich execution environment sends resource information and a file of the trusted application to the trusted execution environment, including: The virtual machine simulator determines the resource information according to the identifier of the virtual machine, the mapping relationship between the identifier of the virtual machine maintained in the virtual machine simulator and the resource information, and sends the resource information to the driver; The client application determines a storage address of a file of the trusted application in the virtual machine, and sends the storage address to the driver; the driver obtains the file of the trusted application from the virtual machine according to the storage address; The driver sends the resource information and the file of the trusted application to the trusted execution environment.

9. A resource allocation device, characterized in that: Comprising means for executing the method as claimed in any one of claims 1 to 8.

10. A computing device, characterized in that: The computer comprises a processor connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the computing device executes the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program or instruction, and when the computer program or instruction is executed by the device, the method according to any one of claims 1 to 8 is implemented.

12. A computer program product, characterized in that The computer program product comprises a computer program or instructions, and when the computer program or instructions are executed by a device, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Multi-tenant environment intelligent management method, device, equipment and storage medium

    CN119781996A