CN106708619B - Resource management method and device - Google Patents
Resource management method and device Download PDFInfo
- Publication number
- CN106708619B CN106708619B CN201510429902.1A CN201510429902A CN106708619B CN 106708619 B CN106708619 B CN 106708619B CN 201510429902 A CN201510429902 A CN 201510429902A CN 106708619 B CN106708619 B CN 106708619B
- Authority
- CN
- China
- Prior art keywords
- application
- physical resource
- physical
- kernel
- allocating
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000007726 management method Methods 0.000 title abstract description 92
- 238000000034 method Methods 0.000 claims abstract description 38
- 230000006870 function Effects 0.000 claims description 95
- 238000012545 processing Methods 0.000 claims description 7
- 230000008569 process Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 14
- 238000013475 authorization Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000015556 catabolic process Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 235000016709 nutrition Nutrition 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
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]
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
The embodiment of the invention provides a resource management method and a device, wherein the method comprises the following steps: acquiring physical resource use information, wherein the physical resource use information is used for indicating physical resources required by application operation; according to the physical resource use information, allocating independent physical resources for the application, and allocating an interface for directly accessing the physical resources for the application so that the application directly accesses the physical resources; therefore, resource contention of different applications to the kernel of the operating system is reduced, and system performance is improved.
Description
Technical Field
The present invention relates to computer technologies, and in particular, to a resource management method and apparatus.
Background
In a current general operating system, an application cannot sense and/or control physical resources, that is, when any application needs to access resources, the application needs to be trapped in a kernel of the operating system, and the resources are accessed through the kernel. Therefore, when multiple applications of the operating system need to access resources, kernel resource contention is caused, resulting in system performance degradation.
Disclosure of Invention
The embodiment of the invention provides a resource management method and device, which improve the system performance.
In a first aspect, an embodiment of the present invention provides a resource management method, including:
acquiring physical resource use information, wherein the physical resource use information is used for indicating physical resources required by application operation;
and allocating independent physical resources for the application according to the physical resource use information, and allocating an interface for directly accessing the physical resources for the application so that the application directly accesses the physical resources.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the obtaining physical resource usage information includes:
acquiring preset physical resource use information; or,
acquiring the physical resource use information according to a 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 allocating, to the application, an interface for directly accessing the physical resource includes:
and 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.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the method further includes: allocating a management policy for managing the physical resources to the application; wherein the user space system service function library comprises: the management policy.
With reference to the first aspect and any one of the first to third possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, after the allocating, according to the physical resource usage information, an independent physical resource to the application and allocating, to the application, an interface for directly accessing the physical resource, the method further includes:
and dynamically updating the independent physical resources and synchronously updating the kernel management data structures in the kernel of the operating system and the kernel management data structures in the user space system service function library.
With reference to the first aspect and any one of the first to fourth possible implementation manners of the first aspect, in a fifth possible implementation manner of the first aspect, after the allocating, according to the physical resource usage information, an independent physical resource to the application and allocating, to the application, an interface for directly accessing the physical resource, the method further includes:
and setting an exception handling function, wherein the exception handling function is used for carrying out exception handling by the application according to the exception handling function when the application triggers exception.
With reference to the first aspect and any one of the first to fifth possible implementation manners of the first aspect, in a sixth possible implementation manner of the first aspect, the physical resource usage information includes at least one of: physical memory information, CPU information, register access control authority, read-write authority of input/output equipment and privilege instruction execution authority.
In a second aspect, an embodiment of the present invention provides a resource management apparatus, including:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring physical resource use information which is used for indicating physical resources required by application operation;
and the allocation module is used for allocating independent physical resources for the application according to the physical resource use information and allocating an interface for directly accessing the physical resources for the application so that the application directly accesses the physical resources.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the obtaining module is specifically configured to:
acquiring preset physical resource use information; or,
acquiring the physical resource use information according to a hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the allocating module is specifically configured to:
and 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.
With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the allocating module is further configured to: allocating a management policy for managing the physical resources to the application; wherein the user space system service function library comprises: the management policy.
With reference to the second aspect and any one of the first to third possible implementation manners of the second aspect, in a fourth possible implementation manner of the second aspect, the apparatus further includes:
and the updating module is used for dynamically updating the independent physical resources and synchronously updating the kernel management data structures in the kernel of the operating system and the kernel management data structures in the user space system service function library.
With reference to the second aspect and any one of the first to fourth possible implementation manners of the second aspect, in a fifth possible implementation manner of the second aspect, the apparatus further includes:
and the exception handling module is used for setting an exception handling function, and the exception handling function is used for carrying out exception handling by the application according to the exception handling function when the application triggers exception.
With reference to the second aspect and any one of the first to fifth possible implementation manners of the second aspect, in a sixth possible implementation manner of the second aspect, the physical resource usage information includes at least one of: physical memory information, CPU information, register access control authority, read-write authority of input/output equipment and privilege instruction execution authority.
In the invention, physical resource use information is acquired and used for indicating physical resources required by application operation; further, according to the physical resource use information, allocating an independent physical resource for the application, and allocating an interface for directly accessing the physical resource for the application, so that the application directly accesses the physical resource; therefore, resource contention of different applications to the kernel of the operating system is reduced, and system performance is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1A is a first diagram of an operating system architecture of the resource management method of the present invention;
FIG. 1B is a flowchart illustrating a resource management method according to a first embodiment of the present invention;
FIG. 2A is a second diagram of the operating system architecture of the resource management method of the present invention;
FIG. 2B is a diagram illustrating a third embodiment of a resource management method according to the present invention;
FIG. 2C is a diagram illustrating a fourth embodiment of a resource management method according to the present invention;
FIG. 3 is a schematic structural diagram of a resource management device according to a first embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a second resource management apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a third embodiment of a resource management device according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1A is a first operating system architecture diagram of the resource management method of the present invention, and fig. 1B is a first flowchart of the resource management method of the present invention. The execution subject of this embodiment is a resource management device configured in the kernel of the operating system, and this device may be implemented by software and/or hardware. The scheme of the embodiment is applied to a general operating system, and the user mode application can bypass an operating system kernel to directly access and manage the physical resources distributed to the application. As shown in fig. 1B, the method of this embodiment may include:
s101, obtaining physical resource use information, wherein the physical resource use information is used for indicating physical resources required by application running.
As shown in fig. 1A, the operating system includes at least: hardware resources, operating system kernel and applications; and the operating system kernel is internally provided with a resource management device. In the embodiment of the invention, physical resource use information used for indicating physical resources required by application running is obtained; optionally, the physical resource usage information includes at least one of: physical memory information, Central Processing Unit (CPU) information, register access control authority, read-write authority of input/output equipment and privilege instruction execution authority; optionally, the physical resource usage information may further include other physical resource information, which is not limited in the present invention.
Optionally, step S101 includes: acquiring preset physical resource use information; or, obtaining the physical resource use information according to a hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
In this embodiment of the present invention, the physical resource usage information may be preset physical resource usage information, or may be obtained according to a hardware control data structure including the physical resource usage information and sent by the application.
S102, according to the physical resource use information, independent physical resources are distributed for the application, and an interface for directly accessing the physical resources is distributed for the application, so that the application directly accesses the physical resources.
In the embodiment of the present invention, after physical resource usage information indicating a physical resource required for an application to run is acquired, an independent physical resource (i.e., a physical resource that is not usable by other applications) (e.g., a CPU, a physical memory, an I/O device, and a privilege instruction execution authority) is allocated to the application according to the physical resource usage information, and an interface for directly accessing the physical resource is allocated to the application, so that the application directly accesses the physical resource through the interface, that is, the application is upgraded to an authorization application that can directly access the physical resource (e.g., directly execute a privilege instruction, directly manage a CPU, directly manage a physical memory, and directly access an I/O device, etc.) by bypassing an operating system kernel; therefore, resource contention of different applications to the kernel of the operating system is reduced, and system performance is improved.
Optionally, allocating an interface for the application to directly access the physical resource includes: and 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 order to ensure nutritional compatibility, an interface for directly accessing the physical resources is provided for the application in a mode of 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; optionally, processor virtualization hardware is initialized according to the physical resource, and the user space system service function library initializes the independent physical resource, so as to provide an interface for the application through 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, and the application directly calls the service management function routine in the user space system service function library to access or manage the physical resource without trapping in an operating system kernel during execution); namely, the application after the privilege escalation can maintain the normal operation of the application directly through the operation of managing and updating the management data structure in the user space system service function library.
Optionally, the resource management method of the present invention further includes: allocating a management policy for managing the physical resources to the application; wherein the user space system service function library comprises: the management policy; so that the application can directly access or manage the physical resources through the interface and/or management policy in the user space system service function library.
In the embodiment of the present invention, the operating system may be an open-source Linux operating system, an operating system such as a Windows operating system developed by Microsoft corporation, an Android system developed by Google corporation, or an iOS system developed by Apple corporation, or an embedded operating system such as Vxworks. 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, etc., as well as facilitating communication between various hardware and software components.
In the embodiment of the invention, physical resource use information is acquired and used for indicating physical resources required by application operation; further, according to the physical resource use information, allocating an independent physical resource for the application, and allocating an interface for directly accessing the physical resource for the application, so that the application directly accesses the physical resource; namely, the application can bypass the kernel of the operating system to directly access the physical resource, so that the resource contention of different applications to the kernel of the operating system is reduced, and the system performance is improved.
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 messaging system call, for example, a message requesting the I/O device is sent to an operating system kernel through an interface provided by a user space system service function library corresponding to the application.
Optionally, after step S102, the method further includes: and dynamically updating the independent physical resources and synchronously updating the kernel management data structures in the kernel of the operating system and the kernel management data structures in the user space system service function library.
In this embodiment of the present invention, optionally, when the privilege-granting application needs to change a physical resource (for example, change a control privilege or apply for a physical memory, a CPU, an I/O device, or the like) in an operation process, the privilege-granting application may send a request message (the request message includes physical resource information that the privilege-granting application needs to update) to the resource management device in the kernel of the operating system by calling an interface that is included in the user space system service function library and used for interacting with the kernel of the operating system, so that the resource management device dynamically updates the independent physical resource according to the request message; optionally, the management data structures in the user space system service function library (i.e. the user mode specified memory) and the operating system kernel are updated according to the physical resource information to be updated.
Optionally, when the privilege offering application needs to change physical resources (for example, release a physical memory, a CPU, an I/O device, and the like) during the running process, the privilege offering application may dynamically update the independent physical resources directly through the user space system service function library, and further, may update a management data structure in the user space system service function library (that is, a user-mode specified memory) through the user space system service function library, and send modification information to the resource management device in the operating system kernel, so that 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:
scenario 1: when the application (i.e. the right-lifting application) accesses the resource management device each time, the resource management device determines whether to update the independent physical resource allocated to the application according to a preset resource allocation policy and a calling parameter (optionally, the calling parameter may include parameters such as a resource type and a resource size of the independent physical resource);
scenario 2: when the application (namely the right-lifting application) falls into an operating system kernel state due to triggering exception, the operating system kernel judges whether the independent physical resource distributed to the application needs to be updated or not;
scenario 3: periodically judging whether the independent physical resources distributed to the application need to be updated by the operating system kernel; if the hardware supports, directly modifying task authority, directly updating and setting a CPU and a register, and dynamically adjusting the execution authority of the CPU and the register, for example, changing partial access management authority of the CPU to the CPU hardware by setting a data structure provided by a Virtual machine control block (VMCS for short); if the hardware does not support, triggering an interrupt to make the application (the privilege application) enter a kernel state, and updating the independent physical resource allocated to the application.
Optionally, after step S102, the method further includes: and setting an exception handling function, wherein the exception handling function is used for carrying out exception handling by the application according to the exception handling function when the application triggers exception.
In the embodiment of the present invention, an exception handling function is set, so that when the application (i.e., the authorization application) triggers an exception, the application performs exception handling according to the exception handling function. Optionally, exception handling processes fall into two categories: the first type is that the user space system service function library contains a customized exception handling function, and the second type is a handling process needing to pass through an operating system kernel; when zero-removing exception, page missing exception or invalid operation code (invalid opcode) or the like occurs in the application, the application performs exception handling through an exception handling function in the user space system service function library; when the application violates the physical resource authority range information corresponding to the application in the execution process, if a register without read-write authority is read and written, and hardware triggers exception or state switching, the application saves the current execution environment, loads the execution environment of an operating system kernel, and performs exception handling according to the exception handling function; alternatively, when the exception handling is completed, the resource management apparatus restores the application to the privileged application again (i.e., re-executes the processes of step S101 and step S102), so that the privileged application continues to execute normally.
Referring to fig. 1A, a second embodiment of the resource management method of the present invention may include the following steps:
1) an application sends physical resource use information used for indicating physical resources required by the running of the application to the resource management device through an interface provided by an operating system kernel, and optionally sends the physical resource use information to the resource management device in a form of a hardware control data structure; optionally, the physical resource usage information includes at least one of: physical memory information, Central Processing Unit (CPU) information, register access control authority, read-write authority of input/output equipment, privilege instruction execution authority and interrupt direction.
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 a physical memory of the application, storing and initializing a register on a CPU required by the application, and constructing a new interrupt vector table and other data structures; optionally, processor virtualization hardware is initialized according to the physical resources allocated to the application, and the physical resources are initialized by a user space system service function library, so as to provide an interface for directly accessing the physical resources to the application through the user space system service function library.
3) The resource management device saves the current execution environment of the application, such as register values, register states, segment registers and the like; loading an execution context corresponding to the privileged application after the application upgrade (i.e. independent physical resources allocated to the application, such as physical memory information, Central Processing Unit (CPU) information, CPU register setting and the like), so that the privileged application directly accesses or manages the physical resources according to the user space system service function library; wherein the userspace system services function library is to provide the privileged application with an administration policy to administer the physical resource and an interface to directly access the physical resource.
4) The resource management device sets an execution entry point and an exception handling function; when the privilege-giving application triggers an exception in the execution process, the context (such as CPU register information and the like) is saved, the next process is switched to, and exception handling is carried out according to the exception handling function.
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 directly manages or accesses the physical resource according to the user space system service function library, and the physical resource does not need to be managed by the operating system kernel, thereby reducing resource contention of different applications on the operating system kernel, and improving system performance.
FIG. 2A is a diagram of a second operating system architecture of the resource management method of the present invention. As shown in fig. 2A, the management core (core) is used to set an instruction execution authority, a register read-write authority, an I/O device, and the like of the application core (core); the method comprises the following steps that an authorization application directly accesses or manages independent physical resources corresponding to the authorization application through a customized user space system service function library (LibXOS); the resource management device is used for process privilege escalation (namely upgrading a common application into a privilege escalation application, specifically, setting a resource privilege range of a process executed on an application core through a management core), wherein the common application needs to access or operate physical resources through an operating system kernel each time, and the privilege escalation application can directly access or operate the corresponding physical resources according to a corresponding user space system service function library); the resource management device is also used for exception handling when the privilege-lifting application exceeds the execution privilege; the user space system service function library acquires remote I/O service through message system call; in addition, when the privilege-granting application cannot realize a certain kernel function through the user space system service function library, the privilege-granting application can write to a specified memory through the request queue, and the service thread reads a response.
Fig. 2B is a schematic diagram of a third embodiment of the resource management method of the present invention, and as shown in fig. 2B, a method for performing page table management in a user mode space is specifically described. Optionally, when the authority of the general application is lifted, the page table data structure in the kernel of the operating system of the general application is copied to a specified physical memory, and is managed by a page table management module in the user mode space system service function library, including operations such as reading, writing and/or updating the page table. When the application is trapped from a non-root mode to a root mode, i.e. to the operating system kernel for reasons such as active or passive (e.g. exception), it is necessary to synchronize the page table data structure to the page table structure managed by the original kernel. Because the virtual memory and the physical memory are discretely mapped in the page table, when the page table data structure is copied, the physical memory mapped in the kernel page table needs to be locked in the kernel and cannot be swapped out; and for the items not filled in the page table, the user mode system service function library manages according to the information of the application request, the execution process state, the reserved physical memory and the like.
Fig. 2C is a schematic diagram of a fourth embodiment of the resource management method of the present invention. As shown in fig. 2C, the content of the memory managed, applied, allocated and released by the user space system service function library (LibXOS) is specifically described. The memory management in LibXOS mainly provides two functions, wherein 1) the first function is: for the function routines of applying and releasing the memory required by the application, the LibXOS only manages the physical memory allocated by the resource management device when the application is authorized, so that all the applying and releasing operations only aim at the reserved physical memory; when the physical memory is exhausted, a new physical memory needs to be applied to the kernel of the operating system in an active and operating system kernel interaction mode to increase the physical memory reserved for the application, the process of applying for the new physical memory is an active trapping operating system mode, namely, the new physical memory is trapped into the kernel of the operating system through vmcall, then the new physical memory is responded by an exception handling function in the kernel of the operating system according to the transmitted parameters, the physical memory is distributed, and finally the process returns; 2) the second part of functions are as follows: processing a user mode page missing exception, wherein the page missing exception refers to a hardware exception triggered by accessing the virtual address when a mapping item in a page table does not exist; the existing Linux and most other operating systems are completed through an exception handling function of a kernel, but in the embodiment of the invention, when the authority of common application is lifted, the existing hardware exception handling function is updated and initialized, and a VMCS data structure is set, so that when the page fault exception occurs, the hardware throws the page fault exception to a user state and the user state page fault exception handling function in a user space system service function library is used for handling the page fault exception, specifically, the user state page fault exception handling function can be written in a page turning mode according to needs in the existing operating system, or the user state page fault exception handling function can be written in a page turning mode in advance, and therefore, the system performance of the application with different memory use requirements is improved.
Fig. 3 is a schematic structural diagram of a resource management device according to a first embodiment of the present invention, and as shown in fig. 3, a resource management device 30 provided in this embodiment may include: an acquisition module 301 and an allocation 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 by application operation;
the allocation 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 the application, so that the application directly accesses the physical resource.
The resource management apparatus of this embodiment may be configured to execute the technical solution in the first embodiment of the resource management method of the present invention, and the implementation principle and the technical effect are similar, which are not described herein again.
Optionally, as an implementable manner, on the basis of the implementation shown in fig. 3, the obtaining module 301 is specifically configured to:
acquiring preset physical resource use information; or,
acquiring the physical resource use information according to a hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
Optionally, as another implementable manner, on the basis of the implementation shown in fig. 3, the allocating module 302 is specifically configured to: and 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.
Optionally, the allocation module is further configured to: allocating a management policy for managing the physical resources to the application; wherein the user space system service function library comprises: the management policy.
Optionally, as another implementable manner, as shown in fig. 4, fig. 4 is a schematic structural diagram of a second embodiment of the resource management device of the present invention, and based on the implementation shown in fig. 3, the resource management device 30 further includes: the updating module 303 is configured to dynamically update the independent physical resource, and update a kernel management data structure in an operating system kernel and the user space system service function library synchronously;
optionally, the method further comprises: the exception handling module 304 is configured to set an exception handling function, where the exception handling function is configured to, when the application triggers an exception, perform exception handling on the application according to the exception handling function.
Optionally, the physical resource usage information includes at least one of: physical memory information, CPU information, register access control authority, read-write authority of input/output equipment and privilege instruction execution authority.
The resource management apparatus of this embodiment may be configured to execute the technical solution in the foregoing resource management method embodiment of the present invention, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 5 is a schematic structural diagram of a third embodiment of the resource management device in the present invention, and as shown in fig. 5, the resource management device 50 provided in this embodiment may include a processor 501 and a memory 502. The resource management device 50 may further comprise a data interface unit 503, and the data interface unit 503 may be connected to the processor 501. The data interface unit 503 is used for inputting/outputting data information, and the memory 502 is used for storing execution instructions. When the resource management device 50 is running, the processor 501 communicates with the memory 502, and the processor 501 calls the execution instruction in the memory 502 to perform the operations in the above-described resource management method embodiment.
The resource management apparatus of this embodiment may be configured to execute the technical solution in the foregoing resource management method embodiment of the present invention, and the implementation principle and the technical effect are similar, which are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (12)
1. A method for resource management, comprising:
acquiring physical resource use information, wherein the physical resource use information is used for indicating physical resources required by application operation;
according to the physical resource use information, allocating independent physical resources for the application, and allocating an interface for directly accessing the physical resources for the application so that the application directly accesses the physical resources;
wherein the allocating an interface for the application to directly access the physical resource comprises:
establishing a user space system service function library for the application, initializing the physical resource by the user space system service function library, 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 resource.
2. The method of claim 1, wherein the obtaining physical resource usage information comprises:
acquiring preset physical resource use information; or,
acquiring the physical resource use information according to a hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
3. The method of claim 1, further comprising: allocating a management policy for managing the physical resources to the application; wherein the user space system service function library comprises: the management policy.
4. The method according to any one of claims 1-3, wherein after allocating the independent physical resource for the application according to the physical resource usage information and allocating the interface for the application to directly access the physical resource, the method further comprises:
and dynamically updating the independent physical resources and synchronously updating the kernel management data structures in the kernel of the operating system and the kernel management data structures in the user space system service function library.
5. The method according to any one of claims 1-3, wherein after allocating the independent physical resource for the application according to the physical resource usage information and allocating the interface for the application to directly access the physical resource, the method further comprises:
and setting an exception handling function, wherein the exception handling function is used for carrying out exception handling by the application according to the exception handling function when the application triggers exception.
6. The method according to any of claims 1-3, wherein the physical resource usage information comprises at least one of: physical memory information, CPU information, register access control authority, read-write authority of input/output equipment and privilege instruction execution authority.
7. A resource management apparatus, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring physical resource use information which is used for indicating physical resources required by application operation;
the allocation module is used for allocating independent physical resources for the application according to the physical resource use information and allocating an interface for directly accessing the physical resources for the application so that the application directly accesses the physical resources;
wherein the allocation module is specifically configured to:
establishing a user space system service function library for the application, initializing the physical resource by the user space system service function library, 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 resource.
8. The apparatus of claim 7, wherein the obtaining module is specifically configured to:
acquiring preset physical resource use information; or,
acquiring the physical resource use information according to a hardware control data structure sent by the application; wherein the hardware control data structure includes the physical resource usage information.
9. The apparatus of claim 7, wherein the assignment module is further configured to: allocating a management policy for managing the physical resources to the application; wherein the user space system service function library comprises: the management policy.
10. The apparatus of any one of claims 7-9, further comprising:
and the updating module is used for dynamically updating the independent physical resources and synchronously updating the kernel management data structures in the kernel of the operating system and the kernel management data structures in the user space system service function library.
11. The apparatus of any one of claims 7-9, further comprising:
and the exception handling module is used for setting an exception handling function, and the exception handling function is used for carrying out exception handling by the application according to the exception handling function when the application triggers exception.
12. The apparatus according to any of claims 7-9, wherein the physical resource usage information comprises at least one of: physical memory information, CPU information, register access control authority, read-write authority of input/output equipment and privilege instruction execution authority.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510429902.1A CN106708619B (en) | 2015-07-21 | 2015-07-21 | Resource management method and device |
PCT/CN2016/073940 WO2017012339A1 (en) | 2015-07-21 | 2016-02-17 | Resource management method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510429902.1A CN106708619B (en) | 2015-07-21 | 2015-07-21 | Resource management method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106708619A CN106708619A (en) | 2017-05-24 |
CN106708619B true CN106708619B (en) | 2021-01-15 |
Family
ID=57834837
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510429902.1A Active CN106708619B (en) | 2015-07-21 | 2015-07-21 | Resource management method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106708619B (en) |
WO (1) | WO2017012339A1 (en) |
Families Citing this family (4)
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 |
CN114611849A (en) * | 2020-11-25 | 2022-06-10 | 北京秦淮数据有限公司 | IDC resource management system and method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103995731A (en) * | 2014-05-09 | 2014-08-20 | 华为技术有限公司 | Management center deployment method and virtual device |
CN104391949A (en) * | 2014-11-26 | 2015-03-04 | 国家电网公司 | Data dictionary based wide area data resource management method |
CN104424034A (en) * | 2013-09-04 | 2015-03-18 | 华为技术有限公司 | Hardware resource access method and hardware resource access device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101488098B (en) * | 2009-02-13 | 2011-11-30 | 华中科技大学 | Multi-core computing resource management system based on virtual computing technology |
CN102117113B (en) * | 2009-12-31 | 2015-03-04 | 联想(北京)有限公司 | Computer system and method of power supply management for central processing unit thereof |
US9146785B2 (en) * | 2011-09-14 | 2015-09-29 | Microsoft Technology Licensing, Llc | Application acceleration in a virtualized environment |
CN102385532A (en) * | 2011-12-02 | 2012-03-21 | 浪潮集团有限公司 | Method for improving cloud application property via non-transparent CACHE |
US9672071B2 (en) * | 2013-09-10 | 2017-06-06 | Vmware, Inc. | Method and system for distributed processing of HTTP requests |
-
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 (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN104391949A (en) * | 2014-11-26 | 2015-03-04 | 国家电网公司 | Data dictionary based wide area data resource management method |
Also Published As
Publication number | Publication date |
---|---|
CN106708619A (en) | 2017-05-24 |
WO2017012339A1 (en) | 2017-01-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109155782B (en) | Inter-process communication between containers | |
US20180121366A1 (en) | Read/write request processing method and apparatus | |
US7421533B2 (en) | Method to manage memory in a platform with virtual machines | |
CN110192182B (en) | Dynamic and dedicated virtualized graphics processing | |
US9081612B2 (en) | Virtual machine control method and virtual machine | |
JP5510556B2 (en) | Method and system for managing virtual machine storage space and physical hosts | |
US9218042B2 (en) | Cooperatively managing enforcement of energy related policies between virtual machine and application runtime | |
US20160224399A1 (en) | Method and Apparatus for Accessing Hardware Resource | |
US10289564B2 (en) | Computer and memory region management method | |
US10846251B1 (en) | Scratchpad-based operating system for multi-core embedded systems | |
CN106708619B (en) | Resource management method and device | |
CN112148422A (en) | IO processing method and device | |
JP2014520346A5 (en) | ||
US10228978B2 (en) | Dynamic management of computing platform resources | |
CN113010265A (en) | Pod scheduling method, scheduler, memory plug-in and system | |
CN104516769A (en) | Verification of dynamic logical partitioning | |
CN113377545B (en) | Method and device for distributing GPU physical memory | |
CN114691300A (en) | Hot migration method of virtual machine instance | |
CN117234729B (en) | Dynamic memory protection method, device, computer equipment and storage medium | |
US20200201691A1 (en) | Enhanced message control banks | |
US9558364B2 (en) | Computing machine, access management method, and access management program | |
US9405470B2 (en) | Data processing system and data processing method | |
CN107562510B (en) | Management method and management equipment for application instances | |
US10891226B1 (en) | Virtual address space dump in a computer system | |
US10606681B2 (en) | Incremental dump with fast reboot |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |