A resource allocation method, system and device
By creating class components in the computer system, each class component contains a virtual machine and a shared interface, which solves the problem of resource competition, shortage and waste, and achieves flexible allocation and efficient utilization of resources.
Patent Information
- Application Number
- CN202011603892.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-12-29
AI Technical Summary
The prior art has led to shortage and waste of resource competition in computer systems, and it is difficult to meet the simultaneous demands of high-performance computing and intelligent devices for computing power, storage and bandwidth.
By creating a class component, each class component includes input and management interfaces, output and application interfaces, as well as at least one virtual machine. Each virtual machine allocates corresponding virtual resources, and shared interfaces and data information to perform the task for processing. If the virtual machine is idle or lack of resources, it will be managed accordingly, such as dormant or increasing resources.
The unified distribution and scheduling of resources are achieved, and the competing and waste of resources are avoided. At the same time, it is flexibly managed to manage resources, meet the needs of different tasks, and reduce the cost of resource.
Smart Images

Figure CN112667401B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource allocation method, system and device. Background Art
[0002] With the development of high-performance computing and smart devices, more and more computer components are beginning to attach intelligent strategies; at the same time, with the development and extension of network and Internet of Things technologies in the field of intelligence, the intelligence of peripherals and terminals has become more and more popular. However, intelligence or intelligent computing often requires higher computing power, storage, data bandwidth and other resources, as well as the support of more complex algorithms and deep structural models. When each hardware component designs and assembles these hardware and software resources based on the maximization of its own needs, since the entire machine does not always run at high load, it causes redundant waste of these resources in the entire system, and even brings asynchronous and uncoordinated conflicts and risks.
[0003] In traditional computer architecture (such as the von Neumann architecture), the roles of various components are relatively clear and the tasks are relatively independent. For example, the CPU is mainly used for computing, and the hard disk and memory serve as storage media. However, with the development of computer technology, especially the leaps and bounds of artificial intelligence technology and machine learning algorithms in recent years, the traditional system structure and allocation are changing. For example, many video and audio input devices must not only have signal capture functions, but also have some data computing and processing capabilities; for another example, many intelligent tasks not only require the computing power of the operator, but also require sufficient high bandwidth and storage space support.
[0004] Therefore, with the development of current technologies (including high-performance computing, artificial intelligence, big data, and network technology, etc.), the intelligence of computer components, peripherals, and terminals has put forward requirements for computing power, storage, bandwidth, and other factors. However, under the traditional computer architecture, these requirements are difficult to meet or meet at the same time. For example, when a storage device needs additional computing power support, since the hardware components will not borrow resources from each other, it may happen that even if the CPU is currently relatively idle, the task cannot be assigned to it.
[0005] To address this issue, existing technologies usually adopt two approaches: driver support or additional resources. Figure 1 Demonstrates common computer system architectures.
[0006] For the first method, when the corresponding driver is running, by sending requests to the system layer and obtaining responses, the required corresponding resources are applied for on the host component or other peripherals for the driven hardware, such as Figure 2However, when multiple hardware components that perform the same or similar tasks apply for resources at the same time, it is easy to cause multiple copies of the same or similar resources to exist in the system at the same time, resulting in resource waste and occupation. In addition, after the hardware components apply for resources, they may not release them in time, which also leads to resource waste and shortage.
[0007] For the second method, although it eliminates the need for the host system to allocate and manage additional hardware resources, it requires high resource costs; for example, if a small data center is equipped with a large number of hard disks, the main control computing power of each hard disk will be largely idle, resulting in a waste of resources.
[0008] It can be seen that the existing solutions easily cause resource competition, shortage and waste. Therefore, how to avoid resource competition, shortage and waste is a problem that those skilled in the art need to solve. Summary of the invention
[0009] In view of this, the purpose of this application is to provide a resource allocation method, system and device to avoid resource competition, shortage and waste. The specific scheme is as follows:
[0010] In a first aspect, the present application provides a resource allocation method, comprising:
[0011] Get pending tasks;
[0012] Retrieving a class component corresponding to the task to be processed; the class component includes: an input and management interface, an output and application interface, and at least one virtual machine, each of the virtual machines is allocated with corresponding virtual resources, and the at least one virtual machine shares the input and management interface, the output and application interface, and all data information required to execute the task to be processed;
[0013] transmitting the to-be-processed task to the at least one virtual machine through the input and management interface, so that the at least one virtual machine executes the to-be-processed task;
[0014] If the pending task is completed, the corresponding execution result is output through the output and application interface.
[0015] Preferably, it also includes:
[0016] In the process of executing the task to be processed, if any target virtual machine is in an idle state for a preset time period, shutting down or hibernating the target virtual machine;
[0017] and / or
[0018] In the process of executing the task to be processed, if the virtual resources of any target virtual machine are insufficient, the virtual resources are increased for the target virtual machine.
[0019] Preferably, the data information includes: each subtask included in the task to be processed, and a computing model and a data set required to execute the task to be processed.
[0020] Preferably, it also includes:
[0021] A response level corresponding to each virtual machine is configured to suspend or start each virtual machine according to the response level.
[0022] Preferably, it also includes:
[0023] The access rights of the class component are configured to manage the execution result according to the access rights, and to start or shut down the at least one virtual machine.
[0024] Preferably, the calling of the class component corresponding to the task to be processed includes:
[0025] Obtaining a task tag for the task to be processed;
[0026] Query the component labels of each class component in the preset class component set;
[0027] Retrieve the class component corresponding to the component tag that is consistent with the task tag.
[0028] Preferably, the virtual resources are allocated based on the target strategy and the functions of each physical resource in the current system;
[0029] The target strategy includes: any one or a combination of the first priority principle, the maximum satisfaction principle, the minimum fragmentation principle and the proximity principle.
[0030] In a second aspect, the present application provides a resource allocation system, including: a hardware device layer, a virtual system layer and a virtual machine layer, wherein:
[0031] The hardware device layer is used to provide physical resources;
[0032] The virtual system layer is used to virtualize the physical resources into virtual resources;
[0033] The virtual machine layer is used to obtain the task to be processed; call the class component corresponding to the task to be processed; the class component includes: an input and management interface, an output and application interface and at least one virtual machine, each of the virtual machines is allocated with corresponding virtual resources, and the at least one virtual machine shares the input and management interface, the output and application interface, and all data information required to execute the task to be processed; the task to be processed is transmitted to the at least one virtual machine through the input and management interface, so that the at least one virtual machine executes the task to be processed; if the execution of the task to be processed is completed, the corresponding execution result is output through the output and application interface.
[0034] Preferably, the virtual system layer is specifically used for:
[0035] The physical resources are virtualized into virtual resources based on the target strategy and the functions of each physical resource in the hardware device layer; the target strategy includes: any one or a combination of the first priority principle, the maximum satisfaction principle, the minimum fragmentation principle and the proximity principle.
[0036] In a third aspect, the present application provides an electronic device, including:
[0037] Memory for storing computer programs;
[0038] The processor is used to execute the computer program to implement the resource allocation method disclosed above.
[0039] It can be seen from the above scheme that the present application provides a resource allocation method, including: obtaining a task to be processed; calling a class component corresponding to the task to be processed; the class component includes: an input and management interface, an output and application interface, and at least one virtual machine, each of the virtual machines is allocated corresponding virtual resources, and the at least one virtual machine shares the input and management interface, the output and application interface, and all data information required to execute the task to be processed; transmitting the task to be processed to the at least one virtual machine through the input and management interface, so that the at least one virtual machine executes the task to be processed; if the execution of the task to be processed is completed, the corresponding execution result is output through the output and application interface.
[0040] It can be seen that the present application pre-creates a class component for executing tasks; the class component includes: an input and management interface, an output and application interface, and at least one virtual machine; each virtual machine is allocated with corresponding virtual resources; at least one virtual machine shares the input and management interface, the output and application interface, and all the data information required to execute the task. If there is a task that needs to be executed, the class component corresponding to the task to be processed is called, and the task to be processed is transmitted to at least one virtual machine in the class component through the input and management interface of the class component, so that the corresponding virtual machine executes the task; if the task to be processed is completed, the corresponding execution result is output through the output and application interface of the class component. The class component based on the concept of virtual machines in the present application can make the resources of the entire system uniformly allocated and scheduled, and all virtual machines in a component share all the data information of the task, and since the corresponding virtual resources have been allocated when the virtual machine is created, each virtual machine will not compete for resources, and different class components will not compete for resources, thereby avoiding resource competition and waste. At the same time, scheduling and managing each virtual machine in the class component can realize flexible allocation and adjustment of resources without adding additional resource costs.
[0041] Correspondingly, a resource allocation system and device provided by the present application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0043] Figure 1 A schematic diagram of an existing computer system architecture disclosed in this application;
[0044] Figure 2 A schematic diagram of applying for resources based on an existing computer system architecture disclosed in this application;
[0045] Figure 3 A schematic diagram of a hard disk with increased computing power and DDR resources disclosed in this application;
[0046] Figure 4 A flow chart of a resource allocation method disclosed in this application;
[0047] Figure 5 A schematic diagram of an electronic device disclosed in this application;
[0048] Figure 6 A schematic diagram of a class component disclosed in this application;
[0049] Figure 7 A schematic diagram of a resource allocation system disclosed in this application;
[0050] Figure 8 A schematic diagram of the structure of a virtual interface module disclosed in this application;
[0051] Fig. 9 A schematic diagram of applying for resources based on a class component and a function virtualization method disclosed in this application;
[0052] Fig.10 This is a schematic diagram of using class components and hard disk to jointly construct a machine learning module disclosed in this application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] Existing solutions are prone to causing resource competition, shortage and waste. Figure 2 As shown in the figure, there are two hard disks in the system that need to perform parallel computing with high computing power requirements. With the support of the driver layer, the system layer can send a request to the graphics card, and the graphics card responds to the hard disk's demand for computing power through the support of the corresponding driver. It is not difficult to see that resource allocation requires coordination and scheduling due to competition; and if the tasks of the two hard disks are repeated, the graphics card's computing power and video memory will be wasted due to task redundancy. Figure 3 As shown in the figure, if computing power and DDR hardware resources are added to the hard disk, that is, the computing power requirements of the two hard disks are met by adding hardware, although there is no need to apply for resources at this time, the newly added hardware may be idle after the current task is completed, so the resource redundancy is large. It can be seen that the existing technology has many problems such as resource competition, waste, difficulty in flexible allocation and adjustment, and high cost.
[0055] To this end, the present application provides a resource allocation solution that can not only meet the growing demand of components, peripherals, terminals, etc. for resources such as computing power, storage, and data bandwidth, but also avoid problems such as task redundancy, resource competition, and cost waste, and can achieve flexible management and scheduling of its response levels, permission settings, etc.
[0056] See also Figure 4 As shown, the embodiment of the present application discloses a resource allocation method, including:
[0057] S401, obtaining tasks to be processed.
[0058] The tasks to be processed may be any tasks, such as: tasks for calculating IO rate, tasks for evaluating image quality, tasks for predicting weather forecasts, tasks for stock quote information resources, tasks for searching query result resources, and other tasks for accessing other resources.
[0059] S402: Retrieve the class component corresponding to the task to be processed.
[0060] This embodiment virtualizes each physical resource in the current system in advance and creates multiple class components. Each class component corresponds to a class of tasks. In particular, this embodiment virtualizes the system physical resources based on the target strategy and the functions of each physical resource in the current system; the target strategy includes: any one or combination of the first priority principle, the maximum satisfaction principle, the minimum fragmentation principle and the proximity principle.
[0061] For example, a first type of component corresponding to the task of calculating IO rate, a second type of component corresponding to the task of evaluating image quality, a third type of component corresponding to the task of predicting weather forecast, etc. is created, and each type of component is labeled with a corresponding component label so that after the task is obtained, the corresponding type of component is selected for the task. In a specific implementation, calling the type of component corresponding to the task to be processed includes: obtaining the task label of the task to be processed; querying the component labels of each type of component in the preset type of component set; calling the type of component corresponding to the component label consistent with the task label.
[0062] Each class component includes: input and management interface, output and application interface and at least one virtual machine. All virtual machines in a class component are allocated corresponding virtual resources, and all virtual machines share the input and management interface and output and application interface in the class component. When executing a task, all virtual machines in a class component share all data information required for the current task. The data information includes: each subtask included in the task to be processed, and the computing model and data set required to execute the task to be processed.
[0063] S403: Transmit the task to be processed to at least one virtual machine in the class component through the input and management interface of the class component, so that the at least one virtual machine executes the task to be processed.
[0064] S404: If the pending task is completed, the corresponding execution result is output through the output of the class component and the application interface.
[0065] In a specific implementation, during the execution of the pending task, if any target virtual machine (any virtual machine in the current class component) is in an idle state for a preset time period, the target virtual machine is shut down or hibernated. That is, when a virtual machine is idle for a long time, it is considered that the virtual machine can temporarily release the corresponding resources to achieve flexible resource scheduling.
[0066] In a specific implementation, during the execution of the pending task, if the virtual resources of any target virtual machine (any virtual machine in the current class component) are insufficient, virtual resources are added to the target virtual machine. That is, when the virtual resources allocated to a virtual machine when it is created are insufficient, some more virtual resources can be allocated to the virtual machine to achieve flexible resource allocation. Virtual resources are allocated based on the target policy and the functions of each physical resource in the current system; it can be understood that the functions of each physical resource here include multiple functions of physical resources, such as a memory that has both a storage function and a DDR cache function, then both the storage function and the DDR cache function can be allocated. The target policy includes any one or combination of the first priority principle, the maximum satisfaction principle, the minimum fragmentation principle, and the proximity principle.
[0067] The first priority principle means that when allocating a resource, first select and allocate it from the main provider of the resource. For example, if virtual memory is needed, first select and allocate virtual memory from physical memory (such as independent memory sticks, etc.), instead of allocating cache in the storage or video memory in the graphics card. This simplifies allocation and avoids resource waste.
[0068] The maximum satisfaction principle means that when allocating a resource, first select and allocate from the resource provider that can meet the demand and has the largest amount of resources. For example, if one SSD has 200GB of space and the other has 100GB of space, and you need to apply for a 120GB virtual hard disk, the first SSD will be allocated first. In this way, the same file can be stored in the same SSD and managed in the same SSD, which is convenient for file storage and subsequent management.
[0069] The minimum fragmentation principle means: when allocating a resource, avoid fragmentation. If fragmentation cannot be avoided, avoid causing large fragmentation. For example: one SSD has 200GB of space and the other has 128GB of space. Now apply for a 120GB virtual hard disk. If it is allocated from the first SSD, there will be 80GB of free space. If it is allocated from the second SSD, there will be 8GB of free space, so it is preferred to allocate from the second SSD. Another example: the first SSD has 50GB of space, the second SSD has 60GB of space, and the third SSD has 50GB of space. Now apply for a 100GB virtual hard disk. If the first and second SSDs are allocated, or the second and third SSDs are allocated, there will be 10GB of free space, causing fragmentation. Therefore, the first SSD and the third SSD are allocated first, and there is no free space left, and no fragmentation will occur.
[0070] The proximity principle means that when allocating a resource, it is selected and allocated from the resource provider closest to the existing resource, so as to meet the proximity principle in transmission. For example, if a virtual machine has applied for the computing power of a graphics card for calculation, and now needs to apply for cache, then the cache is allocated from the graphics card's video memory first, so that data processing is completed directly inside the graphics card, and other buses outside the graphics card do not need to undertake data transmission tasks, so as to reduce the bus load and effectively reduce data transmission delay.
[0071] In order to properly schedule the virtual machines in the class components, you can configure the response level for the virtual machines, so that after configuring the response level corresponding to each virtual machine, you can pause or start each virtual machine according to the response level. For example, set some virtual machines in some class components to remain online permanently. For some virtual machines in some class components, you can temporarily stop them from running when some system resources are in short supply.
[0072] Of course, you can also configure access rights for each class component, so that after configuring the access rights of the class component, you can manage the execution results according to the access rights and start or shut down at least one virtual machine. For example, if you only have system management rights, you can start or shut down virtual machines in certain class components. If you only have read-only rights, you can only receive the output information corresponding to the class component in one direction. Access rights refer to the access rights of the host in the system to the class component. The access can be initiated by hardware devices, virtual machine systems, other class components or virtual machines in the system.
[0073] It can be seen that the embodiment of the present application pre-creates a class component for executing tasks; the class component includes: an input and management interface, an output and application interface, and at least one virtual machine; each virtual machine is allocated with corresponding virtual resources; at least one virtual machine shares the input and management interface, the output and application interface, and all the data information required to execute the task. If there is a task that needs to be executed, the class component corresponding to the task to be processed is called, and the task to be processed is transmitted to at least one virtual machine in the class component through the input and management interface of the class component, so that the corresponding virtual machine executes the task; if the task to be processed is completed, the corresponding execution result is output through the output and application interface of the class component. The class component based on the concept of virtual machines in the present application can make the resources of the entire system uniformly allocated and scheduled, and all virtual machines in a component share all the data information of the task, and since the corresponding virtual resources have been allocated when the virtual machine is created, each virtual machine will not compete for resources, and different class components will not compete for resources, thereby avoiding the competition and waste of resources. At the same time, scheduling and managing each virtual machine in the class component can realize the flexible allocation and adjustment of resources without adding additional resource costs.
[0074] A resource allocation system provided in an embodiment of the present application is introduced below. The resource allocation system described below and the resource allocation method described above can be referenced to each other.
[0075] The embodiment of the present application discloses a resource allocation system, including: a hardware device layer, a virtual system layer and a virtual machine layer, wherein:
[0076] The hardware device layer is used to provide physical resources;
[0077] The virtual system layer is used to virtualize physical resources into virtual resources;
[0078] The virtual machine layer is used to obtain the tasks to be processed; call the class components corresponding to the tasks to be processed; the class components include: an input and management interface, an output and application interface and at least one virtual machine, each virtual machine is allocated with corresponding virtual resources, at least one virtual machine shares the input and management interface, the output and application interface, and all data information required to execute the tasks to be processed; the tasks to be processed are transmitted to at least one virtual machine through the input and management interface, so that at least one virtual machine executes the tasks to be processed; if the tasks to be processed are executed, the corresponding execution results are output through the output and application interface.
[0079] In a specific implementation, the virtual system layer is specifically used to: virtualize physical resources into virtual resources based on target policies and the functions of each physical resource in the hardware device layer; the target policy includes: any one or combination of the first priority principle, the maximum satisfaction principle, the minimum fragmentation principle and the proximity principle.
[0080] In a specific embodiment, the virtual machine layer is also used to: during the execution of the pending task, if any target virtual machine has been in an idle state for a preset time period, shut down or hibernate the target virtual machine; and / or during the execution of the pending task, if any target virtual machine has insufficient virtual resources, increase virtual resources for the target virtual machine.
[0081] In a specific implementation, the data information includes: each subtask included in the task to be processed, and a computing model and a data set required to execute the task to be processed.
[0082] In a specific implementation, the virtual machine layer is further used to: configure a response level corresponding to each virtual machine, so as to suspend or start each virtual machine according to the response level.
[0083] In a specific implementation, the virtual machine layer is further used to: configure access rights of class components to manage execution results according to the access rights, and to start or shut down at least one virtual machine.
[0084] In a specific implementation, the virtual machine layer is specifically used to: obtain the task tag of the task to be processed; query the component tag of each class component in the preset class component set; and call the class component corresponding to the component tag consistent with the task tag.
[0085] In a specific implementation, virtual resources are allocated based on target strategies and functions of various physical resources in the current system; the target strategies include: any one or a combination of the first priority principle, the maximum satisfaction principle, the minimum fragmentation principle and the proximity principle.
[0086] Among them, for more specific working processes of each module and unit in this embodiment, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0087] It can be seen that this embodiment provides a resource allocation system that can not only meet the growing demands of components, peripherals, terminals, etc. for resources such as computing power, storage, and data bandwidth, but also avoid problems such as task redundancy, resource competition, and cost waste, and can achieve flexible management and scheduling of its response levels, authority settings, etc.
[0088] An electronic device provided in an embodiment of the present application is introduced below. The electronic device described below and the resource allocation method and system described above can be referenced to each other.
[0089] See also Figure 5 As shown, the embodiment of the present application discloses an electronic device, including:
[0090] Memory 501, used for storing computer programs;
[0091] The processor 502 is used to execute the computer program to implement the method disclosed in any of the above embodiments.
[0092] In order to introduce this application more clearly, Figure 6 The class components provided by this application are further introduced.
[0093] like Figure 6 As shown, a class component is a set of virtual machines, which consists of one or more virtual machines.
[0094] Create a class component to respond to and complete a class of identical or similar tasks. Similar tasks are tasks whose to-be-processed data and execution results are essentially the same, but in different forms. For example, for the same batch of to-be-processed data, two tasks are performed to predict temperature. One requires the execution results to be output in Fahrenheit, and the other requires the execution results to be output in Celsius.
[0095] Generally, a class of identical or similar tasks often originates from a class of identical or similar hardware devices (including components, peripherals, terminals, etc.) in the system. When executing these identical or similar tasks, they will request a class of identical or similar system resources (computing power, storage, data bandwidth, etc.), call the same or similar computing models, use the same or similar data sets, and obtain the corresponding computing results. Therefore, identical or similar tasks can correspond to the same class of components.
[0096] This type of component can be set up with a task pool for storing subtasks, a model pool consisting of computing models that need to be called, a data pool consisting of data sets that need to be used, etc., as well as input and management interfaces and output and application interfaces for transmitting data. In addition, all virtual machines in this type of component share the task pool, model pool, and data pool. The virtual machines in this type of component meet the minimum resource requirements required for the execution of such tasks.
[0097] Among them: the input and management interface can be used to add, delete and modify data, add, delete and optimize models, add, delete, start and stop tasks, etc. The output and application interface can be used to obtain information such as the calculation results of tasks and the power on and off status of virtual machines. The input and management interface and the output and application interface constitute the interface pool of the class component. The component label of the class component can be determined based on the data to be processed and the execution results to be transmitted in the input and management interface and the output and application interface. The virtual machines in a class component share the task pool, model pool, data pool and interface pool.
[0098] At the same time, class components can achieve dynamic, flexible, safe and stable supervision and scheduling of virtual machines in terms of response level, permission setting, resource allocation, etc. through the virtual machine's management and scheduling mechanism.
[0099] (1) Resource control: Through the virtual machine management scheduling mechanism, when creating a virtual machine in a class component, the corresponding virtual resources are allocated to the virtual machine. After the allocation, each virtual machine will strictly follow it without additional adjustments. The virtual resources allocated to the virtual machine include: the percentage of CPU occupied, the amount of storage space and memory address required, the bus bandwidth rate, etc.
[0100] (2) Flexible configuration: Through the combination of multiple virtual machines and the virtualization configuration in each virtual machine, the diverse customization needs of class components can be met. For example: There are two tasks A and B in the task sharing pool, which require 2% and 5% of computing resources. A needs to be kept running all the time, while B will only be called up intermittently. In this case, two virtual machines can be used to form this class component. Virtual machine 0 corresponds to task A and remains started for a long time; virtual machine 1 corresponds to task B. When task B needs to be awakened, the virtual machine is started or activated. When task B enters the idle period, virtual machine 1 is shut down or hibernated.
[0101] (3) Dynamic scheduling: Dynamic scheduling of class components is achieved through dynamic scheduling of virtual machines. For example, in addition to tasks A and B, there is also task C in the above task sharing pool. C will only be called up and run intermittently. Unlike B, task C may occupy 2% to 5% of the computing power each time. At this time, a virtual machine 2 with 2% computing power can be added to this class component, and virtual machine 2 can be started or activated with the running of task C. When the computing power of virtual machine 2 is at risk of being insufficient, computing power is dynamically added to virtual machine 2 from system resources.
[0102] (4) Response level: By setting the virtual machine level, the response level of class components can be managed. For example, some virtual machines in certain class components can be set to remain online permanently. For some virtual machines in certain class components, they can be temporarily stopped when certain system resources become scarce.
[0103] (5) Permission setting: Through the permission management of virtual machine business, different levels of access and management operations of class components can be achieved. For example, only when you have system management permissions can you start or shut down the virtual machines in certain class components. When you only have read-only permissions, you can only receive the output information corresponding to the class components in a one-way manner.
[0104] In this embodiment, although a group of virtual machines in a class component share the task pool, model pool, data pool and interface pool, their operating environments are independent of each other. In particular, different class components, or class components and hosts, have their own operating environments that are independent, and will not generate competition and conflict events, nor will they affect the normal operation of other components, peripherals or terminals in the system.
[0105] like Figure 7As shown, before creating a class component, the physical resources in the system need to be virtualized. Specifically, all hardware resources in the entire system are integrated and subdivided into independent hardware units, and virtual machines are established based on one or more hardware units, and then one or more virtual machines are grouped into a class component.
[0106] like Figure 7 As shown in the figure, the virtual system is a link between the upper and lower layers. It interacts with the underlying bare devices through the hardware driver module and provides virtual hardware services to the upper layer through the virtual interface module. Figure 8 ,The virtual interface module can virtualize physical resources based on hardware ,devices, or can virtualize physical resources based on the functions of the ,devices.
[0107] exist Figure 8 In this embodiment, based on the inheritance of device virtualization, a method based on function virtualization is added, which can achieve more flexible configuration of hardware resources while ensuring compatibility, and even respond to resource requests that could not be completed before.
[0108] The device-based virtualization method requires that such devices must exist in the system, and the virtual configuration cannot be higher than the actual configuration. For example, if we want to use a virtual system to virtualize an 8GB memory on a bare metal machine, first of all, there must be allocatable memory in the system, and the available space must be no less than 8GB. However, when there is no allocatable memory in the system, or the available space is less than 8GB, the device-based virtualization method cannot provide services.
[0109] Function-based virtualization is not based on the device, but on the device's function. A device usually has more than one function. For example, a graphics card has both a GPU with computing functions and a DDR cache. If you need to virtualize 8GB of memory, but the system's physical memory only has 6GB of space to allocate, you can add 2GB of allocable video memory from the graphics card to form a total of 8GB of memory to respond to virtual service requests for 8GB of memory. Fig. 9 As shown in FIG. 1 , when two hard disks request the same resource at the same time, they can send the request to the virtual system at the same time. The virtual system searches for the corresponding class component I from the class component and provides it to hard disks 0 and 1 for use. Figure 2 It can be found that this embodiment is more flexible in requesting and allocating resources.
[0110] This application designs a new computer system architecture based on class components, so that the hardware resources of the entire system are uniformly allocated and scheduled. The class components can use a group of virtual machines to process resource requests for the same hardware devices or similar tasks, meet the growing demand for computing power, storage, data bandwidth and other resources of the system's traditional components, peripherals, terminals, etc., and avoid problems such as redundancy of tasks, competition for resources, and waste of costs. In a class component, a task sharing pool, a model sharing pool, a data sharing pool, an interface sharing pool, etc. are set to avoid redundancy and waste of tasks, computing models, data, input and output data. System files, partitions, memory, ports, etc. can be shared between class components, or between class components and hosts and other devices and terminals, reducing bandwidth requirements, transmission power consumption and response delays, etc., and improving the overall performance of the system. A method based on functional virtualization has also been added to achieve more flexible configuration and allocation of hardware resources. The new architecture is compatible with existing hardware and systems and is easy to apply and promote.
[0111] The following is a further introduction to this application in conjunction with specific application scenarios.
[0112] Generally, the design of SSD includes hardware design such as main control, flash memory, capacitors, etc., as well as software design such as front-end, back-end, FTL (Flash Translation Layer). Among them, FTL is the software core of SSD, and its importance lies in determining the service life, performance and reliability of an SSD. In order to achieve efficient FTL, machine learning methods can be used to predict the read and write intensity in the future window period, thereby providing "foresight" information for mechanisms such as GC and buffer management to obtain better SSD performance. In this way, it is necessary to build a machine learning model, and building this machine learning model requires a computer to perform training tasks and prediction tasks.
[0113] Generally speaking, note that the computing power, cache, and bandwidth resources required for the online learning phase (or training phase) and the inference phase (or prediction phase) of a machine learning model are different, and the resources required for the training phase are much greater than those for the prediction phase.
[0114] Therefore, the class components provided by this application can be used to perform complex training tasks, and the hard disk (SSD) can be used to perform relatively simple prediction tasks. Fig.10 As shown, the class component executes the model training task and sends the trained model to the SSD according to the model synchronization principle (such as a specified time interval, or waiting for a hard disk to send a request, etc.); the SSD uses the new model to predict the read and write intensity in real time. Fig.10 The LSTM model is taken as an example. Other models can also be used for calculation, such as GRU, CNN, etc. Fig.10 The curve in is a schematic diagram of the model prediction results.
[0115] Calling Figure 6 The class components shown can uniformly call the system's hardware resources to complete the online training calculation of the model, and can synchronize with the models of each storage end according to the set time interval. After the SSD obtains the trained model, it can make real-time predictions on the read and write intensity of the storage end.
[0116] It can be seen that the present application utilizes class components to perform training tasks, and can use a group of virtual machines to process resource requests for the same hardware devices or similar tasks, thereby meeting the growing demand for computing power, storage, data bandwidth and other resources by traditional system components, peripherals, terminals, etc., while avoiding problems such as task redundancy, resource competition, and cost waste, reducing bandwidth requirements, transmission power consumption, and response delays, and improving the overall performance of the system.
[0117] The "first", "second", "third", "fourth", etc. (if any) referred to in this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods or devices.
[0118] It should be noted that the descriptions involving "first", "second", etc. in this application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0119] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0120] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.
[0121] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A resource allocation method, characterized in that: include: Get pending tasks; Retrieve the class component corresponding to the task to be processed; The class component includes: an input and management interface, an output and application interface, and at least one virtual machine, each of which is allocated with corresponding virtual resources, and the at least one virtual machine shares the input and management interface, the output and application interface, and all data information required to execute the task to be processed; the input and management interface is used to implement: adding, deleting and modifying data, adding, deleting and optimizing models, adding, deleting, starting and stopping tasks; the output and application interface is used to obtain the calculation results of the task and the power on / off status of the virtual machine; transmitting the to-be-processed task to the at least one virtual machine through the input and management interface, so that the at least one virtual machine executes the to-be-processed task; If the pending task is completed, the corresponding execution result is output through the output and application interface; The same or similar tasks correspond to the same class component, in which a task pool for storing subtasks, a model pool consisting of computing models to be called, and a data pool consisting of data sets to be used are set; all virtual machines in the class component share the task pool, model pool, and data pool, and the operating environments of all virtual machines are independent of each other; Among them, the hard disk is used to perform the prediction task of the machine learning model; the class component performs the model training task of the machine learning model, and according to the model synchronization principle, the trained model is sent to the hard disk; the hard disk uses the new model to predict the read and write intensity in real time; Configuring a response level corresponding to each virtual machine to suspend or start each virtual machine according to the response level; Configuring the access rights of the class component to manage the execution result according to the access rights and start or shut down the at least one virtual machine; wherein, when having system management rights, starting or shutting down the virtual machine in the class component; when having read-only rights, unidirectionally receiving the output information corresponding to the class component; The calling of the class component corresponding to the task to be processed includes: Obtaining a task tag for the task to be processed; Query the component labels of each class component in the preset class component set; Retrieve the class component corresponding to the component tag that is consistent with the task tag.
2. The resource allocation method according to claim 1, characterized in that: Also includes: In the process of executing the task to be processed, if any target virtual machine is in an idle state for a preset time period, shutting down or hibernating the target virtual machine; and / or In the process of executing the task to be processed, if the virtual resources of any target virtual machine are insufficient, the virtual resources are increased for the target virtual machine.
3. The resource allocation method according to claim 1, characterized in that: The data information includes: each subtask included in the task to be processed, and the computing model and data set required to execute the task to be processed.
4. The resource allocation method according to any one of claims 1 to 3, characterized in that: The virtual resources are allocated based on the target strategy and the functions of each physical resource in the current system; The target strategy includes: any one or a combination of the first priority principle, the maximum satisfaction principle, the minimum fragmentation principle and the proximity principle.
5. A resource allocation system, characterized in that: include: Hardware device layer, virtual system layer and virtual machine layer, including: The hardware device layer is used to provide physical resources; The virtual system layer is used to virtualize the physical resources into virtual resources; The virtual machine layer is used to obtain the tasks to be processed; call the class components corresponding to the tasks to be processed; the class components include: an input and management interface, an output and application interface and at least one virtual machine, each of the virtual machines is allocated with corresponding virtual resources, and the at least one virtual machine shares the input and management interface, the output and application interface, and all data information required to execute the tasks to be processed; the input and management interface is used to implement: adding, deleting and modifying data, adding, deleting and optimizing models, adding, deleting, starting and stopping tasks; the output and application interface is used to obtain the calculation results of the tasks and the power on and off status of the virtual machines; the input and management interface is used to implement: adding, deleting and modifying data, adding, deleting and optimizing models, adding, deleting, starting and stopping tasks; the output and application interface is used to obtain the calculation results of the tasks and the power on and off status of the virtual machines; the input and The management interface transmits the pending task to the at least one virtual machine so that the at least one virtual machine executes the pending task; if the pending task is completed, the corresponding execution result is output through the output and application interface; the response level corresponding to each virtual machine is configured to suspend or start each virtual machine according to the response level; the access rights of the class component are configured to manage the execution result according to the access rights, and start or shut down the at least one virtual machine; wherein, when the system management rights are possessed, the virtual machines in the class component are started or shut down; when the read-only rights are possessed, the output information corresponding to the class component is received unidirectionally; The calling of the class component corresponding to the task to be processed includes: Obtaining a task tag for the task to be processed; Query the component labels of each class component in the preset class component set; Retrieve the class component corresponding to the component tag consistent with the task tag; The same or similar tasks correspond to the same class component, in which a task pool for storing subtasks, a model pool consisting of computing models to be called, and a data pool consisting of data sets to be used are set; all virtual machines in the class component share the task pool, model pool, and data pool, and the operating environments of all virtual machines are independent of each other; Among them, the hard disk is used to perform the prediction task of the machine learning model; the class component performs the model training task of the machine learning model, and according to the model synchronization principle, the trained model is sent to the hard disk; the hard disk uses the new model to predict the read and write intensity in real time.
6. The resource allocation system according to claim 5, characterized in that: The virtual system layer is specifically used for: The physical resources are virtualized into virtual resources based on the target strategy and the functions of each physical resource in the hardware device layer; the target strategy includes: any one or a combination of the first priority principle, the maximum satisfaction principle, the minimum fragmentation principle and the proximity principle.
7. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the resource allocation method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Low-energy independent task scheduling and resource configuration method
CN105912406A
Information processing method and device in cloud game, cloud game server and medium
CN111450524A