WO2017012339A1 - Resource management method and apparatus - Google Patents
Resource management method and apparatus Download PDFInfo
- Publication number
- WO2017012339A1 WO2017012339A1 PCT/CN2016/073940 CN2016073940W WO2017012339A1 WO 2017012339 A1 WO2017012339 A1 WO 2017012339A1 CN 2016073940 W CN2016073940 W CN 2016073940W WO 2017012339 A1 WO2017012339 A1 WO 2017012339A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- physical resource
- application
- usage information
- resource usage
- physical
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
Definitions
- the embodiments of the present invention relate to computer technologies, and in particular, to a resource management method and apparatus.
- an application cannot perceive and/or control physical resources, that is, when any of the applications needs to access resources, it needs to sink into the kernel of the operating system, and access resources through the kernel. Therefore, when multiple applications of the operating system need to access resources, kernel resource contention may occur, resulting in system performance degradation.
- Embodiments of the present invention provide a resource management method and apparatus, which improve system performance.
- an embodiment of the present invention provides a resource management method, including:
- the acquiring physical resource usage information includes:
- the application is configured to directly access an interface of the physical resource, including :
- the method further includes: assigning, to the application, a management policy for managing the physical resource;
- the user space system service function library includes: the management policy.
- the method further includes:
- the independent physical resources are dynamically updated, and the operating system kernel and the kernel management data structure in the user space system service function library are synchronously updated.
- the method further includes:
- An exception handling function is provided, and the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
- the physical resource usage information includes at least one of the following: Physical memory information, central processor CPU information, register access control permissions, input/output device read and write permissions, and privileged instruction execution permissions.
- an embodiment of the present invention provides a resource management apparatus, including:
- An acquiring module configured to acquire physical resource usage information, where the physical resource usage information is used to indicate a physical resource required for the application to run;
- An allocating module configured to allocate an independent physical resource to the application according to the physical resource usage information, and allocate an interface for directly accessing the physical resource, so that the application directly accesses the physical resource .
- the acquiring module is specifically configured to:
- the allocation module is specifically configured to:
- the allocating module is further configured to: allocate, by the application, a management policy for managing the physical resource
- the user space system service function library includes: the management policy.
- the device further includes:
- an update module configured to dynamically update the independent physical resource, and synchronously update an operating system kernel and a kernel management data structure in the user space system service function library.
- the device further includes:
- An exception handling module is configured to set an exception handling function, where the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
- the physical resource usage information includes at least one of the following: Physical memory information, central processor CPU information, register access control permissions, input/output device read and write permissions, and privileged instruction execution permissions.
- the physical resource usage information is used to indicate the physical resource required for the application to run; and further, the independent physical resource is allocated to the application according to the physical resource usage information, and The application allocates an interface for directly accessing the physical resource, so that the application directly accesses the physical resource; thereby reducing resource contention of the operating system kernel by different applications, and improving system performance.
- FIG. 1A is a first structural diagram of an operating system of a resource management method according to the present invention.
- FIG. 1B is a schematic flowchart of Embodiment 1 of a resource management method according to the present invention.
- FIG. 2A is a second structural diagram of an operating system of a resource management method according to the present invention.
- FIG. 2B is a schematic diagram of Embodiment 3 of a resource management method according to the present invention.
- FIG. 2C is a schematic diagram of Embodiment 4 of a resource management method according to the present invention.
- Embodiment 3 is a schematic structural diagram of Embodiment 1 of a resource management apparatus according to the present invention.
- Embodiment 4 is a schematic structural diagram of Embodiment 2 of a resource management apparatus according to the present invention.
- FIG. 5 is a schematic structural diagram of Embodiment 3 of a resource management apparatus according to the present invention.
- FIG. 1A is a schematic diagram of an operating system architecture of a resource management method according to the present invention.
- FIG. 1B is a schematic flowchart of Embodiment 1 of a resource management method according to the present invention.
- the execution body of this embodiment is a resource management device configured in an operating system kernel, and the device can be implemented by software and/or hardware.
- the solution of this embodiment is applied to a general-purpose operating system, and the user mode application can directly access and manage the physical resources allocated for the application by bypassing the operating system kernel.
- the method in this embodiment may include:
- the operating system at least includes: a hardware resource, an operating system kernel, and an application; wherein the operating system kernel is provided with a resource management device.
- the physical resource usage information used to indicate the physical resource required for the application to run is obtained.
- the physical resource usage information includes at least one of the following: physical memory information, central processor CPU information, and a register. Access control rights, input/output device read and write rights, and privileged instruction execution rights; optionally, the physical resource usage information may also include other physical resource information, which is not limited by the present invention.
- the step S101 includes: acquiring the preset physical resource usage information; or acquiring the physical resource usage information according to the hardware control data structure sent by the application; wherein the hardware control data structure includes the Physical resource usage information.
- the physical resource usage information may be preset physical resource usage information. Or acquiring the physical resource usage information for a hardware control data structure that includes the physical resource usage information sent according to the application.
- S102 Allocate an independent physical resource to the application according to the physical resource usage information, and allocate an interface for directly accessing the physical resource to the application, so that the application directly accesses the physical resource.
- the application after obtaining the physical resource usage information for indicating the physical resource required for the application to run, the application allocates an independent physical resource according to the physical resource usage information (that is, a physical that cannot be used by other applications).
- a resource such as a CPU, a physical memory, an I/O device, and a privileged instruction execution authority, etc.
- an interface for directly accessing the physical resource is allocated to the application, so that the application directly accesses the interface through the interface
- the physical resource that is, the application is upgraded to an privileged application that can directly access the physical resources (such as directly executing privileged instructions, directly managing the CPU, directly managing physical memory, and directly accessing I/O devices) by bypassing the operating system kernel. This reduces the resource contention of the operating system kernel by different applications and improves system performance.
- allocating an interface for directly accessing the physical resource to the application includes: establishing a user space system service function library for the application, and copying a management data structure of a kernel required by the application to the The user space system service function library, wherein the management data structure is used to directly access the physical resource.
- a user space system service function library is established for the application, and a management data structure of a kernel required by the application is copied into the user space system service function library.
- the user space system service function library includes a service management function routine corresponding to the independent physical resource, where the application is directly executed Calling the service management function routine in the user space system service function library can access or manage the physical resource without being trapped in the operating system kernel; that is, the authorized application can directly manage and update the user space system.
- the operation of the management data structure in the service function library maintains the normal operation of the application.
- the resource management method of the present invention further includes: allocating, to the application, a management policy for managing the physical resource; wherein the user space system service function library includes: the management policy; Through the interface and/or management policy in the user space system service function library Access or manage the physical resources directly.
- the operating system may be an open source Linux operating system, a Windows operating system developed by Microsoft Corporation, an Android system of Google Corporation, or an operating system developed by Apple Inc., or an operating system such as Vxworks.
- Embedded operating system The operating system includes various components and/or drivers for controlling and managing conventional system tasks such as memory management, storage device control, power management, and the like, as well as facilitating communication between various hardware and software.
- the physical resource usage information is used to indicate the physical resource required for the application to run; and further, the independent physical resource is allocated to the application according to the physical resource usage information. And assigning, to the application, an interface for directly accessing the physical resource, so that the application directly accesses the physical resource; that is, the application can directly access the physical resource by bypassing an operating system kernel, thereby reducing different Application resource contention to the operating system kernel improves system performance.
- the I/O device is a shared device, in order to ensure the security of the application accessing the I/O device, optionally, the I/O device is shared with other applications through a message system call, as described by The interface provided by the corresponding user space system service function library is used to send a message requesting the I/O device to the operating system kernel.
- the method further includes: dynamically updating the independent physical resource, and synchronously updating an operating system kernel and a kernel management data structure in the user space system service function library.
- the privilege application may be Sending a request message to the resource management apparatus in the operating system kernel by calling an interface included in the user space system service function library for interacting with an operating system kernel (the request message includes the Applying updated physical resource information), so that the resource management device dynamically updates the independent physical resource according to the request message; optionally, updating the user space system service function library according to the physical resource information that needs to be updated. (ie user-defined memory) and management data structures in the operating system kernel.
- the privilege application may directly pass the user space system service function library. Dynamically updating independent physical resources, and further, updating, by the user space system service function library, a management data structure in a user space system service function library (ie, user state specified memory), and sending the modification information to the operating system
- the resource management device in the kernel to enable The resource management device synchronously updates the kernel management data structure in the operating system kernel.
- dynamically updating the independent physical resource further includes the following three scenarios:
- Scenario 1 When the application (ie, the privilege application) accesses the resource management device each time, the resource management device according to the preset resource allocation policy and the calling parameter (optionally, the calling parameter may include Determining whether it is necessary to update an independent physical resource allocated for the application, such as a resource type and a resource size of the independent physical resource;
- Scenario 2 When the application (ie, the privilege application) is trapped in the operating system kernel state due to the trigger exception, the operating system kernel determines whether it is necessary to update the independent physical resource allocated for the application;
- Scenario 3 The operating system kernel periodically determines whether it needs to update the independent physical resources allocated for the application; if the hardware supports, directly modify the task permissions, directly update the CPU and registers, and dynamically adjust its execution permissions, such as Set the data structure provided by the virtual machine control block (VMCS) to change its partial access management authority to the CPU hardware; if the hardware does not support, trigger the interrupt to cause the application (the authorized application) to fall into the kernel state. And update the independent physical resources allocated for the application.
- VMCS virtual machine control block
- the method further includes: setting an exception handling function, where the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
- the application when the application (ie, the privilege application) triggers an exception, the application performs exception processing according to the exception handling function.
- the exception handling process is divided into two categories: a first type is that the user space system service function library includes a customized exception handling function, and the second type is a processing process that needs to pass through an operating system kernel;
- a divide-by-zero exception, a page missing exception, or an invalid opcode occurs, the application performs exception processing through an exception handling function in the user space system service function library; when the application violates during execution
- the physical resource authority range information corresponding to the application is read, such as a register having no read/write permission, a hardware trigger exception, or a state switch, the application saves the current execution environment and loads the execution environment of the operating system kernel.
- the resource management apparatus restores the application to the authorization application again (ie, re-executing the processes of step S101 and step S102) ), so that the privilege application continues to perform normally.
- the second embodiment of the resource management method of the present invention may include the following steps:
- the application sends the physical resource usage information used to indicate the physical resource required for the application to be sent to the resource management device through an interface provided by the operating system kernel, optionally through hard
- the form of the piece of control data structure is sent to the resource management device; optionally, the physical resource usage information includes at least one of the following: physical memory information, central processor CPU information, register access control authority, and input/output device read Write permissions, privileged instruction execution permissions, and interrupt pointers.
- the resource management device of the operating system kernel allocates an independent physical resource to the application according to the physical resource usage information sent by the application, and allocates an interface for directly accessing the physical resource to the application, Such as initializing physical memory of the application, saving and initializing registers on the CPU required by the application, and constructing a new interrupt vector table or the like; optionally, according to the allocation for the application
- the physical resource initializes the processor virtualization hardware and initializes the physical resource by the user space system service function library to facilitate providing the application with an interface for direct access to the physical resource through the user space system service function library.
- the resource management device saves an execution environment of the application, such as a register value, a register state, a segment register, and the like; and loads an execution context corresponding to the privileged application after the application is upgraded (ie, an independent allocation for the application)
- Physical resources such as physical memory information, central processor CPU information, and CPU register settings, etc., to enable the privileged application to directly access or manage the physical resources according to the user space system service function library;
- a user space system service function library is used to provide the privileged application with a management policy for managing the physical resources and an interface for directly accessing the physical resources.
- the resource management device sets an execution entry point, and sets an exception handling function; when the elevation application triggers an exception during execution, saves the context (such as CPU register information, etc.), switches to the next process, and according to The exception handling function performs exception handling.
- an independent physical resource is allocated to the application, and an interface for directly accessing the physical resource is allocated to the application, so that the application is based on a user space system service function library.
- FIG. 2A is a second structural diagram of an operating system of a resource management method according to the present invention.
- a management core is used to set an instruction execution permission of a core, a register read/write permission, and an I/O device, etc., and an authorized user space system service function library (LibXOS) is provided.
- LibXOS authorized user space system service function library
- the resource management device is used to process the privilege (that is, upgrading the normal application to the privilege application, specifically, setting the execution process on the application core through the management core a range of resource permissions; where a normal application needs to be accessed through the operating system kernel or The physical resource is operated, and the privilege application can directly access or operate the corresponding physical resource according to the corresponding user space system service function library; the resource management device is further configured to: when the privilege application exceeds the execution permission Exception handling; the user space system service function library obtains the remote I/O service through the message system call; in addition, when the privilege application cannot pass a kernel function implemented by the user space system service function library, the request queue can be Write to the specified memory and the response is read by the service thread.
- the privilege that is, upgrading the normal application to the privilege application, specifically, setting the execution process on the application core through the management core a range of resource permissions
- the privilege application can directly access or operate the corresponding physical resource according to the corresponding user space system service function library
- the resource management device is further configured to: when
- FIG. 2B is a schematic diagram of Embodiment 3 of a resource management method according to the present invention.
- a method for performing page table management in a user state space is specifically described.
- the page table data structure of the common application in the operating system kernel is copied into the specified physical memory, and is performed by the page table management module in the user state space system service function library.
- Management including operations such as reading, writing, and/or updating page tables.
- the page table is a discrete mapping of virtual memory and physical memory
- the items that are not yet filled in the page table are managed by the user state system service function library according to the application request, the execution process state, and the reserved physical memory.
- FIG. 2C is a schematic diagram of Embodiment 4 of a resource management method according to the present invention.
- the memory management in LibXOS mainly provides two parts. Among them, 1) The first part of the function is: For the application required and the function routine for releasing the memory, LibXOS only manages the physical memory allocated by the resource management device when the application is authorized.
- FIG. 3 is a schematic structural diagram of Embodiment 1 of a resource management apparatus according to the present invention.
- the resource management apparatus 30 provided in this embodiment may include: an obtaining module 301 and an allocating module 302.
- the obtaining module 301 is configured to obtain physical resource usage information, where the physical resource usage information is used to indicate physical resources required for the application to run;
- the allocating module 302 is configured to allocate an independent physical resource to the application according to the physical resource usage information, and allocate an interface for directly accessing the physical resource to enable the application to directly access the physical resource. .
- the resource management apparatus in this embodiment may be used to perform the technical solution in the first embodiment of the foregoing resource management method of the present invention, and the implementation principle and technical effects are similar, and details are not described herein again.
- the obtaining module 301 is specifically configured to:
- the allocating module 302 is specifically configured to: establish a user space system service function library for the application, and The management data structure of the kernel required by the application is copied into the user space system service function library, wherein the management data structure is used to directly access the physical resource.
- the allocating module is further configured to: allocate, to the application, a management policy for managing the physical resource; where the user space system service function library includes: the management policy.
- FIG. 4 is a schematic structural diagram of Embodiment 2 of the resource management apparatus according to the present invention.
- the resource management apparatus 30 is provided.
- the method further includes: an update module 303, configured to dynamically update the independent physical resource, and synchronously update an operating system kernel and a kernel management data structure in the user space system service function library;
- the method further includes: an exception processing module 304, configured to set an exception handling function, where the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
- an exception processing module 304 configured to set an exception handling function, where the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
- the physical resource usage information includes at least one of the following: physical memory information, central processor CPU information, register access control authority, input/output device read/write permission, and privileged instruction execution authority.
- the resource management device in this embodiment may be used to implement the technical solution in the foregoing resource management method embodiment of the present invention, and the implementation principle and the technical effect are similar, and details are not described herein again.
- FIG. 5 is a schematic structural diagram of Embodiment 3 of the resource management apparatus according to the present invention.
- the resource management apparatus 50 provided in this embodiment may include a processor 501 and a memory 502.
- the resource management device 50 may also include a data interface unit 503 that may be coupled to the processor 501.
- the data interface unit 503 is used to input/output data information
- the memory 502 is used to store execution instructions.
- the processor 501 communicates with the memory 502, and the processor 501 calls an execution instruction in the memory 502 to perform the operations in the resource management method embodiment described above.
- the resource management device in this embodiment may be used to implement the technical solution in the foregoing resource management method embodiment of the present invention, and the implementation principle and the technical effect are similar, and details are not described herein again.
- the disclosed apparatus and method may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
- the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
- the above software functional unit is stored in a storage medium and includes a plurality of instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) Or a processor performs part of the steps of the method of the various embodiments of the present invention.
- the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
- the aforementioned program can be stored in a computer readable storage medium.
- the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
A resource management method and apparatus. The method comprises: acquiring physical resource usage information, wherein the physical resource usage information is used for indicating a physical resource required for running an application (S101); and allocating a separate physical resource to the application according to the physical resource usage information and allocating an interface for directly accessing the physical resource to the application, so that the application directly accesses the physical resource (S102). Thus, resource contention of different applications for an operating system kernel is reduced, and the system performance is improved.
Description
本发明实施例涉及计算机技术,尤其涉及一种资源管理方法及装置。The embodiments of the present invention relate to computer technologies, and in particular, to a resource management method and apparatus.
目前通用的操作系统中,应用无法感知和/或控制物理资源,即当任意所述应用需要访问资源时,都需要陷入所述操作系统的内核,通过所述内核访问资源。因此,当所述操作系统的多个应用都需要访问资源时,会引起内核资源争用,导致系统性能下降。In the current general operating system, an application cannot perceive and/or control physical resources, that is, when any of the applications needs to access resources, it needs to sink into the kernel of the operating system, and access resources through the kernel. Therefore, when multiple applications of the operating system need to access resources, kernel resource contention may occur, resulting in system performance degradation.
发明内容Summary of the invention
本发明实施例提供一种资源管理方法及装置,提升了系统性能。Embodiments of the present invention provide a resource management method and apparatus, which improve system performance.
第一方面,本发明实施例提供一种资源管理方法,包括:In a first aspect, an embodiment of the present invention provides a resource management method, including:
获取物理资源使用信息,所述物理资源使用信息用于指示应用运行所需要的物理资源;Obtaining physical resource usage information, where the physical resource usage information is used to indicate a physical resource required for the application to run;
根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用直接访问所述物理资源。Assigning an independent physical resource to the application according to the physical resource usage information, and allocating an interface for directly accessing the physical resource to the application, so that the application directly accesses the physical resource.
结合第一方面,在第一方面的第一种可能的实现方式中,所述获取物理资源使用信息,包括:With reference to the first aspect, in the first possible implementation manner of the first aspect, the acquiring physical resource usage information includes:
获取预设的所述物理资源使用信息;或者,Obtaining the preset physical resource usage information; or
根据所述应用发送的硬件控制数据结构获取所述物理资源使用信息;其中,所述硬件控制数据结构包括所述物理资源使用信息。Acquiring the physical resource usage information according to the hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述为所述应用分配用于直接访问所述物理资源的接口,包括:With reference to the first aspect, or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the that the application is configured to directly access an interface of the physical resource, including :
为所述应用建立用户空间系统服务功能库,并将所述应用所需的内核的管理数据结构复制到所述用户空间系统服务功能库中,其中,所述管理数据结构用于直接访问所述物理资源。
Establishing a user space system service function library for the application, and copying a management data structure of a kernel required by the application into the user space system service function library, wherein the management data structure is used for directly accessing the Physical resources.
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,还包括:为所述应用分配用于管理所述物理资源的管理策略;其中,所述用户空间系统服务功能库包括:所述管理策略。In conjunction with the second possible implementation of the first aspect, in a third possible implementation manner of the first aspect, the method further includes: assigning, to the application, a management policy for managing the physical resource; The user space system service function library includes: the management policy.
结合第一方面、第一方面的第一种至第三种任一种可能的实现方式,在第一方面的第四种可能的实现方式中,所述根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口之后,还包括:With reference to the first aspect, the first to the third possible implementation manners of the first aspect, in the fourth possible implementation manner of the first aspect, After the application allocates an independent physical resource and allocates an interface for directly accessing the physical resource to the application, the method further includes:
动态更新所述独立的物理资源,并同步更新操作系统内核和所述用户空间系统服务功能库中的内核管理数据结构。The independent physical resources are dynamically updated, and the operating system kernel and the kernel management data structure in the user space system service function library are synchronously updated.
结合第一方面、第一方面的第一种至第四种任一种可能的实现方式,在第一方面的第五种可能的实现方式中,所述根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口之后,还包括:With reference to the first aspect, the first to the fourth possible implementation manners of the first aspect, in the fifth possible implementation manner of the first aspect, After the application allocates an independent physical resource and allocates an interface for directly accessing the physical resource to the application, the method further includes:
设置异常处理函数,所述异常处理函数用于当所述应用触发异常时,所述应用根据所述异常处理函数进行异常处理。An exception handling function is provided, and the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
结合第一方面、第一方面的第一种至第五种任一种可能的实现方式,在第一方面的第六种可能的实现方式中,所述物理资源使用信息包括以下至少一种:物理内存信息、中央处理器CPU信息、寄存器访问控制权限、输入/输出设备读写权限及特权指令执行权限。With reference to the first aspect, the first to the fifth possible implementation manners of the first aspect, in the sixth possible implementation manner of the first aspect, the physical resource usage information includes at least one of the following: Physical memory information, central processor CPU information, register access control permissions, input/output device read and write permissions, and privileged instruction execution permissions.
第二方面,本发明实施例提供一种资源管理装置,包括:In a second aspect, an embodiment of the present invention provides a resource management apparatus, including:
获取模块,用于获取物理资源使用信息,所述物理资源使用信息用于指示应用运行所需要的物理资源;An acquiring module, configured to acquire physical resource usage information, where the physical resource usage information is used to indicate a physical resource required for the application to run;
分配模块,用于根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用直接访问所述物理资源。An allocating module, configured to allocate an independent physical resource to the application according to the physical resource usage information, and allocate an interface for directly accessing the physical resource, so that the application directly accesses the physical resource .
结合第二方面,在第二方面的第一种可能的实现方式中,所述获取模块具体用于:With reference to the second aspect, in a first possible implementation manner of the second aspect, the acquiring module is specifically configured to:
获取预设的所述物理资源使用信息;或者,Obtaining the preset physical resource usage information; or
根据所述应用发送的硬件控制数据结构获取所述物理资源使用信息;其中,所述硬件控制数据结构包括所述物理资源使用信息。Acquiring the physical resource usage information according to the hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第二
种可能的实现方式中,所述分配模块具体用于:In combination with the second aspect or the first possible implementation of the second aspect, the second in the second aspect
In a possible implementation manner, the allocation module is specifically configured to:
为所述应用建立用户空间系统服务功能库,并将所述应用所需的内核的管理数据结构复制到所述用户空间系统服务功能库中,其中,所述管理数据结构用于直接访问所述物理资源。Establishing a user space system service function library for the application, and copying a management data structure of a kernel required by the application into the user space system service function library, wherein the management data structure is used for directly accessing the Physical resources.
结合第二方面的第二种可能的实现方式,在第二方面的第三种可能的实现方式中,所述分配模块还用于:为所述应用分配用于管理所述物理资源的管理策略;其中,所述用户空间系统服务功能库包括:所述管理策略。In conjunction with the second possible implementation of the second aspect, in a third possible implementation manner of the second aspect, the allocating module is further configured to: allocate, by the application, a management policy for managing the physical resource The user space system service function library includes: the management policy.
结合第二方面、第二方面的第一种至第三种任一种可能的实现方式,在第二方面的第四种可能的实现方式中,所述装置还包括:With reference to the second aspect, the first to the third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the device further includes:
更新模块,用于动态更新所述独立的物理资源,并同步更新操作系统内核和所述用户空间系统服务功能库中的内核管理数据结构。And an update module, configured to dynamically update the independent physical resource, and synchronously update an operating system kernel and a kernel management data structure in the user space system service function library.
结合第二方面、第二方面的第一种至第四种任一种可能的实现方式,在第二方面的第五种可能的实现方式中,所述装置还包括:With reference to the second aspect, the first to the fourth possible implementation manners of the second aspect, in a fifth possible implementation manner of the second aspect, the device further includes:
异常处理模块,用于设置异常处理函数,所述异常处理函数用于当所述应用触发异常时,所述应用根据所述异常处理函数进行异常处理。An exception handling module is configured to set an exception handling function, where the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
结合第二方面、第二方面的第一种至第五种任一种可能的实现方式,在第二方面的第六种可能的实现方式中,所述物理资源使用信息包括以下至少一种:物理内存信息、中央处理器CPU信息、寄存器访问控制权限、输入/输出设备读写权限及特权指令执行权限。With reference to the second aspect, the first to the fifth possible implementation manner of the second aspect, in the sixth possible implementation manner of the second aspect, the physical resource usage information includes at least one of the following: Physical memory information, central processor CPU information, register access control permissions, input/output device read and write permissions, and privileged instruction execution permissions.
本发明中,通过获取物理资源使用信息,所述物理资源使用信息用于指示应用运行所需要的物理资源;进一步地,根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用直接访问所述物理资源;从而减少了不同应用对操作系统内核的资源争用,提升了系统性能。In the present invention, the physical resource usage information is used to indicate the physical resource required for the application to run; and further, the independent physical resource is allocated to the application according to the physical resource usage information, and The application allocates an interface for directly accessing the physical resource, so that the application directly accesses the physical resource; thereby reducing resource contention of the operating system kernel by different applications, and improving system performance.
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.
图1A为本发明资源管理方法的操作系统架构图一;
1A is a first structural diagram of an operating system of a resource management method according to the present invention;
图1B为本发明资源管理方法实施例一的流程示意图;1B is a schematic flowchart of Embodiment 1 of a resource management method according to the present invention;
图2A为本发明资源管理方法的操作系统架构图二;2A is a second structural diagram of an operating system of a resource management method according to the present invention;
图2B为本发明资源管理方法实施例三的示意图;2B is a schematic diagram of Embodiment 3 of a resource management method according to the present invention;
图2C为本发明资源管理方法实施例四的示意图;2C is a schematic diagram of Embodiment 4 of a resource management method according to the present invention;
图3为本发明资源管理装置实施例一的结构示意图;3 is a schematic structural diagram of Embodiment 1 of a resource management apparatus according to the present invention;
图4为本发明资源管理装置实施例二的结构示意图;4 is a schematic structural diagram of Embodiment 2 of a resource management apparatus according to the present invention;
图5为本发明资源管理装置实施例三的结构示意图。FIG. 5 is a schematic structural diagram of Embodiment 3 of a resource management apparatus according to the present invention.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
图1A为本发明资源管理方法的操作系统架构图一,图1B为本发明资源管理方法实施例一的流程示意图。本实施例的执行主体为配置在操作系统内核中的资源管理装置,该装置可以通过软件和/或硬件实现。本实施例的方案应用于通用的操作系统中,实现了用户态应用可以绕过操作系统内核直接访问和管理为所述应用分配的物理资源。如图1B所示,本实施例的方法可以包括:1A is a schematic diagram of an operating system architecture of a resource management method according to the present invention. FIG. 1B is a schematic flowchart of Embodiment 1 of a resource management method according to the present invention. The execution body of this embodiment is a resource management device configured in an operating system kernel, and the device can be implemented by software and/or hardware. The solution of this embodiment is applied to a general-purpose operating system, and the user mode application can directly access and manage the physical resources allocated for the application by bypassing the operating system kernel. As shown in FIG. 1B, the method in this embodiment may include:
S101、获取物理资源使用信息,所述物理资源使用信息用于指示应用运行所需要的物理资源。S101. Acquire physical resource usage information, where the physical resource usage information is used to indicate a physical resource required for the application to run.
如图1A所示,操作系统至少包括:硬件资源、操作系统内核和应用;其中,所述操作系统内核中设置有资源管理装置。本发明实施例中,获取用于指示应用运行所需要的物理资源的物理资源使用信息;可选地,所述物理资源使用信息包括以下至少一种:物理内存信息、中央处理器CPU信息、寄存器访问控制权限、输入/输出设备读写权限及特权指令执行权限;可选地,所述物理资源使用信息还可包括其它物理资源信息,本发明对此并不作限制。As shown in FIG. 1A, the operating system at least includes: a hardware resource, an operating system kernel, and an application; wherein the operating system kernel is provided with a resource management device. In the embodiment of the present invention, the physical resource usage information used to indicate the physical resource required for the application to run is obtained. Optionally, the physical resource usage information includes at least one of the following: physical memory information, central processor CPU information, and a register. Access control rights, input/output device read and write rights, and privileged instruction execution rights; optionally, the physical resource usage information may also include other physical resource information, which is not limited by the present invention.
可选地,步骤S101包括:获取预设的所述物理资源使用信息;或者,根据所述应用发送的硬件控制数据结构获取所述物理资源使用信息;其中,所述硬件控制数据结构包括所述物理资源使用信息。Optionally, the step S101 includes: acquiring the preset physical resource usage information; or acquiring the physical resource usage information according to the hardware control data structure sent by the application; wherein the hardware control data structure includes the Physical resource usage information.
本发明实施例中,所述物理资源使用信息可为预设的物理资源使用信息,
或者为根据所述应用发送的包括所述物理资源使用信息的硬件控制数据结构获取所述物理资源使用信息。In the embodiment of the present invention, the physical resource usage information may be preset physical resource usage information.
Or acquiring the physical resource usage information for a hardware control data structure that includes the physical resource usage information sent according to the application.
S102、根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用直接访问所述物理资源。S102. Allocate an independent physical resource to the application according to the physical resource usage information, and allocate an interface for directly accessing the physical resource to the application, so that the application directly accesses the physical resource.
本发明实施例中,在获取到用于指示应用运行所需要的物理资源的物理资源使用信息后,根据所述物理资源使用信息为所述应用分配独立的物理资源(即其它应用不可使用的物理资源)(如CPU、物理内存、I/O设备及特权指令执行权限等),并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用通过所述接口直接访问所述物理资源,即所述应用升级为可绕过操作系统内核直接访问所述物理资源(如直接执行特权指令、直接管理CPU、直接管理物理内存和直接访问I/O设备等)的提权应用;从而减少了不同应用对操作系统内核的资源争用,提升了系统性能。In the embodiment of the present invention, after obtaining the physical resource usage information for indicating the physical resource required for the application to run, the application allocates an independent physical resource according to the physical resource usage information (that is, a physical that cannot be used by other applications). a resource (such as a CPU, a physical memory, an I/O device, and a privileged instruction execution authority, etc.), and an interface for directly accessing the physical resource is allocated to the application, so that the application directly accesses the interface through the interface The physical resource, that is, the application is upgraded to an privileged application that can directly access the physical resources (such as directly executing privileged instructions, directly managing the CPU, directly managing physical memory, and directly accessing I/O devices) by bypassing the operating system kernel. This reduces the resource contention of the operating system kernel by different applications and improves system performance.
可选地,为所述应用分配用于直接访问所述物理资源的接口包括:为所述应用建立用户空间系统服务功能库,并将所述应用所需的内核的管理数据结构复制到所述用户空间系统服务功能库中,其中,所述管理数据结构用于直接访问所述物理资源。Optionally, allocating an interface for directly accessing the physical resource to the application includes: establishing a user space system service function library for the application, and copying a management data structure of a kernel required by the application to the The user space system service function library, wherein the management data structure is used to directly access the physical resource.
本发明实施例中为了保证营养兼容性,通过为所述应用建立用户空间系统服务功能库,并将所述应用所需的内核的管理数据结构复制到所述用户空间系统服务功能库中的方式为所述应用提供用于直接访问所述物理资源的接口;可选地,根据所述物理资源初始化处理器虚拟化硬件,并由用户空间系统服务功能库初始化所述独立的物理资源,以便于通过所述用户空间系统服务功能库向所述应用提供接口(可选地,所述用户空间系统服务功能库中包括所述独立的物理资源对应的服务管理函数例程,所述应用执行时直接调用所述用户空间系统服务功能库中的服务管理函数例程即可访问或管理所述物理资源,无需陷入操作系统内核);即提权后的应用可直接通过管理、更新所述用户空间系统服务功能库中的所述管理数据结构的操作来维持应用的正常运行。In order to ensure nutritional compatibility in the embodiment of the present invention, a user space system service function library is established for the application, and a management data structure of a kernel required by the application is copied into the user space system service function library. Providing, for the application, an interface for directly accessing the physical resource; optionally, initializing processor virtualization hardware according to the physical resource, and initializing the independent physical resource by a user space system service function library, so as to facilitate Providing an interface to the application by using the user space system service function library (optionally, the user space system service function library includes a service management function routine corresponding to the independent physical resource, where the application is directly executed Calling the service management function routine in the user space system service function library can access or manage the physical resource without being trapped in the operating system kernel; that is, the authorized application can directly manage and update the user space system. The operation of the management data structure in the service function library maintains the normal operation of the application.
可选地,本发明资源管理方法还包括:为所述应用分配用于管理所述物理资源的管理策略;其中,所述用户空间系统服务功能库包括:所述管理策略;以便于所述应用通过所述用户空间系统服务功能库中的接口和/或管理策
略直接访问或管理所述物理资源。Optionally, the resource management method of the present invention further includes: allocating, to the application, a management policy for managing the physical resource; wherein the user space system service function library includes: the management policy; Through the interface and/or management policy in the user space system service function library
Access or manage the physical resources directly.
在本发明实施方式中,所述操作系统可以是开源的Linux操作系统,Microsoft公司开发的Windows操作系统,Google公司的Android系统、或Apple公司开发的iOS系统等操作系统,或者是Vxworks这类的嵌入式操作系统。所述操作系统包括用于控制和管理常规系统任务,例如内存管理、存储设备控制、电源管理等,以及有助于各种软硬件之间通信的各种组件和/或驱动器。In the embodiment of the present invention, the operating system may be an open source Linux operating system, a Windows operating system developed by Microsoft Corporation, an Android system of Google Corporation, or an operating system developed by Apple Inc., or an operating system such as Vxworks. Embedded operating system. The operating system includes various components and/or drivers for controlling and managing conventional system tasks such as memory management, storage device control, power management, and the like, as well as facilitating communication between various hardware and software.
本发明实施例中,通过获取物理资源使用信息,所述物理资源使用信息用于指示应用运行所需要的物理资源;进一步地,根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用直接访问所述物理资源;即所述应用可绕过操作系统内核直接访问所述物理资源,从而减少了不同应用对操作系统内核的资源争用,提升了系统性能。In the embodiment of the present invention, the physical resource usage information is used to indicate the physical resource required for the application to run; and further, the independent physical resource is allocated to the application according to the physical resource usage information. And assigning, to the application, an interface for directly accessing the physical resource, so that the application directly accesses the physical resource; that is, the application can directly access the physical resource by bypassing an operating system kernel, thereby reducing different Application resource contention to the operating system kernel improves system performance.
当所述I/O设备为共享设备时,为了保证所述应用访问I/O设备的安全性,可选地,通过消息式系统调用与其它应用共享所述I/O设备,如通过所述应用对应的用户空间系统服务功能库提供的接口,向操作系统内核发送请求所述I/O设备的消息。When the I/O device is a shared device, in order to ensure the security of the application accessing the I/O device, optionally, the I/O device is shared with other applications through a message system call, as described by The interface provided by the corresponding user space system service function library is used to send a message requesting the I/O device to the operating system kernel.
可选地,步骤S102之后还包括:动态更新所述独立的物理资源,并同步更新操作系统内核和所述用户空间系统服务功能库中的内核管理数据结构。Optionally, after step S102, the method further includes: dynamically updating the independent physical resource, and synchronously updating an operating system kernel and a kernel management data structure in the user space system service function library.
本发明实施例中,可选地,当所述提权应用在运行过程中需要更改物理资源(如更改控制权限或者申请物理内存、CPU、I/O设备等)时,所述提权应用可通过调用所述用户空间系统服务功能库中包含的用于与操作系统内核交互的接口,向所述操作系统内核中的所述资源管理装置发送请求消息(所述请求消息中包含所述提权应用需要更新的物理资源信息),以使所述资源管理装置根据所述请求消息动态更新所述独立的物理资源;可选地,根据所述需要更新的物理资源信息更新用户空间系统服务功能库(即用户态指定内存)和操作系统内核中的管理数据结构。In the embodiment of the present invention, optionally, when the privilege application needs to change physical resources (such as changing control authority or applying physical memory, CPU, I/O device, etc.) during the running process, the privilege application may be Sending a request message to the resource management apparatus in the operating system kernel by calling an interface included in the user space system service function library for interacting with an operating system kernel (the request message includes the Applying updated physical resource information), so that the resource management device dynamically updates the independent physical resource according to the request message; optionally, updating the user space system service function library according to the physical resource information that needs to be updated. (ie user-defined memory) and management data structures in the operating system kernel.
可选地,当所述提权应用在运行过程中需要更改物理资源(如释放物理内存、CPU、I/O设备等)时,所述提权应用可直接通过所述用户空间系统服务功能库动态更新独立的物理资源,进一步地,可通过所述用户空间系统服务功能库更新用户空间系统服务功能库(即用户态指定内存)中的管理数据结构,并将修改信息发送给所述操作系统内核中的所述资源管理装置,以使
所述资源管理装置同步更新操作系统内核中的内核管理数据结构。Optionally, when the privilege application needs to change physical resources (such as releasing physical memory, CPU, I/O device, etc.) during the running process, the privilege application may directly pass the user space system service function library. Dynamically updating independent physical resources, and further, updating, by the user space system service function library, a management data structure in a user space system service function library (ie, user state specified memory), and sending the modification information to the operating system The resource management device in the kernel to enable
The resource management device synchronously updates the kernel management data structure in the operating system kernel.
可选地,动态更新所述独立的物理资源还包含以下三种情景:Optionally, dynamically updating the independent physical resource further includes the following three scenarios:
情景1:当所述应用(即提权应用)每次访问所述资源管理装置时,所述资源管理装置根据预设的资源分配策略和调用参数(可选地,所述调用参数可包括所述独立的物理资源的资源类型和资源大小等参数)判断是否需要更新为所述应用分配的独立的物理资源;Scenario 1: When the application (ie, the privilege application) accesses the resource management device each time, the resource management device according to the preset resource allocation policy and the calling parameter (optionally, the calling parameter may include Determining whether it is necessary to update an independent physical resource allocated for the application, such as a resource type and a resource size of the independent physical resource;
情景2:当所述应用(即提权应用)因触发异常陷入到操作系统内核态时,操作系统内核判断是否需要更新为所述应用分配的独立的物理资源;Scenario 2: When the application (ie, the privilege application) is trapped in the operating system kernel state due to the trigger exception, the operating system kernel determines whether it is necessary to update the independent physical resource allocated for the application;
情景3:操作系统内核周期性地判断是否需要更新为所述应用分配的独立的物理资源;若硬件支持,则直接修改任务权限,直接更新设置CPU及寄存器,并动态调整其执行权限,如通过设置虚拟机控制块(Virtual machine control block,简称VMCS)提供的数据结构来改变其对CPU硬件的部分访问管理权限;若硬件不支持,则触发中断使所述应用(提权应用)陷入内核态,并更新为所述应用分配的独立的物理资源。Scenario 3: The operating system kernel periodically determines whether it needs to update the independent physical resources allocated for the application; if the hardware supports, directly modify the task permissions, directly update the CPU and registers, and dynamically adjust its execution permissions, such as Set the data structure provided by the virtual machine control block (VMCS) to change its partial access management authority to the CPU hardware; if the hardware does not support, trigger the interrupt to cause the application (the authorized application) to fall into the kernel state. And update the independent physical resources allocated for the application.
可选地,步骤S102之后还包括:设置异常处理函数,所述异常处理函数用于当所述应用触发异常时,所述应用根据所述异常处理函数进行异常处理。Optionally, after step S102, the method further includes: setting an exception handling function, where the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
本发明实施例中,通过设置异常处理函数,以便当所述应用(即提权应用)触发异常时,所述应用根据所述异常处理函数进行异常处理。可选地,异常处理过程分为两类:第一类为所述用户空间系统服务功能库中包含已定制的异常处理函数,第二类为需要通过操作系统内核的处理过程;当所述应用中发生除零异常、页缺失异常或者无效操作码(invalid opcode)等时,所述应用通过所述用户空间系统服务功能库中的异常处理函数进行异常处理;当所述应用在执行过程中违反了所述应用对应的所述物理资源权限范围信息时,如读写了无读写权限的寄存器、硬件触发异常或者状态切换,则所述应用保存当前的执行环境,加载操作系统内核的执行环境,并根据所述异常处理函数进行异常处理;可选地,当所述异常处理完成后,所述资源管理装置再次将所述应用恢复为提权应用(即重新执行步骤S101和步骤S102的过程),以使得所述提权应用继续正常执行。In the embodiment of the present invention, by setting an exception handling function, when the application (ie, the privilege application) triggers an exception, the application performs exception processing according to the exception handling function. Optionally, the exception handling process is divided into two categories: a first type is that the user space system service function library includes a customized exception handling function, and the second type is a processing process that needs to pass through an operating system kernel; When a divide-by-zero exception, a page missing exception, or an invalid opcode occurs, the application performs exception processing through an exception handling function in the user space system service function library; when the application violates during execution When the physical resource authority range information corresponding to the application is read, such as a register having no read/write permission, a hardware trigger exception, or a state switch, the application saves the current execution environment and loads the execution environment of the operating system kernel. And performing exception processing according to the exception handling function; optionally, after the exception processing is completed, the resource management apparatus restores the application to the authorization application again (ie, re-executing the processes of step S101 and step S102) ), so that the privilege application continues to perform normally.
结合图1A所示,本发明资源管理方法实施例二中可以包括如下步骤:As shown in FIG. 1A, the second embodiment of the resource management method of the present invention may include the following steps:
1)应用通过操作系统内核提供的接口,将用于指示所述应用运行所需要的物理资源的物理资源使用信息发送给所述资源管理装置,可选地,通过硬
件控制数据结构的形式发送给所述资源管理装置;可选地,所述物理资源使用信息包括以下至少一种:物理内存信息、中央处理器CPU信息、寄存器访问控制权限、输入/输出设备读写权限、特权指令执行权限及中断指向。1) The application sends the physical resource usage information used to indicate the physical resource required for the application to be sent to the resource management device through an interface provided by the operating system kernel, optionally through hard
The form of the piece of control data structure is sent to the resource management device; optionally, the physical resource usage information includes at least one of the following: physical memory information, central processor CPU information, register access control authority, and input/output device read Write permissions, privileged instruction execution permissions, and interrupt pointers.
2)所述操作系统内核的资源管理装置根据所述应用发送的所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,如对所述应用的物理内存进行初始化、对所述应用所需的CPU上的寄存器进行保存和初始化及构建新的中断向量表等数据结构;可选地,根据为所述应用分配的所述物理资源初始化处理器虚拟化硬件,并由用户空间系统服务功能库初始化所述物理资源,以便于通过所述用户空间系统服务功能库向所述应用提供用于直接访问所述物理资源的接口。2) The resource management device of the operating system kernel allocates an independent physical resource to the application according to the physical resource usage information sent by the application, and allocates an interface for directly accessing the physical resource to the application, Such as initializing physical memory of the application, saving and initializing registers on the CPU required by the application, and constructing a new interrupt vector table or the like; optionally, according to the allocation for the application The physical resource initializes the processor virtualization hardware and initializes the physical resource by the user space system service function library to facilitate providing the application with an interface for direct access to the physical resource through the user space system service function library.
3)所述资源管理装置保存所述应用当前的执行环境,如寄存器值、寄存器状态及段寄存器等;并加载所述应用升级后的特权应用对应的执行上下文(即为所述应用分配的独立的物理资源,如物理内存信息、中央处理器CPU信息及CPU寄存器设置等),以使所述特权应用根据所述用户空间系统服务功能库,直接访问或管理所述物理资源;其中,所述用户空间系统服务功能库用于为所述特权应用提供管理所述物理资源的管理策略和用于直接访问所述物理资源的接口。3) the resource management device saves an execution environment of the application, such as a register value, a register state, a segment register, and the like; and loads an execution context corresponding to the privileged application after the application is upgraded (ie, an independent allocation for the application) Physical resources, such as physical memory information, central processor CPU information, and CPU register settings, etc., to enable the privileged application to directly access or manage the physical resources according to the user space system service function library; A user space system service function library is used to provide the privileged application with a management policy for managing the physical resources and an interface for directly accessing the physical resources.
4)所述资源管理装置设置执行入口点,并设置异常处理函数;当所述提权应用在执行过程中触发异常时,保存上下文(如CPU寄存器信息等),切换到下一个进程,并根据所述异常处理函数进行异常处理。4) the resource management device sets an execution entry point, and sets an exception handling function; when the elevation application triggers an exception during execution, saves the context (such as CPU register information, etc.), switches to the next process, and according to The exception handling function performs exception handling.
综上所述,本实施例中,通过为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用根据用户空间系统服务功能库直接管理或访问所述物理资源,而无需通过操作系统内核管理物理资源,从而减少了不同应用对操作系统内核的资源争用,提升了系统性能。In summary, in this embodiment, an independent physical resource is allocated to the application, and an interface for directly accessing the physical resource is allocated to the application, so that the application is based on a user space system service function library. Directly manage or access the physical resources without managing physical resources through the operating system kernel, thereby reducing resource contention of operating system kernels by different applications and improving system performance.
图2A为本发明资源管理方法的操作系统架构图二。如图2A所示,管理核(core)用于设置应用核(core)的指令执行权限、寄存器读写权限及I/O设备等;提权应用通过定制的用户空间系统服务功能库(LibXOS)直接访问或管理所述提权应用对应的独立的物理资源;所述资源管理装置用于进程提权(即将普通应用升级为提权应用,具体地,通过管理核来设置应用核上执行进程的资源权限范围;其中,普通应用每次需要通过操作系统内核访问或
操作物理资源,提权应用可直接根据其对应的用户空间系统服务功能库直接访问或操作其对应的物理资源);所述所述资源管理装置还用于对所述提权应用超出执行权限时的异常处理;用户空间系统服务功能库通过消息式系统调用来获取远端的I/O服务;另外,当提权应用不能通过用户空间系统服务功能库实现的某内核功能时,可通过请求队列写到指定内存,并由服务线程读取响应。2A is a second structural diagram of an operating system of a resource management method according to the present invention. As shown in FIG. 2A, a management core is used to set an instruction execution permission of a core, a register read/write permission, and an I/O device, etc., and an authorized user space system service function library (LibXOS) is provided. Directly accessing or managing the independent physical resource corresponding to the privilege application; the resource management device is used to process the privilege (that is, upgrading the normal application to the privilege application, specifically, setting the execution process on the application core through the management core a range of resource permissions; where a normal application needs to be accessed through the operating system kernel or
The physical resource is operated, and the privilege application can directly access or operate the corresponding physical resource according to the corresponding user space system service function library; the resource management device is further configured to: when the privilege application exceeds the execution permission Exception handling; the user space system service function library obtains the remote I/O service through the message system call; in addition, when the privilege application cannot pass a kernel function implemented by the user space system service function library, the request queue can be Write to the specified memory and the response is read by the service thread.
图2B为本发明资源管理方法实施例三的示意图,如图2B所示,具体地描述了在用户态空间进行页表管理的方法。可选地,在对普通应用进行提权时,将所述普通应用在操作系统内核中的页表数据结构拷贝到指定物理内存中,并由用户态空间系统服务功能库里的页表管理模块进行管理,包括对页表的读写和/或更新等操作。当所述应用从非根(non-root)模式陷入到根(root)模式时,即因为主动或被动(如异常)等原因陷入操作系统内核时,需要将所述页表数据结构同步到原来内核管理的页表结构。由于页表里面是对虚拟内存和物理内存进行离散的映射,因此,在拷贝页表数据结构的时,对于已经映射在内核页表里的物理内存,需要在内核里进行锁定,不让换出;而对于页表里面还未填充的项,则是由用户态系统服务功能库根据应用请求、执行过程状态和预留物理内存等信息来进行管理的。FIG. 2B is a schematic diagram of Embodiment 3 of a resource management method according to the present invention. As shown in FIG. 2B, a method for performing page table management in a user state space is specifically described. Optionally, when the normal application is used for the weighting, the page table data structure of the common application in the operating system kernel is copied into the specified physical memory, and is performed by the page table management module in the user state space system service function library. Management, including operations such as reading, writing, and/or updating page tables. When the application falls into the root mode from a non-root mode, that is, when it is trapped in the operating system kernel due to active or passive (such as an exception), the page table data structure needs to be synchronized to the original state. The page table structure managed by the kernel. Since the page table is a discrete mapping of virtual memory and physical memory, when copying the page table data structure, for the physical memory already mapped in the kernel page table, it is necessary to lock in the kernel, and not to swap out The items that are not yet filled in the page table are managed by the user state system service function library according to the application request, the execution process state, and the reserved physical memory.
图2C为本发明资源管理方法实施例四的示意图。如图2C所示,具体描述了通过用户空间系统服务功能库(LibXOS)进行管理、申请、分配和释放内存的内容。LibXOS中的内存管理主要提供两部分功能,其中,1)第一部分功能为:对于应用所需的申请和释放内存的函数例程,LibXOS只管理在对应用提权时资源管理装置分配的物理内存,因此所有申请和释放操作都只针对预留的所述物理内存;但当所述物理内存耗尽时,就需要通过主动与操作系统内核交互的方式向操作系统内核申请新的物理内存,以增加为所述应用预留的物理内存,申请新的物理内存的过程即为主动陷入操作系统方式,即通过vmcall陷入操作系统内核,然后根据传递的参数,由操作系统内核中的异常处理函数来响应,并分配物理内存,最后返回;2)第二部分功能为:用户态缺页异常处理,其中,缺页异常是指页表中的映射项不存在时,访问该虚拟地址所触发的硬件异常;现有Linux和大部分其它操作系统都通过内核的异常处理函数来完成的,但本发明实施例中在对普通应用提权时更新初始化了现有硬件异常处理函数,并设置了VMCS数据结构,使得在发生缺页异常时,硬
件会将缺页异常抛到用户态,并由用户空间系统服务功能库中的用户态缺页异常处理函数进行处理,具体地,可按照现有操作系统中按需调页的方式来编写用户态缺页异常处理函数,也可采用提前调页的方式来编写用户态缺页异常处理函数,因此,提升了不同内存使用需求的应用的系统性能。2C is a schematic diagram of Embodiment 4 of a resource management method according to the present invention. As shown in FIG. 2C, the content of managing, applying, allocating, and releasing memory through the user space system service function library (LibXOS) is specifically described. The memory management in LibXOS mainly provides two parts. Among them, 1) The first part of the function is: For the application required and the function routine for releasing the memory, LibXOS only manages the physical memory allocated by the resource management device when the application is authorized. Therefore, all application and release operations are only for the reserved physical memory; but when the physical memory is exhausted, it is necessary to apply for new physical memory to the operating system kernel by actively interacting with the operating system kernel to increase For the physical memory reserved for the application, the process of applying for new physical memory is to actively fall into the operating system mode, that is, into the operating system kernel through vmcall, and then respond by the exception handling function in the operating system kernel according to the passed parameters. And allocate physical memory, and finally return; 2) The second part of the function is: user state page fault exception handling, wherein the page fault exception refers to the hardware exception triggered by accessing the virtual address when the mapping entry in the page table does not exist. Existing Linux and most other operating systems are done through the kernel's exception handling functions, but this is In an embodiment of the common application provide temporary update existing hardware initialization exception handler, and the VMCS data structure is provided, such that when a page fault exception occurs, hard
The device will throw the page fault exception to the user state, and is processed by the user state page fault exception handler function in the user space system service function library. Specifically, the user can be written according to the on-demand page paging in the existing operating system. State-of-the-page exception handling functions can also be used to write user-mode page fault exception handling functions in advance, thus improving the system performance of applications with different memory usage requirements.
图3为本发明资源管理装置实施例一的结构示意图,如图3所示,本实施例提供的资源管理装置30可以包括:获取模块301及分配模块302。FIG. 3 is a schematic structural diagram of Embodiment 1 of a resource management apparatus according to the present invention. As shown in FIG. 3, the resource management apparatus 30 provided in this embodiment may include: an obtaining module 301 and an allocating module 302.
其中,获取模块301用于获取物理资源使用信息,所述物理资源使用信息用于指示应用运行所需要的物理资源;The obtaining module 301 is configured to obtain physical resource usage information, where the physical resource usage information is used to indicate physical resources required for the application to run;
分配模块302用于根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用直接访问所述物理资源。The allocating module 302 is configured to allocate an independent physical resource to the application according to the physical resource usage information, and allocate an interface for directly accessing the physical resource to enable the application to directly access the physical resource. .
本实施例的资源管理装置可以用于执行本发明上述资源管理方法实施例一中的技术方案,其实现原理和技术效果类似,此处不再赘述。The resource management apparatus in this embodiment may be used to perform the technical solution in the first embodiment of the foregoing resource management method of the present invention, and the implementation principle and technical effects are similar, and details are not described herein again.
可选地,作为一种可实施的方式,在图3所示的实施方式的基础上,所述获取模块301具体用于:Optionally, as an implementable manner, on the basis of the embodiment shown in FIG. 3, the obtaining module 301 is specifically configured to:
获取预设的所述物理资源使用信息;或者,Obtaining the preset physical resource usage information; or
根据所述应用发送的硬件控制数据结构获取所述物理资源使用信息;其中,所述硬件控制数据结构包括所述物理资源使用信息。Acquiring the physical resource usage information according to the hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
可选地,作为另一种可实施的方式,在图3所示的实施方式的基础上,所述分配模块302具体用于:为所述应用建立用户空间系统服务功能库,并将所述应用所需的内核的管理数据结构复制到所述用户空间系统服务功能库中,其中,所述管理数据结构用于直接访问所述物理资源。Optionally, in another implementation manner, on the basis of the embodiment shown in FIG. 3, the allocating module 302 is specifically configured to: establish a user space system service function library for the application, and The management data structure of the kernel required by the application is copied into the user space system service function library, wherein the management data structure is used to directly access the physical resource.
可选地,所述分配模块还用于:为所述应用分配用于管理所述物理资源的管理策略;其中,所述用户空间系统服务功能库包括:所述管理策略。Optionally, the allocating module is further configured to: allocate, to the application, a management policy for managing the physical resource; where the user space system service function library includes: the management policy.
可选地,作为另一种可实施的方式,如图4所示,图4为本发明资源管理装置实施例二的结构示意图,在图3所示的实施方式的基础上,资源管理装置30还包括:更新模块303用于动态更新所述独立的物理资源,并同步更新操作系统内核和所述用户空间系统服务功能库中的内核管理数据结构;Optionally, as another implementation manner, as shown in FIG. 4, FIG. 4 is a schematic structural diagram of Embodiment 2 of the resource management apparatus according to the present invention. On the basis of the implementation manner shown in FIG. 3, the resource management apparatus 30 is provided. The method further includes: an update module 303, configured to dynamically update the independent physical resource, and synchronously update an operating system kernel and a kernel management data structure in the user space system service function library;
可选地,还包括:异常处理模块304用于设置异常处理函数,所述异常处理函数用于当所述应用触发异常时,所述应用根据所述异常处理函数进行异常处理。
Optionally, the method further includes: an exception processing module 304, configured to set an exception handling function, where the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
可选地,所述物理资源使用信息包括以下至少一种:物理内存信息、中央处理器CPU信息、寄存器访问控制权限、输入/输出设备读写权限及特权指令执行权限。Optionally, the physical resource usage information includes at least one of the following: physical memory information, central processor CPU information, register access control authority, input/output device read/write permission, and privileged instruction execution authority.
本实施例的资源管理装置可以用于执行本发明上述资源管理方法实施例中的技术方案,其实现原理和技术效果类似,此处不再赘述。The resource management device in this embodiment may be used to implement the technical solution in the foregoing resource management method embodiment of the present invention, and the implementation principle and the technical effect are similar, and details are not described herein again.
图5为本发明资源管理装置实施例三的结构示意图,如图5所示,本实施例提供的资源管理装置50可以包括处理器501和存储器502。资源管理装置50还可以包括数据接口单元503,该数据接口单元503可以和处理器501相连。其中,数据接口单元503用于输入/输出数据信息,存储器502用于存储执行指令。当资源管理装置50运行时,处理器501与存储器502之间通信,处理器501调用存储器502中的执行指令,用以执行上述资源管理方法实施例中的操作。FIG. 5 is a schematic structural diagram of Embodiment 3 of the resource management apparatus according to the present invention. As shown in FIG. 5, the resource management apparatus 50 provided in this embodiment may include a processor 501 and a memory 502. The resource management device 50 may also include a data interface unit 503 that may be coupled to the processor 501. The data interface unit 503 is used to input/output data information, and the memory 502 is used to store execution instructions. When the resource management device 50 is running, the processor 501 communicates with the memory 502, and the processor 501 calls an execution instruction in the memory 502 to perform the operations in the resource management method embodiment described above.
本实施例的资源管理装置可以用于执行本发明上述资源管理方法实施例中的技术方案,其实现原理和技术效果类似,此处不再赘述。The resource management device in this embodiment may be used to implement the technical solution in the foregoing resource management method embodiment of the present invention, and the implementation principle and the technical effect are similar, and details are not described herein again.
在本发明所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)
或处理器(processor)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium. The above software functional unit is stored in a storage medium and includes a plurality of instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.)
Or a processor performs part of the steps of the method of the various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
本领域技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of each functional module described above is exemplified. In practical applications, the above function assignment can be completed by different functional modules as needed, that is, the device is installed. The internal structure is divided into different functional modules to perform all or part of the functions described above. For the specific working process of the device described above, refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。One of ordinary skill in the art will appreciate that all or part of the steps to implement the various method embodiments described above may be accomplished by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. The program, when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present invention. range.
Claims (14)
- 一种资源管理方法,其特征在于,包括:A resource management method, comprising:获取物理资源使用信息,所述物理资源使用信息用于指示应用运行所需要的物理资源;Obtaining physical resource usage information, where the physical resource usage information is used to indicate a physical resource required for the application to run;根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用直接访问所述物理资源。Assigning an independent physical resource to the application according to the physical resource usage information, and allocating an interface for directly accessing the physical resource to the application, so that the application directly accesses the physical resource.
- 根据权利要求1所述的方法,其特征在于,所述获取物理资源使用信息,包括:The method according to claim 1, wherein the obtaining physical resource usage information comprises:获取预设的所述物理资源使用信息;或者,Obtaining the preset physical resource usage information; or根据所述应用发送的硬件控制数据结构获取所述物理资源使用信息;其中,所述硬件控制数据结构包括所述物理资源使用信息。Acquiring the physical resource usage information according to the hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
- 根据权利要求1或2所述的方法,其特征在于,所述为所述应用分配用于直接访问所述物理资源的接口,包括:The method according to claim 1 or 2, wherein the allocating an interface for directly accessing the physical resource to the application comprises:为所述应用建立用户空间系统服务功能库,并将所述应用所需的内核的管理数据结构复制到所述用户空间系统服务功能库中,其中,所述管理数据结构用于直接访问所述物理资源。Establishing a user space system service function library for the application, and copying a management data structure of a kernel required by the application into the user space system service function library, wherein the management data structure is used for directly accessing the Physical resources.
- 根据权利要求3所述的方法,其特征在于,还包括:为所述应用分配用于管理所述物理资源的管理策略;其中,所述用户空间系统服务功能库包括:所述管理策略。The method according to claim 3, further comprising: allocating a management policy for managing the physical resource to the application; wherein the user space system service function library comprises: the management policy.
- 根据权利要求1-4中任一项所述的方法,其特征在于,所述根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口之后,还包括:The method according to any one of claims 1 to 4, wherein the assigning an independent physical resource to the application according to the physical resource usage information, and allocating the application for direct access to the After the interface of the physical resources, it also includes:动态更新所述独立的物理资源,并同步更新操作系统内核和所述用户空间系统服务功能库中的内核管理数据结构。The independent physical resources are dynamically updated, and the operating system kernel and the kernel management data structure in the user space system service function library are synchronously updated.
- 根据权利要求1-5中任一项所述的方法,其特征在于,所述根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口之后,还包括:The method according to any one of claims 1 to 5, wherein the assigning an independent physical resource to the application according to the physical resource usage information, and allocating the application for direct access to the After the interface of the physical resources, it also includes:设置异常处理函数,所述异常处理函数用于当所述应用触发异常时,所述应用根据所述异常处理函数进行异常处理。 An exception handling function is provided, and the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
- 根据权利要求1-6中任一项所述的方法,其特征在于,所述物理资源使用信息包括以下至少一种:物理内存信息、中央处理器CPU信息、寄存器访问控制权限、输入/输出设备读写权限及特权指令执行权限。The method according to any one of claims 1 to 6, wherein the physical resource usage information comprises at least one of: physical memory information, central processor CPU information, register access control authority, input/output device Read and write permissions and privileged instruction execution permissions.
- 一种资源管理装置,其特征在于,包括:A resource management device, comprising:获取模块,用于获取物理资源使用信息,所述物理资源使用信息用于指示应用运行所需要的物理资源;An acquiring module, configured to acquire physical resource usage information, where the physical resource usage information is used to indicate a physical resource required for the application to run;分配模块,用于根据所述物理资源使用信息为所述应用分配独立的物理资源,并为所述应用分配用于直接访问所述物理资源的接口,以使所述应用直接访问所述物理资源。An allocating module, configured to allocate an independent physical resource to the application according to the physical resource usage information, and allocate an interface for directly accessing the physical resource, so that the application directly accesses the physical resource .
- 根据权利要求8所述的装置,其特征在于,所述获取模块具体用于:The device according to claim 8, wherein the obtaining module is specifically configured to:获取预设的所述物理资源使用信息;或者,Obtaining the preset physical resource usage information; or根据所述应用发送的硬件控制数据结构获取所述物理资源使用信息;其中,所述硬件控制数据结构包括所述物理资源使用信息。Acquiring the physical resource usage information according to the hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
- 根据权利要求8或9所述的装置,其特征在于,所述分配模块具体用于:The device according to claim 8 or 9, wherein the distribution module is specifically configured to:为所述应用建立用户空间系统服务功能库,并将所述应用所需的内核的管理数据结构复制到所述用户空间系统服务功能库中,其中,所述管理数据结构用于直接访问所述物理资源。Establishing a user space system service function library for the application, and copying a management data structure of a kernel required by the application into the user space system service function library, wherein the management data structure is used for directly accessing the Physical resources.
- 根据权利要求10所述的装置,其特征在于,所述分配模块还用于:为所述应用分配用于管理所述物理资源的管理策略;其中,所述用户空间系统服务功能库包括:所述管理策略。The apparatus according to claim 10, wherein the allocation module is further configured to: allocate, to the application, a management policy for managing the physical resource; wherein the user space system service function library comprises: Management strategy.
- 根据权利要求8-11中任一项所述的装置,其特征在于,还包括:The device according to any one of claims 8-11, further comprising:更新模块,用于动态更新所述独立的物理资源,并同步更新操作系统内核和所述用户空间系统服务功能库中的内核管理数据结构。And an update module, configured to dynamically update the independent physical resource, and synchronously update an operating system kernel and a kernel management data structure in the user space system service function library.
- 根据权利要求8-12中任一项所述的装置,其特征在于,还包括:The device according to any one of claims 8 to 12, further comprising:异常处理模块,用于设置异常处理函数,所述异常处理函数用于当所述应用触发异常时,所述应用根据所述异常处理函数进行异常处理。An exception handling module is configured to set an exception handling function, where the exception handling function is configured to perform exception processing according to the exception handling function when the application triggers an exception.
- 根据权利要求8-13中任一项所述的装置,其特征在于,所述物理资源使用信息包括以下至少一种:物理内存信息、中央处理器CPU信息、寄存器访问控制权限、输入/输出设备读写权限及特权指令执行权限。 The apparatus according to any one of claims 8 to 13, wherein the physical resource usage information comprises at least one of: physical memory information, central processor CPU information, register access control authority, and input/output device. Read and write permissions and privileged instruction execution permissions.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510429902.1 | 2015-07-21 | ||
CN201510429902.1A CN106708619B (en) | 2015-07-21 | 2015-07-21 | Resource management method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017012339A1 true WO2017012339A1 (en) | 2017-01-26 |
Family
ID=57834837
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/073940 WO2017012339A1 (en) | 2015-07-21 | 2016-02-17 | Resource management method and apparatus |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106708619B (en) |
WO (1) | WO2017012339A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114611849A (en) * | 2020-11-25 | 2022-06-10 | 北京秦淮数据有限公司 | IDC resource management system and method |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109144714A (en) * | 2017-06-19 | 2019-01-04 | 中兴通讯股份有限公司 | EMS memory management process and device |
CN109901935B (en) * | 2017-12-11 | 2021-12-17 | 航天信息股份有限公司 | Method and equipment for communicating with USB Key |
CN109976886B (en) * | 2017-12-28 | 2021-10-22 | 深圳中电长城信息安全系统有限公司 | Kernel remote switching method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101488098A (en) * | 2009-02-13 | 2009-07-22 | 华中科技大学 | Multi-core computing resource management system based on virtual computing technology |
CN102117113A (en) * | 2009-12-31 | 2011-07-06 | 联想(北京)有限公司 | Computer system and method of power supply management for central processing unit thereof |
CN102385532A (en) * | 2011-12-02 | 2012-03-21 | 浪潮集团有限公司 | Method for improving cloud application property via non-transparent CACHE |
US20130067468A1 (en) * | 2011-09-14 | 2013-03-14 | Microsoft Corporation | Application acceleration in a virtualized environment |
CN103995731A (en) * | 2014-05-09 | 2014-08-20 | 华为技术有限公司 | Management center deployment method and virtual device |
CN104424034A (en) * | 2013-09-04 | 2015-03-18 | 华为技术有限公司 | Hardware resource access method and hardware resource access device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9672071B2 (en) * | 2013-09-10 | 2017-06-06 | Vmware, Inc. | Method and system for distributed processing of HTTP requests |
CN104391949B (en) * | 2014-11-26 | 2018-01-19 | 国家电网公司 | A kind of wide-area data method for managing resource based on data dictionary |
-
2015
- 2015-07-21 CN CN201510429902.1A patent/CN106708619B/en active Active
-
2016
- 2016-02-17 WO PCT/CN2016/073940 patent/WO2017012339A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101488098A (en) * | 2009-02-13 | 2009-07-22 | 华中科技大学 | Multi-core computing resource management system based on virtual computing technology |
CN102117113A (en) * | 2009-12-31 | 2011-07-06 | 联想(北京)有限公司 | Computer system and method of power supply management for central processing unit thereof |
US20130067468A1 (en) * | 2011-09-14 | 2013-03-14 | Microsoft Corporation | Application acceleration in a virtualized environment |
CN102385532A (en) * | 2011-12-02 | 2012-03-21 | 浪潮集团有限公司 | Method for improving cloud application property via non-transparent CACHE |
CN104424034A (en) * | 2013-09-04 | 2015-03-18 | 华为技术有限公司 | Hardware resource access method and hardware resource access device |
CN103995731A (en) * | 2014-05-09 | 2014-08-20 | 华为技术有限公司 | Management center deployment method and virtual device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114611849A (en) * | 2020-11-25 | 2022-06-10 | 北京秦淮数据有限公司 | IDC resource management system and method |
Also Published As
Publication number | Publication date |
---|---|
CN106708619B (en) | 2021-01-15 |
CN106708619A (en) | 2017-05-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3798835B1 (en) | Method, device, and system for implementing hardware acceleration processing | |
CA2933712C (en) | Resource processing method, operating system, and device | |
US10191759B2 (en) | Apparatus and method for scheduling graphics processing unit workloads from virtual machines | |
JP5323897B2 (en) | Method, apparatus and system for bi-directional communication between a virtual machine monitor and an ACPI compliant guest operating system | |
TWI417790B (en) | Logical partitioning and virtualization in a heterogeneous architecture | |
WO2021217529A1 (en) | Method and system for inter-process communication | |
JP2009506462A (en) | Hierarchical virtualization using a multi-layered virtualization mechanism | |
JP2007220086A (en) | Input/output controller, input/output control system, and input/output control method | |
GB2525003A (en) | Data Processing Systems | |
US20170206104A1 (en) | Persistent guest and software-defined storage in computing fabric | |
WO2017012339A1 (en) | Resource management method and apparatus | |
TW201030623A (en) | Providing multiple virtual device controllers by redirecting an interrupt from a physical device controller | |
US10162663B2 (en) | Computer and hypervisor-based resource scheduling method | |
US9558364B2 (en) | Computing machine, access management method, and access management program | |
US9569241B2 (en) | Sharing devices assigned to virtual machines using runtime exclusion | |
KR101535792B1 (en) | Apparatus for configuring operating system and method thereof | |
US20200201691A1 (en) | Enhanced message control banks | |
KR101334842B1 (en) | Virtual machine manager for platform of terminal having function of virtualization and method thereof | |
US20150212826A1 (en) | Information processing apparatus, information processing method, and storage medium | |
US20240354138A1 (en) | Power-management virtual machines | |
KR102333693B1 (en) | Method and apparatus for operating multi-processor system in electronic device | |
JP2011257973A (en) | Memory management method and memory management device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16827031 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16827031 Country of ref document: EP Kind code of ref document: A1 |