Resource allocation method and apparatus, electronic device, and medium
By analyzing configuration differences and adjusting the configuration information of virtual machine devices, the problem of inaccurate virtual machine resource allocation in existing technologies is solved, the hit rate is improved and resource waste is reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2022-06-29
- Publication Date
- 2026-07-10
AI Technical Summary
The existing resource allocation method based on virtual machine pre-deployment is difficult to accurately match user needs among thousands of combinations when faced with user resource requests, resulting in wasted resource consumption.
By analyzing configuration differences, the configuration information of virtual machine devices is adjusted to match user needs, including adjusting CPU, memory, storage, and operating system patch sets, to generate a second target virtual machine device that better meets user requirements.
This improves the hit rate of virtual machines in provisioning and reduces the resource consumption caused by pre-deploying virtual machines.
Smart Images

Figure CN115033387B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of cloud computing technology, and can be applied to the field of financial technology, and more specifically to a resource allocation method, apparatus, device, medium and program product. Background Technology
[0002] With the continuous development and popularization of cloud computing, data center computing resources are often provided to users in the form of Infrastructure as a Service (IaaS) and Platform as a Service (PaaS) through virtualization to meet users' resource needs. Currently, the conventional IaaS or PaaS resource allocation method based on templates or images usually involves pre-allocating resources according to users' resource request requirements, then sequentially implementing the OS and middleware (if included in the resource request), and delivering them to users after implementation.
[0003] When faced with user IaaS and PaaS resource requests, existing online virtual resource allocation schemes based on virtual machine pre-deployment can only improve resource provisioning efficiency by providing pre-deployed virtual machines when the user's resource request and the pre-deployed virtual machine are perfectly matched in terms of parameters such as region, availability zone, environment, CPU, memory, OS version, and middleware. However, existing common operating systems (OS) include nearly 10 major versions and more than 30 minor versions, such as RHEL 6.7, RHEL 7.6, Oracle Linux 7.6, and Windows 2008; common middleware such as WebLogic, Apache, and Tuxedo have more than 10 major versions and more than 40 minor versions. Combined with the different requirements of different types such as compute-intensive, memory-intensive, and big data-intensive systems in terms of CPU, memory, and hard disk, thousands of types of pre-deployed virtual machines can be combined, which will greatly reduce the hit rate of pre-deployed virtual machines in the supply and increase the resource consumption brought by pre-deployment. Summary of the Invention
[0004] In view of the above problems, this disclosure provides a resource allocation method, apparatus, device, medium, and program product. Based on configuration differences, a second resource allocation result corresponding to the configuration differences can be determined. Then, based on the second resource allocation result, the configuration information of the first target virtual machine device is adjusted to obtain the second target virtual machine device; resources are then allocated to the user. This helps improve the hit rate of virtual machines in provisioning and reduces the resource consumption caused by a large number of pre-deployed virtual machines.
[0005] According to a first aspect of this disclosure, a resource allocation method is provided, comprising: responding to receiving a resource allocation request from a user, determining a target condition corresponding to the request; obtaining a first resource allocation result, determining a first target virtual machine device corresponding to the first resource allocation result; determining whether configuration information of the first target virtual machine device matches the target condition; if the configuration information does not match the target condition, determining a configuration difference between the configuration information and the target condition; determining a second resource allocation result corresponding to the configuration difference based on the configuration difference; adjusting the configuration information of the first target virtual machine device based on the second resource allocation result to obtain a second target virtual machine device; and allocating resources to the user based on the second target virtual machine device; wherein the first resource allocation result includes a resource pre-allocation result determined according to a pre-allocation rule.
[0006] According to embodiments of this disclosure, the configuration information includes one or more of the following: number of central processing units (CPUs), memory capacity, and storage information. The step of adjusting the configuration information of the first target virtual machine device based on the second resource allocation result to obtain a second target virtual machine device includes at least one of the following operations: adjusting the number of CPUs in the first target virtual machine device based on the second resource allocation result; adjusting the memory capacity of the first target virtual machine device based on the second resource allocation result; and adjusting the storage information of the first target virtual machine device based on the second resource allocation result. The storage information includes one or more of the following: storage type, storage quantity, and storage capacity.
[0007] According to an embodiment of this disclosure, the target conditions include a target operating system patch set; allocating resources to the user based on the second target virtual machine device includes: when there is a version mismatch between the operating system patch set of the second target virtual machine device and the target operating system patch set, installing an operating system patch set corresponding to the target operating system patch set for the second target virtual machine device.
[0008] According to an embodiment of this disclosure, the target conditions include installing a target toolset; allocating resources to the user based on the second target virtual machine device includes: determining the existing toolset of the second target virtual machine device; determining whether the existing toolset includes the target toolset; and if the existing toolset does not include the target toolset, installing a target tool corresponding to the target toolset for the second target virtual machine device.
[0009] According to embodiments of this disclosure, the target conditions include one or more of the following: resource pool conditions, environment conditions, virtual machine device type conditions, and operating system conditions. The resource allocation method further includes: determining whether the first target virtual machine matches the target conditions; and if the first target virtual machine does not match the target conditions, generating a first target virtual machine that matches the target conditions based on the resource pre-allocation result determined by the pre-allocation rules.
[0010] According to an embodiment of this disclosure, the target conditions include: installing Platform as a Service; the allocation of resources to the user based on the second target virtual machine device includes: installing Platform as a Service based on the second target virtual machine.
[0011] A second aspect of this disclosure provides a resource allocation apparatus, comprising: a first determining module, configured to determine a target condition corresponding to the request in response to receiving a resource allocation request from a user; a second determining module, configured to acquire a first resource allocation result and determine a first target virtual machine device corresponding to the first resource allocation result; a third determining module, configured to determine whether the configuration information of the first target virtual machine device matches the target condition; a fourth determining module, configured to determine a configuration difference between the configuration information and the target condition if the configuration information does not match the target condition; a fifth determining module, configured to determine a second resource allocation result corresponding to the configuration difference based on the configuration difference; an adjusting device module, configured to adjust the configuration information of the first target virtual machine device based on the second resource allocation result to obtain a second target virtual machine device; and a resource allocation module, configured to allocate resources to the user based on the second target virtual machine device; wherein the first resource allocation result includes a resource pre-allocation result determined according to a pre-allocation rule.
[0012] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the resource allocation method described above.
[0013] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the resource allocation method described above.
[0014] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described resource allocation method.
[0015] The resource allocation method provided in this embodiment can determine a second resource allocation result corresponding to the configuration differences based on the configuration differences. Then, based on the second resource allocation result, the configuration information of the first target virtual machine device is adjusted to obtain the second target virtual machine device; resources are then allocated to the user. This helps improve the hit rate of virtual machines in provisioning and reduces the resource consumption caused by a large number of pre-deployed virtual machines. Attached Figure Description
[0016] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0017] Figure 1 The illustrations depict application scenarios of resource allocation methods, apparatuses, devices, media, and program products according to embodiments of the present disclosure.
[0018] Figure 2 A flowchart illustrating a resource allocation method according to an embodiment of the present disclosure is shown schematically;
[0019] Figure 3 The illustration schematically depicts an execution diagram of resource allocation according to an embodiment of the present disclosure;
[0020] Figure 4 This illustration schematically shows a process diagram for determining a second target virtual machine device according to an embodiment of the present disclosure;
[0021] Figure 5 A schematic block diagram of a resource allocation apparatus according to an embodiment of the present disclosure is shown; and
[0022] Figure 6 A block diagram of an electronic device suitable for implementing a resource allocation method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0023] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0024] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0025] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0026] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).
[0027] Embodiments of this disclosure provide a resource allocation method and apparatus, which, in response to receiving a resource allocation request from a user, determine target conditions corresponding to the request; obtain a first resource allocation result, determine a first target virtual machine device corresponding to the first resource allocation result; determine whether the configuration information of the first target virtual machine device matches the target conditions; if the configuration information does not match the target conditions, determine the configuration difference between the configuration information and the target conditions; determine a second resource allocation result corresponding to the configuration difference based on the configuration difference; adjust the configuration information of the first target virtual machine device based on the second resource allocation result to obtain a second target virtual machine device; and allocate resources to the user based on the second target virtual machine device.
[0028] The first resource allocation result includes the resource pre-allocation result determined according to the pre-allocation rules.
[0029] Figure 1 The illustrations depict application scenarios of resource allocation methods, apparatuses, devices, media, and program products according to embodiments of the present disclosure.
[0030] like Figure 1 As shown, application scenario 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as a medium for providing a communication link between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0031] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0032] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0033] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0034] It should be noted that the resource allocation method provided in this embodiment can generally be executed by server 105. Correspondingly, the resource allocation device provided in this embodiment can generally be located in server 105. The resource allocation method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the resource allocation device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.
[0035] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0036] The following will be based on Figure 1 The described scene, through Figure 2 The resource allocation method of the disclosed embodiments will be described in detail.
[0037] Figure 2 A flowchart illustrating a resource allocation method according to an embodiment of the present disclosure is shown schematically.
[0038] like Figure 2 As shown, this embodiment includes operations S210 to S270, and the resource allocation method can be executed by a server.
[0039] In the technical solution disclosed herein, the acquisition, collection, storage, use, processing, transmission, provision, disclosure, and application of data all comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.
[0040] In operation S210, in response to receiving a resource allocation request from the user, the target conditions corresponding to the request are determined.
[0041] Resource allocation requests from users, such as resource request forms submitted by users. These resource request forms may include resource pool conditions, environment conditions, device type conditions, specified Infrastructure as a Service (IaaS) devices, IP (Internet Protocol) addresses, and whether PaaS (Platform as a Service) services need to be installed, etc.
[0042] For example, requirements such as resource pool conditions, environmental conditions, and equipment type conditions can be used as target conditions corresponding to the request.
[0043] In operation S220, the first resource allocation result is obtained, and the first target virtual machine device corresponding to the first resource allocation result is determined.
[0044] For example, based on the resource request submitted by the user, pre-allocation is completed in the resource pool containing the pre-deployment buffer pool according to the pre-allocation rules, and the pre-deployment virtual machine that is matched in the pre-deployment scenario is determined. For example, the matched pre-deployment virtual machine can be used as the first target virtual machine device.
[0045] It can be understood that pre-allocation refers to the resource allocation plan determined before resource supply is executed; pre-deployment refers to the system extracting and completing pre-allocation and resource supply implementation based on the predicted future resource demand before receiving user resource request forms, and generating pre-deployed virtual machine devices; and deployment buffer pool refers to a resource pool consisting of a group of pre-deployed virtual machine devices.
[0046] For example, the resource pre-allocation result determined according to the pre-allocation rules can be used as the first resource allocation result.
[0047] In operation S230, determine whether the configuration information of the first target virtual machine device matches the target conditions.
[0048] For example, matching the pre-deployment buffer pool involves comparing the matched pre-deployment virtual machines with the target conditions in the resource request form. This might include comparing the hardware configuration with the hardware configuration requirements in the resource request form.
[0049] In operation S240, if the configuration information does not match the target conditions, determine the configuration differences between the configuration information and the target conditions.
[0050] For example, determine the difference between the number of CPU cores of the first target virtual machine device and the target conditions.
[0051] For example, determine the difference between the memory capacity of the first target virtual machine device and the target conditions.
[0052] For example, determine the difference between the operating system version of the first target virtual machine device and the target conditions.
[0053] For example, determining the differences between the storage conditions of the first target virtual machine device and the target conditions.
[0054] It is understandable that the configuration differences between the configuration information of the first target virtual machine device and the target conditions can be determined.
[0055] In operation S250, the second resource allocation result corresponding to the configuration difference is determined based on the configuration difference.
[0056] It is understandable that, given the configuration differences, pre-allocation can be performed based on these differences, and this pre-allocation result can be used as the second resource allocation result corresponding to the configuration differences. This allows the pre-deployed IaaS virtual machines in the pre-deployed virtual resource pool to cover the resource needs of a wider range of users as much as possible.
[0057] For example, the pre-allocation results of computing resources for pre-deployed virtual machine devices can be adjusted according to the requirements of the resource request form.
[0058] For example, the memory resource pre-allocation results of pre-deployed virtual machine devices can be adjusted according to the resource request form requirements.
[0059] For example, the storage device pre-allocation results for pre-deployed virtual machine devices can be adjusted according to the resource request form requirements.
[0060] In operation S260, based on the second resource allocation result, the configuration information of the first target virtual machine device is adjusted to obtain the second target virtual machine device.
[0061] For example, the number of CPU cores of the first target virtual machine device can be adjusted according to the second resource allocation result.
[0062] For example, the memory capacity of the first target virtual machine device can be adjusted according to the second resource allocation result.
[0063] For example, storage devices can be mounted on the first target virtual machine device according to the second resource allocation result.
[0064] For example, an IP address can be configured for the first target virtual machine device according to the second resource allocation result.
[0065] The adjusted first target virtual machine device can be used as the second target virtual machine device.
[0066] When operating S270, resources are allocated to users based on the second target virtual machine device.
[0067] It is understandable that resource provisioning is implemented based on the second target virtual machine device, and the resources are allocated to users after implementation.
[0068] Analysis of virtual machine information revealed nearly 200 combinations of operating system and middleware versions. Including CPU and memory differences, the number reaches approximately 700. Focusing solely on major operating system versions, a significant proportion of virtual machines use RHEL 7.6, RHEL 6.7, and Oracle Linux 7.6. If the pre-deployed virtual machine hardware configuration, OS version, and middleware version are treated as a whole and matched against user resource requests, it becomes difficult to accurately match the user's resource needs among hundreds of combinations, potentially leading to substantial resource waste from deploying virtual machines.
[0069] By separating IaaS and PaaS requirements in resource supply, the operating system and middleware in user resource supply requirements are decoupled; the necessary conditions for pre-deployment hits are identified, the hit rules are simplified in a hierarchical manner, and then supplemented by pre-allocation and implementation capabilities based on configuration differences, the pre-deployed IaaS virtual machines in the pre-deployed resource pool can cover a wider range of user resource needs as much as possible, thereby improving the hit rate of virtual machine devices in supply, eliminating the need to deploy a large number of virtual machines, and thus reducing resource waste.
[0070] Figure 3 This illustration schematically depicts an execution diagram of resource allocation according to an embodiment of the present disclosure, see below. Figure 3 First, the user sends a resource allocation request through client 310, such as submitting a resource request form. Upon receiving the request, server 320 forwards it to resource allocation device 330; it may also send pre-allocation rules to resource allocation device 330. Resource allocation device 330, upon receiving the request, determines whether a first target virtual machine device meeting the requirements is stored in the pre-deployment buffer pool and obtains the device's configuration information; it then compares this configuration information with the requirements in the resource request form. If they do not match, it determines a resource allocation result based on the configuration difference. Using this result, it adjusts the first target virtual machine device to obtain a second target virtual machine device, and then allocates resources to the user based on the second target virtual machine device. Resource allocation device 330 can then send this resource to client 310.
[0071] The resource allocation method provided in this embodiment can determine a second resource allocation result corresponding to the configuration differences based on the configuration differences. Then, based on the second resource allocation result, the configuration information of the first target virtual machine device is adjusted to obtain the second target virtual machine device; resources are then allocated to the user. This helps improve the hit rate of virtual machines in provisioning and reduces the resource consumption caused by a large number of pre-deployed virtual machines.
[0072] The configuration information includes one or more of the following: the number of central processing units (CPUs), memory capacity, and storage information. Adjusting the configuration information of the first target virtual machine device based on the second resource allocation result to obtain the second target virtual machine device involves at least one of the following operations: adjusting the number of CPUs in the first target virtual machine device based on the second resource allocation result; adjusting the memory capacity of the first target virtual machine device based on the second resource allocation result; and adjusting the storage information of the first target virtual machine device based on the second resource allocation result; wherein the storage information includes one or more of the following: storage type, storage quantity, and storage capacity.
[0073] It is understandable that the problem of partial mismatch between the hardware parameters of the virtual machine and the resource request can be solved by adjusting one or more of the following: the number of central processing units of the first target virtual machine device, the memory capacity of the first target virtual machine device, and the storage information of the first target virtual machine device.
[0074] The resource allocation method provided in this embodiment can improve the hit rate of virtual machines in provisioning by adjusting the number of central processing units of the first target virtual machine device based on the second resource allocation result; adjusting the memory capacity of the first target virtual machine device based on the second resource allocation result; and adjusting the storage information of the first target virtual machine device based on the second resource allocation result.
[0075] The target conditions include the target operating system patch set; based on the second target virtual machine device, allocating resources to the user includes: if the versions of the operating system patch set of the second target virtual machine device and the target operating system patch set do not match, installing the operating system patch set corresponding to the target operating system patch set on the second target virtual machine device.
[0076] For example, verify whether the operating system patch set of the second target virtual machine device is consistent with the target operating system patch set version required in the resource request form. If they are inconsistent, install the operating system patch set that meets the version requirements on the second target virtual machine device.
[0077] The resource allocation method provided in this embodiment can improve the hit rate of virtual machines in provisioning by installing an operating system patch set corresponding to the target operating system patch set for the second target virtual machine device when there is a version mismatch between the operating system patch set of the second target virtual machine device and the target operating system patch set.
[0078] The target conditions include installing the target toolset; allocating resources to the user based on the second target virtual machine device includes: determining the existing toolset of the second target virtual machine device; determining whether the existing toolset includes the target toolset; and if the existing toolset does not include the target toolset, installing the target toolset corresponding to the target toolset on the second target virtual machine device.
[0079] For example, check if the second target virtual machine device has the toolset required by the resource request form. If not, install the missing tools for the second target virtual machine device.
[0080] The resource allocation method provided in this embodiment can improve the hit rate of virtual machines in provisioning by installing target tools corresponding to the target toolset on the second target virtual machine device when the existing toolset does not include the target toolset.
[0081] The target conditions include one or more of the following: resource pool conditions, environment conditions, virtual machine device type conditions, and operating system conditions. The resource allocation method also includes: determining whether the first target virtual machine matches the target conditions; and if the first target virtual machine does not match the target conditions, generating a first target virtual machine that matches the target conditions based on the resource pre-allocation result determined by the pre-allocation rules.
[0082] Resource pool conditions, such as region and availability zone. Environment conditions, such as development and testing environment, non-functional environment, production environment, etc. Virtual machine device type conditions, such as application server, database server, etc. Operating system conditions, such as operating system version information; for example, the corresponding major OS version without patch set requirements can be obtained from the operating system version information in the resource request form, and the existence of virtual machine devices with the specified OS version in the pre-deployment cache pool can be verified based on the major OS version.
[0083] Figure 4 The illustration shows a schematic diagram of the process for determining a second target virtual machine device according to an embodiment of the present disclosure.
[0084] For example, such as Figure 4 As shown, this embodiment includes operations S401 to S412.
[0085] In operation S401, determine the resource request form corresponding to the target conditions.
[0086] In operation S402, check if the virtual machine device for the specified resource pool exists in the pre-deployment buffer pool. If it does not exist, proceed to operation S403, which performs pre-allocation according to the pre-allocation rules.
[0087] In operation S404, assuming the virtual machine devices for the specified resource pool exist, check if the pre-deployment buffer pool contains virtual machine devices for the specified environment. If not, proceed to operation S405, which involves performing pre-allocation according to the pre-allocation rules.
[0088] In operation S406, assuming a virtual machine device for the specified environment exists, check if a virtual machine device of the specified type exists in the pre-deployment buffer pool. This specified type may include virtual machine device type conditions. If it does not exist, proceed to operation S407, which performs pre-allocation according to the pre-allocation rules.
[0089] In operation S408, if a virtual machine device of a specified type exists, check whether the pre-deployment buffer pool contains the virtual machine device for the specified operation. If it does not exist, then execute operation S409, which performs pre-allocation according to the pre-allocation rules.
[0090] In operation S410, the first target virtual machine device is determined, that is, the first target virtual machine device that meets the above requirements is obtained from the pre-deployed cache pool, and the configuration information of the device is determined.
[0091] In operation S411, pre-allocation is performed based on configuration differences to determine the second resource allocation result.
[0092] In operation S412, based on the second resource allocation result, the first target virtual machine device is adjusted to obtain the second target virtual machine device.
[0093] The resource allocation method provided in this embodiment can utilize one or more of the following: resource pool conditions, environment conditions, virtual machine device type conditions, and operating system conditions, to obtain virtual machine devices that meet the requirements from the resource pool, making the virtual machine devices more compatible with the needs and improving the hit rate in the supply.
[0094] The target conditions include: installing Platform as a Service; allocating resources to users based on the second target virtual machine device includes: installing Platform as a Service based on the second target virtual machine.
[0095] For example, check whether the resource request form requires the installation of PaaS (Platform as a Service). If it does, then execute the corresponding PaaS installation service.
[0096] The resource allocation method provided in this embodiment can install Platform as a Service (PaaS) based on a second target virtual machine, thereby meeting the user's PaaS resource application needs.
[0097] Based on the above resource allocation method, this disclosure also provides a resource allocation device. The following will be combined with... Figure 5 The device is described in detail.
[0098] Figure 5 A schematic block diagram of a resource allocation apparatus according to an embodiment of the present disclosure is shown.
[0099] like Figure 5As shown, the resource allocation device 500 of this embodiment includes a first determining module 510, a second determining module 520, a third determining module 530, a fourth determining module 540, a fifth determining module 550, an adjusting device module 560, and a resource allocation module 570.
[0100] A first determining module 510 is configured to, in response to receiving a resource allocation request from a user, determine a target condition corresponding to the request; a second determining module 520 is configured to, obtain a first resource allocation result, and determine a first target virtual machine device corresponding to the first resource allocation result; a third determining module 530 is configured to, determine whether the configuration information of the first target virtual machine device matches the target condition; a fourth determining module 540 is configured to, if the configuration information does not match the target condition, determine a configuration difference between the configuration information and the target condition; a fifth determining module 550 is configured to, based on the configuration difference, determine a second resource allocation result corresponding to the configuration difference; a device adjustment module 560 is configured to, based on the second resource allocation result, adjust the configuration information of the first target virtual machine device to obtain a second target virtual machine device; and a resource allocation module 570 is configured to, based on the second target virtual machine device, allocate resources to the user; wherein, the first resource allocation result includes a resource pre-allocation result determined according to a pre-allocation rule.
[0101] In some embodiments, the configuration information includes one or more of the following: number of central processing units, memory capacity, and storage information; the adjustment device module is configured to perform at least one of the following operations: adjust the number of central processing units of the first target virtual machine device based on the second resource allocation result; adjust the memory capacity of the first target virtual machine device based on the second resource allocation result; and adjust the storage information of the first target virtual machine device based on the second resource allocation result; wherein the storage information includes one or more of the following: storage type, storage quantity, and storage capacity.
[0102] In some embodiments, the target conditions include a target operating system patch set; the resource allocation module is configured to: install an operating system patch set corresponding to the target operating system patch set for the second target virtual machine device when there is a version mismatch between the operating system patch set of the second target virtual machine device and the target operating system patch set.
[0103] In some embodiments, the target condition includes installing a target toolset; the resource allocation module is configured to: determine the existing toolset of the second target virtual machine device; determine whether the existing toolset includes the target toolset; and if the existing toolset does not include the target toolset, install the target toolset corresponding to the target toolset on the second target virtual machine device.
[0104] In some embodiments, the target conditions include one or more of the following: resource pool conditions, environment conditions, virtual machine device type conditions, and operating system conditions. The resource allocation device further includes: a sixth determining module, configured to determine whether the first target virtual machine matches the target conditions; and a generating module, configured to generate a first target virtual machine that matches the target conditions based on the resource pre-allocation result determined by the pre-allocation rules if the first target virtual machine does not match the target conditions.
[0105] In some embodiments, the target condition includes: installing Platform as a Service; the resource allocation module is used to: install Platform as a Service based on the second target virtual machine.
[0106] According to embodiments of this disclosure, any plurality of modules among the first determining module 510, the second determining module 520, the third determining module 530, the fourth determining module 540, the fifth determining module 550, the adjusting device module 560, and the allocating resource module 560 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules can be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the first determining module 510, the second determining module 520, the third determining module 530, the fourth determining module 540, the fifth determining module 550, the adjusting device module 560, and the allocating resource module 560 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in any one of software, hardware, and firmware methods, or in a suitable combination of any of these methods. Alternatively, at least one of the first determining module 510, the second determining module 520, the third determining module 530, the fourth determining module 540, the fifth determining module 550, the adjusting device module 560, and the allocating resource module 560 may be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0107] Figure 6 A block diagram of an electronic device suitable for implementing a resource allocation method according to an embodiment of the present disclosure is shown schematically.
[0108] like Figure 6 As shown, an electronic device 600 according to an embodiment of this disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.
[0109] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0110] According to embodiments of this disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0111] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0112] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.
[0113] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the resource allocation method provided in the embodiments of this disclosure.
[0114] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0115] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0116] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0117] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0119] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0120] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A resource allocation method, comprising: In response to receiving a resource allocation request from a user, determine the target conditions corresponding to the request; Based on the user's resource allocation request, in the resource pool containing the pre-deployment buffer pool, the resource pre-allocation result determined according to the pre-allocation rules is used as the first resource allocation result, and in the case of pre-deployment hit, the hit pre-deployment virtual machine is determined, and the hit pre-deployment virtual machine is used as the first target virtual machine device. The pre-deployment hit rules include the existence of virtual machine devices with a specified resource pool, specified environment, specified type and specified operating system in the pre-deployment buffer pool. Determine whether the configuration information of the first target virtual machine device matches the target conditions; If the configuration information does not match the target conditions, determine the configuration difference between the configuration information and the target conditions; Based on the configuration differences, determine the second resource allocation result corresponding to the configuration differences; Based on the second resource allocation result, the configuration information of the first target virtual machine device is adjusted to obtain the second target virtual machine device; as well as Based on the second target virtual machine device, resources are allocated to the user; The first resource allocation result includes the resource pre-allocation result determined according to the pre-allocation rules.
2. The method according to claim 1, wherein, The configuration information includes one or more of the following: number of central processing units, memory capacity, and storage information; adjusting the configuration information of the first target virtual machine device based on the second resource allocation result to obtain the second target virtual machine device includes at least one of the following operations: Based on the second resource allocation result, adjust the number of central processing units in the first target virtual machine device; Based on the second resource allocation result, adjust the memory capacity of the first target virtual machine device; as well as Based on the second resource allocation result, adjust the storage information of the first target virtual machine device; The storage information includes one or more of the following: storage type, storage quantity, and storage capacity.
3. The method according to claim 1, wherein, The target conditions include a target operating system patch set; the allocation of resources to the user based on the second target virtual machine device includes: If the versions of the operating system patch set for the second target virtual machine device do not match those of the target operating system patch set, the operating system patch set corresponding to the target operating system patch set shall be installed for the second target virtual machine device.
4. The method according to claim 1, wherein, The target conditions include installing the target toolset; the allocation of resources to the user based on the second target virtual machine device includes: Identify the existing toolset for the second target virtual machine device; Determine whether the existing toolset includes the target toolset; and If the existing toolset does not include the target toolset, install the target tools corresponding to the target toolset on the second target virtual machine device.
5. The method according to claim 1, wherein, The target conditions include one or more of the following: resource pool conditions, environment conditions, virtual machine device type conditions, and operating system conditions. The method further includes: Determine whether the first target virtual machine matches the target conditions; and If the first target virtual machine does not match the target conditions, a first target virtual machine that matches the target conditions is generated according to the resource pre-allocation result determined by the pre-allocation rules.
6. The method according to claim 1, wherein, The target conditions include: installing Platform as a Service; the allocation of resources to the user based on the second target virtual machine device includes: Install Platform as a Service based on the second target virtual machine.
7. A resource allocation device, comprising: The first determining module is used to determine the target conditions corresponding to the resource allocation request received from the user in response to the request. The second determining module is used to, based on the user's resource allocation request, take the resource pre-allocation result determined according to the pre-allocation rules as the first resource allocation result in the resource pool containing the pre-deployment buffer pool, and determine the pre-deployment virtual machine that is hit if the pre-deployment is hit, and take the hit pre-deployment virtual machine as the first target virtual machine device. The pre-deployment hit rules include the existence of virtual machine devices with a specified resource pool, specified environment, specified type and specified operating system in the pre-deployment buffer pool. The third determining module is used to determine whether the configuration information of the first target virtual machine device matches the target conditions; The fourth determining module is used to determine the configuration difference between the configuration information and the target conditions when the configuration information does not match the target conditions. The fifth determining module is used to determine the second resource allocation result corresponding to the configuration difference based on the configuration difference; The device adjustment module is used to adjust the configuration information of the first target virtual machine device based on the second resource allocation result to obtain the second target virtual machine device; as well as The resource allocation module is used to allocate resources to the user based on the second target virtual machine device; The first resource allocation result includes the resource pre-allocation result determined according to the pre-allocation rules.
8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 6.